Skip to content

Commit 7a2cbc0

Browse files
committed
3rdparty (yyjson): upgrade to 0.11.1
1 parent f22d73d commit 7a2cbc0

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

src/3rdparty/yyjson/repo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"home": "https://github.com/ibireme/yyjson",
33
"license": "MIT ( embed in source )",
4-
"version": "0.11.0",
4+
"version": "0.11.1",
55
"author": "ibireme"
66
}

src/3rdparty/yyjson/yyjson.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,8 @@ typedef union v64_uni { v64 v; u64 u; } v64_uni;
566566
*============================================================================*/
567567

568568
#define byte_move_idx(x) ((char *)dst)[x] = ((const char *)src)[x];
569+
#define byte_move_src(x) ((char *)tmp)[x] = ((const char *)src)[x];
570+
#define byte_move_dst(x) ((char *)dst)[x] = ((const char *)tmp)[x];
569571

570572
static_inline void byte_copy_2(void *dst, const void *src) {
571573
#if !YYJSON_DISABLE_UNALIGNED_MEMORY_ACCESS
@@ -605,7 +607,9 @@ static_inline void byte_move_2(void *dst, const void *src) {
605607
memcpy(&tmp, src, 2);
606608
memcpy(dst, &tmp, 2);
607609
#else
608-
repeat2_incr(byte_move_idx)
610+
char tmp[2];
611+
repeat2_incr(byte_move_src)
612+
repeat2_incr(byte_move_dst)
609613
#endif
610614
}
611615

@@ -615,7 +619,9 @@ static_inline void byte_move_4(void *dst, const void *src) {
615619
memcpy(&tmp, src, 4);
616620
memcpy(dst, &tmp, 4);
617621
#else
618-
repeat4_incr(byte_move_idx)
622+
char tmp[4];
623+
repeat4_incr(byte_move_src)
624+
repeat4_incr(byte_move_dst)
619625
#endif
620626
}
621627

@@ -625,7 +631,9 @@ static_inline void byte_move_8(void *dst, const void *src) {
625631
memcpy(&tmp, src, 8);
626632
memcpy(dst, &tmp, 8);
627633
#else
628-
repeat8_incr(byte_move_idx)
634+
char tmp[8];
635+
repeat8_incr(byte_move_src)
636+
repeat8_incr(byte_move_dst)
629637
#endif
630638
}
631639

@@ -639,7 +647,9 @@ static_inline void byte_move_16(void *dst, const void *src) {
639647
memcpy(pdst, &tmp1, 8);
640648
memcpy(pdst + 8, &tmp2, 8);
641649
#else
642-
repeat16_incr(byte_move_idx)
650+
char tmp[16];
651+
repeat16_incr(byte_move_src)
652+
repeat16_incr(byte_move_dst)
643653
#endif
644654
}
645655

@@ -700,7 +710,6 @@ static_inline u32 byte_load_4(const void *src) {
700710
#if !YYJSON_DISABLE_UNALIGNED_MEMORY_ACCESS
701711
memcpy(&uni, src, 4);
702712
#else
703-
v32_uni uni;
704713
uni.v.c[0] = ((const char *)src)[0];
705714
uni.v.c[1] = ((const char *)src)[1];
706715
uni.v.c[2] = ((const char *)src)[2];

src/3rdparty/yyjson/yyjson.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -502,13 +502,13 @@ extern "C" {
502502
#define YYJSON_VERSION_MINOR 11
503503

504504
/** The patch version of yyjson. */
505-
#define YYJSON_VERSION_PATCH 0
505+
#define YYJSON_VERSION_PATCH 1
506506

507507
/** The version of yyjson in hex: `(major << 16) | (minor << 8) | (patch)`. */
508-
#define YYJSON_VERSION_HEX 0x000B00
508+
#define YYJSON_VERSION_HEX 0x000B01
509509

510510
/** The version string of yyjson. */
511-
#define YYJSON_VERSION_STRING "0.11.0"
511+
#define YYJSON_VERSION_STRING "0.11.1"
512512

513513
/** The version of yyjson in hex, same as `YYJSON_VERSION_HEX`. */
514514
yyjson_api uint32_t yyjson_version(void);

0 commit comments

Comments
 (0)