--- parser3/src/lib/json/pa_json.C 2015/09/29 12:25:15 1.14 +++ parser3/src/lib/json/pa_json.C 2016/12/26 19:41:59 1.16 @@ -121,6 +121,11 @@ enum actions { STATE_UC, /* Unicode character read */ }; +/* some compilers have the following names defined */ +#undef _C2 +#undef ST_ +#undef PT_ + /* error state */ #define STATE___ 0xff @@ -180,9 +185,6 @@ static const uint8_t state_transition_ta /*D1*/ PT_(___,___,___,___,___,___,___,___,___,___,_D2,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___), /*D2*/ PT_(___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_U1,___,___,___,___,___), }; -#undef ST_ -#undef PT_ - /* map from (previous state+new character class) to the buffer policy. ignore=0/append=1/escape=2 */ static const uint8_t buffer_policy_table[NR_STATES][NR_CLASSES] = { /* white ABCDF other */ @@ -454,7 +456,7 @@ static int act_cb(json_parser *parser) static int act_ce(json_parser *parser) { - parser->state = (uint8_t)((parser->save_state > STATE_AA) ? STATE_OK : parser->save_state); + parser->state = (parser->save_state > STATE_AA) ? (uint8_t)(STATE_OK) : (uint8_t)(parser->save_state); return 0; } @@ -638,7 +640,7 @@ int json_parser_string(json_parser *pars unsigned char ch = s[i]; ret = 0; - next_class = (uint8_t)((ch >= 128) ? C_OTHER : character_class[ch]); + next_class = (ch >= 128) ? (uint8_t)(C_OTHER) : (uint8_t)(character_class[ch]); if (next_class == C_ERROR) { ret = JSON_ERROR_BAD_CHAR; break;