Skip to content
Snippets Groups Projects
Commit eb2a9ded authored by Lorenz Meier's avatar Lorenz Meier
Browse files

Only printing value if equal

parent c46efd3a
No related branches found
No related tags found
No related merge requests found
......@@ -327,12 +327,12 @@ do_compare(const char* name, const char* val)
switch (param_type(param)) {
case PARAM_TYPE_INT32:
if (!param_get(param, &i)) {
printf("curr: %d: ", i);
/* convert string */
char* end;
int j = strtol(val,&end,10);
if (i == j) {
printf(" %d: ", i);
ret = 0;
}
......@@ -342,12 +342,12 @@ do_compare(const char* name, const char* val)
case PARAM_TYPE_FLOAT:
if (!param_get(param, &f)) {
printf("curr: %4.4f: ", (double)f);
/* convert string */
char* end;
float g = strtod(val,&end);
float g = strtod(val, &end);
if (fabsf(f - g) < 1e-7f) {
printf(" %4.4f: ", (double)f);
ret = 0;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment