Kaydet (Commit) 43ecef8c authored tarafından Enrico Tröger's avatar Enrico Tröger

Fix a few compiler warnings about unused return values caused by recent glibc versions.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3380 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 860fd1a8
......@@ -10,6 +10,10 @@
* src/editor.c:
Improve auto-closing of braces, brackets and quotes
(patch by Guillaume de Rorthais, thanks).
* tagmanager/get.c, tagmanager/tm_work_object.c,
tagmanager/tm_workspace.c:
Fix a few compiler warnings about unused return values caused
by recent glibc versions.
2008-12-11 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
......
......@@ -733,9 +733,8 @@ extern char *getArglistFromFilePos(fpos_t startPosition, const char *tokenName)
if (pos2 > pos1)
{
result = (char *) g_malloc(sizeof(char ) * (pos2 - pos1 + 2));
if (result != NULL)
if (result != NULL && fread(result, sizeof(char), pos2 - pos1 + 1, File.fp) > 0)
{
fread(result, sizeof(char), pos2 - pos1 + 1, File.fp);
result[pos2-pos1+1] = '\0';
arglist = getArglistFromStr(result, tokenName);
free(result);
......
......@@ -79,11 +79,12 @@ gchar *tm_get_real_path(const gchar *file_name)
gsize len = get_path_max(file_name) + 1;
gchar *path = g_malloc0(len);
realpath(file_name, path);
return path;
if (realpath(file_name, path))
return path;
else
g_free(path);
}
else
return NULL;
return NULL;
}
guint tm_work_object_register(GFreeFunc free_func, TMUpdateFunc update_func, TMFindFunc find_func)
......
......@@ -196,8 +196,9 @@ static void write_includes_file(FILE *fp, GList *includes_files)
{
char *str = g_strdup_printf("#include \"%s\"\n", (char*)node->data);
int str_len = strlen(str);
size_t size;
fwrite(str, str_len, 1, fp);
size = fwrite(str, str_len, 1, fp);
free(str);
node = g_list_next (node);
}
......@@ -223,8 +224,9 @@ static void append_to_temp_file(FILE *fp, GList *file_list)
}
else
{
fwrite(contents, length, 1, fp);
fwrite("\n", 1, 1, fp); /* in case file doesn't end in newline (e.g. windows). */
size_t size;
size = fwrite(contents, length, 1, fp);
size = fwrite("\n", 1, 1, fp); /* in case file doesn't end in newline (e.g. windows). */
g_free(contents);
}
node = g_list_next (node);
......@@ -358,12 +360,13 @@ gboolean tm_workspace_create_global_tags(const char *config_dir, const char *pre
*/
if (pre_process != NULL)
{
int ret;
command = g_strdup_printf("%s %s | grep -v -E '^\\s*(G_BEGIN_DECLS|G_END_DECLS)\\s*$' > %s",
pre_process, temp_file, temp_file2);
#ifdef TM_DEBUG
g_message("Executing: %s", command);
#endif
system(command);
ret = system(command);
g_free(command);
g_unlink(temp_file);
g_free(temp_file);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment