@@ -13,13 +13,11 @@ const char* ffOptionsParseDisplayJsonConfig(FFOptionsDisplay* options, yyjson_va
1313 if (!object ) return NULL ;
1414 if (!yyjson_is_obj (object )) return "Property 'display' must be an object" ;
1515
16- yyjson_val * key_ , * val ;
16+ yyjson_val * key , * val ;
1717 size_t idx , max ;
18- yyjson_obj_foreach (object , idx , max , key_ , val )
18+ yyjson_obj_foreach (object , idx , max , key , val )
1919 {
20- const char * key = yyjson_get_str (key_ );
21-
22- if (ffStrEqualsIgnCase (key , "stat" ))
20+ if (unsafe_yyjson_equals_str (key , "stat" ))
2321 {
2422 if (yyjson_is_bool (val ))
2523 {
@@ -39,21 +37,21 @@ const char* ffOptionsParseDisplayJsonConfig(FFOptionsDisplay* options, yyjson_va
3937 else
4038 return "display.stat must be a boolean or a positive integer" ;
4139 }
42- else if (ffStrEqualsIgnCase (key , "pipe" ))
40+ else if (unsafe_yyjson_equals_str (key , "pipe" ))
4341 options -> pipe = yyjson_get_bool (val );
44- else if (ffStrEqualsIgnCase (key , "showErrors" ))
42+ else if (unsafe_yyjson_equals_str (key , "showErrors" ))
4543 options -> showErrors = yyjson_get_bool (val );
46- else if (ffStrEqualsIgnCase (key , "disableLinewrap" ))
44+ else if (unsafe_yyjson_equals_str (key , "disableLinewrap" ))
4745 options -> disableLinewrap = yyjson_get_bool (val );
48- else if (ffStrEqualsIgnCase (key , "hideCursor" ))
46+ else if (unsafe_yyjson_equals_str (key , "hideCursor" ))
4947 options -> hideCursor = yyjson_get_bool (val );
50- else if (ffStrEqualsIgnCase (key , "separator" ))
48+ else if (unsafe_yyjson_equals_str (key , "separator" ))
5149 ffStrbufSetJsonVal (& options -> keyValueSeparator , val );
52- else if (ffStrEqualsIgnCase (key , "color" ))
50+ else if (unsafe_yyjson_equals_str (key , "color" ))
5351 {
5452 if (yyjson_is_str (val ))
5553 {
56- ffOptionParseColor (yyjson_get_str (val ), & options -> colorKeys );
54+ ffOptionParseColor (unsafe_yyjson_get_str (val ), & options -> colorKeys );
5755 ffStrbufSet (& options -> colorTitle , & options -> colorKeys );
5856 }
5957 else if (yyjson_is_obj (val ))
@@ -74,9 +72,9 @@ const char* ffOptionsParseDisplayJsonConfig(FFOptionsDisplay* options, yyjson_va
7472 else
7573 return "display.color must be either a string or an object" ;
7674 }
77- else if (ffStrEqualsIgnCase (key , "brightColor" ))
75+ else if (unsafe_yyjson_equals_str (key , "brightColor" ))
7876 options -> brightColor = yyjson_get_bool (val );
79- else if (ffStrEqualsIgnCase (key , "duration" ))
77+ else if (unsafe_yyjson_equals_str (key , "duration" ))
8078 {
8179 if (!yyjson_is_obj (val ))
8280 return "display.duration must be an object" ;
@@ -98,7 +96,7 @@ const char* ffOptionsParseDisplayJsonConfig(FFOptionsDisplay* options, yyjson_va
9896 options -> durationSpaceBeforeUnit = (FFSpaceBeforeUnitType ) value ;
9997 }
10098 }
101- else if (ffStrEqualsIgnCase (key , "size" ))
99+ else if (unsafe_yyjson_equals_str (key , "size" ))
102100 {
103101 if (!yyjson_is_obj (val ))
104102 return "display.size must be an object" ;
@@ -154,7 +152,7 @@ const char* ffOptionsParseDisplayJsonConfig(FFOptionsDisplay* options, yyjson_va
154152 options -> sizeSpaceBeforeUnit = (FFSpaceBeforeUnitType ) value ;
155153 }
156154 }
157- else if (ffStrEqualsIgnCase (key , "temp" ))
155+ else if (unsafe_yyjson_equals_str (key , "temp" ))
158156 {
159157 if (!yyjson_is_obj (val ))
160158 return "display.temp must be an object" ;
@@ -211,7 +209,7 @@ const char* ffOptionsParseDisplayJsonConfig(FFOptionsDisplay* options, yyjson_va
211209 options -> tempSpaceBeforeUnit = (FFSpaceBeforeUnitType ) value ;
212210 }
213211 }
214- else if (ffStrEqualsIgnCase (key , "percent" ))
212+ else if (unsafe_yyjson_equals_str (key , "percent" ))
215213 {
216214 if (!yyjson_is_obj (val ))
217215 return "display.percent must be an object" ;
@@ -259,7 +257,7 @@ const char* ffOptionsParseDisplayJsonConfig(FFOptionsDisplay* options, yyjson_va
259257 yyjson_val * width = yyjson_obj_get (val , "width" );
260258 if (width ) options -> percentWidth = (uint8_t ) yyjson_get_uint (width );
261259 }
262- else if (ffStrEqualsIgnCase (key , "bar" ))
260+ else if (unsafe_yyjson_equals_str (key , "bar" ))
263261 {
264262 if (yyjson_is_obj (val ))
265263 {
@@ -369,7 +367,7 @@ const char* ffOptionsParseDisplayJsonConfig(FFOptionsDisplay* options, yyjson_va
369367 else
370368 return "display.bar must be an object" ;
371369 }
372- else if (ffStrEqualsIgnCase (key , "fraction" ))
370+ else if (unsafe_yyjson_equals_str (key , "fraction" ))
373371 {
374372 if (yyjson_is_obj (val ))
375373 {
@@ -386,11 +384,9 @@ const char* ffOptionsParseDisplayJsonConfig(FFOptionsDisplay* options, yyjson_va
386384 else
387385 return "display.fraction must be an object" ;
388386 }
389- else if (ffStrEqualsIgnCase (key , "noBuffer" ))
387+ else if (unsafe_yyjson_equals_str (key , "noBuffer" ))
390388 options -> noBuffer = yyjson_get_bool (val );
391- else if (ffStrEqualsIgnCase (key , "keyWidth" ))
392- return "display.keyWidth has been renamed to display.key.width" ;
393- else if (ffStrEqualsIgnCase (key , "key" ))
389+ else if (unsafe_yyjson_equals_str (key , "key" ))
394390 {
395391 if (yyjson_is_obj (val ))
396392 {
@@ -420,7 +416,7 @@ const char* ffOptionsParseDisplayJsonConfig(FFOptionsDisplay* options, yyjson_va
420416 else
421417 return "display.key must be an object" ;
422418 }
423- else if (ffStrEqualsIgnCase (key , "constants" ))
419+ else if (unsafe_yyjson_equals_str (key , "constants" ))
424420 {
425421 if (!yyjson_is_arr (val ))
426422 return "display.constants must be an array" ;
@@ -429,7 +425,7 @@ const char* ffOptionsParseDisplayJsonConfig(FFOptionsDisplay* options, yyjson_va
429425 yyjson_arr_foreach (val , idx , max , item )
430426 ffStrbufInitJsonVal (ffListAdd (& options -> constants ), item );
431427 }
432- else if (ffStrEqualsIgnCase (key , "freq" ))
428+ else if (unsafe_yyjson_equals_str (key , "freq" ))
433429 {
434430 if (!yyjson_is_obj (val ))
435431 return "display.freq must be an object" ;
0 commit comments