Add old style wwarning to compile flags. Fix code accordingly

This commit is contained in:
Mario Hüttel 2019-08-25 21:51:35 +02:00
parent c5e697b366
commit b102d90d33
3 changed files with 4 additions and 4 deletions

View File

@ -32,7 +32,7 @@ set(SOURCE
${LAYER_SELECTOR_SOURCES}
)
add_compile_options(-Wall)
add_compile_options(-Wall -Wold-style-declaration)
add_executable(${PROJECT_NAME} ${SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/resources/resources.c)
add_dependencies(${PROJECT_NAME} glib-resources)

2
main.c
View File

@ -117,7 +117,7 @@ static void app_about(GSimpleAction *action, GVariant *parameter, gpointer user_
/**
* @brief Contains the application menu entries
*/
const static GActionEntry app_actions[] = {
static const GActionEntry app_actions[] = {
{"quit", app_quit, NULL, NULL, NULL, {0}},
{"about", app_about, NULL, NULL, NULL, {0}}
};

View File

@ -183,10 +183,10 @@ static double convert_number_to_engineering(double input, const char **out_prefi
const char *selected_prefix = NULL;
double return_val = 0.0;
int idx;
const static char * prefixes[] = {"y", "z", "a", "f", "p", "n", "u", "m", "c", "d", /* < 1 */
static const char * prefixes[] = {"y", "z", "a", "f", "p", "n", "u", "m", "c", "d", /* < 1 */
"", /* 1 */
"h", "k", "M", "G", "T", "P", "E", "Z", "Y"}; /* > 1 */
const static double scale[] = {1E-24, 1E-21, 1E-18, 1E-15, 1E-12, 1E-9, 1E-6, 1E-3, 1E-2, 1E-1,
static const double scale[] = {1E-24, 1E-21, 1E-18, 1E-15, 1E-12, 1E-9, 1E-6, 1E-3, 1E-2, 1E-1,
1,
1E2, 1E3, 1E6, 1E9, 1E12, 1E15, 1E18, 1E21, 1E24};
const int prefix_count = (int)(sizeof(prefixes)/sizeof(char *));