mirror of
https://github.com/vale981/libblobpack
synced 2025-03-05 09:51:42 -05:00
minor adjustments
This commit is contained in:
parent
e3b9c8d231
commit
8931018c36
3 changed files with 13 additions and 13 deletions
2
blob.c
2
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);
|
||||
|
|
|
@ -36,7 +36,7 @@ http://www.opensource.apple.com/source/tcl/tcl-14/tcl/license.terms
|
|||
* Copyright (c) 1994 Sun Microsystems, Inc.
|
||||
*/
|
||||
|
||||
#include <blobpack/blobpack.h>
|
||||
#include "blobpack.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#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){
|
||||
|
|
20
ujsondec.c
20
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 (;;)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue