1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 11:02:48 -05:00

Colin's const-fixing Patch Of Death. Seems to build fine on Windows

as well as Unix, so it can go in.

[originally from svn r3162]
This commit is contained in:
Simon Tatham
2003-05-04 14:18:18 +00:00
parent 0bfe876b57
commit 6bb121ecb9
31 changed files with 104 additions and 93 deletions

View File

@ -2720,7 +2720,7 @@ void *eventlogstuff_new(void)
return es;
}
void logevent_dlg(void *estuff, char *string)
void logevent_dlg(void *estuff, const char *string)
{
struct eventlog_stuff *es = (struct eventlog_stuff *)estuff;

View File

@ -166,7 +166,7 @@ int from_backend(void *frontend, int is_stderr, const char *data, int len)
return term_data(inst->term, is_stderr, data, len);
}
void logevent(void *frontend, char *string)
void logevent(void *frontend, const char *string)
{
struct gui_data *inst = (struct gui_data *)frontend;
@ -3075,7 +3075,8 @@ int pt_main(int argc, char **argv)
inst->back = select_backend(&inst->cfg);
{
char *realhost, *error;
char *realhost;
const char *error;
error = inst->back->init((void *)inst, &inst->backhandle,
&inst->cfg, inst->cfg.host, inst->cfg.port,

View File

@ -485,8 +485,8 @@ static void pty_uxsel_setup(void)
* Also places the canonical host name into `realhost'. It must be
* freed by the caller.
*/
static char *pty_init(void *frontend, void **backend_handle, Config *cfg,
char *host, int port, char **realhost, int nodelay)
static const char *pty_init(void *frontend, void **backend_handle, Config *cfg,
char *host, int port, char **realhost, int nodelay)
{
int slavefd;
pid_t pid, pgrp;

View File

@ -64,7 +64,7 @@ void fatal_message_box(void *window, char *msg);
void about_box(void *window);
void *eventlogstuff_new(void);
void showeventlog(void *estuff, void *parentwin);
void logevent_dlg(void *estuff, char *string);
void logevent_dlg(void *estuff, const char *string);
int reallyclose(void *frontend);
/* Things pterm.c needs from {ptermm,uxputty}.c */

View File

@ -258,7 +258,7 @@ void old_keyfile_warning(void)
fputs(message, stderr);
}
void logevent(void *frontend, char *string)
void logevent(void *frontend, const char *string)
{
log_eventlog(logctx, string);
}

View File

@ -26,7 +26,7 @@
struct Socket_tag {
struct socket_function_table *fn;
/* the above variable absolutely *must* be the first in this structure */
char *error;
const char *error;
int s;
Plug plug;
void *private_ptr;
@ -56,7 +56,7 @@ struct Socket_tag {
typedef struct Socket_tag *Actual_Socket;
struct SockAddr_tag {
char *error;
const char *error;
/*
* Which address family this address belongs to. AF_INET for
* IPv4; AF_INET6 for IPv6; AF_UNSPEC indicates that name
@ -115,7 +115,7 @@ void sk_cleanup(void)
}
}
char *error_string(int error)
const char *error_string(int error)
{
return strerror(error);
}
@ -322,7 +322,7 @@ static int sk_tcp_write_oob(Socket s, const char *data, int len);
static void sk_tcp_set_private_ptr(Socket s, void *ptr);
static void *sk_tcp_get_private_ptr(Socket s);
static void sk_tcp_set_frozen(Socket s, int is_frozen);
static char *sk_tcp_socket_error(Socket s);
static const char *sk_tcp_socket_error(Socket s);
static struct socket_function_table tcp_fn_table = {
sk_tcp_plug,
@ -837,8 +837,8 @@ static int net_select_result(int fd, int event)
ret = recv(s->s, buf, sizeof(buf), MSG_OOB);
noise_ultralight(ret);
if (ret <= 0) {
char *str = (ret == 0 ? "Internal networking trouble" :
error_string(errno));
const char *str = (ret == 0 ? "Internal networking trouble" :
error_string(errno));
/* We're inside the Unix frontend here, so we know
* that the frontend handle is unnecessary. */
logevent(NULL, str);
@ -1003,11 +1003,11 @@ static void *sk_tcp_get_private_ptr(Socket sock)
* if there's a problem. These functions extract an error message,
* or return NULL if there's no problem.
*/
char *sk_addr_error(SockAddr addr)
const char *sk_addr_error(SockAddr addr)
{
return addr->error;
}
static char *sk_tcp_socket_error(Socket sock)
static const char *sk_tcp_socket_error(Socket sock)
{
Actual_Socket s = (Actual_Socket) sock;
return s->error;

View File

@ -574,7 +574,7 @@ int main(int argc, char **argv)
*/
logctx = log_init(NULL, &cfg);
{
char *error;
const char *error;
char *realhost;
/* nodelay is only useful if stdin is a terminal device */
int nodelay = cfg.tcp_nodelay && isatty(0);