Skip to content

Commit c3fc708

Browse files
committed
Change set_int() parameter type from int to int64_t: #240
1 parent f0c9ff8 commit c3fc708

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ All notable changes to this project will be documented in this file.
66
## Unreleased
77
#### Added
88
- Add a set of `write_buf()` functions for writing JSON to a buffer without allocation.
9+
- Add optional compile-time JSON depth limit via `YYJSON_READER_DEPTH_LIMIT`.
10+
11+
#### Changed
12+
- Change `set_int()` parameter type from `int` to `int64_t`.
13+
14+
#### Fixed
15+
- Fix `tinycc` preprocessor error.
916

1017

1118
## 0.12.0 (2025-08-18)

doc/API.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ bool yyjson_set_null(yyjson_val *val);
885885
bool yyjson_set_bool(yyjson_val *val, bool num);
886886
bool yyjson_set_uint(yyjson_val *val, uint64_t num);
887887
bool yyjson_set_sint(yyjson_val *val, int64_t num);
888-
bool yyjson_set_int(yyjson_val *val, int num);
888+
bool yyjson_set_int(yyjson_val *val, int64_t num);
889889
bool yyjson_set_float(yyjson_val *val, float num);
890890
bool yyjson_set_double(yyjson_val *val, double num);
891891
bool yyjson_set_real(yyjson_val *val, double num);

src/yyjson.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1997,7 +1997,7 @@ yyjson_api_inline bool yyjson_set_sint(yyjson_val *val, int64_t num);
19971997
/** Set the value to int.
19981998
Returns false if input is NULL or `val` is object or array.
19991999
@warning This will modify the `immutable` value, use with caution. */
2000-
yyjson_api_inline bool yyjson_set_int(yyjson_val *val, int num);
2000+
yyjson_api_inline bool yyjson_set_int(yyjson_val *val, int64_t num);
20012001

20022002
/** Set the value to float.
20032003
Returns false if input is NULL or `val` is object or array.
@@ -2600,7 +2600,7 @@ yyjson_api_inline bool yyjson_mut_set_sint(yyjson_mut_val *val, int64_t num);
26002600
/** Set the value to int.
26012601
Returns false if input is NULL.
26022602
@warning This function should not be used on an existing object or array. */
2603-
yyjson_api_inline bool yyjson_mut_set_int(yyjson_mut_val *val, int num);
2603+
yyjson_api_inline bool yyjson_mut_set_int(yyjson_mut_val *val, int64_t num);
26042604

26052605
/** Set the value to float.
26062606
Returns false if input is NULL.
@@ -5426,9 +5426,9 @@ yyjson_api_inline bool yyjson_set_sint(yyjson_val *val, int64_t num) {
54265426
return true;
54275427
}
54285428

5429-
yyjson_api_inline bool yyjson_set_int(yyjson_val *val, int num) {
5429+
yyjson_api_inline bool yyjson_set_int(yyjson_val *val, int64_t num) {
54305430
if (yyjson_unlikely(!val || unsafe_yyjson_is_ctn(val))) return false;
5431-
unsafe_yyjson_set_sint(val, (int64_t)num);
5431+
unsafe_yyjson_set_sint(val, num);
54325432
return true;
54335433
}
54345434

@@ -5979,9 +5979,9 @@ yyjson_api_inline bool yyjson_mut_set_sint(yyjson_mut_val *val, int64_t num) {
59795979
return true;
59805980
}
59815981

5982-
yyjson_api_inline bool yyjson_mut_set_int(yyjson_mut_val *val, int num) {
5982+
yyjson_api_inline bool yyjson_mut_set_int(yyjson_mut_val *val, int64_t num) {
59835983
if (yyjson_unlikely(!val)) return false;
5984-
unsafe_yyjson_set_sint(val, (int64_t)num);
5984+
unsafe_yyjson_set_sint(val, num);
59855985
return true;
59865986
}
59875987

0 commit comments

Comments
 (0)