From ab4a2aaf4a4b2b4e416aa1f113b30362cbe0dec3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 24 Mar 2012 06:38:07 +0000 Subject: style cleanup: follow style guide for formatting of if/for/while loops, and else if's --- source/blender/editors/space_file/fsmenu.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'source/blender/editors/space_file/fsmenu.c') diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index 8b98b942f42..ddd4b31d145 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -177,7 +177,8 @@ void fsmenu_insert_entry(struct FSMenu* fsmenu, FSMenuCategory category, const c else if (sorted && cmp_ret < 0) { break; } - } else { + } + else { // if we're bookmarking this, file should come // before the last separator, only automatically added // current dir go after the last sep. @@ -194,7 +195,8 @@ void fsmenu_insert_entry(struct FSMenu* fsmenu, FSMenuCategory category, const c if (prev) { fsme->next= prev->next; prev->next= fsme; - } else { + } + else { fsme->next= fsms; fsmenu_set_category(fsmenu, category, fsme); } @@ -217,7 +219,8 @@ void fsmenu_remove_entry(struct FSMenu* fsmenu, FSMenuCategory category, int idx /* remove fsme from list */ if (prev) { prev->next= fsme->next; - } else { + } + else { fsms= fsme->next; fsmenu_set_category(fsmenu, category, fsms); } @@ -267,11 +270,13 @@ void fsmenu_read_bookmarks(struct FSMenu* fsmenu, const char *filename) while ( fgets ( line, 256, fp ) != NULL ) /* read a line */ { - if (strncmp(line, "[Bookmarks]", 11)==0){ + if (strncmp(line, "[Bookmarks]", 11)==0) { category = FS_CATEGORY_BOOKMARKS; - } else if (strncmp(line, "[Recent]", 8)==0){ + } + else if (strncmp(line, "[Recent]", 8)==0) { category = FS_CATEGORY_RECENT; - } else { + } + else { int len = strlen(line); if (len>0) { if (line[len-1] == '\n') { @@ -344,7 +349,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu) * assume they are the standard ones * TODO : replace hardcoded paths with proper BLI_get_folder calls */ home = getenv("HOME"); - if(home) { + if (home) { BLI_snprintf(line, 256, "%s/", home); fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, line, 1, 0); BLI_snprintf(line, 256, "%s/Desktop/", home); @@ -465,7 +470,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu) { const char *home= getenv("HOME"); - if(home) { + if (home) { BLI_snprintf(line, FILE_MAXDIR, "%s/", home); fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, line, 1, 0); BLI_snprintf(line, FILE_MAXDIR, "%s/Desktop/", home); @@ -489,11 +494,11 @@ void fsmenu_read_system(struct FSMenu* fsmenu) else { while ((mnt = getmntent (fp))) { /* not sure if this is right, but seems to give the relevant mnts */ - if(strncmp(mnt->mnt_fsname, "/dev", 4)) + if (strncmp(mnt->mnt_fsname, "/dev", 4)) continue; len= strlen(mnt->mnt_dir); - if(len && mnt->mnt_dir[len-1] != '/') { + if (len && mnt->mnt_dir[len-1] != '/') { BLI_snprintf(line, FILE_MAXDIR, "%s/", mnt->mnt_dir); fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, line, 1, 0); } @@ -509,7 +514,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu) #endif /* fallback */ - if(!found) + if (!found) fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, "/", 1, 0); } } -- cgit v1.2.3