1
0
mirror of https://git.zap.org.au/git/trader.git synced 2024-07-21 16:14:14 -04:00

Change parameters of apply_xor() from void * to char *

Arithmetic on void * pointers is undefined, according to Section 6.5.6
Paragraph 2, Section 6.2.5 Paragraph 1 and Section 6.2.5 Paragraph 19 of
the ISO/IEC 9899:1999 C99 standard: the void type is incomplete and thus
its size cannot be determined.

GCC allows pointer arithmetic on void * as an extension (and only warns
if "-Wpointer-arith" is given); the Oracle Developer Studio C compiler
issues a warning by default.
This commit is contained in:
John Zaitseff 2018-08-04 14:31:45 +10:00
parent a47e8528dc
commit de6f113d12

View File

@ -206,7 +206,7 @@ static bool add_currency_symbol = false; // Do we need to add "$"?
apply_xor(apply_xor(buffer)) == buffer. It is used by both scramble()
and unscramble().
*/
static void apply_xor (void *restrict dest, const void *restrict src,
static void apply_xor (char *restrict dest, const char *restrict src,
size_t n, unsigned int *restrict key);
@ -760,7 +760,7 @@ char *unscramble (char *restrict dest, const char *restrict src,
/***********************************************************************/
// apply_xor: Scramble a buffer using xor_table
void apply_xor (void *restrict dest, const void *restrict src,
void apply_xor (char *restrict dest, const char *restrict src,
size_t n, unsigned int *restrict key)
{
assert(dest != NULL);