Skip to content

Commit

Permalink
merge JSON fixes from 1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
obiltschnig committed Sep 30, 2023
1 parent b9015c4 commit 8fe335a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion JSON/include/Poco/JSON/Array.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class JSON_API Array
/// Array::Ptr arr = result.extract<Array::Ptr>();
/// Object::Ptr object = arr->getObject(0); // object == {\"test\" : 0}
/// int i = object->getElement<int>("test"); // i == 0;
/// Object::Ptr subObject = *arr->getObject(1); // subObject == {\"test\" : 0}
/// Object::Ptr subObject = arr->getObject(1); // subObject == {\"test\" : 0}
/// Array subArr::Ptr = subObject->getArray("test1"); // subArr == [1, 2, 3]
/// i = result = subArr->get(0); // i == 1;
///
Expand Down
2 changes: 1 addition & 1 deletion JSON/include/Poco/JSON/Query.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class JSON_API Query
{
public:
Query(const Dynamic::Var& source);
/// Creates a Query/
/// Creates a Query.
///
/// Source must be JSON Object, Array, Object::Ptr,
/// Array::Ptr or empty Var. Any other type will trigger throwing of
Expand Down
2 changes: 1 addition & 1 deletion JSON/src/pdjson.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ read_number(json_stream *json, int c)
json_error(json, "unexpected byte '%c' in number", c);
return JSON_ERROR;
}
} else if (strchr("123456789", c) != NULL) {
} else if (c >= '1' && c <= '9') {
c = json->source.peek(&json->source);
if (is_digit(c)) {
if (read_digits(json) != 0)
Expand Down
18 changes: 9 additions & 9 deletions JSON/src/pdjson.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
extern "C" {
#else
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
#include <stdbool.h>
#else
#ifndef bool
#define bool int
#define true 1
#define false 0
#include <stdbool.h>
#else
#ifndef bool
#define bool int
#define true 1
#define false 0
#endif /* bool */
#endif /* __STDC_VERSION__ */
#endif /* __cplusplus */
Expand All @@ -33,7 +33,7 @@ struct json_allocator {
void (*free)(void *);
};

typedef int (*json_user_io) (void *user);
typedef int (*json_user_io)(void *user);

typedef struct json_stream json_stream;
typedef struct json_allocator json_allocator;
Expand Down Expand Up @@ -69,8 +69,8 @@ PDJSON_SYMEXPORT bool json_isspace(int c);
/* internal */

struct json_source {
int (*get) (struct json_source *);
int (*peek) (struct json_source *);
int (*get)(struct json_source *);
int (*peek)(struct json_source *);
size_t position;
union {
struct {
Expand Down

0 comments on commit 8fe335a

Please sign in to comment.