1
1

Forgot to remove some more .s strings and do a rename in order to prevent compiler warnings + added include

Signed-off-by: Patrick Winnertz <winnie@debian.org>
Этот коммит содержится в:
Patrick Winnertz 2009-02-06 00:34:50 +01:00
родитель 0450daf566
Коммит d8aa8a3028
3 изменённых файлов: 10 добавлений и 8 удалений

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

@ -11,13 +11,13 @@
#define mhl_mem_alloc_z(sz) (calloc(1,sz)) #define mhl_mem_alloc_z(sz) (calloc(1,sz))
/* free a chunk of memory from stack, passing NULL does no harm */ /* free a chunk of memory from stack, passing NULL does no harm */
static inline void g_free(void* ptr) static inline void mhl_mem_free(void* ptr)
{ {
if (ptr) free(ptr); if (ptr) free(ptr);
} }
/* free an ptr and NULL it */ /* free an ptr and NULL it */
#define MHL_PTR_FREE(ptr) do { g_free(ptr); (ptr) = NULL; } while (0) #define MHL_PTR_FREE(ptr) do { mhl_mem_free(ptr); (ptr) = NULL; } while (0)
/* allocate a chunk on stack - automatically free'd on function exit */ /* allocate a chunk on stack - automatically free'd on function exit */
#define mhl_stack_alloc(sz) (alloca(sz)) #define mhl_stack_alloc(sz) (alloca(sz))

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

@ -463,7 +463,7 @@ fish_dir_load(struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path)
"echo '### 500'\n" "echo '### 500'\n"
"fi\n", "fi\n",
quoted_path, quoted_path, quoted_path, quoted_path, quoted_path, quoted_path); quoted_path, quoted_path, quoted_path, quoted_path, quoted_path, quoted_path);
g_free (quoted_path.s); g_free (quoted_path);
ent = vfs_s_generate_entry(me, NULL, dir, 0); ent = vfs_s_generate_entry(me, NULL, dir, 0);
while (1) { while (1) {
int res = vfs_s_get_line_interruptible (me, buffer, sizeof (buffer), SUP.sockr); int res = vfs_s_get_line_interruptible (me, buffer, sizeof (buffer), SUP.sockr);
@ -735,14 +735,14 @@ fish_file_store(struct vfs_class *me, struct vfs_s_fh *fh, char *name, char *loc
(unsigned long) s.st_size); (unsigned long) s.st_size);
} }
close(h); close(h);
g_free(quoted_name.s); g_free(quoted_name);
if ((fish_get_reply (me, SUP.sockr, NULL, 0) != COMPLETE) || was_error) if ((fish_get_reply (me, SUP.sockr, NULL, 0) != COMPLETE) || was_error)
ERRNOR (E_REMOTE, -1); ERRNOR (E_REMOTE, -1);
return 0; return 0;
error_return: error_return:
close(h); close(h);
fish_get_reply(me, SUP.sockr, NULL, 0); fish_get_reply(me, SUP.sockr, NULL, 0);
g_free(quoted_name.s); g_free(quoted_name);
return -1; return -1;
} }
@ -780,7 +780,7 @@ fish_linear_start (struct vfs_class *me, struct vfs_s_fh *fh, off_t offset)
"echo '### 500'\n" "echo '### 500'\n"
"fi\n", "fi\n",
quoted_name, quoted_name, quoted_name, quoted_name ); quoted_name, quoted_name, quoted_name, quoted_name );
g_free (quoted_name.s); g_free (quoted_name);
if (offset != PRELIM) ERRNOR (E_REMOTE, 0); if (offset != PRELIM) ERRNOR (E_REMOTE, 0);
fh->linear = LS_LINEAR_OPEN; fh->linear = LS_LINEAR_OPEN;
fh->u.fish.got = 0; fh->u.fish.got = 0;
@ -934,8 +934,8 @@ static int fish_##name (struct vfs_class *me, const char *path1, const char *pat
rpath2 = mhl_shell_escape_dup (crpath2); \ rpath2 = mhl_shell_escape_dup (crpath2); \
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.s); \ g_free (rpath1); \
g_free (rpath2.s); \ g_free (rpath2); \
return fish_send_command(me, super2, buf, OPT_FLUSH); \ return fish_send_command(me, super2, buf, OPT_FLUSH); \
} }

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

@ -38,6 +38,8 @@
#include <signal.h> #include <signal.h>
#include <ctype.h> /* is_digit() */ #include <ctype.h> /* is_digit() */
#include <mhl/string.h>
#include "../src/global.h" #include "../src/global.h"
#include "../src/tty.h" /* enable/disable interrupt key */ #include "../src/tty.h" /* enable/disable interrupt key */
#include "../src/wtools.h" /* message() */ #include "../src/wtools.h" /* message() */