Commit 23bde0d558e5a6477143f0ba478530d11d52afd0

Authored by Arnaud Blanchard
1 parent 58ab0be4

Fix warning and problem of writing

Showing 1 changed file with 4 additions and 4 deletions
@@ -49,7 +49,7 @@ int main(int argc, char** argv){ @@ -49,7 +49,7 @@ int main(int argc, char** argv){
49 char const *number_str; 49 char const *number_str;
50 char *default_output; 50 char *default_output;
51 int number, ret; 51 int number, ret;
52 - long executing_time, previous_executing_time; 52 + uint64_t executing_time, previous_executing_time;
53 size_t linecap=0; 53 size_t linecap=0;
54 ssize_t line_size; 54 ssize_t line_size;
55 blc_channel channel; 55 blc_channel channel;
@@ -73,11 +73,11 @@ int main(int argc, char** argv){ @@ -73,11 +73,11 @@ int main(int argc, char** argv){
73 number=strtod(number_str, NULL); 73 number=strtod(number_str, NULL);
74 74
75 array_def_with_tsv_file_first_line(&channel, filename, time_str); 75 array_def_with_tsv_file_first_line(&channel, filename, time_str);
76 - channel.create_or_open(channel_name, BLC_CHANNEL_READ); 76 + channel.create_or_open(channel_name, BLC_CHANNEL_WRITE);
77 blc_loop_try_add_posting_semaphore(channel.sem_ack_data); 77 blc_loop_try_add_posting_semaphore(channel.sem_ack_data);
78 78
79 SYSTEM_ERROR_CHECK(file=fopen(filename, "r"), NULL, "Opening '%s'", filename); 79 SYSTEM_ERROR_CHECK(file=fopen(filename, "r"), NULL, "Opening '%s'", filename);
80 - if (time_str) SYSTEM_SUCCESS_CHECK(fscanf(file, "%ld\t", &previous_executing_time), 1, "Reading time in file '%s'", filename); 80 + if (time_str) SYSTEM_SUCCESS_CHECK(fscanf(file, "%llu\t", &previous_executing_time), 1, "Reading time in file '%s'", filename);
81 81
82 channel.publish(); 82 channel.publish();
83 BLC_COMMAND_LOOP(period){ 83 BLC_COMMAND_LOOP(period){
@@ -90,7 +90,7 @@ int main(int argc, char** argv){ @@ -90,7 +90,7 @@ int main(int argc, char** argv){
90 else{ 90 else{
91 fscan_tsv_floats(file, channel.floats, channel.dims[0].length); 91 fscan_tsv_floats(file, channel.floats, channel.dims[0].length);
92 if (time_str) { 92 if (time_str) {
93 - ret=fscanf(file, "%lld\t", &executing_time); 93 + ret=fscanf(file, "%llu\t", &executing_time);
94 if (ret==0 && feof(file)){ 94 if (ret==0 && feof(file)){
95 if (number==-1) blc_command_ask_quit(); 95 if (number==-1) blc_command_ask_quit();
96 else EXIT_ON_ERROR("End of file and you request '%d' iterations. Only '%d' has been done.", number, blc_loop_iteration); 96 else EXIT_ON_ERROR("End of file and you request '%d' iterations. Only '%d' has been done.", number, blc_loop_iteration);