diff options
author | Sean McBride <sean@rogue-research.com> | 2022-10-21 20:45:43 -0400 |
---|---|---|
committer | Sean McBride <sean@rogue-research.com> | 2022-10-25 09:06:44 -0400 |
commit | 0212538640b36e18cbb197ec4719896c68f7008b (patch) | |
tree | ce2bb2db068859c1d1072c1c6ee8d964ee00a571 /expat | |
parent | 2ee10be8c8fbe5863ed424113527caf4572e0b81 (diff) | |
download | libexpat-git-0212538640b36e18cbb197ec4719896c68f7008b.tar.gz |
Fixed most clang -Wreserved-id-macro warnings
Renamed to not start with underscore + uppercase, which is reserved.
Diffstat (limited to 'expat')
-rw-r--r-- | expat/lib/siphash.h | 10 | ||||
-rw-r--r-- | expat/tests/runtests.c | 4 | ||||
-rw-r--r-- | expat/xmlwf/readfilemap.c | 18 |
3 files changed, 16 insertions, 16 deletions
diff --git a/expat/lib/siphash.h b/expat/lib/siphash.h index 303283ad..a1ed99e6 100644 --- a/expat/lib/siphash.h +++ b/expat/lib/siphash.h @@ -106,7 +106,7 @@ * if this code is included and compiled as C++; related GCC warning is: * warning: use of C++11 long long integer constant [-Wlong-long] */ -#define _SIP_ULL(high, low) ((((uint64_t)high) << 32) | (low)) +#define SIP_ULL(high, low) ((((uint64_t)high) << 32) | (low)) #define SIP_ROTL(x, b) (uint64_t)(((x) << (b)) | ((x) >> (64 - (b)))) @@ -190,10 +190,10 @@ sip_round(struct siphash *H, const int rounds) { static struct siphash * sip24_init(struct siphash *H, const struct sipkey *key) { - H->v0 = _SIP_ULL(0x736f6d65U, 0x70736575U) ^ key->k[0]; - H->v1 = _SIP_ULL(0x646f7261U, 0x6e646f6dU) ^ key->k[1]; - H->v2 = _SIP_ULL(0x6c796765U, 0x6e657261U) ^ key->k[0]; - H->v3 = _SIP_ULL(0x74656462U, 0x79746573U) ^ key->k[1]; + H->v0 = SIP_ULL(0x736f6d65U, 0x70736575U) ^ key->k[0]; + H->v1 = SIP_ULL(0x646f7261U, 0x6e646f6dU) ^ key->k[1]; + H->v2 = SIP_ULL(0x6c796765U, 0x6e657261U) ^ key->k[0]; + H->v3 = SIP_ULL(0x74656462U, 0x79746573U) ^ key->k[1]; H->p = H->buf; H->c = 0; diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index 24e62a45..8c34f59b 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -507,7 +507,7 @@ START_TEST(test_siphash_spec) { const char message[] = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09" "\x0a\x0b\x0c\x0d\x0e"; const size_t len = sizeof(message) - 1; - const uint64_t expected = _SIP_ULL(0xa129ca61U, 0x49be45e5U); + const uint64_t expected = SIP_ULL(0xa129ca61U, 0x49be45e5U); struct siphash state; struct sipkey key; @@ -4932,7 +4932,7 @@ START_TEST(test_hash_collision) { * tests invoked from qa.sh usually provide a hash collision, but * not always. This is an attempt to provide insurance. */ -#define COLLIDING_HASH_SALT (unsigned long)_SIP_ULL(0xffffffffU, 0xff99fc90U) +#define COLLIDING_HASH_SALT (unsigned long)SIP_ULL(0xffffffffU, 0xff99fc90U) const char *text = "<doc>\n" "<a1/><a2/><a3/><a4/><a5/><a6/><a7/><a8/>\n" diff --git a/expat/xmlwf/readfilemap.c b/expat/xmlwf/readfilemap.c index 59121f5b..0ddb0434 100644 --- a/expat/xmlwf/readfilemap.c +++ b/expat/xmlwf/readfilemap.c @@ -50,14 +50,14 @@ #if defined(_MSC_VER) # include <io.h> /* https://msdn.microsoft.com/en-us/library/wyssk1bs(v=vs.100).aspx */ -# define _EXPAT_read _read -# define _EXPAT_read_count_t int -# define _EXPAT_read_req_t unsigned int +# define EXPAT_read _read +# define EXPAT_read_count_t int +# define EXPAT_read_req_t unsigned int #else /* POSIX */ /* http://pubs.opengroup.org/onlinepubs/009695399/functions/read.html */ -# define _EXPAT_read read -# define _EXPAT_read_count_t ssize_t -# define _EXPAT_read_req_t size_t +# define EXPAT_read read +# define EXPAT_read_count_t ssize_t +# define EXPAT_read_req_t size_t #endif #ifndef S_ISREG @@ -87,7 +87,7 @@ filemap(const tchar *name, void *arg) { size_t nbytes; int fd; - _EXPAT_read_count_t n; + EXPAT_read_count_t n; struct stat sb; void *p; @@ -125,14 +125,14 @@ filemap(const tchar *name, close(fd); return 0; } - n = _EXPAT_read(fd, p, (_EXPAT_read_req_t)nbytes); + n = EXPAT_read(fd, p, (EXPAT_read_req_t)nbytes); if (n < 0) { tperror(name); free(p); close(fd); return 0; } - if (n != (_EXPAT_read_count_t)nbytes) { + if (n != (EXPAT_read_count_t)nbytes) { ftprintf(stderr, T("%s: read unexpected number of bytes\n"), name); free(p); close(fd); |