Revision: 3380 http://geany.svn.sourceforge.net/geany/?rev=3380&view=rev Author: eht16 Date: 2008-12-15 21:20:34 +0000 (Mon, 15 Dec 2008)
Log Message: ----------- Fix a few compiler warnings about unused return values caused by recent glibc versions.
Modified Paths: -------------- trunk/ChangeLog trunk/tagmanager/get.c trunk/tagmanager/tm_work_object.c trunk/tagmanager/tm_workspace.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-12-15 21:20:04 UTC (rev 3379) +++ trunk/ChangeLog 2008-12-15 21:20:34 UTC (rev 3380) @@ -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>
Modified: trunk/tagmanager/get.c =================================================================== --- trunk/tagmanager/get.c 2008-12-15 21:20:04 UTC (rev 3379) +++ trunk/tagmanager/get.c 2008-12-15 21:20:34 UTC (rev 3380) @@ -733,9 +733,8 @@ 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);
Modified: trunk/tagmanager/tm_work_object.c =================================================================== --- trunk/tagmanager/tm_work_object.c 2008-12-15 21:20:04 UTC (rev 3379) +++ trunk/tagmanager/tm_work_object.c 2008-12-15 21:20:34 UTC (rev 3380) @@ -79,11 +79,12 @@ 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)
Modified: trunk/tagmanager/tm_workspace.c =================================================================== --- trunk/tagmanager/tm_workspace.c 2008-12-15 21:20:04 UTC (rev 3379) +++ trunk/tagmanager/tm_workspace.c 2008-12-15 21:20:34 UTC (rev 3380) @@ -196,8 +196,9 @@ { 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 @@ } 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 @@ */ 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);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.