mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 03:22:48 -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:
@ -3083,7 +3083,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
||||
*/
|
||||
term_seen_key_event(term);
|
||||
if (ldisc)
|
||||
ldisc_send(ldisc, (char *)buf, len, 1);
|
||||
ldisc_send(ldisc, buf, len, 1);
|
||||
show_mouseptr(0);
|
||||
}
|
||||
}
|
||||
@ -5921,12 +5921,12 @@ void frontend_keypress(void *handle)
|
||||
return;
|
||||
}
|
||||
|
||||
int from_backend(void *frontend, int is_stderr, const char *data, int len)
|
||||
int from_backend(void *frontend, int is_stderr, const void *data, int len)
|
||||
{
|
||||
return term_data(term, is_stderr, data, len);
|
||||
}
|
||||
|
||||
int from_backend_untrusted(void *frontend, const char *data, int len)
|
||||
int from_backend_untrusted(void *frontend, const void *data, int len)
|
||||
{
|
||||
return term_data_untrusted(term, data, len);
|
||||
}
|
||||
|
@ -137,14 +137,14 @@ static void sk_handle_close(Socket s)
|
||||
sfree(ps);
|
||||
}
|
||||
|
||||
static int sk_handle_write(Socket s, const char *data, int len)
|
||||
static int sk_handle_write(Socket s, const void *data, int len)
|
||||
{
|
||||
Handle_Socket ps = (Handle_Socket) s;
|
||||
|
||||
return handle_write(ps->send_h, data, len);
|
||||
}
|
||||
|
||||
static int sk_handle_write_oob(Socket s, const char *data, int len)
|
||||
static int sk_handle_write_oob(Socket s, const void *data, int len)
|
||||
{
|
||||
/*
|
||||
* oob data is treated as inband; nasty, but nothing really
|
||||
|
@ -931,8 +931,8 @@ static void sk_tcp_flush(Socket s)
|
||||
}
|
||||
|
||||
static void sk_tcp_close(Socket s);
|
||||
static int sk_tcp_write(Socket s, const char *data, int len);
|
||||
static int sk_tcp_write_oob(Socket s, const char *data, int len);
|
||||
static int sk_tcp_write(Socket s, const void *data, int len);
|
||||
static int sk_tcp_write_oob(Socket s, const void *data, int len);
|
||||
static void sk_tcp_write_eof(Socket s);
|
||||
static void sk_tcp_set_frozen(Socket s, int is_frozen);
|
||||
static const char *sk_tcp_socket_error(Socket s);
|
||||
@ -1568,7 +1568,7 @@ void try_send(Actual_Socket s)
|
||||
}
|
||||
}
|
||||
|
||||
static int sk_tcp_write(Socket sock, const char *buf, int len)
|
||||
static int sk_tcp_write(Socket sock, const void *buf, int len)
|
||||
{
|
||||
Actual_Socket s = (Actual_Socket) sock;
|
||||
|
||||
@ -1588,7 +1588,7 @@ static int sk_tcp_write(Socket sock, const char *buf, int len)
|
||||
return bufchain_size(&s->output_data);
|
||||
}
|
||||
|
||||
static int sk_tcp_write_oob(Socket sock, const char *buf, int len)
|
||||
static int sk_tcp_write_oob(Socket sock, const void *buf, int len)
|
||||
{
|
||||
Actual_Socket s = (Actual_Socket) sock;
|
||||
|
||||
|
@ -104,7 +104,7 @@ void frontend_echoedit_update(void *frontend, int echo, int edit)
|
||||
char *get_ttymode(void *frontend, const char *mode) { return NULL; }
|
||||
|
||||
int from_backend(void *frontend_handle, int is_stderr,
|
||||
const char *data, int len)
|
||||
const void *data, int len)
|
||||
{
|
||||
if (is_stderr) {
|
||||
handle_write(stderr_handle, data, len);
|
||||
@ -115,7 +115,7 @@ int from_backend(void *frontend_handle, int is_stderr,
|
||||
return handle_backlog(stdout_handle) + handle_backlog(stderr_handle);
|
||||
}
|
||||
|
||||
int from_backend_untrusted(void *frontend_handle, const char *data, int len)
|
||||
int from_backend_untrusted(void *frontend_handle, const void *data, int len)
|
||||
{
|
||||
/*
|
||||
* No "untrusted" output should get here (the way the code is
|
||||
|
Reference in New Issue
Block a user