Resolve warnings about assignments within conditions.

- Working towards issue #11.
This commit is contained in:
Ari Koivula 2014-04-04 11:39:25 +03:00
parent d44d1837bb
commit 61ae195af7
2 changed files with 5 additions and 4 deletions

View file

@ -157,7 +157,6 @@ static int config_parse(config *cfg, const char *name, const char *value)
static const char * const colormatrix_names[] = { "GBR", "bt709", "undef", "", "fcc", "bt470bg", "smpte170m", static const char * const colormatrix_names[] = { "GBR", "bt709", "undef", "", "fcc", "bt470bg", "smpte170m",
"smpte240m", "YCgCo", "bt2020nc", "bt2020c", NULL }; "smpte240m", "YCgCo", "bt2020nc", "bt2020c", NULL };
int i;
int error = 0; int error = 0;
if (!name) if (!name)
@ -165,8 +164,9 @@ static int config_parse(config *cfg, const char *name, const char *value)
if (!value) if (!value)
value = "true"; value = "true";
if ((!strncmp(name, "no-", 3) && (i = 3))) { // Treat "--no-param" as --param 0
name += i; if ((!strncmp(name, "no-", 3))) {
name += 3;
value = atobool(value) ? "false" : "true"; value = atobool(value) ? "false" : "true";
} }

View file

@ -147,7 +147,8 @@ int main(int argc, char *argv[])
sprintf(dim_str, "_%dx%d.yuv", cfg->width, cfg->height); sprintf(dim_str, "_%dx%d.yuv", cfg->width, cfg->height);
left_len = strlen(cfg->debug); left_len = strlen(cfg->debug);
right_len = strlen(dim_str); right_len = strlen(dim_str);
if (!(cfg->debug = realloc(cfg->debug, left_len + right_len + 1))) { cfg->debug = realloc(cfg->debug, left_len + right_len + 1);
if (!cfg->debug) {
fprintf(stderr, "realloc failed!\n"); fprintf(stderr, "realloc failed!\n");
return EXIT_FAILURE; return EXIT_FAILURE;
} }