Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer
Submodule .devcontainer updated 83 files
+1 −0 .gitattributes
+65 −0 .github/actions/build-image-context-tag/action.yml
+74 −29 .github/actions/cmake-build/action.yml
+32 −0 .github/actions/compare-cmake-presets/action.yml
+201 −0 .github/actions/compare-cmake-presets/compare.py
+51 −0 .github/actions/docker-push-with-retry/action.yml
+358 −0 .github/actions/externpro-deps-configure/action.yml
+48 −0 .github/actions/externpro-validate/action.yml
+29 −0 .github/actions/gh-retry/gh-retry.sh
+79 −0 .github/actions/ghcr-access/action.yml
+44 −0 .github/actions/git-am-patches/action.yml
+19 −0 .github/actions/git-configure-bot/action.yml
+42 −0 .github/actions/labels-mgmt/action.yml
+91 −0 .github/actions/pr-close-superseded/action.yml
+116 −0 .github/actions/release-tag-intent/action.yml
+0 −8 .github/actions/sync-caller-workflows/action.yml
+241 −508 .github/actions/sync-caller-workflows/sync.sh
+19 −0 .github/aw/actions-lock.json
+60 −0 .github/docs/README.md
+34 −0 .github/docs/architecture-overview.md
+ .github/docs/assets/org_01_actions-secrets.png
+ .github/docs/assets/org_02_new-secret.png
+ .github/docs/assets/org_03_secrets-populated.png
+ .github/docs/assets/pat_01_new.png
+ .github/docs/assets/pat_02_permissions.png
+ .github/docs/assets/pat_03_generate-token.png
+ .github/docs/assets/pat_04_copy-token.png
+ .github/docs/assets/repo_01_actions-secrets.png
+ .github/docs/assets/repo_02_new-secret.png
+ .github/docs/assets/repo_03_secrets-populated.png
+91 −0 .github/docs/build-customizations.md
+117 −0 .github/docs/caller-workflows.md
+50 −0 .github/docs/release-flow.md
+99 −0 .github/docs/reusable-workflows.md
+113 −0 .github/docs/secrets-and-tokens.md
+42 −0 .github/docs/supply-chain.md
+0 −2 .github/release-tag.yml.example
+8 −4 .github/wf-templates/xpbuild.yml
+12 −0 .github/wf-templates/xpinit.yml
+1 −1 .github/wf-templates/xprelease.yml
+2 −2 .github/wf-templates/xptag.yml
+3 −2 .github/wf-templates/xpupdate.yml
+7 −288 .github/workflows/README.md
+146 −39 .github/workflows/build-linux.yml
+8 −9 .github/workflows/build-macos.yml
+24 −10 .github/workflows/build-windows.yml
+1,203 −0 .github/workflows/create-draft-release-on-tag.lock.yml
+281 −0 .github/workflows/create-draft-release-on-tag.md
+353 −0 .github/workflows/init-externpro.yml
+105 −28 .github/workflows/release-from-build.yml
+15 −25 .github/workflows/tag-release.yml
+151 −429 .github/workflows/update-externpro.yml
+0 −288 .windsurf/workflows/manifestUpdate.md
+148 −46 README.md
+30 −32 cmake/README.md
+333 −279 cmake/deps.svg
+32 −0 cmake/docs/README.md
+70 −0 cmake/docs/classified-sources.md
+27 −0 cmake/docs/cmakeup.md
+54 −0 cmake/docs/dependency-provider.md
+40 −0 cmake/docs/diff-types.md
+115 −0 cmake/docs/download-and-extract.md
+127 −0 cmake/docs/extern-package.md
+85 −0 cmake/docs/how-to-adopt-externpro.md
+64 −0 cmake/docs/packaging.md
+2 −1 cmake/presets/CMakePresets.json
+4 −1 cmake/presets/xpDarwinNinja.json
+4 −1 cmake/presets/xpLinuxNinja.json
+4 −1 cmake/presets/xpLinuxNinjaTargets.json
+183 −0 cmake/presets/xpMswVs2022.json
+184 −0 cmake/presets/xpMswVs2026.json
+0 −157 cmake/presets/xpWindowsVs2019.json
+0 −180 cmake/presets/xpWindowsVs2022.json
+64 −42 cmake/pros.cmake
+0 −106 cmake/pros.md
+761 −109 cmake/xpfunmac.cmake
+2 −4 cmake/xpuse.cmake.in
+1 −0 cmake/xpusext.cmake.in
+1 −1 funcs.sh
+0 −0 scripts/enable-systemctl.sh
+0 −0 scripts/git-lfs-check.sh
+0 −0 scripts/wslresolv.sh
+11 −0 xpro-dev.code-workspace
4 changes: 4 additions & 0 deletions .github/release-tag.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"message": "xpro version 1.1.0-763.4 tag",
"tag": "xpv1.1.0-763.4"
}
2 changes: 0 additions & 2 deletions .github/release-tag.yml

This file was deleted.

19 changes: 10 additions & 9 deletions .github/workflows/xpbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@ jobs:
contents: read
pull-requests: write
packages: write
uses: externpro/externpro/.github/workflows/build-linux.yml@25.07.6
uses: externpro/externpro/.github/workflows/build-linux.yml@26.01.1
secrets:
automation_token: ${{ secrets.GHCR_TOKEN }}
with:
cmake-workflow-preset: LinuxRelease
secrets: inherit
cmake_workflow_preset_suffix: Release
macos:
uses: externpro/externpro/.github/workflows/build-macos.yml@25.07.6
with:
cmake-workflow-preset: DarwinRelease
uses: externpro/externpro/.github/workflows/build-macos.yml@26.01.1
secrets: inherit
windows:
uses: externpro/externpro/.github/workflows/build-windows.yml@25.07.6
with:
cmake-workflow-preset: WindowsRelease
cmake_workflow_preset_suffix: Release
windows:
uses: externpro/externpro/.github/workflows/build-windows.yml@26.01.1
secrets: inherit
with:
cmake_workflow_preset_suffix: Release
12 changes: 12 additions & 0 deletions .github/workflows/xpinit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: xpInit externpro
permissions:
contents: write
pull-requests: write
packages: write
on:
workflow_dispatch:
jobs:
init:
uses: externpro/externpro/.github/workflows/init-externpro.yml@main
secrets:
automation_token: ${{ secrets.XPRO_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/xprelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
# Upload build artifacts as release assets
release-from-build:
if: github.event_name == 'workflow_dispatch'
uses: externpro/externpro/.github/workflows/release-from-build.yml@25.07.6
uses: externpro/externpro/.github/workflows/release-from-build.yml@26.01.1
with:
workflow_run_url: ${{ github.event.inputs.workflow_run_url }}
permissions:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/xptag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ on:
jobs:
tag:
if: ${{ github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'xpro' && contains(github.event.pull_request.labels.*.name, 'release:tag') }}
uses: externpro/externpro/.github/workflows/tag-release.yml@25.07.6
uses: externpro/externpro/.github/workflows/tag-release.yml@26.01.1
with:
merge_sha: ${{ github.event.pull_request.merge_commit_sha }}
pr_number: ${{ github.event.pull_request.number }}
secrets:
workflow_write_token: ${{ secrets.XPUPDATE_TOKEN }}
automation_token: ${{ secrets.XPRO_TOKEN }}
13 changes: 6 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.5...3.31)
CMAKE_MINIMUM_REQUIRED(VERSION 3.5...4.3)

SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules)

Expand All @@ -7,7 +7,6 @@ set(LIB_MINOR_VERSION "1")
set(LIB_PATCH_VERSION "0")
set(LIB_VERSION_STRING "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}.${LIB_PATCH_VERSION}")

set(CMAKE_PROJECT_TOP_LEVEL_INCLUDES .devcontainer/cmake/xproinc.cmake)
PROJECT(RapidJSON VERSION "${LIB_VERSION_STRING}" LANGUAGES CXX)

# compile in release with debug info mode by default
Expand Down Expand Up @@ -149,7 +148,7 @@ SET(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}" CACHE PATH "The directory
SET(LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}" CACHE STRING "Directory where lib will install")
SET(DOC_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/doc/${PROJECT_NAME}" CACHE PATH "Path to the documentation")

IF(NOT DEFINED XP_NAMESPACE)
IF(NOT COMMAND xpExternPackage)
SET(_CMAKE_INSTALL_DIR "${LIB_INSTALL_DIR}/cmake/${PROJECT_NAME}")
ELSE()
SET(_CMAKE_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/cmake")
Expand All @@ -160,16 +159,16 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)

set(lib_name ${PROJECT_NAME})
set(targetsFile ${PROJECT_NAME}-targets)
if(DEFINED XP_NAMESPACE)
if(COMMAND xpExternPackage)
set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_DIR}")
xpExternPackage(REPO_NAME rapidjson NAMESPACE ${XP_NAMESPACE}
TARGETS_FILE ${targetsFile} LIBRARIES ${lib_name}
xpExternPackage(REPO_NAME rapidjson TARGETS_FILE ${targetsFile}
LIBRARIES ${lib_name} DEFAULT_TARGETS ${lib_name}
BASE v${CMAKE_PROJECT_VERSION}-763 XPDIFF "patch"
WEB "http://Tencent.github.io/rapidjson/" UPSTREAM "github.com/Tencent/rapidjson"
DESC "A fast JSON parser/generator for C++ with both SAX/DOM style API"
LICENSE "[MIT](https://raw.githubusercontent.com/Tencent/rapidjson/master/license.txt 'MIT License')"
)
set(nameSpace NAMESPACE ${XP_NAMESPACE}::)
set(nameSpace NAMESPACE rapidjson::)
set(OPT_INSTALL EXCLUDE_FROM_ALL)
endif()

Expand Down
3 changes: 2 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"include": [
".devcontainer/cmake/presets/xpLinuxNinja.json",
".devcontainer/cmake/presets/xpDarwinNinja.json",
".devcontainer/cmake/presets/xpWindowsVs2022.json"
".devcontainer/cmake/presets/xpMswVs2022.json",
".devcontainer/cmake/presets/xpMswVs2026.json"
]
}
2 changes: 1 addition & 1 deletion CMakePresetsBase.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"hidden": true,
"binaryDir": "${sourceDir}/_bld-${presetName}",
"cacheVariables": {
"XP_NAMESPACE": "xpro"
"CMAKE_EXPERIMENTAL_GENERATE_SBOM": "ca494ed3-b261-4205-a01f-603c95e4cae0"
}
}
],
Expand Down
2 changes: 1 addition & 1 deletion example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5...3.31)
cmake_minimum_required(VERSION 3.5...4.3)

if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
Expand Down
14 changes: 12 additions & 2 deletions include/rapidjson/document.h
Original file line number Diff line number Diff line change
Expand Up @@ -2445,13 +2445,23 @@ class GenericValue {
data_.f.flags = kShortStringFlag;
data_.ss.SetLength(s.length);
str = data_.ss.str;
std::memmove(str, s, s.length * sizeof(Ch));
for (SizeType i = 0; i < s.length; i++) {
if (i == 0 || s.s != 0) // Ensure source is valid
str[i] = s.s[i];
else
str[i] = '\0';
}
} else {
data_.f.flags = kCopyStringFlag;
data_.s.length = s.length;
str = static_cast<Ch *>(allocator.Malloc((s.length + 1) * sizeof(Ch)));
SetStringPointer(str);
std::memcpy(str, s, s.length * sizeof(Ch));
for (SizeType i = 0; i < s.length; i++) {
if (i == 0 || s.s != 0) // Ensure source is valid
str[i] = s.s[i];
else
str[i] = '\0';
}
}
str[s.length] = '\0';
}
Expand Down
5 changes: 3 additions & 2 deletions include/rapidjson/pointer.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ class GenericPointer {
GenericPointer r;
r.allocator_ = allocator;
Ch *p = r.CopyFromRaw(*this, 1, token.length + 1);
std::memcpy(p, token.name, (token.length + 1) * sizeof(Ch));
if (p != 0 && token.name != 0) // Ensure both pointers are valid
std::memcpy(p, token.name, (token.length + 1) * sizeof(Ch));
r.tokens_[tokenCount_].name = p;
r.tokens_[tokenCount_].length = token.length;
r.tokens_[tokenCount_].index = token.index;
Expand Down Expand Up @@ -892,7 +893,7 @@ class GenericPointer {
if (rhs.tokenCount_ > 0) {
std::memcpy(tokens_, rhs.tokens_, rhs.tokenCount_ * sizeof(Token));
}
if (nameBufferSize > 0) {
if (nameBufferSize > 0 && rhs.nameBuffer_ != 0) {
std::memcpy(nameBuffer_, rhs.nameBuffer_, nameBufferSize * sizeof(Ch));
}

Expand Down
19 changes: 11 additions & 8 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
if(COMMAND xpFindPkg)
xpFindPkg(PKGS googletest)
xpFindPkg(PKGS Threads GTest)
enable_testing()
get_target_property(GTEST_INCLUDE_DIR xpro::gtest INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(GTEST_INCLUDE_DIR GTest::gtest INTERFACE_INCLUDE_DIRECTORIES)
include_directories(SYSTEM ${GTEST_INCLUDE_DIR})
set(TEST_LIBRARIES xpro::gtest xpro::gtest_main)
if(FALSE) # doesn't build with googletest-v1.16.0.1
add_custom_target(tests ALL)
add_subdirectory(perftest)
add_subdirectory(unittest)
endif()
set(TEST_LIBRARIES GTest::gtest GTest::gtest_main)

# Override C++ standard to C++14 for test targets only
# (Google Test v1.16.0+ requires C++14)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
add_custom_target(tests ALL)
add_subdirectory(perftest)
add_subdirectory(unittest)
else()
find_package(GTestSrc)
endif()
Expand Down
8 changes: 4 additions & 4 deletions test/perftest/misctest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ void itoa_Writer_StringBufferVerify() {
Writer writer(sb);
for (size_t j = 0; j < randvalCount; j++) {
char buffer[32];
sprintf(buffer, "%d", randval[j]);
snprintf(buffer, sizeof(buffer), "%d", randval[j]);
writer.WriteInt(randval[j]);
ASSERT_STREQ(buffer, sb.GetString());
sb.Clear();
Expand All @@ -776,7 +776,7 @@ void itoa_Writer_InsituStringStreamVerify() {
Writer writer;
for (size_t j = 0; j < randvalCount; j++) {
char buffer[32];
sprintf(buffer, "%d", randval[j]);
snprintf(buffer, sizeof(buffer), "%d", randval[j]);
char buffer2[32];
rapidjson::InsituStringStream ss(buffer2);
writer.Reset(ss);
Expand Down Expand Up @@ -830,7 +830,7 @@ void itoa64_Writer_StringBufferVerify() {
for (size_t j = 0; j < randvalCount; j++) {
char buffer[32];
int64_t x = randval[j] * randval[j];
sprintf(buffer, "%" PRIi64, x);
snprintf(buffer, sizeof(buffer), "%" PRIi64, x);
writer.WriteInt64(x);
ASSERT_STREQ(buffer, sb.GetString());
sb.Clear();
Expand All @@ -843,7 +843,7 @@ void itoa64_Writer_InsituStringStreamVerify() {
for (size_t j = 0; j < randvalCount; j++) {
char buffer[32];
int64_t x = randval[j] * randval[j];
sprintf(buffer, "%" PRIi64, x);
snprintf(buffer, sizeof(buffer), "%" PRIi64, x);
char buffer2[32];
rapidjson::InsituStringStream ss(buffer2);
writer.Reset(ss);
Expand Down
2 changes: 1 addition & 1 deletion test/perftest/perftest.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class PerfTest : public ::testing::Test {
types_[j] = 0;
for (size_t i = 0; i < sizeof(typespaths) / sizeof(typespaths[0]); i++) {
char filename[256];
sprintf(filename, "%s/%s", typespaths[i], typesfilenames[j]);
snprintf(filename, sizeof(filename), "%s/%s", typespaths[i], typesfilenames[j]);
if (FILE* fp = fopen(filename, "rb")) {
fseek(fp, 0, SEEK_END);
typesLength_[j] = (size_t)ftell(fp);
Expand Down
6 changes: 3 additions & 3 deletions test/perftest/schematest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ static char* ReadFile(const char* filename, Allocator& allocator) {
"../../bin/",
"../../../bin/"
};
char buffer[1024];
char buffer[4096];
FILE *fp = 0;
for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
sprintf(buffer, "%s%s", paths[i], filename);
snprintf(buffer, sizeof(buffer), "%s%s", paths[i], filename);
fp = fopen(buffer, "rb");
if (fp)
break;
Expand Down Expand Up @@ -92,7 +92,7 @@ class Schema : public PerfTest {

for (size_t i = 0; i < ARRAY_SIZE(filenames); i++) {
char filename[FILENAME_MAX];
sprintf(filename, "jsonschema/tests/draft4/%s", filenames[i]);
snprintf(filename, sizeof(filename), "jsonschema/tests/draft4/%s", filenames[i]);
char* json = ReadFile(filename, jsonAllocator);
if (!json) {
printf("json test suite file %s not found", filename);
Expand Down
11 changes: 7 additions & 4 deletions test/unittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,13 @@ add_test(NAME unittest
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)

if(NOT MSVC AND VALGRIND_FOUND)
# Not running SIMD.* unit test cases for Valgrind
add_test(NAME valgrind_unittest
COMMAND valgrind --suppressions=${CMAKE_SOURCE_DIR}/test/valgrind.supp --leak-check=full --error-exitcode=1 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest --gtest_filter=-SIMD.*
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
# Only run valgrind test if unittest is available (Debug or Release build types)
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "Release")
# Not running SIMD.* unit test cases for Valgrind
add_test(NAME valgrind_unittest
COMMAND valgrind --suppressions=${CMAKE_SOURCE_DIR}/test/valgrind.supp --leak-check=full --error-exitcode=1 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest --gtest_filter=-SIMD.*
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
endif()

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_test(NAME symbol_check
Expand Down
6 changes: 3 additions & 3 deletions test/unittest/documenttest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ static FILE* OpenEncodedFile(const char* filename) {
"../../bin/encodings",
"../../../bin/encodings"
};
char buffer[1024];
char buffer[4096];
for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
sprintf(buffer, "%s/%s", paths[i], filename);
snprintf(buffer, sizeof(buffer), "%s/%s", paths[i], filename);
FILE *fp = fopen(buffer, "rb");
if (fp)
return fp;
Expand Down Expand Up @@ -461,7 +461,7 @@ struct DocumentMove: public ::testing::Test {
};

typedef ::testing::Types< CrtAllocator, MemoryPoolAllocator<> > MoveAllocatorTypes;
TYPED_TEST_CASE(DocumentMove, MoveAllocatorTypes);
TYPED_TEST_SUITE(DocumentMove, MoveAllocatorTypes);

TYPED_TEST(DocumentMove, MoveConstructor) {
typedef TypeParam Allocator;
Expand Down
4 changes: 2 additions & 2 deletions test/unittest/encodedstreamtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ class EncodedStreamTest : public ::testing::Test {
"../../bin/encodings",
"../../../bin/encodings"
};
char buffer[1024];
char buffer[4096];
for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
sprintf(buffer, "%s/%s", paths[i], filename);
snprintf(buffer, sizeof(buffer), "%s/%s", paths[i], filename);
FILE *fp = fopen(buffer, "rb");
if (fp)
return fp;
Expand Down
4 changes: 2 additions & 2 deletions test/unittest/istreamwrappertest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ static bool Open(FileStreamType& fs, const char* filename) {
"../../bin/encodings",
"../../../bin/encodings"
};
char buffer[1024];
char buffer[4096];
for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
sprintf(buffer, "%s/%s", paths[i], filename);
snprintf(buffer, sizeof(buffer), "%s/%s", paths[i], filename);
fs.open(buffer, ios_base::in | ios_base::binary);
if (fs.is_open())
return true;
Expand Down
12 changes: 6 additions & 6 deletions test/unittest/itoatest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,28 @@ struct Traits {

template <>
struct Traits<uint32_t> {
enum { kBufferSize = 11 };
enum { kBufferSize = 16 };
enum { kMaxDigit = 10 };
static uint32_t Negate(uint32_t x) { return x; }
};

template <>
struct Traits<int32_t> {
enum { kBufferSize = 12 };
enum { kBufferSize = 16 };
enum { kMaxDigit = 10 };
static int32_t Negate(int32_t x) { return -x; }
};

template <>
struct Traits<uint64_t> {
enum { kBufferSize = 21 };
enum { kBufferSize = 24 };
enum { kMaxDigit = 20 };
static uint64_t Negate(uint64_t x) { return x; }
};

template <>
struct Traits<int64_t> {
enum { kBufferSize = 22 };
enum { kBufferSize = 24 };
enum { kMaxDigit = 20 };
static int64_t Negate(int64_t x) { return -x; }
};
Expand Down Expand Up @@ -92,7 +92,7 @@ static void Verify(void(*f)(T, char*), char* (*g)(T, char*)) {
}

static void u32toa_naive(uint32_t value, char* buffer) {
char temp[10];
char temp[16];
char *p = temp;
do {
*p++ = static_cast<char>(char(value % 10) + '0');
Expand All @@ -116,7 +116,7 @@ static void i32toa_naive(int32_t value, char* buffer) {
}

static void u64toa_naive(uint64_t value, char* buffer) {
char temp[20];
char temp[24];
char *p = temp;
do {
*p++ = static_cast<char>(char(value % 10) + '0');
Expand Down
Loading