mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
Patch from Colin Watson intended to give a clean Unix compile with GCC 4.
(Since we choose to compile with -Werror, this is particularly important.) I haven't yet checked that the resulting source actually compiles cleanly with GCC 4, hence not marking `gcc4-warnings' as fixed just yet. [originally from svn r7041]
This commit is contained in:
parent
dbb8e96493
commit
cd94e3bc3c
9
cmdgen.c
9
cmdgen.c
@ -233,7 +233,7 @@ static int move(char *from, char *to)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *blobfp(char *alg, int bits, char *blob, int bloblen)
|
static char *blobfp(char *alg, int bits, unsigned char *blob, int bloblen)
|
||||||
{
|
{
|
||||||
char buffer[128];
|
char buffer[128];
|
||||||
unsigned char digest[16];
|
unsigned char digest[16];
|
||||||
@ -270,7 +270,8 @@ int main(int argc, char **argv)
|
|||||||
int sshver = 0;
|
int sshver = 0;
|
||||||
struct ssh2_userkey *ssh2key = NULL;
|
struct ssh2_userkey *ssh2key = NULL;
|
||||||
struct RSAKey *ssh1key = NULL;
|
struct RSAKey *ssh1key = NULL;
|
||||||
char *ssh2blob = NULL, *ssh2alg = NULL;
|
unsigned char *ssh2blob = NULL;
|
||||||
|
char *ssh2alg = NULL;
|
||||||
const struct ssh_signkey *ssh2algf = NULL;
|
const struct ssh_signkey *ssh2algf = NULL;
|
||||||
int ssh2bloblen;
|
int ssh2bloblen;
|
||||||
char *passphrase = NULL;
|
char *passphrase = NULL;
|
||||||
@ -715,12 +716,12 @@ int main(int argc, char **argv)
|
|||||||
ssh1key = snew(struct RSAKey);
|
ssh1key = snew(struct RSAKey);
|
||||||
if (!load_encrypted) {
|
if (!load_encrypted) {
|
||||||
void *vblob;
|
void *vblob;
|
||||||
char *blob;
|
unsigned char *blob;
|
||||||
int n, l, bloblen;
|
int n, l, bloblen;
|
||||||
|
|
||||||
ret = rsakey_pubblob(&infilename, &vblob, &bloblen,
|
ret = rsakey_pubblob(&infilename, &vblob, &bloblen,
|
||||||
&origcomment, &error);
|
&origcomment, &error);
|
||||||
blob = (char *)vblob;
|
blob = (unsigned char *)vblob;
|
||||||
|
|
||||||
n = 4; /* skip modulus bits */
|
n = 4; /* skip modulus bits */
|
||||||
|
|
||||||
|
2
misc.c
2
misc.c
@ -102,7 +102,7 @@ prompts_t *new_prompts(void *frontend)
|
|||||||
void add_prompt(prompts_t *p, char *promptstr, int echo, size_t len)
|
void add_prompt(prompts_t *p, char *promptstr, int echo, size_t len)
|
||||||
{
|
{
|
||||||
prompt_t *pr = snew(prompt_t);
|
prompt_t *pr = snew(prompt_t);
|
||||||
unsigned char *result = snewn(len, unsigned char);
|
char *result = snewn(len, char);
|
||||||
pr->prompt = promptstr;
|
pr->prompt = promptstr;
|
||||||
pr->echo = echo;
|
pr->echo = echo;
|
||||||
pr->result = result;
|
pr->result = result;
|
||||||
|
7
ssh.c
7
ssh.c
@ -1489,6 +1489,7 @@ static struct Packet *construct_packet(Ssh ssh, int pkttype, va_list ap)
|
|||||||
|
|
||||||
while ((argtype = va_arg(ap, int)) != PKT_END) {
|
while ((argtype = va_arg(ap, int)) != PKT_END) {
|
||||||
unsigned char *argp, argchar;
|
unsigned char *argp, argchar;
|
||||||
|
char *sargp;
|
||||||
unsigned long argint;
|
unsigned long argint;
|
||||||
int arglen;
|
int arglen;
|
||||||
switch (argtype) {
|
switch (argtype) {
|
||||||
@ -1507,8 +1508,8 @@ static struct Packet *construct_packet(Ssh ssh, int pkttype, va_list ap)
|
|||||||
ssh_pkt_adddata(pkt, argp, arglen);
|
ssh_pkt_adddata(pkt, argp, arglen);
|
||||||
break;
|
break;
|
||||||
case PKT_STR:
|
case PKT_STR:
|
||||||
argp = va_arg(ap, unsigned char *);
|
sargp = va_arg(ap, char *);
|
||||||
ssh_pkt_addstring(pkt, argp);
|
ssh_pkt_addstring(pkt, sargp);
|
||||||
break;
|
break;
|
||||||
case PKT_BIGNUM:
|
case PKT_BIGNUM:
|
||||||
bn = va_arg(ap, Bignum);
|
bn = va_arg(ap, Bignum);
|
||||||
@ -1654,7 +1655,7 @@ static void ssh_pkt_addstring(struct Packet *pkt, char *data)
|
|||||||
static void ssh1_pkt_addmp(struct Packet *pkt, Bignum b)
|
static void ssh1_pkt_addmp(struct Packet *pkt, Bignum b)
|
||||||
{
|
{
|
||||||
int len = ssh1_bignum_length(b);
|
int len = ssh1_bignum_length(b);
|
||||||
unsigned char *data = snewn(len, char);
|
unsigned char *data = snewn(len, unsigned char);
|
||||||
(void) ssh1_write_bignum(data, b);
|
(void) ssh1_write_bignum(data, b);
|
||||||
ssh_pkt_adddata(pkt, data, len);
|
ssh_pkt_adddata(pkt, data, len);
|
||||||
sfree(data);
|
sfree(data);
|
||||||
|
6
ssh.h
6
ssh.h
@ -403,9 +403,9 @@ extern struct ssh2_userkey ssh2_wrong_passphrase;
|
|||||||
int ssh2_userkey_encrypted(const Filename *filename, char **comment);
|
int ssh2_userkey_encrypted(const Filename *filename, char **comment);
|
||||||
struct ssh2_userkey *ssh2_load_userkey(const Filename *filename,
|
struct ssh2_userkey *ssh2_load_userkey(const Filename *filename,
|
||||||
char *passphrase, const char **errorstr);
|
char *passphrase, const char **errorstr);
|
||||||
char *ssh2_userkey_loadpub(const Filename *filename, char **algorithm,
|
unsigned char *ssh2_userkey_loadpub(const Filename *filename, char **algorithm,
|
||||||
int *pub_blob_len, char **commentptr,
|
int *pub_blob_len, char **commentptr,
|
||||||
const char **errorstr);
|
const char **errorstr);
|
||||||
int ssh2_save_userkey(const Filename *filename, struct ssh2_userkey *key,
|
int ssh2_save_userkey(const Filename *filename, struct ssh2_userkey *key,
|
||||||
char *passphrase);
|
char *passphrase);
|
||||||
const struct ssh_signkey *find_pubkey_alg(const char *name);
|
const struct ssh_signkey *find_pubkey_alg(const char *name);
|
||||||
|
@ -868,9 +868,9 @@ struct ssh2_userkey *ssh2_load_userkey(const Filename *filename,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *ssh2_userkey_loadpub(const Filename *filename, char **algorithm,
|
unsigned char *ssh2_userkey_loadpub(const Filename *filename, char **algorithm,
|
||||||
int *pub_blob_len, char **commentptr,
|
int *pub_blob_len, char **commentptr,
|
||||||
const char **errorstr)
|
const char **errorstr)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
char header[40], *b;
|
char header[40], *b;
|
||||||
@ -940,7 +940,7 @@ char *ssh2_userkey_loadpub(const Filename *filename, char **algorithm,
|
|||||||
*pub_blob_len = public_blob_len;
|
*pub_blob_len = public_blob_len;
|
||||||
if (algorithm)
|
if (algorithm)
|
||||||
*algorithm = alg->name;
|
*algorithm = alg->name;
|
||||||
return (char *)public_blob;
|
return public_blob;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Error processing.
|
* Error processing.
|
||||||
|
@ -224,6 +224,7 @@ static void lz77_compress(struct LZ77Context *ctx,
|
|||||||
}
|
}
|
||||||
st->npending -= i;
|
st->npending -= i;
|
||||||
|
|
||||||
|
defermatch.distance = 0; /* appease compiler */
|
||||||
defermatch.len = 0;
|
defermatch.len = 0;
|
||||||
deferchr = '\0';
|
deferchr = '\0';
|
||||||
while (len > 0) {
|
while (len > 0) {
|
||||||
|
@ -136,6 +136,7 @@ static void *add234_internal(tree234 * t, void *e, int index)
|
|||||||
return orig_e;
|
return orig_e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
n = NULL; /* placate gcc; will always be set below since t->root != NULL */
|
||||||
np = &t->root;
|
np = &t->root;
|
||||||
while (*np) {
|
while (*np) {
|
||||||
int childnum;
|
int childnum;
|
||||||
|
@ -2696,7 +2696,7 @@ void eventlog_selection_get(GtkWidget *widget, GtkSelectionData *seldata,
|
|||||||
struct eventlog_stuff *es = (struct eventlog_stuff *)data;
|
struct eventlog_stuff *es = (struct eventlog_stuff *)data;
|
||||||
|
|
||||||
gtk_selection_data_set(seldata, seldata->target, 8,
|
gtk_selection_data_set(seldata, seldata->target, 8,
|
||||||
es->seldata, es->sellen);
|
(unsigned char *)es->seldata, es->sellen);
|
||||||
}
|
}
|
||||||
|
|
||||||
gint eventlog_selection_clear(GtkWidget *widget, GdkEventSelection *seldata,
|
gint eventlog_selection_clear(GtkWidget *widget, GdkEventSelection *seldata,
|
||||||
|
@ -1466,22 +1466,23 @@ void palette_reset(void *frontend)
|
|||||||
*/
|
*/
|
||||||
void init_cutbuffers()
|
void init_cutbuffers()
|
||||||
{
|
{
|
||||||
|
unsigned char empty[] = "";
|
||||||
XChangeProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
|
XChangeProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
|
||||||
XA_CUT_BUFFER0, XA_STRING, 8, PropModeAppend, "", 0);
|
XA_CUT_BUFFER0, XA_STRING, 8, PropModeAppend, empty, 0);
|
||||||
XChangeProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
|
XChangeProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
|
||||||
XA_CUT_BUFFER1, XA_STRING, 8, PropModeAppend, "", 0);
|
XA_CUT_BUFFER1, XA_STRING, 8, PropModeAppend, empty, 0);
|
||||||
XChangeProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
|
XChangeProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
|
||||||
XA_CUT_BUFFER2, XA_STRING, 8, PropModeAppend, "", 0);
|
XA_CUT_BUFFER2, XA_STRING, 8, PropModeAppend, empty, 0);
|
||||||
XChangeProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
|
XChangeProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
|
||||||
XA_CUT_BUFFER3, XA_STRING, 8, PropModeAppend, "", 0);
|
XA_CUT_BUFFER3, XA_STRING, 8, PropModeAppend, empty, 0);
|
||||||
XChangeProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
|
XChangeProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
|
||||||
XA_CUT_BUFFER4, XA_STRING, 8, PropModeAppend, "", 0);
|
XA_CUT_BUFFER4, XA_STRING, 8, PropModeAppend, empty, 0);
|
||||||
XChangeProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
|
XChangeProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
|
||||||
XA_CUT_BUFFER5, XA_STRING, 8, PropModeAppend, "", 0);
|
XA_CUT_BUFFER5, XA_STRING, 8, PropModeAppend, empty, 0);
|
||||||
XChangeProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
|
XChangeProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
|
||||||
XA_CUT_BUFFER6, XA_STRING, 8, PropModeAppend, "", 0);
|
XA_CUT_BUFFER6, XA_STRING, 8, PropModeAppend, empty, 0);
|
||||||
XChangeProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
|
XChangeProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(),
|
||||||
XA_CUT_BUFFER7, XA_STRING, 8, PropModeAppend, "", 0);
|
XA_CUT_BUFFER7, XA_STRING, 8, PropModeAppend, empty, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Store the data in a cut-buffer. */
|
/* Store the data in a cut-buffer. */
|
||||||
@ -1601,15 +1602,16 @@ void selection_get(GtkWidget *widget, GtkSelectionData *seldata,
|
|||||||
struct gui_data *inst = (struct gui_data *)data;
|
struct gui_data *inst = (struct gui_data *)data;
|
||||||
if (seldata->target == utf8_string_atom)
|
if (seldata->target == utf8_string_atom)
|
||||||
gtk_selection_data_set(seldata, seldata->target, 8,
|
gtk_selection_data_set(seldata, seldata->target, 8,
|
||||||
inst->pasteout_data_utf8,
|
(unsigned char *)inst->pasteout_data_utf8,
|
||||||
inst->pasteout_data_utf8_len);
|
inst->pasteout_data_utf8_len);
|
||||||
else if (seldata->target == compound_text_atom)
|
else if (seldata->target == compound_text_atom)
|
||||||
gtk_selection_data_set(seldata, seldata->target, 8,
|
gtk_selection_data_set(seldata, seldata->target, 8,
|
||||||
inst->pasteout_data_ctext,
|
(unsigned char *)inst->pasteout_data_ctext,
|
||||||
inst->pasteout_data_ctext_len);
|
inst->pasteout_data_ctext_len);
|
||||||
else
|
else
|
||||||
gtk_selection_data_set(seldata, seldata->target, 8,
|
gtk_selection_data_set(seldata, seldata->target, 8,
|
||||||
inst->pasteout_data, inst->pasteout_data_len);
|
(unsigned char *)inst->pasteout_data,
|
||||||
|
inst->pasteout_data_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
gint selection_clear(GtkWidget *widget, GdkEventSelection *seldata,
|
gint selection_clear(GtkWidget *widget, GdkEventSelection *seldata,
|
||||||
@ -2488,15 +2490,16 @@ int do_cmdline(int argc, char **argv, int do_everything,
|
|||||||
cfg->line_codepage[sizeof(cfg->line_codepage)-1] = '\0';
|
cfg->line_codepage[sizeof(cfg->line_codepage)-1] = '\0';
|
||||||
|
|
||||||
} else if (!strcmp(p, "-geometry")) {
|
} else if (!strcmp(p, "-geometry")) {
|
||||||
int flags, x, y, w, h;
|
int flags, x, y;
|
||||||
|
unsigned int w, h;
|
||||||
EXPECTS_ARG;
|
EXPECTS_ARG;
|
||||||
SECOND_PASS_ONLY;
|
SECOND_PASS_ONLY;
|
||||||
|
|
||||||
flags = XParseGeometry(val, &x, &y, &w, &h);
|
flags = XParseGeometry(val, &x, &y, &w, &h);
|
||||||
if (flags & WidthValue)
|
if (flags & WidthValue)
|
||||||
cfg->width = w;
|
cfg->width = (int)w;
|
||||||
if (flags & HeightValue)
|
if (flags & HeightValue)
|
||||||
cfg->height = h;
|
cfg->height = (int)h;
|
||||||
|
|
||||||
if (flags & (XValue | YValue)) {
|
if (flags & (XValue | YValue)) {
|
||||||
inst->xpos = x;
|
inst->xpos = x;
|
||||||
|
Loading…
Reference in New Issue
Block a user