zserge / jsmn

Jsmn is a world fastest JSON parser/tokenizer. This is the official repo replacing the old one at Bitbucket
MIT License
3.65k stars 778 forks source link

Many wanings about sign. #174

Open maxsupermanhd opened 4 years ago

maxsupermanhd commented 4 years ago
jsmn.h: In function ‘jsmn_parse_primitive’:
jsmn.h:141:11: warning: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Wsign-conversion]
   start = parser->pos;
           ^~~~~~
jsmn.h:159:21: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
       parser->pos = start;
                     ^~~~~
jsmn.h:176:19: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
     parser->pos = start;
                   ^~~~~
jsmn.h:179:49: warning: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Wsign-conversion]
   jsmn_fill_token(token, JSMN_PRIMITIVE, start, parser->pos);
                                                 ^~~~~~
jsmn.h: In function ‘jsmn_parse_string’:
jsmn.h:195:15: warning: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Wsign-conversion]
   int start = parser->pos;
               ^~~~~~
jsmn.h:210:23: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
         parser->pos = start;
                       ^~~~~
jsmn.h:213:54: warning: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Wsign-conversion]
       jsmn_fill_token(token, JSMN_STRING, start + 1, parser->pos);
                                                      ^~~~~~
jsmn.h:244:27: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
             parser->pos = start;
                           ^~~~~
jsmn.h:253:23: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
         parser->pos = start;
                       ^~~~~
jsmn.h:258:17: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
   parser->pos = start;
                 ^~~~~
jsmn.h: In function ‘jsmn_parse’:
jsmn.h:270:15: warning: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Wsign-conversion]
   int count = parser->toknext;
               ^~~~~~
jsmn.h:302:22: warning: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Wsign-conversion]
       token->start = parser->pos;
                      ^~~~~~
jsmn.h:303:26: warning: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Wsign-conversion]
       parser->toksuper = parser->toknext - 1;
                          ^~~~~~
jsmn.h:334:16: warning: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Wsign-conversion]
       for (i = parser->toknext - 1; i >= 0; i--) {
                ^~~~~~
jsmn.h:341:24: warning: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Wsign-conversion]
           token->end = parser->pos + 1;
                        ^~~~~~
jsmn.h:374:26: warning: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Wsign-conversion]
       parser->toksuper = parser->toknext - 1;
                          ^~~~~~
jsmn.h:383:18: warning: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Wsign-conversion]
         for (i = parser->toknext - 1; i >= 0; i--) {
                  ^~~~~~
jsmn.h:441:14: warning: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Wsign-conversion]
     for (i = parser->toknext - 1; i >= 0; i--) {
              ^~~~~~