From da165819db2898172b05228028786a0d427f19aa Mon Sep 17 00:00:00 2001 From: Jim-Wang Date: Wed, 20 Dec 2023 08:48:22 +0000 Subject: [PATCH 01/10] Fix array length issue --- ports/portable-snippets/CMakeLists.txt | 1 + ports/portable-snippets/fix_array.patch | 98 +++++++++++++++++++++++++ ports/portable-snippets/portfile.cmake | 2 + ports/portable-snippets/vcpkg.json | 2 +- 4 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 ports/portable-snippets/fix_array.patch diff --git a/ports/portable-snippets/CMakeLists.txt b/ports/portable-snippets/CMakeLists.txt index 5f511265ad05bf..fb882c99c84b6e 100644 --- a/ports/portable-snippets/CMakeLists.txt +++ b/ports/portable-snippets/CMakeLists.txt @@ -5,6 +5,7 @@ project(portable-snippets LANGUAGES C) include(GNUInstallDirs) option(PSNIP_INSTALL_HEADERS "Install header files" ON) +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std:c11" ) # https://stackoverflow.com/questions/7787823/cmake-how-to-get-the-name-of-all-subdirectories-of-a-directory function (list_subdir output_variable path) diff --git a/ports/portable-snippets/fix_array.patch b/ports/portable-snippets/fix_array.patch new file mode 100644 index 00000000000000..04c6e1be4b3b68 --- /dev/null +++ b/ports/portable-snippets/fix_array.patch @@ -0,0 +1,98 @@ +diff --git a/random/random.c b/random/random.c +index 0a83d00..1b5f3f5 100644 +--- a/random/random.c ++++ b/random/random.c +@@ -31,7 +31,7 @@ + # endif + #endif + +-static int (* psnip_random_secure_generate)(size_t length, psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) = NULL; ++static int (* psnip_random_secure_generate)(size_t length, psnip_uint8_t data[ARRAY_LEN]) = NULL; + static psnip_once psnip_random_secure_once = PSNIP_ONCE_INIT; + + #if defined(__linux) +@@ -66,7 +66,7 @@ psnip_random__getrandom(void* buf, size_t buflen, unsigned int flags) { + # endif + + static int +-psnip_random_secure_generate_getrandom(size_t length, psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) { ++psnip_random_secure_generate_getrandom(size_t length, psnip_uint8_t data[ARRAY_LEN) { + size_t bytes_read = 0; + int r; + +@@ -93,7 +93,7 @@ psnip_random_secure_generate_getrandom(size_t length, psnip_uint8_t data[PSNIP_R + __attribute__((__target__("rdrnd"))) + #endif + static int +-psnip_random__rdrand (size_t length, psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) { ++psnip_random__rdrand (size_t length, psnip_uint8_t data[ARRAY_LEN]) { + size_t remaining = length; + unsigned int r; + #if defined(PSNIP_CPU_ARCH_X86_64) +@@ -136,7 +136,7 @@ psnip_random__rdrand (size_t length, psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM + static HMODULE psnip_rand_secure__advapi32_dll = NULL; + static BOOLEAN (APIENTRY *psnip_rand_secure__RtlGenRandom)(void*, ULONG); + +-static int psnip_random_secure_generate_RtlGenRandom(size_t length, psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) { ++static int psnip_random_secure_generate_RtlGenRandom(size_t length, psnip_uint8_t data[ARRAY_LEN]) { + assert(psnip_rand_secure__RtlGenRandom != NULL); + + return psnip_rand_secure__RtlGenRandom(data, (ULONG) length) ? 0 : -3; +@@ -162,7 +162,7 @@ psnip_random_secure_init(void) { + + #if !defined(PSNIP_RANDOM_SECURE_FOUND) + static int +-psnip_random_secure_generate_dev_random(size_t length, psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) { ++psnip_random_secure_generate_dev_random(size_t length, psnip_uint8_t data[ARRAY_LEN]) { + static FILE* dev_random = NULL; + size_t bytes_read = 0; + +@@ -182,7 +182,7 @@ psnip_random_secure_generate_dev_random(size_t length, psnip_uint8_t data[PSNIP_ + } + + static int +-psnip_random_secure_generate_dev_urandom(size_t length, psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) { ++psnip_random_secure_generate_dev_urandom(size_t length, psnip_uint8_t data[ARRAY_LEN]) { + static FILE* dev_urandom = NULL; + size_t bytes_read = 0; + +@@ -297,7 +297,7 @@ psnip_random__pcg_from_state(psnip_uint32_t state) { + } + + static int +-psnip_random__pgc_generate(psnip_atomic_int32* state, size_t length, psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) { ++psnip_random__pgc_generate(psnip_atomic_int32* state, size_t length, psnip_uint8_t data[ARRAY_LEN]) { + psnip_int32_t old_state; + psnip_uint32_t new_state, v; + size_t remaining; +@@ -369,7 +369,7 @@ psnip_random_fast_init(void) { + int + psnip_random_bytes(enum PSnipRandomSource source, + size_t length, +- psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) { ++ psnip_uint8_t data[ARRAY_LEN]) { + switch (source) { + case PSNIP_RANDOM_SOURCE_SECURE: + #if !defined(PSNIP_RANDOM_SECURE_NO_INIT) +diff --git a/random/random.h b/random/random.h +index 4d654cc..bcde053 100644 +--- a/random/random.h ++++ b/random/random.h +@@ -15,6 +15,8 @@ + # define PSNIP_RANDOM_ARRAY_PARAM(expr) + #endif + ++#define ARRAY_LEN 4096 ++ + #if defined(__cplusplus) + extern "C" { + #endif +@@ -27,7 +29,7 @@ enum PSnipRandomSource { + + int psnip_random_bytes (enum PSnipRandomSource source, + size_t length, +- psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]); ++ psnip_uint8_t data[ARRAY_LEN]); + psnip_uint32_t psnip_random_get_seed (void); + void psnip_random_set_seed (psnip_uint32_t seed); + diff --git a/ports/portable-snippets/portfile.cmake b/ports/portable-snippets/portfile.cmake index 6ad89c381d2aec..e3006d0953a2ba 100644 --- a/ports/portable-snippets/portfile.cmake +++ b/ports/portable-snippets/portfile.cmake @@ -6,6 +6,8 @@ vcpkg_from_github( REF 26496acb37ab46ee249ea19d45381da6955d89c4 SHA512 6213b22e4358b06f92396731d94fd27d4cf3568a47c56c057174c1839929c6a569ad5b1e1302fe0d092c4f393c570607b96e9e977223f86a9e3c2862010f3af0 HEAD_REF master + PATCHES + fix_array.patch ) file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") diff --git a/ports/portable-snippets/vcpkg.json b/ports/portable-snippets/vcpkg.json index b1f66080fdf9c8..efcb6e53382290 100644 --- a/ports/portable-snippets/vcpkg.json +++ b/ports/portable-snippets/vcpkg.json @@ -1,7 +1,7 @@ { "name": "portable-snippets", "version-date": "2019-09-20", - "port-version": 3, + "port-version": 4, "description": "Collection of miscellaneous portable C snippets", "homepage": "https://github.com/nemequ/portable-snippets", "license": null, From ab06c54b6bec778eca60205eb4e474fb644e39a4 Mon Sep 17 00:00:00 2001 From: Jim-Wang Date: Wed, 20 Dec 2023 08:49:32 +0000 Subject: [PATCH 02/10] update version --- versions/baseline.json | 2 +- versions/p-/portable-snippets.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/versions/baseline.json b/versions/baseline.json index 83b8f2608563f2..4db27d719fde09 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6730,7 +6730,7 @@ }, "portable-snippets": { "baseline": "2019-09-20", - "port-version": 3 + "port-version": 4 }, "portaudio": { "baseline": "19.7", diff --git a/versions/p-/portable-snippets.json b/versions/p-/portable-snippets.json index 7235f311e03599..92912ee644b374 100644 --- a/versions/p-/portable-snippets.json +++ b/versions/p-/portable-snippets.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "e322033f8a1bf39b0c2fcab904295595755cebcd", + "version-date": "2019-09-20", + "port-version": 4 + }, { "git-tree": "cb5584d76235e5a975e7c201d244c385cfd1dae7", "version-date": "2019-09-20", From 7a2600a220ea2edc0bfba5a9a6004fdc4062a8d3 Mon Sep 17 00:00:00 2001 From: Jim-Wang Date: Wed, 20 Dec 2023 09:05:43 +0000 Subject: [PATCH 03/10] fix cmake --- ports/portable-snippets/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/portable-snippets/CMakeLists.txt b/ports/portable-snippets/CMakeLists.txt index fb882c99c84b6e..d18acf23efbedd 100644 --- a/ports/portable-snippets/CMakeLists.txt +++ b/ports/portable-snippets/CMakeLists.txt @@ -5,7 +5,7 @@ project(portable-snippets LANGUAGES C) include(GNUInstallDirs) option(PSNIP_INSTALL_HEADERS "Install header files" ON) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std:c11" ) +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11" ) # https://stackoverflow.com/questions/7787823/cmake-how-to-get-the-name-of-all-subdirectories-of-a-directory function (list_subdir output_variable path) From 161c608bab092409bfc3bf0e54360f8416ee0d9b Mon Sep 17 00:00:00 2001 From: Jim-Wang Date: Wed, 20 Dec 2023 09:06:07 +0000 Subject: [PATCH 04/10] update version --- versions/p-/portable-snippets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/p-/portable-snippets.json b/versions/p-/portable-snippets.json index 92912ee644b374..a3c76b400cfe7b 100644 --- a/versions/p-/portable-snippets.json +++ b/versions/p-/portable-snippets.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "e322033f8a1bf39b0c2fcab904295595755cebcd", + "git-tree": "cf16987ed03b0a28f7fa0eb44e625a310b3e175c", "version-date": "2019-09-20", "port-version": 4 }, From 44154f959983dfe0bcc36163b54d1b0ac100804c Mon Sep 17 00:00:00 2001 From: Jim-Wang Date: Wed, 20 Dec 2023 09:14:25 +0000 Subject: [PATCH 05/10] fix cmake --- ports/portable-snippets/fix_array.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/portable-snippets/fix_array.patch b/ports/portable-snippets/fix_array.patch index 04c6e1be4b3b68..128071f69605fe 100644 --- a/ports/portable-snippets/fix_array.patch +++ b/ports/portable-snippets/fix_array.patch @@ -16,7 +16,7 @@ index 0a83d00..1b5f3f5 100644 static int -psnip_random_secure_generate_getrandom(size_t length, psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) { -+psnip_random_secure_generate_getrandom(size_t length, psnip_uint8_t data[ARRAY_LEN) { ++psnip_random_secure_generate_getrandom(size_t length, psnip_uint8_t data[ARRAY_LEN]) { size_t bytes_read = 0; int r; From e7e848413c8ba126b6c991545a63b613bef2ed57 Mon Sep 17 00:00:00 2001 From: Jim-Wang Date: Wed, 20 Dec 2023 09:14:41 +0000 Subject: [PATCH 06/10] update version --- versions/p-/portable-snippets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/p-/portable-snippets.json b/versions/p-/portable-snippets.json index a3c76b400cfe7b..04d6458a59a311 100644 --- a/versions/p-/portable-snippets.json +++ b/versions/p-/portable-snippets.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "cf16987ed03b0a28f7fa0eb44e625a310b3e175c", + "git-tree": "507a1e5bc665140eff4db32e37db140856adaeb0", "version-date": "2019-09-20", "port-version": 4 }, From 07525d88df3828a11c8c87325b569784cf9cab0c Mon Sep 17 00:00:00 2001 From: Jim-Wang Date: Wed, 20 Dec 2023 10:53:22 +0000 Subject: [PATCH 07/10] fix cmake --- ports/portable-snippets/fix_array.patch | 33 +++++++++---------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/ports/portable-snippets/fix_array.patch b/ports/portable-snippets/fix_array.patch index 128071f69605fe..dd18bb89b0f134 100644 --- a/ports/portable-snippets/fix_array.patch +++ b/ports/portable-snippets/fix_array.patch @@ -1,5 +1,5 @@ diff --git a/random/random.c b/random/random.c -index 0a83d00..1b5f3f5 100644 +index 0a83d00..a0d628c 100644 --- a/random/random.c +++ b/random/random.c @@ -31,7 +31,7 @@ @@ -7,7 +7,7 @@ index 0a83d00..1b5f3f5 100644 #endif -static int (* psnip_random_secure_generate)(size_t length, psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) = NULL; -+static int (* psnip_random_secure_generate)(size_t length, psnip_uint8_t data[ARRAY_LEN]) = NULL; ++static int (* psnip_random_secure_generate)(size_t length, psnip_uint8_t *data) = NULL; static psnip_once psnip_random_secure_once = PSNIP_ONCE_INIT; #if defined(__linux) @@ -16,7 +16,7 @@ index 0a83d00..1b5f3f5 100644 static int -psnip_random_secure_generate_getrandom(size_t length, psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) { -+psnip_random_secure_generate_getrandom(size_t length, psnip_uint8_t data[ARRAY_LEN]) { ++psnip_random_secure_generate_getrandom(size_t length, psnip_uint8_t *data) { size_t bytes_read = 0; int r; @@ -25,7 +25,7 @@ index 0a83d00..1b5f3f5 100644 #endif static int -psnip_random__rdrand (size_t length, psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) { -+psnip_random__rdrand (size_t length, psnip_uint8_t data[ARRAY_LEN]) { ++psnip_random__rdrand (size_t length, psnip_uint8_t *data) { size_t remaining = length; unsigned int r; #if defined(PSNIP_CPU_ARCH_X86_64) @@ -34,7 +34,7 @@ index 0a83d00..1b5f3f5 100644 static BOOLEAN (APIENTRY *psnip_rand_secure__RtlGenRandom)(void*, ULONG); -static int psnip_random_secure_generate_RtlGenRandom(size_t length, psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) { -+static int psnip_random_secure_generate_RtlGenRandom(size_t length, psnip_uint8_t data[ARRAY_LEN]) { ++static int psnip_random_secure_generate_RtlGenRandom(size_t length, psnip_uint8_t *data) { assert(psnip_rand_secure__RtlGenRandom != NULL); return psnip_rand_secure__RtlGenRandom(data, (ULONG) length) ? 0 : -3; @@ -43,7 +43,7 @@ index 0a83d00..1b5f3f5 100644 #if !defined(PSNIP_RANDOM_SECURE_FOUND) static int -psnip_random_secure_generate_dev_random(size_t length, psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) { -+psnip_random_secure_generate_dev_random(size_t length, psnip_uint8_t data[ARRAY_LEN]) { ++psnip_random_secure_generate_dev_random(size_t length, psnip_uint8_t *data) { static FILE* dev_random = NULL; size_t bytes_read = 0; @@ -52,7 +52,7 @@ index 0a83d00..1b5f3f5 100644 static int -psnip_random_secure_generate_dev_urandom(size_t length, psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) { -+psnip_random_secure_generate_dev_urandom(size_t length, psnip_uint8_t data[ARRAY_LEN]) { ++psnip_random_secure_generate_dev_urandom(size_t length, psnip_uint8_t *data) { static FILE* dev_urandom = NULL; size_t bytes_read = 0; @@ -61,7 +61,7 @@ index 0a83d00..1b5f3f5 100644 static int -psnip_random__pgc_generate(psnip_atomic_int32* state, size_t length, psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) { -+psnip_random__pgc_generate(psnip_atomic_int32* state, size_t length, psnip_uint8_t data[ARRAY_LEN]) { ++psnip_random__pgc_generate(psnip_atomic_int32* state, size_t length, psnip_uint8_t *data) { psnip_int32_t old_state; psnip_uint32_t new_state, v; size_t remaining; @@ -70,29 +70,20 @@ index 0a83d00..1b5f3f5 100644 psnip_random_bytes(enum PSnipRandomSource source, size_t length, - psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) { -+ psnip_uint8_t data[ARRAY_LEN]) { ++ psnip_uint8_t *data) { switch (source) { case PSNIP_RANDOM_SOURCE_SECURE: #if !defined(PSNIP_RANDOM_SECURE_NO_INIT) diff --git a/random/random.h b/random/random.h -index 4d654cc..bcde053 100644 +index 4d654cc..3786921 100644 --- a/random/random.h +++ b/random/random.h -@@ -15,6 +15,8 @@ - # define PSNIP_RANDOM_ARRAY_PARAM(expr) - #endif - -+#define ARRAY_LEN 4096 -+ - #if defined(__cplusplus) - extern "C" { - #endif -@@ -27,7 +29,7 @@ enum PSnipRandomSource { +@@ -27,7 +27,7 @@ enum PSnipRandomSource { int psnip_random_bytes (enum PSnipRandomSource source, size_t length, - psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]); -+ psnip_uint8_t data[ARRAY_LEN]); ++ psnip_uint8_t *data); psnip_uint32_t psnip_random_get_seed (void); void psnip_random_set_seed (psnip_uint32_t seed); From 6813cd9c40d8ca5e716fdd87f540a29a105e0bae Mon Sep 17 00:00:00 2001 From: Jim-Wang Date: Wed, 20 Dec 2023 10:53:38 +0000 Subject: [PATCH 08/10] update version --- versions/p-/portable-snippets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/p-/portable-snippets.json b/versions/p-/portable-snippets.json index 04d6458a59a311..3e3dcf1eb1a4ba 100644 --- a/versions/p-/portable-snippets.json +++ b/versions/p-/portable-snippets.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "507a1e5bc665140eff4db32e37db140856adaeb0", + "git-tree": "5472e188613c086b8193ab533eb0f710b9b98ed1", "version-date": "2019-09-20", "port-version": 4 }, From d6b61c2be9b969535698754d8a978ba17b18e20f Mon Sep 17 00:00:00 2001 From: Jim-Wang Date: Thu, 21 Dec 2023 06:38:01 +0000 Subject: [PATCH 09/10] modify pathc --- ports/portable-snippets/CMakeLists.txt | 2 +- ports/portable-snippets/fix_array.patch | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ports/portable-snippets/CMakeLists.txt b/ports/portable-snippets/CMakeLists.txt index d18acf23efbedd..ed95b8b2969fcd 100644 --- a/ports/portable-snippets/CMakeLists.txt +++ b/ports/portable-snippets/CMakeLists.txt @@ -5,7 +5,7 @@ project(portable-snippets LANGUAGES C) include(GNUInstallDirs) option(PSNIP_INSTALL_HEADERS "Install header files" ON) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11" ) +set(CMAKE_C_STANDARD 11) # https://stackoverflow.com/questions/7787823/cmake-how-to-get-the-name-of-all-subdirectories-of-a-directory function (list_subdir output_variable path) diff --git a/ports/portable-snippets/fix_array.patch b/ports/portable-snippets/fix_array.patch index dd18bb89b0f134..5d3a0bf5bd77d8 100644 --- a/ports/portable-snippets/fix_array.patch +++ b/ports/portable-snippets/fix_array.patch @@ -7,7 +7,7 @@ index 0a83d00..a0d628c 100644 #endif -static int (* psnip_random_secure_generate)(size_t length, psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) = NULL; -+static int (* psnip_random_secure_generate)(size_t length, psnip_uint8_t *data) = NULL; ++static int (* psnip_random_secure_generate)(size_t length, psnip_uint8_t data[]) = NULL; static psnip_once psnip_random_secure_once = PSNIP_ONCE_INIT; #if defined(__linux) @@ -16,7 +16,7 @@ index 0a83d00..a0d628c 100644 static int -psnip_random_secure_generate_getrandom(size_t length, psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) { -+psnip_random_secure_generate_getrandom(size_t length, psnip_uint8_t *data) { ++psnip_random_secure_generate_getrandom(size_t length, psnip_uint8_t data[]) { size_t bytes_read = 0; int r; @@ -25,7 +25,7 @@ index 0a83d00..a0d628c 100644 #endif static int -psnip_random__rdrand (size_t length, psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) { -+psnip_random__rdrand (size_t length, psnip_uint8_t *data) { ++psnip_random__rdrand (size_t length, psnip_uint8_t data[]) { size_t remaining = length; unsigned int r; #if defined(PSNIP_CPU_ARCH_X86_64) @@ -34,7 +34,7 @@ index 0a83d00..a0d628c 100644 static BOOLEAN (APIENTRY *psnip_rand_secure__RtlGenRandom)(void*, ULONG); -static int psnip_random_secure_generate_RtlGenRandom(size_t length, psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) { -+static int psnip_random_secure_generate_RtlGenRandom(size_t length, psnip_uint8_t *data) { ++static int psnip_random_secure_generate_RtlGenRandom(size_t length, psnip_uint8_t data[]) { assert(psnip_rand_secure__RtlGenRandom != NULL); return psnip_rand_secure__RtlGenRandom(data, (ULONG) length) ? 0 : -3; @@ -43,7 +43,7 @@ index 0a83d00..a0d628c 100644 #if !defined(PSNIP_RANDOM_SECURE_FOUND) static int -psnip_random_secure_generate_dev_random(size_t length, psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) { -+psnip_random_secure_generate_dev_random(size_t length, psnip_uint8_t *data) { ++psnip_random_secure_generate_dev_random(size_t length, psnip_uint8_t data[]) { static FILE* dev_random = NULL; size_t bytes_read = 0; @@ -52,7 +52,7 @@ index 0a83d00..a0d628c 100644 static int -psnip_random_secure_generate_dev_urandom(size_t length, psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) { -+psnip_random_secure_generate_dev_urandom(size_t length, psnip_uint8_t *data) { ++psnip_random_secure_generate_dev_urandom(size_t length, psnip_uint8_t data[]) { static FILE* dev_urandom = NULL; size_t bytes_read = 0; @@ -61,7 +61,7 @@ index 0a83d00..a0d628c 100644 static int -psnip_random__pgc_generate(psnip_atomic_int32* state, size_t length, psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) { -+psnip_random__pgc_generate(psnip_atomic_int32* state, size_t length, psnip_uint8_t *data) { ++psnip_random__pgc_generate(psnip_atomic_int32* state, size_t length, psnip_uint8_t data[]) { psnip_int32_t old_state; psnip_uint32_t new_state, v; size_t remaining; @@ -70,7 +70,7 @@ index 0a83d00..a0d628c 100644 psnip_random_bytes(enum PSnipRandomSource source, size_t length, - psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]) { -+ psnip_uint8_t *data) { ++ psnip_uint8_t data[]) { switch (source) { case PSNIP_RANDOM_SOURCE_SECURE: #if !defined(PSNIP_RANDOM_SECURE_NO_INIT) @@ -83,7 +83,7 @@ index 4d654cc..3786921 100644 int psnip_random_bytes (enum PSnipRandomSource source, size_t length, - psnip_uint8_t data[PSNIP_RANDOM_ARRAY_PARAM(length)]); -+ psnip_uint8_t *data); ++ psnip_uint8_t data[]); psnip_uint32_t psnip_random_get_seed (void); void psnip_random_set_seed (psnip_uint32_t seed); From 46ddf942375f21621f24d221b13903e40c398624 Mon Sep 17 00:00:00 2001 From: Jim-Wang Date: Thu, 21 Dec 2023 06:38:28 +0000 Subject: [PATCH 10/10] update version --- versions/p-/portable-snippets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/p-/portable-snippets.json b/versions/p-/portable-snippets.json index 3e3dcf1eb1a4ba..43762e7cce0de9 100644 --- a/versions/p-/portable-snippets.json +++ b/versions/p-/portable-snippets.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "5472e188613c086b8193ab533eb0f710b9b98ed1", + "git-tree": "48afab31a20c7a30b01e5b1875e5b9ef0b7ededf", "version-date": "2019-09-20", "port-version": 4 },