Compare commits

...

3 Commits

5 changed files with 10 additions and 10 deletions

View File

@ -32,7 +32,7 @@ set(SOURCE
${LAYER_SELECTOR_SOURCES} ${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_executable(${PROJECT_NAME} ${SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/resources/resources.c)
add_dependencies(${PROJECT_NAME} glib-resources) add_dependencies(${PROJECT_NAME} glib-resources)

View File

@ -55,7 +55,7 @@ G_DEFINE_TYPE(ColorPalette, color_palette, G_TYPE_OBJECT)
static int count_non_empty_lines_in_array(const char *data, size_t length) static int count_non_empty_lines_in_array(const char *data, size_t length)
{ {
unsigned int idx; unsigned int idx;
int non_empty_lines; int non_empty_lines = 0;
char last_char = '\n'; char last_char = '\n';
if (!data) if (!data)

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 * @brief Contains the application menu entries
*/ */
const static GActionEntry app_actions[] = { static const GActionEntry app_actions[] = {
{"quit", app_quit, NULL, NULL, NULL, {0}}, {"quit", app_quit, NULL, NULL, NULL, {0}},
{"about", app_about, NULL, NULL, NULL, {0}} {"about", app_about, NULL, NULL, NULL, {0}}
}; };

View File

@ -1,10 +1,10 @@
add_custom_target(glib-resources DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/resources.c) add_custom_target(glib-resources DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/resources.c")
add_custom_command(DEPENDS add_custom_command(DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/*.glade "${CMAKE_CURRENT_SOURCE_DIR}/*.glade"
${CMAKE_CURRENT_SOURCE_DIR}/resources.xml "${CMAKE_CURRENT_SOURCE_DIR}/resources.xml"
${CMAKE_CURRENT_SOURCE_DIR}/color-palette.txt "${CMAKE_CURRENT_SOURCE_DIR}/color-palette.txt"
OUTPUT OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/resources.c "${CMAKE_CURRENT_BINARY_DIR}/resources.c"
COMMAND COMMAND
glib-compile-resources --target="${CMAKE_CURRENT_BINARY_DIR}/resources.c" --sourcedir="${CMAKE_CURRENT_SOURCE_DIR}" --generate-source "${CMAKE_CURRENT_SOURCE_DIR}/resources.xml" glib-compile-resources --target="${CMAKE_CURRENT_BINARY_DIR}/resources.c" --sourcedir="${CMAKE_CURRENT_SOURCE_DIR}" --generate-source "${CMAKE_CURRENT_SOURCE_DIR}/resources.xml"
) )

View File

@ -183,10 +183,10 @@ static double convert_number_to_engineering(double input, const char **out_prefi
const char *selected_prefix = NULL; const char *selected_prefix = NULL;
double return_val = 0.0; double return_val = 0.0;
int idx; 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 */ "", /* 1 */
"h", "k", "M", "G", "T", "P", "E", "Z", "Y"}; /* > 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, 1,
1E2, 1E3, 1E6, 1E9, 1E12, 1E15, 1E18, 1E21, 1E24}; 1E2, 1E3, 1E6, 1E9, 1E12, 1E15, 1E18, 1E21, 1E24};
const int prefix_count = (int)(sizeof(prefixes)/sizeof(char *)); const int prefix_count = (int)(sizeof(prefixes)/sizeof(char *));