Permalink
Browse files

mingw_get_folder_basepath(): avoid "default" switch branch to have gc…

…c warning.

Since gcc warns when switching on an enumeration with missing items, it is
best to avoid any default branch.

Also transformed the s_warning() into an s_carp() to see who is triggering
the warning in case it ever happens.
  • Loading branch information...
rmanfredi committed Jun 10, 2012
1 parent 243cec4 commit 76c053d715b669264f2431dba345afb1fb06d16e
Showing with 6 additions and 5 deletions.
  1. +6 −5 src/lib/mingw32.c
View
@@ -2886,16 +2886,17 @@ mingw_get_folder_basepath(enum special_folder which_folder)
case PRIVLIB_PATH:
special_path = mingw_filename_nearby(
"share" G_DIR_SEPARATOR_S PACKAGE);
- break;
+ goto done;
case NLS_PATH:
special_path = mingw_filename_nearby(
"share" G_DIR_SEPARATOR_S "locale");
- break;
- default:
- s_warning("%s() needs implementation for foldertype %d",
- G_STRFUNC, which_folder);
+ goto done;
}
+ s_carp("%s() needs implementation for foldertype %d",
+ G_STRFUNC, which_folder);
+
+done:
return special_path;
}

0 comments on commit 76c053d

Please sign in to comment.