mirror of
https://github.com/kgabis/parson.git
synced 2024-11-24 14:05:30 +00:00
1.2.1: Not using SIZE_MAX macro (issue #167)
This commit is contained in:
parent
6b3d6f42f2
commit
fd77bcddc1
@ -3,7 +3,7 @@ project(parson C)
|
|||||||
|
|
||||||
include (GNUInstallDirs)
|
include (GNUInstallDirs)
|
||||||
|
|
||||||
set(PARSON_VERSION 1.2.0)
|
set(PARSON_VERSION 1.2.1)
|
||||||
add_library(parson parson.c)
|
add_library(parson parson.c)
|
||||||
target_include_directories(parson PUBLIC $<INSTALL_INTERFACE:include>)
|
target_include_directories(parson PUBLIC $<INSTALL_INTERFACE:include>)
|
||||||
|
|
||||||
|
4
Makefile
4
Makefile
@ -1,8 +1,8 @@
|
|||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -O0 -g -Wall -Wextra -Wfloat-equal -std=c89 -pedantic-errors -DTESTS_MAIN
|
CFLAGS = -O0 -g -Wall -Wextra -std=c89 -pedantic-errors -DTESTS_MAIN
|
||||||
|
|
||||||
CPPC = g++
|
CPPC = g++
|
||||||
CPPFLAGS = -O0 -g -Wall -Wextra -Wfloat-equal -DTESTS_MAIN
|
CPPFLAGS = -O0 -g -Wall -Wextra -DTESTS_MAIN
|
||||||
|
|
||||||
all: test testcpp test_hash_collisions
|
all: test testcpp test_hash_collisions
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "parson",
|
"name": "parson",
|
||||||
"version": "1.2.0",
|
"version": "1.2.1",
|
||||||
"repo": "kgabis/parson",
|
"repo": "kgabis/parson",
|
||||||
"description": "Small json parser and reader",
|
"description": "Small json parser and reader",
|
||||||
"keywords": [ "json", "parser" ],
|
"keywords": [ "json", "parser" ],
|
||||||
|
6
parson.c
6
parson.c
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: MIT
|
SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
Parson 1.2.0 ( http://kgabis.github.com/parson/ )
|
Parson 1.2.1 ( http://kgabis.github.com/parson/ )
|
||||||
Copyright (c) 2012 - 2021 Krzysztof Gabis
|
Copyright (c) 2012 - 2021 Krzysztof Gabis
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#define PARSON_IMPL_VERSION_MAJOR 1
|
#define PARSON_IMPL_VERSION_MAJOR 1
|
||||||
#define PARSON_IMPL_VERSION_MINOR 2
|
#define PARSON_IMPL_VERSION_MINOR 2
|
||||||
#define PARSON_IMPL_VERSION_PATCH 0
|
#define PARSON_IMPL_VERSION_PATCH 1
|
||||||
|
|
||||||
#if (PARSON_VERSION_MAJOR != PARSON_IMPL_VERSION_MAJOR)\
|
#if (PARSON_VERSION_MAJOR != PARSON_IMPL_VERSION_MAJOR)\
|
||||||
|| (PARSON_VERSION_MINOR != PARSON_IMPL_VERSION_MINOR)\
|
|| (PARSON_VERSION_MINOR != PARSON_IMPL_VERSION_MINOR)\
|
||||||
@ -80,7 +80,7 @@
|
|||||||
#define IS_NUMBER_INVALID(x) (((x) * 0.0) != 0.0)
|
#define IS_NUMBER_INVALID(x) (((x) * 0.0) != 0.0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define OBJECT_INVALID_IX SIZE_MAX
|
#define OBJECT_INVALID_IX ((size_t)-1)
|
||||||
|
|
||||||
static JSON_Malloc_Function parson_malloc = malloc;
|
static JSON_Malloc_Function parson_malloc = malloc;
|
||||||
static JSON_Free_Function parson_free = free;
|
static JSON_Free_Function parson_free = free;
|
||||||
|
6
parson.h
6
parson.h
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
SPDX-License-Identifier: MIT
|
SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
Parson 1.2.0 ( http://kgabis.github.com/parson/ )
|
Parson 1.2.1 ( http://kgabis.github.com/parson/ )
|
||||||
Copyright (c) 2012 - 2021 Krzysztof Gabis
|
Copyright (c) 2012 - 2021 Krzysztof Gabis
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
@ -33,9 +33,9 @@ extern "C"
|
|||||||
|
|
||||||
#define PARSON_VERSION_MAJOR 1
|
#define PARSON_VERSION_MAJOR 1
|
||||||
#define PARSON_VERSION_MINOR 2
|
#define PARSON_VERSION_MINOR 2
|
||||||
#define PARSON_VERSION_PATCH 0
|
#define PARSON_VERSION_PATCH 1
|
||||||
|
|
||||||
#define PARSON_VERSION_STRING "1.2.0"
|
#define PARSON_VERSION_STRING "1.2.1"
|
||||||
|
|
||||||
#include <stddef.h> /* size_t */
|
#include <stddef.h> /* size_t */
|
||||||
|
|
||||||
|
2
tests.c
2
tests.c
@ -212,7 +212,7 @@ void test_suite_2(JSON_Value *root_value) {
|
|||||||
TEST(len == 7);
|
TEST(len == 7);
|
||||||
TEST(memcmp(json_object_get_string(root_object, "string with null"), "abc\0def", len) == 0);
|
TEST(memcmp(json_object_get_string(root_object, "string with null"), "abc\0def", len) == 0);
|
||||||
|
|
||||||
TEST(json_object_get_number(root_object, "positive one") == 1.0);
|
TEST(DBL_EQ(json_object_get_number(root_object, "positive one"), 1.0));
|
||||||
TEST(DBL_EQ(json_object_get_number(root_object, "negative one"), -1.0));
|
TEST(DBL_EQ(json_object_get_number(root_object, "negative one"), -1.0));
|
||||||
TEST(DBL_EQ(json_object_get_number(root_object, "hard to parse number"), -0.000314));
|
TEST(DBL_EQ(json_object_get_number(root_object, "hard to parse number"), -0.000314));
|
||||||
TEST(json_object_get_boolean(root_object, "boolean true") == 1);
|
TEST(json_object_get_boolean(root_object, "boolean true") == 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user