1
1

* direntry.c: Added const qualifiers to work around gcc

warnings.
	* extfs.c: Likewise.
	* fish.c: Likewise.
	* ftpfs.c: Likewise.
	* sfs.c: Likewise.
	* xdirentry.h: Likewise.
Этот коммит содержится в:
Roland Illig 2005-09-05 00:52:56 +00:00
родитель 1efcbd27a7
Коммит 7e7b81b73e
7 изменённых файлов: 36 добавлений и 22 удалений

Просмотреть файл

@ -1,3 +1,13 @@
2005-09-05 Roland Illig <roland.illig@gmx.de>
* direntry.c: Added const qualifiers to work around gcc
warnings.
* extfs.c: Likewise.
* fish.c: Likewise.
* ftpfs.c: Likewise.
* sfs.c: Likewise.
* xdirentry.h: Likewise.
2005-08-15 Roland Illig <roland.illig@gmx.de> 2005-08-15 Roland Illig <roland.illig@gmx.de>
* vfs-impl.h (union vfs_dirent): Using the offsetof macro * vfs-impl.h (union vfs_dirent): Using the offsetof macro

Просмотреть файл

@ -456,10 +456,11 @@ vfs_s_free_super (struct vfs_class *me, struct vfs_s_super *super)
* Dissect the path and create corresponding superblock. Note that inname * Dissect the path and create corresponding superblock. Note that inname
* can be changed and the result may point inside the original string. * can be changed and the result may point inside the original string.
*/ */
char * const char *
vfs_s_get_path_mangle (struct vfs_class *me, char *inname, vfs_s_get_path_mangle (struct vfs_class *me, char *inname,
struct vfs_s_super **archive, int flags) struct vfs_s_super **archive, int flags)
{ {
const char *retval;
char *local, *op; char *local, *op;
const char *archive_name; const char *archive_name;
int result = -1; int result = -1;
@ -468,8 +469,7 @@ vfs_s_get_path_mangle (struct vfs_class *me, char *inname,
archive_name = inname; archive_name = inname;
vfs_split (inname, &local, &op); vfs_split (inname, &local, &op);
if (!local) retval = (local) ? local : "";
local = "";
if (MEDATA->archive_check) if (MEDATA->archive_check)
if (!(cookie = MEDATA->archive_check (me, archive_name, op))) if (!(cookie = MEDATA->archive_check (me, archive_name, op)))
@ -506,7 +506,7 @@ vfs_s_get_path_mangle (struct vfs_class *me, char *inname,
return_success: return_success:
*archive = super; *archive = super;
return local; return retval;
} }
@ -518,12 +518,12 @@ static char *
vfs_s_get_path (struct vfs_class *me, const char *inname, vfs_s_get_path (struct vfs_class *me, const char *inname,
struct vfs_s_super **archive, int flags) struct vfs_s_super **archive, int flags)
{ {
char * const buf = g_strdup (inname); char *buf, *retval;
char *res = vfs_s_get_path_mangle (me, buf, archive, flags);
if (res) buf = g_strdup (inname);
res = g_strdup (res); retval = g_strdup (vfs_s_get_path_mangle (me, buf, archive, flags));
g_free (buf); g_free (buf);
return res; return retval;
} }
void void

Просмотреть файл

@ -155,7 +155,7 @@ static void extfs_make_dots (struct entry *ent)
} }
static struct entry *extfs_generate_entry (struct archive *archive, static struct entry *extfs_generate_entry (struct archive *archive,
char *name, struct entry *parentry, mode_t mode) const char *name, struct entry *parentry, mode_t mode)
{ {
mode_t myumask; mode_t myumask;
struct inode *inode, *parent; struct inode *inode, *parent;
@ -452,7 +452,7 @@ extfs_get_path_mangle (struct vfs_class *me, char *inname, struct archive **arch
if (fstype == -1) if (fstype == -1)
return NULL; return NULL;
if (!local) if (!local)
local = ""; local = inname + strlen (inname);
/* /*
* All filesystems should have some local archive, at least * All filesystems should have some local archive, at least
@ -582,9 +582,10 @@ static struct entry *extfs_resolve_symlinks (struct entry *entry)
return res; return res;
} }
static char *extfs_get_archive_name (struct archive *archive) static const char *
extfs_get_archive_name (struct archive *archive)
{ {
char *archive_name; const char *archive_name;
if (archive->local_name) if (archive->local_name)
archive_name = archive->local_name; archive_name = archive->local_name;

Просмотреть файл

@ -712,13 +712,14 @@ fish_send_command(struct vfs_class *me, struct vfs_s_super *super, const char *c
#define PREFIX \ #define PREFIX \
char buf[BUF_LARGE]; \ char buf[BUF_LARGE]; \
const char *crpath; \
char *rpath, *mpath = g_strdup (path); \ char *rpath, *mpath = g_strdup (path); \
struct vfs_s_super *super; \ struct vfs_s_super *super; \
if (!(rpath = vfs_s_get_path_mangle (me, mpath, &super, 0))) { \ if (!(crpath = vfs_s_get_path_mangle (me, mpath, &super, 0))) { \
g_free (mpath); \ g_free (mpath); \
return -1; \ return -1; \
} \ } \
rpath = name_quote (rpath, 0); \ rpath = name_quote (crpath, 0); \
g_free (mpath); g_free (mpath);
#define POSTFIX(flags) \ #define POSTFIX(flags) \
@ -741,20 +742,21 @@ fish_chmod (struct vfs_class *me, const char *path, int mode)
static int fish_##name (struct vfs_class *me, const char *path1, const char *path2) \ static int fish_##name (struct vfs_class *me, const char *path1, const char *path2) \
{ \ { \
char buf[BUF_LARGE]; \ char buf[BUF_LARGE]; \
const char *crpath1, *crpath2; \
char *rpath1, *rpath2, *mpath1, *mpath2; \ char *rpath1, *rpath2, *mpath1, *mpath2; \
struct vfs_s_super *super1, *super2; \ struct vfs_s_super *super1, *super2; \
if (!(rpath1 = vfs_s_get_path_mangle (me, mpath1 = g_strdup(path1), &super1, 0))) { \ if (!(crpath1 = vfs_s_get_path_mangle (me, mpath1 = g_strdup(path1), &super1, 0))) { \
g_free (mpath1); \ g_free (mpath1); \
return -1; \ return -1; \
} \ } \
if (!(rpath2 = vfs_s_get_path_mangle (me, mpath2 = g_strdup(path2), &super2, 0))) { \ if (!(crpath2 = vfs_s_get_path_mangle (me, mpath2 = g_strdup(path2), &super2, 0))) { \
g_free (mpath1); \ g_free (mpath1); \
g_free (mpath2); \ g_free (mpath2); \
return -1; \ return -1; \
} \ } \
rpath1 = name_quote (rpath1, 0); \ rpath1 = name_quote (crpath1, 0); \
g_free (mpath1); \ g_free (mpath1); \
rpath2 = name_quote (rpath2, 0); \ rpath2 = name_quote (crpath2, 0); \
g_free (mpath2); \ g_free (mpath2); \
g_snprintf(buf, sizeof(buf), string "\n", rpath1, rpath2, rpath1, rpath2); \ g_snprintf(buf, sizeof(buf), string "\n", rpath1, rpath2, rpath1, rpath2); \
g_free (rpath1); \ g_free (rpath1); \

Просмотреть файл

@ -1461,7 +1461,8 @@ static int ftpfs_ctl (void *fh, int ctlop, void *arg)
static int static int
ftpfs_send_command(struct vfs_class *me, const char *filename, const char *cmd, int flags) ftpfs_send_command(struct vfs_class *me, const char *filename, const char *cmd, int flags)
{ {
char *rpath, *p, *mpath = g_strdup(filename); const char *rpath;
char *p, *mpath = g_strdup(filename);
struct vfs_s_super *super; struct vfs_s_super *super;
int r; int r;
int flush_directory_cache = (flags & OPT_FLUSH); int flush_directory_cache = (flags & OPT_FLUSH);

Просмотреть файл

@ -148,7 +148,7 @@ sfs_vfmake (struct vfs_class *me, const char *name, char *cache)
return 0; /* OK */ return 0; /* OK */
} }
static char * static const char *
sfs_redirect (struct vfs_class *me, const char *name) sfs_redirect (struct vfs_class *me, const char *name)
{ {
struct cachedfile *cur = head; struct cachedfile *cur = head;

Просмотреть файл

@ -182,7 +182,7 @@ struct vfs_s_inode *vfs_s_find_root (struct vfs_class *me,
/* outside interface */ /* outside interface */
void vfs_s_init_class (struct vfs_class *vclass, void vfs_s_init_class (struct vfs_class *vclass,
struct vfs_s_subclass *sub); struct vfs_s_subclass *sub);
char *vfs_s_get_path_mangle (struct vfs_class *me, char *inname, const char *vfs_s_get_path_mangle (struct vfs_class *me, char *inname,
struct vfs_s_super **archive, int flags); struct vfs_s_super **archive, int flags);
void vfs_s_invalidate (struct vfs_class *me, struct vfs_s_super *super); void vfs_s_invalidate (struct vfs_class *me, struct vfs_s_super *super);
char *vfs_s_fullpath (struct vfs_class *me, struct vfs_s_inode *ino); char *vfs_s_fullpath (struct vfs_class *me, struct vfs_s_inode *ino);