Commit e630972374455d0d777ed3f26d28946faae3ca6c

Authored by Arnaud Blanchard
1 parent cd0c932a

Fix compilation error and warning

@@ -16,9 +16,9 @@ project(i_keyboard) @@ -16,9 +16,9 @@ project(i_keyboard)
16 find_package(blc_channel REQUIRED) 16 find_package(blc_channel REQUIRED)
17 find_package(blc_program REQUIRED) 17 find_package(blc_program REQUIRED)
18 18
19 -add_definitions(${BL_DEFINITIONS}) 19 +add_definitions(${BL_DEFINITIONS} -Wno-multichar)
20 include_directories(${BL_INCLUDE_DIRS}) 20 include_directories(${BL_INCLUDE_DIRS})
21 -add_executable(i_keyboard src/main.cpp) 21 +add_executable(i_keyboard src/i_keyboard.cpp)
22 target_link_libraries(i_keyboard ${BL_LIBRARIES}) 22 target_link_libraries(i_keyboard ${BL_LIBRARIES})
23 23
24 24
@@ -231,7 +231,7 @@ int main(int argc, char** argv){ @@ -231,7 +231,7 @@ int main(int argc, char** argv){
231 uchar answer; 231 uchar answer;
232 blc_array array_select; 232 blc_array array_select;
233 233
234 - asprintf(&default_output, "/%s%d", basename(argv[0]), getpid()); //This will not be free but it is only allocate once 234 + SYSTEM_ERROR_CHECK(asprintf(&default_output, "/%s%d", basename(argv[0]), getpid()), -1, NULL); //This will not be free but it is only allocate once
235 blc_program_set_description("Get keyboard inputs"); 235 blc_program_set_description("Get keyboard inputs");
236 blc_program_add_option(&display, 'd', "display", NULL, "Display a text graph", NULL); 236 blc_program_add_option(&display, 'd', "display", NULL, "Display a text graph", NULL);
237 blc_program_add_option(&filename, 'f', "file", "filename", "Initialize the values with a tsv file", NULL); 237 blc_program_add_option(&filename, 'f', "file", "filename", "Initialize the values with a tsv file", NULL);
@@ -300,9 +300,7 @@ int main(int argc, char** argv){ @@ -300,9 +300,7 @@ int main(int argc, char** argv){
300 } 300 }
301 } 301 }
302 } 302 }
303 -  
304 -  
305 - 303 +
306 304
307 305
308 if (memchr(key_list, quitting_key, keys_nb)) EXIT_ON_ERROR("The quitting key '%c' is in your key list %.*s, you need to select an other one with --quitting_key=...", quitting_key, keys_nb, key_list); 306 if (memchr(key_list, quitting_key, keys_nb)) EXIT_ON_ERROR("The quitting key '%c' is in your key list %.*s, you need to select an other one with --quitting_key=...", quitting_key, keys_nb, key_list);