Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Marcus Hoffmann
nettle
Commits
330a14f6
Commit
330a14f6
authored
Sep 03, 2016
by
Niels Möller
Browse files
Macro to convert string literals to unsigned.
parent
efac4e8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
ChangeLog
View file @
330a14f6
2016-09-03 Niels Möller <nisse@lysator.liu.se>
* testsuite/testutils.h (US): New macro, for unsigned string
literals.
(LDATA): Use the US macro, to eliminate pointer signedness
warnings.
* testsuite/rsa-encrypt-test.c (test_main): Fix pointer
signednesss warning.
...
...
testsuite/testutils.h
View file @
330a14f6
...
...
@@ -267,10 +267,17 @@ void
test_ecc_mul_h
(
unsigned
curve
,
unsigned
n
,
const
mp_limb_t
*
p
);
#endif
/* WITH_HOGWEED */
/* String literal of type unsigned char. The GNUC version is safer. */
#if __GNUC__
#define US(s) ({ static const unsigned char us_s[] = s; us_s; })
#else
#define US(s) ((const uint8_t *) (s))
#endif
/* LDATA needs to handle NUL characters. */
#define LLENGTH(x) (sizeof(x) - 1)
#define LDATA(x) LLENGTH(x),
x
#define LDATA(x) LLENGTH(x),
US(x)
#define LDUP(x) strlen(x), strdup(x)
#define SHEX(x) (tstring_hex(x))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment