Conversion looses precision warnings #31

Open
wants to merge 3 commits into
from
View
@@ -1,2 +1,3 @@
+.DS_Store
Makefile
/build/
View
@@ -50,13 +50,14 @@ typedef struct yajl_bytestack_t
#define yajl_bs_current(obs) \
(assert((obs).used > 0), (obs).stack[(obs).used - 1])
-#define yajl_bs_push(obs, byte) { \
- if (((obs).size - (obs).used) == 0) { \
- (obs).size += YAJL_BS_INC; \
- (obs).stack = (obs).yaf->realloc((obs).yaf->ctx,\
- (void *) (obs).stack, (obs).size);\
- } \
- (obs).stack[((obs).used)++] = (byte); \
+#define yajl_bs_push(obs, byte) { \
+ if (((obs).size - (obs).used) == 0) { \
+ (obs).size += YAJL_BS_INC; \
+ (obs).stack = (obs).yaf->realloc((obs).yaf->ctx, \
+ (void *)((obs).stack), \
+ (size_t)((obs).size)); \
+ } \
+ (obs).stack[((obs).used)++] = (byte); \
}
/* removes the top item of the stack, returns nothing */
View
@@ -279,7 +279,7 @@ yajl_do_parse(yajl_handle hand, const unsigned char * jsonText,
hand->ctx,(const char *) buf, bufLen));
} else if (hand->callbacks->yajl_integer) {
long long int i = 0;
- i = yajl_parse_integer(buf, bufLen);
+ i = yajl_parse_integer(buf, (unsigned int)bufLen);
if ((i == LLONG_MIN || i == LLONG_MAX) &&
errno == ERANGE)
{
View
@@ -312,7 +312,7 @@ static int handle_number (void *ctx, const char *string, size_t string_length)
endptr = NULL;
errno = 0;
v->u.number.i = yajl_parse_integer((const unsigned char *) v->u.number.r,
- strlen(v->u.number.r));
+ (unsigned int)strlen(v->u.number.r));
if ((errno == 0) && (endptr != NULL) && (*endptr == 0))
v->u.number.flags |= YAJL_NUMBER_INT_VALID;