From: Cloudwalk Date: Mon, 10 May 2021 17:52:35 +0000 (-0400) Subject: Rename indent/dedent functions X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5f3b11852a5a1a52ec62244c1330ad02ab739142;p=xonotic%2Fdarkplaces.git Rename indent/dedent functions --- diff --git a/json.c b/json.c index 705d1c0b..b7ad7cb4 100644 --- a/json.c +++ b/json.c @@ -208,7 +208,7 @@ static inline qbool Json_Parse_Pairs(struct qjson_state_s *json) // Parse an object. static inline void Json_Parse_Object(struct qjson_state_s *json) { - Parse_IncDepth(json->state); + Parse_Indent(json->state); /* * Json objects are basically a data map; key-value pairs. @@ -219,13 +219,13 @@ static inline void Json_Parse_Object(struct qjson_state_s *json) if(Parse_CurrentToken(json->state) != '}') Parse_Error(json->state, PARSE_ERR_INVAL, ", or }"); - Parse_DecDepth(json->state); + Parse_Dedent(json->state); } // Parse an array. static inline void Json_Parse_Array(struct qjson_state_s *json) { - Parse_IncDepth(json->state); + Parse_Indent(json->state); /* * Json arrays are basically lists. They can contain @@ -239,7 +239,7 @@ static inline void Json_Parse_Array(struct qjson_state_s *json) if(Parse_CurrentToken(json->state) != ']') Parse_Error(json->state, PARSE_ERR_INVAL, ", or ]"); - Parse_DecDepth(json->state); + Parse_Dedent(json->state); } // Main function for the parser. diff --git a/parser.h b/parser.h index 9eeb520c..05cf6e3a 100644 --- a/parser.h +++ b/parser.h @@ -56,14 +56,14 @@ char Parse_CurrentToken(struct qparser_state_s *state); qparser_state_t *Parse_New(const unsigned char *in); qparser_state_t *Parse_LoadFile(const char *file); -static inline void Parse_IncDepth(struct qparser_state_s *state) +static inline void Parse_Indent(struct qparser_state_s *state) { if(state->depth >= PARSER_MAX_DEPTH) Parse_Error(state, PARSE_ERR_DEPTH, NULL); state->depth++; } -static inline void Parse_DecDepth(struct qparser_state_s *state) +static inline void Parse_Dedent(struct qparser_state_s *state) { state->depth--; } \ No newline at end of file