To support this change, turn on lots more compiler warnings, and fix all the warnings generated.
Showing the changes to src/sox.c (1 of 93 files). Show all
Unified · Split
| @@ -128,8 +128,8 @@ static void sigint(int s); · 127 unmodified lines | |||
| 128 | /* Array's tracking input and output files */ | 128 | /* Array's tracking input and output files */ |
| 129 | static file_options_t *file_opts[MAX_FILES]; | 129 | static file_options_t *file_opts[MAX_FILES]; |
| 130 | static ft_t file_desc[MAX_FILES]; | 130 | static ft_t file_desc[MAX_FILES]; |
| 131 | static int file_count = 0; | 131 | static size_t file_count = 0; |
| 132 | static int input_count = 0; | 132 | static size_t input_count = 0; |
| 133 | 133 | ||
| 134 | /* We parse effects into a temporary effects table and then place into | 134 | /* We parse effects into a temporary effects table and then place into |
| 135 | * the real effects table. This makes it easier to reorder some effects | 135 | * the real effects table. This makes it easier to reorder some effects |
| @@ -179,7 +179,7 @@ static void sox_output_message(int level, st_output_message_t m) · 43 unmodified lines | |||
| 179 | int main(int argc, char **argv) | 179 | int main(int argc, char **argv) |
| 180 | { | 180 | { |
| 181 | file_options_t *fo; | 181 | file_options_t *fo; |
| 182 | int i; | 182 | size_t i; |
| 183 | 183 | ||
| 184 | myname = argv[0]; | 184 | myname = argv[0]; |
| 185 | 185 | ||
| @@ -202,8 +202,8 @@ int main(int argc, char **argv) · 16 unmodified lines | |||
| 202 | 202 | ||
| 203 | fo = (file_options_t *)calloc(sizeof(file_options_t), 1); | 203 | fo = (file_options_t *)calloc(sizeof(file_options_t), 1); |
| 204 | fo->info.size = -1; | 204 | fo->info.size = -1; |
| 205 | fo->info.encoding = -1; | 205 | fo->info.encoding = ST_ENCODING_UNKNOWN; |
| 206 | fo->info.channels = -1; | 206 | fo->info.channels = 0; |
| 207 | fo->info.compression = HUGE_VAL; | 207 | fo->info.compression = HUGE_VAL; |
| 208 | fo->volume = 1.0; | 208 | fo->volume = 1.0; |
| 209 | file_opts[file_count++] = fo; | 209 | file_opts[file_count++] = fo; |
| @@ -551,7 +551,7 @@ static int compare_input(ft_t ft1, ft_t ft2) · 341 unmodified lines | |||
| 551 | return ST_SUCCESS; | 551 | return ST_SUCCESS; |
| 552 | } | 552 | } |
| 553 | 553 | ||
| 554 | void optimize_trim(void) | 554 | static void optimize_trim(void) |
| 555 | { | 555 | { |
| 556 | /* Speed hack. If the "trim" effect is the first effect then | 556 | /* Speed hack. If the "trim" effect is the first effect then |
| 557 | * peak inside its "effect descriptor" and see what the | 557 | * peak inside its "effect descriptor" and see what the |
| @@ -585,9 +585,9 @@ void optimize_trim(void) · 27 unmodified lines | |||
| 585 | */ | 585 | */ |
| 586 | 586 | ||
| 587 | static void process(void) { | 587 | static void process(void) { |
| 588 | int e, f, flowstatus = ST_SUCCESS; | 588 | int e, flowstatus = ST_SUCCESS; |
| 589 | int current_input; | 589 | size_t current_input; |
| 590 | st_size_t s; | 590 | st_size_t s, f; |
| 591 | st_ssize_t ilen[MAX_INPUT_FILES]; | 591 | st_ssize_t ilen[MAX_INPUT_FILES]; |
| 592 | st_sample_t *ibuf[MAX_INPUT_FILES]; | 592 | st_sample_t *ibuf[MAX_INPUT_FILES]; |
| 593 | 593 | ||
| @@ -626,9 +626,9 @@ static void process(void) { · 32 unmodified lines | |||
| 626 | options->info.rate = file_desc[0]->info.rate; | 626 | options->info.rate = file_desc[0]->info.rate; |
| 627 | if (options->info.size == -1) | 627 | if (options->info.size == -1) |
| 628 | options->info.size = file_desc[0]->info.size; | 628 | options->info.size = file_desc[0]->info.size; |
| 629 | if (options->info.encoding == -1) | 629 | if (options->info.encoding == ST_ENCODING_UNKNOWN) |
| 630 | options->info.encoding = file_desc[0]->info.encoding; | 630 | options->info.encoding = file_desc[0]->info.encoding; |
| 631 | if (options->info.channels == -1) | 631 | if (options->info.channels == 0) |
| 632 | options->info.channels = file_desc[0]->info.channels; | 632 | options->info.channels = file_desc[0]->info.channels; |
| 633 | 633 | ||
| 634 | if (options->comment != NULL) | 634 | if (options->comment != NULL) |
| @@ -1263,7 +1263,7 @@ static void reserve_effect_buf(void) · 628 unmodified lines | |||
| 1263 | static int flow_effect_out(void) | 1263 | static int flow_effect_out(void) |
| 1264 | { | 1264 | { |
| 1265 | int e, havedata, flowstatus = 0; | 1265 | int e, havedata, flowstatus = 0; |
| 1266 | int len, total; | 1266 | size_t len, total; |
| 1267 | 1267 | ||
| 1268 | do { | 1268 | do { |
| 1269 | /* run entire chain BACKWARDS: pull, don't push.*/ | 1269 | /* run entire chain BACKWARDS: pull, don't push.*/ |
| @@ -1330,9 +1330,9 @@ static int flow_effect_out(void) · 60 unmodified lines | |||
| 1330 | 1330 | ||
| 1331 | len = st_write(file_desc[file_count-1], | 1331 | len = st_write(file_desc[file_count-1], |
| 1332 | &efftab[neffects-1].obuf[total], | 1332 | &efftab[neffects-1].obuf[total], |
| 1333 | (st_ssize_t)efftab[neffects-1].olen-total); | 1333 | efftab[neffects-1].olen-total); |
| 1334 | 1334 | ||
| 1335 | if (len < 0 || file_desc[file_count-1]->file.eof) | 1335 | if (len != efftab[neffects-1].olen-total || file_desc[file_count-1]->file.eof) |
| 1336 | { | 1336 | { |
| 1337 | st_warn("Error writing: %s", | 1337 | st_warn("Error writing: %s", |
| 1338 | file_desc[file_count-1]->st_errstr); | 1338 | file_desc[file_count-1]->st_errstr); |
| @@ -1877,7 +1877,7 @@ static void usage_effect(char *effect) · 538 unmodified lines | |||
| 1877 | 1877 | ||
| 1878 | void cleanup(void) | 1878 | void cleanup(void) |
| 1879 | { | 1879 | { |
| 1880 | int i; | 1880 | size_t i; |
| 1881 | struct stat st; | 1881 | struct stat st; |
| 1882 | char *fn; | 1882 | char *fn; |
| 1883 | 1883 | ||