camconst: use true/false instead of 0/1 for "global_green_equilibration"

This commit is contained in:
Alberto Griggio
2018-06-08 13:55:15 +02:00
parent 0e22f0b610
commit 4361e12062
3 changed files with 45 additions and 42 deletions

View File

@@ -343,12 +343,12 @@ CameraConst::parseEntry(void *cJSON_, const char *make_model)
ji = cJSON_GetObjectItem(js, "global_green_equilibration");
if (ji) {
if (ji->type != cJSON_Number) {
fprintf(stderr, "\"global_green_equilibration\" must be a number\n");
if (ji->type != cJSON_False && ji->type != cJSON_True) {
fprintf(stderr, "\"global_green_equilibration\" must be a boolean\n");
goto parse_error;
}
cc->globalGreenEquilibration = ji->valueint;
cc->globalGreenEquilibration = (ji->type == cJSON_True);
}
return cc;