From 263830f0004481cd4921f03f4242d7c80794b08d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 3 Dec 2010 17:05:21 +0000 Subject: Enabled GCC -Wwrite-strings warning for CMake and replaced many 'char's for 'const char's,. Only one functional change where Transform orientations passed "" to BIF_createTransformOrientation() which could then have the value written into. --- source/blender/editors/space_file/file_panels.c | 8 +++++--- source/blender/editors/space_file/filelist.c | 4 ++-- source/blender/editors/space_file/fsmenu.c | 2 +- source/blender/editors/space_file/fsmenu.h | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) (limited to 'source/blender/editors/space_file') diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c index 86cd4a967f1..109c5f0fdf6 100644 --- a/source/blender/editors/space_file/file_panels.c +++ b/source/blender/editors/space_file/file_panels.c @@ -68,7 +68,6 @@ static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory cat uiBut *but; uiLayout *box, *col; struct FSMenu* fsmenu = fsmenu_get(); - char *curdir= (sfile->params)? sfile->params->dir: ""; int i, i_iter, nentries = fsmenu_get_nentries(fsmenu, category); /* reset each time */ @@ -95,8 +94,11 @@ static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory cat entry = fsmenu_get_entry(fsmenu, category, i); /* set this list item as active if we have a match */ - if(strcmp(curdir, entry) == 0) - *nr= i; + if(sfile->params) { + if(strcmp(sfile->params->dir, entry) == 0) { + *nr= i; + } + } /* create nice bookmark name, shows last directory in the full path currently */ BLI_strncpy(temp, entry, FILE_MAX); diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 41ad7ad3503..c476b5d8cde 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -238,8 +238,8 @@ static int compare_size(const void *a1, const void *a2) static int compare_extension(const void *a1, const void *a2) { const struct direntry *entry1=a1, *entry2=a2; - char *sufix1, *sufix2; - char *nil=""; + const char *sufix1, *sufix2; + const char *nil=""; if (!(sufix1= strstr (entry1->relname, ".blend.gz"))) sufix1= strrchr (entry1->relname, '.'); diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index a043fc8cfd1..2856f0f4fdf 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -157,7 +157,7 @@ short fsmenu_can_save (struct FSMenu* fsmenu, FSMenuCategory category, int idx) return fsme?fsme->save:0; } -void fsmenu_insert_entry(struct FSMenu* fsmenu, FSMenuCategory category, char *path, int sorted, short save) +void fsmenu_insert_entry(struct FSMenu* fsmenu, FSMenuCategory category, const char *path, int sorted, short save) { FSMenuEntry *prev; FSMenuEntry *fsme; diff --git a/source/blender/editors/space_file/fsmenu.h b/source/blender/editors/space_file/fsmenu.h index dcf8d3eb632..d499f439f65 100644 --- a/source/blender/editors/space_file/fsmenu.h +++ b/source/blender/editors/space_file/fsmenu.h @@ -56,7 +56,7 @@ char* fsmenu_get_entry (struct FSMenu* fsmenu, FSMenuCategory category, int ind * Duplicate entries are not added. * @param sorted Should entry be inserted in sorted order? */ -void fsmenu_insert_entry (struct FSMenu* fsmenu, FSMenuCategory category, char *path, int sorted, short save); +void fsmenu_insert_entry (struct FSMenu* fsmenu, FSMenuCategory category, const char *path, int sorted, short save); /** Return whether the entry was created by the user and can be saved and deleted */ short fsmenu_can_save (struct FSMenu* fsmenu, FSMenuCategory category, int index); -- cgit v1.2.3