@@ -74,7 +74,7 @@ static void skipSpace( const char * buf,
74
74
{
75
75
size_t i = 0U ;
76
76
77
- assert_param ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
77
+ coreJSON_ASSERT ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
78
78
79
79
for ( i = * start ; i < max ; i ++ )
80
80
{
@@ -132,7 +132,7 @@ static bool shortestUTF8( size_t length,
132
132
bool ret = false;
133
133
uint32_t min = 0U , max = 0U ;
134
134
135
- assert_param ( ( length >= 2U ) && ( length <= 4U ) );
135
+ coreJSON_ASSERT ( ( length >= 2U ) && ( length <= 4U ) );
136
136
137
137
switch ( length )
138
138
{
@@ -193,11 +193,11 @@ static bool skipUTF8MultiByte( const char * buf,
193
193
uint32_t value = 0U ;
194
194
char_ c ;
195
195
196
- assert_param ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
196
+ coreJSON_ASSERT ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
197
197
198
198
i = * start ;
199
- assert_param ( i < max );
200
- assert_param ( !isascii_ ( buf [ i ] ) );
199
+ coreJSON_ASSERT ( i < max );
200
+ coreJSON_ASSERT ( !isascii_ ( buf [ i ] ) );
201
201
202
202
c .c = buf [ i ];
203
203
@@ -254,7 +254,7 @@ static bool skipUTF8( const char * buf,
254
254
{
255
255
bool ret = false;
256
256
257
- assert_param ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
257
+ coreJSON_ASSERT ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
258
258
259
259
if ( * start < max )
260
260
{
@@ -331,8 +331,8 @@ static bool skipOneHexEscape( const char * buf,
331
331
size_t i = 0U , end = 0U ;
332
332
uint16_t value = 0U ;
333
333
334
- assert_param ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
335
- assert_param ( outValue != NULL );
334
+ coreJSON_ASSERT ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
335
+ coreJSON_ASSERT ( outValue != NULL );
336
336
337
337
i = * start ;
338
338
#define HEX_ESCAPE_LENGTH ( 6U ) /* e.g., \u1234 */
@@ -394,7 +394,7 @@ static bool skipHexEscape( const char * buf,
394
394
size_t i = 0U ;
395
395
uint16_t value = 0U ;
396
396
397
- assert_param ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
397
+ coreJSON_ASSERT ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
398
398
399
399
i = * start ;
400
400
@@ -445,7 +445,7 @@ static bool skipEscape( const char * buf,
445
445
bool ret = false;
446
446
size_t i = 0U ;
447
447
448
- assert_param ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
448
+ coreJSON_ASSERT ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
449
449
450
450
i = * start ;
451
451
@@ -512,7 +512,7 @@ static bool skipString( const char * buf,
512
512
bool ret = false;
513
513
size_t i = 0 ;
514
514
515
- assert_param ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
515
+ coreJSON_ASSERT ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
516
516
517
517
i = * start ;
518
518
@@ -576,7 +576,7 @@ static bool strnEq( const char * a,
576
576
{
577
577
size_t i = 0U ;
578
578
579
- assert_param ( ( a != NULL ) && ( b != NULL ) );
579
+ coreJSON_ASSERT ( ( a != NULL ) && ( b != NULL ) );
580
580
581
581
for ( i = 0 ; i < n ; i ++ )
582
582
{
@@ -609,8 +609,8 @@ static bool skipLiteral( const char * buf,
609
609
{
610
610
bool ret = false;
611
611
612
- assert_param ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
613
- assert_param ( literal != NULL );
612
+ coreJSON_ASSERT ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
613
+ coreJSON_ASSERT ( literal != NULL );
614
614
615
615
if ( ( * start < max ) && ( length <= ( max - * start ) ) )
616
616
{
@@ -689,7 +689,7 @@ static bool skipDigits( const char * buf,
689
689
size_t i = 0U , saveStart = 0U ;
690
690
int32_t value = 0 ;
691
691
692
- assert_param ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
692
+ coreJSON_ASSERT ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
693
693
694
694
saveStart = * start ;
695
695
@@ -742,7 +742,7 @@ static void skipDecimals( const char * buf,
742
742
{
743
743
size_t i = 0U ;
744
744
745
- assert_param ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
745
+ coreJSON_ASSERT ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
746
746
747
747
i = * start ;
748
748
@@ -770,7 +770,7 @@ static void skipExponent( const char * buf,
770
770
{
771
771
size_t i = 0U ;
772
772
773
- assert_param ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
773
+ coreJSON_ASSERT ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
774
774
775
775
i = * start ;
776
776
@@ -807,7 +807,7 @@ static bool skipNumber( const char * buf,
807
807
bool ret = false;
808
808
size_t i = 0U ;
809
809
810
- assert_param ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
810
+ coreJSON_ASSERT ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
811
811
812
812
i = * start ;
813
813
@@ -903,7 +903,7 @@ static bool skipSpaceAndComma( const char * buf,
903
903
bool ret = false;
904
904
size_t i = 0U ;
905
905
906
- assert_param ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
906
+ coreJSON_ASSERT ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
907
907
908
908
skipSpace ( buf , start , max );
909
909
i = * start ;
@@ -938,7 +938,7 @@ static void skipArrayScalars( const char * buf,
938
938
{
939
939
size_t i = 0U ;
940
940
941
- assert_param ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
941
+ coreJSON_ASSERT ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
942
942
943
943
i = * start ;
944
944
@@ -980,7 +980,7 @@ static void skipObjectScalars( const char * buf,
980
980
size_t i = 0U ;
981
981
bool comma = false;
982
982
983
- assert_param ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
983
+ coreJSON_ASSERT ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
984
984
985
985
i = * start ;
986
986
@@ -1035,7 +1035,7 @@ static void skipScalars( const char * buf,
1035
1035
size_t max ,
1036
1036
char mode )
1037
1037
{
1038
- assert_param ( isOpenBracket_ ( mode ) );
1038
+ coreJSON_ASSERT ( isOpenBracket_ ( mode ) );
1039
1039
1040
1040
skipSpace ( buf , start , max );
1041
1041
@@ -1076,7 +1076,7 @@ static JSONStatus_t skipCollection( const char * buf,
1076
1076
int16_t depth = -1 ;
1077
1077
size_t i = 0U ;
1078
1078
1079
- assert_param ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
1079
+ coreJSON_ASSERT ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
1080
1080
1081
1081
i = * start ;
1082
1082
@@ -1221,8 +1221,8 @@ static bool nextValue( const char * buf,
1221
1221
bool ret = true;
1222
1222
size_t i = 0U , valueStart = 0U ;
1223
1223
1224
- assert_param ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
1225
- assert_param ( ( value != NULL ) && ( valueLength != NULL ) );
1224
+ coreJSON_ASSERT ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
1225
+ coreJSON_ASSERT ( ( value != NULL ) && ( valueLength != NULL ) );
1226
1226
1227
1227
i = * start ;
1228
1228
valueStart = i ;
@@ -1278,9 +1278,9 @@ static bool nextKeyValuePair( const char * buf,
1278
1278
bool ret = true;
1279
1279
size_t i = 0U , keyStart = 0U ;
1280
1280
1281
- assert_param ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
1282
- assert_param ( ( key != NULL ) && ( keyLength != NULL ) );
1283
- assert_param ( ( value != NULL ) && ( valueLength != NULL ) );
1281
+ coreJSON_ASSERT ( ( buf != NULL ) && ( start != NULL ) && ( max > 0U ) );
1282
+ coreJSON_ASSERT ( ( key != NULL ) && ( keyLength != NULL ) );
1283
+ coreJSON_ASSERT ( ( value != NULL ) && ( valueLength != NULL ) );
1284
1284
1285
1285
i = * start ;
1286
1286
keyStart = i ;
@@ -1351,8 +1351,8 @@ static bool objectSearch( const char * buf,
1351
1351
1352
1352
size_t i = 0U , key = 0U , keyLength = 0U , value = 0U , valueLength = 0U ;
1353
1353
1354
- assert_param ( ( buf != NULL ) && ( query != NULL ) );
1355
- assert_param ( ( outValue != NULL ) && ( outValueLength != NULL ) );
1354
+ coreJSON_ASSERT ( ( buf != NULL ) && ( query != NULL ) );
1355
+ coreJSON_ASSERT ( ( outValue != NULL ) && ( outValueLength != NULL ) );
1356
1356
1357
1357
skipSpace ( buf , & i , max );
1358
1358
@@ -1418,8 +1418,8 @@ static bool arraySearch( const char * buf,
1418
1418
size_t i = 0U , value = 0U , valueLength = 0U ;
1419
1419
uint32_t currentIndex = 0U ;
1420
1420
1421
- assert_param ( buf != NULL );
1422
- assert_param ( ( outValue != NULL ) && ( outValueLength != NULL ) );
1421
+ coreJSON_ASSERT ( buf != NULL );
1422
+ coreJSON_ASSERT ( ( outValue != NULL ) && ( outValueLength != NULL ) );
1423
1423
1424
1424
skipSpace ( buf , & i , max );
1425
1425
@@ -1486,8 +1486,8 @@ static bool skipQueryPart( const char * buf,
1486
1486
bool ret = false;
1487
1487
size_t i = 0U ;
1488
1488
1489
- assert_param ( ( buf != NULL ) && ( start != NULL ) && ( outLength != NULL ) );
1490
- assert_param ( max > 0U );
1489
+ coreJSON_ASSERT ( ( buf != NULL ) && ( start != NULL ) && ( outLength != NULL ) );
1490
+ coreJSON_ASSERT ( max > 0U );
1491
1491
1492
1492
i = * start ;
1493
1493
@@ -1535,9 +1535,9 @@ static JSONStatus_t multiSearch( const char * buf,
1535
1535
JSONStatus_t ret = JSONSuccess ;
1536
1536
size_t i = 0U , start = 0U , queryStart = 0U , value = 0U , length = max ;
1537
1537
1538
- assert_param ( ( buf != NULL ) && ( query != NULL ) );
1539
- assert_param ( ( outValue != NULL ) && ( outValueLength != NULL ) );
1540
- assert_param ( ( max > 0U ) && ( queryLength > 0U ) );
1538
+ coreJSON_ASSERT ( ( buf != NULL ) && ( query != NULL ) );
1539
+ coreJSON_ASSERT ( ( outValue != NULL ) && ( outValueLength != NULL ) );
1540
+ coreJSON_ASSERT ( ( max > 0U ) && ( queryLength > 0U ) );
1541
1541
1542
1542
while ( i < queryLength )
1543
1543
{
@@ -1747,10 +1747,10 @@ static JSONStatus_t iterate( const char * buf,
1747
1747
JSONStatus_t ret = JSONNotFound ;
1748
1748
bool found = false;
1749
1749
1750
- assert_param ( ( buf != NULL ) && ( max > 0U ) );
1751
- assert_param ( ( start != NULL ) && ( next != NULL ) );
1752
- assert_param ( ( outKey != NULL ) && ( outKeyLength != NULL ) );
1753
- assert_param ( ( outValue != NULL ) && ( outValueLength != NULL ) );
1750
+ coreJSON_ASSERT ( ( buf != NULL ) && ( max > 0U ) );
1751
+ coreJSON_ASSERT ( ( start != NULL ) && ( next != NULL ) );
1752
+ coreJSON_ASSERT ( ( outKey != NULL ) && ( outKeyLength != NULL ) );
1753
+ coreJSON_ASSERT ( ( outValue != NULL ) && ( outValueLength != NULL ) );
1754
1754
1755
1755
if ( * start < max )
1756
1756
{
0 commit comments