mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-15 01:57:40 -05:00
Make lots of generic data parameters into 'void *'.
This is a cleanup I started to notice a need for during the BinarySink work. It removes a lot of faffing about casting things to char * or unsigned char * so that some API will accept them, even though lots of such APIs really take a plain 'block of raw binary data' argument and don't care what C thinks the signedness of that data might be - they may well reinterpret it back and forth internally. So I've tried to arrange for all the function call APIs that ought to have a void * (or const void *) to have one, and those that need to do pointer arithmetic on the parameter internally can cast it back at the top of the function. That saves endless ad-hoc casts at the call sites.
This commit is contained in:
6
sshbn.c
6
sshbn.c
@ -1404,8 +1404,9 @@ void decbn(Bignum bn)
|
||||
bn[i]--;
|
||||
}
|
||||
|
||||
Bignum bignum_from_bytes(const unsigned char *data, int nbytes)
|
||||
Bignum bignum_from_bytes(const void *vdata, int nbytes)
|
||||
{
|
||||
const unsigned char *data = (const unsigned char *)vdata;
|
||||
Bignum result;
|
||||
int w, i;
|
||||
|
||||
@ -1426,8 +1427,9 @@ Bignum bignum_from_bytes(const unsigned char *data, int nbytes)
|
||||
return result;
|
||||
}
|
||||
|
||||
Bignum bignum_from_bytes_le(const unsigned char *data, int nbytes)
|
||||
Bignum bignum_from_bytes_le(const void *vdata, int nbytes)
|
||||
{
|
||||
const unsigned char *data = (const unsigned char *)vdata;
|
||||
Bignum result;
|
||||
int w, i;
|
||||
|
||||
|
Reference in New Issue
Block a user