diff --git a/blob.c b/blob.c index 190a031..536eb3c 100644 --- a/blob.c +++ b/blob.c @@ -311,7 +311,7 @@ void blob_dump(struct blob *self){ if(!self) return; printf("=========== blob ===========\n"); - printf("size: %lu, memory: %lu\n", blob_size(self), self->memlen); + printf("size: %d, memory: %d\n", (int)blob_size(self), (int)self->memlen); for(int c = 0; c < 8; c++) printf("%02x ", ((char*)self->buf)[c] & 0xff); printf("\n"); _blob_field_dump(blob_head(self), 0); diff --git a/blob_ujson.c b/blob_ujson.c index 961140c..344461e 100644 --- a/blob_ujson.c +++ b/blob_ujson.c @@ -36,7 +36,7 @@ http://www.opensource.apple.com/source/tcl/tcl-14/tcl/license.terms * Copyright (c) 1994 Sun Microsystems, Inc. */ -#include +#include "blobpack.h" #include #include #include "ujson.h" @@ -103,7 +103,7 @@ JSOBJ Object_newUnsignedLong(void *prv, JSUINT64 value){ JSOBJ Object_newDouble(void *prv, double value){ DEBUG("new double\n"); - return blob_put_float(prv, value); + return blob_put_real(prv, value); } static void Object_releaseObject(void *prv, JSOBJ obj){ diff --git a/ujsondec.c b/ujsondec.c index 5051942..4cec99a 100644 --- a/ujsondec.c +++ b/ujsondec.c @@ -82,7 +82,7 @@ double createDouble(double intNeg, double intValue, double frcValue, int frcDeci return (intValue + (frcValue * g_pow10[frcDecimalCount])) * intNeg; } -FASTCALL_ATTR JSOBJ FASTCALL_MSVC decodePreciseFloat(struct DecoderState *ds) +JSOBJ FASTCALL_MSVC decodePreciseFloat(struct DecoderState *ds) { char *end; double value; @@ -99,7 +99,7 @@ FASTCALL_ATTR JSOBJ FASTCALL_MSVC decodePreciseFloat(struct DecoderState *ds) return ds->dec->newDouble(ds->prv, value); } -FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_numeric (struct DecoderState *ds) +JSOBJ FASTCALL_MSVC decode_numeric (struct DecoderState *ds) { int intNeg = 1; int mantSize = 0; @@ -309,7 +309,7 @@ BREAK_EXP_LOOP: return ds->dec->newDouble (ds->prv, createDouble( (double) intNeg, (double) intValue , frcValue, decimalCount) * pow(10.0, expValue * expNeg)); } -FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_true ( struct DecoderState *ds) +JSOBJ FASTCALL_MSVC decode_true ( struct DecoderState *ds) { char *offset = ds->start; offset ++; @@ -329,7 +329,7 @@ SETERROR: return SetError(ds, -1, "Unexpected character found when decoding 'true'"); } -FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_false ( struct DecoderState *ds) +JSOBJ FASTCALL_MSVC decode_false ( struct DecoderState *ds) { char *offset = ds->start; offset ++; @@ -351,7 +351,7 @@ SETERROR: return SetError(ds, -1, "Unexpected character found when decoding 'false'"); } -FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_null ( struct DecoderState *ds) +JSOBJ FASTCALL_MSVC decode_null ( struct DecoderState *ds) { char *offset = ds->start; offset ++; @@ -371,7 +371,7 @@ SETERROR: return SetError(ds, -1, "Unexpected character found when decoding 'null'"); } -FASTCALL_ATTR void FASTCALL_MSVC SkipWhitespace(struct DecoderState *ds) +void FASTCALL_MSVC SkipWhitespace(struct DecoderState *ds) { char *offset = ds->start; @@ -422,7 +422,7 @@ static const JSUINT8 g_decoderLookup[256] = /* 0xf0 */ 4, 4, 4, 4, 4, 4, 4, 4, DS_UTFLENERROR, DS_UTFLENERROR, DS_UTFLENERROR, DS_UTFLENERROR, DS_UTFLENERROR, DS_UTFLENERROR, DS_UTFLENERROR, DS_UTFLENERROR, }; -FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_string ( struct DecoderState *ds) +JSOBJ FASTCALL_MSVC decode_string ( struct DecoderState *ds) { JSUTF16 sur[2] = { 0 }; int iSur = 0; @@ -672,7 +672,7 @@ FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_string ( struct DecoderState *ds) } } -FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_array(struct DecoderState *ds) +JSOBJ FASTCALL_MSVC decode_array(struct DecoderState *ds) { JSOBJ itemValue; JSOBJ newObj; @@ -735,7 +735,7 @@ FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_array(struct DecoderState *ds) } } -FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_object( struct DecoderState *ds) +JSOBJ FASTCALL_MSVC decode_object( struct DecoderState *ds) { JSOBJ itemName; JSOBJ itemValue; @@ -820,7 +820,7 @@ FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_object( struct DecoderState *ds) } } -FASTCALL_ATTR JSOBJ FASTCALL_MSVC decode_any(struct DecoderState *ds) +JSOBJ FASTCALL_MSVC decode_any(struct DecoderState *ds) { for (;;) {