Skip to content

Commit 18654c3

Browse files
committed
Merge #735: secp256k1-sys: update util.h patch to delete more stdio code
b66bae7 secp256k1-sys: update util.h patch to delete more stdio code (Andrew Poelstra) Pull request description: Fixes #734 ACKs for top commit: Kixunil: ACK b66bae7 Tree-SHA512: 8d1266a1decbd06055922a19d687ec1e616dcf8a21764386c73cc8e20d390c9bc5a6ca416a3dc2602cc8ad7a5641f1af8607d3f64291325b2b2fff343677bc82
2 parents c61dea9 + b66bae7 commit 18654c3

File tree

2 files changed

+24
-22
lines changed

2 files changed

+24
-22
lines changed

secp256k1-sys/depend/secp256k1/src/util.h

-21
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,13 @@
1111

1212
#include <stdlib.h>
1313
#include <stdint.h>
14-
#include <stdio.h>
1514
#include <limits.h>
1615

1716
#define STR_(x) #x
1817
#define STR(x) STR_(x)
1918
#define DEBUG_CONFIG_MSG(x) "DEBUG_CONFIG: " x
2019
#define DEBUG_CONFIG_DEF(x) DEBUG_CONFIG_MSG(#x "=" STR(x))
2120

22-
/* Debug helper for printing arrays of unsigned char. */
23-
#define PRINT_BUF(buf, len) do { \
24-
printf("%s[%lu] = ", #buf, (unsigned long)len); \
25-
print_buf_plain(buf, len); \
26-
} while(0)
27-
28-
static void print_buf_plain(const unsigned char *buf, size_t len) {
29-
size_t i;
30-
printf("{");
31-
for (i = 0; i < len; i++) {
32-
if (i % 8 == 0) {
33-
printf("\n ");
34-
} else {
35-
printf(" ");
36-
}
37-
printf("0x%02X,", buf[i]);
38-
}
39-
printf("\n}\n");
40-
}
41-
4221
# if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) )
4322
# if SECP256K1_GNUC_PREREQ(2,7)
4423
# define SECP256K1_INLINE __inline__

secp256k1-sys/depend/util.h.patch

+24-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,27 @@
1-
148,152c148,150
1+
14d13
2+
< #include <stdio.h>
3+
22,41d20
4+
< /* Debug helper for printing arrays of unsigned char. */
5+
< #define PRINT_BUF(buf, len) do { \
6+
< printf("%s[%lu] = ", #buf, (unsigned long)len); \
7+
< print_buf_plain(buf, len); \
8+
< } while(0)
9+
<
10+
< static void print_buf_plain(const unsigned char *buf, size_t len) {
11+
< size_t i;
12+
< printf("{");
13+
< for (i = 0; i < len; i++) {
14+
< if (i % 8 == 0) {
15+
< printf("\n ");
16+
< } else {
17+
< printf(" ");
18+
< }
19+
< printf("0x%02X,", buf[i]);
20+
< }
21+
< printf("\n}\n");
22+
< }
23+
<
24+
148,152c127,129
225
< void *ret = malloc(size);
326
< if (ret == NULL) {
427
< secp256k1_callback_call(cb, "Out of memory");

0 commit comments

Comments
 (0)