Commits

Anonymous committed 700bc7a

changed return value to jsmnerr_t, fixed warning about signed/unsigned values

Comments (0)

Files changed (1)

 /**
  * Fills next available token with JSON primitive.
  */
-static int jsmn_parse_primitive(jsmn_parser *parser, const char *js,
+static jsmnerr_t jsmn_parse_primitive(jsmn_parser *parser, const char *js,
 		jsmntok_t *tokens, size_t num_tokens) {
 	jsmntok_t *token;
 	int start;
 /**
  * Filsl next token with JSON string.
  */
-static int jsmn_parse_string(jsmn_parser *parser, const char *js,
+static jsmnerr_t jsmn_parse_string(jsmn_parser *parser, const char *js,
 		jsmntok_t *tokens, size_t num_tokens) {
 	jsmntok_t *token;
 
  */
 jsmnerr_t jsmn_parse(jsmn_parser *parser, const char *js, jsmntok_t *tokens, 
 		unsigned int num_tokens) {
-	int r;
+	jsmnerr_t r;
 	int i;
+	unsigned int tokindex;
 	jsmntok_t *token;
 
 	/* initialize the rest of tokens (they could be reallocated) */
-	for (i = parser->toknext; i < num_tokens; i++) {
-		jsmn_fill_token(&tokens[i], JSMN_PRIMITIVE, -1, -1);
+	for (tokindex = parser->toknext; tokindex < num_tokens; tokindex++) {
+		jsmn_fill_token(&tokens[tokindex], JSMN_PRIMITIVE, -1, -1);
 	}
 
 	for (; js[parser->pos] != '\0'; parser->pos++) {