diff --git a/charset/utf8.c b/charset/utf8.c index 3c777292..fe46cf98 100644 --- a/charset/utf8.c +++ b/charset/utf8.c @@ -267,7 +267,7 @@ void utf8_read_test(int line, char *input, int inlen, ...) } if (l != str[i]) { printf("%d: char %d came out as %08x, should be %08x\n", - line, i, str[i], l); + line, i, str[i], (unsigned)l); total_errs++; } } @@ -306,7 +306,7 @@ void utf8_write_test(int line, const long *input, int inlen, ...) } if (l != str[i]) { printf("%d: char %d came out as %08x, should be %08x\n", - line, i, str[i], l); + line, i, str[i], (unsigned)l); total_errs++; } } diff --git a/import.c b/import.c index adf68777..88589a71 100644 --- a/import.c +++ b/import.c @@ -445,7 +445,7 @@ static struct openssh_pem_key *load_openssh_pem_key(const Filename *filename, if (!strcmp(p, "ENCRYPTED")) ret->encrypted = TRUE; } else if (!strcmp(line, "DEK-Info")) { - int i, j, ivlen; + int i, ivlen; if (!strncmp(p, "DES-EDE3-CBC,", 13)) { ret->encryption = OP_E_3DES; @@ -459,6 +459,7 @@ static struct openssh_pem_key *load_openssh_pem_key(const Filename *filename, } p = strchr(p, ',') + 1;/* always non-NULL, by above checks */ for (i = 0; i < ivlen; i++) { + unsigned j; if (1 != sscanf(p, "%2x", &j)) { errmsg = "expected more iv data in DEK-Info"; goto error; diff --git a/minibidi.c b/minibidi.c index 8d78594d..2bdf4deb 100644 --- a/minibidi.c +++ b/minibidi.c @@ -2014,7 +2014,7 @@ int main(int argc, char **argv) unsigned long chr = strtoul(argv[i], NULL, 0); int type = getType(chr); assert(typetoname[type].type == type); - printf("U+%04x: %s\n", chr, typetoname[type].name); + printf("U+%04x: %s\n", (unsigned)chr, typetoname[type].name); } return 0; diff --git a/misc.c b/misc.c index 734ea8b1..469e4aeb 100644 --- a/misc.c +++ b/misc.c @@ -157,7 +157,8 @@ int main(void) passes++; \ } else { \ printf("fail: %s(%s,%s)%s = %u, expected %u\n", \ - #func, #string, #arg2, #suffix, ret, result); \ + #func, #string, #arg2, #suffix, ret, \ + (unsigned)result); \ fails++; \ } \ } while (0) diff --git a/pscp.c b/pscp.c index 454ec084..210362df 100644 --- a/pscp.c +++ b/pscp.c @@ -1476,7 +1476,7 @@ int scp_get_sink_action(struct scp_sink_action *act) act->action = SCP_SINK_ENDDIR; return 0; case 'T': - if (sscanf(act->buf, "%ld %*d %ld %*d", + if (sscanf(act->buf, "%lu %*d %lu %*d", &act->mtime, &act->atime) == 2) { act->settime = 1; back->send(backhandle, "", 1); diff --git a/terminal.c b/terminal.c index f47fe1bd..ba9dd617 100644 --- a/terminal.c +++ b/terminal.c @@ -4327,7 +4327,7 @@ static void term_out(Terminal *term) for (i = 1; i < term->esc_nargs; i++) { if (i != 1) strcat(term->id_string, ";"); - sprintf(lbuf, "%d", term->esc_args[i]); + sprintf(lbuf, "%u", term->esc_args[i]); strcat(term->id_string, lbuf); } strcat(term->id_string, "c"); diff --git a/windows/window.c b/windows/window.c index 89ddb863..96600311 100644 --- a/windows/window.c +++ b/windows/window.c @@ -5199,8 +5199,8 @@ void write_clip(void *frontend, wchar_t * data, int *attr, int len, int must_des multilen = WideCharToMultiByte(CP_ACP, 0, unitab+uindex, 1, NULL, 0, NULL, NULL); if (multilen != 1) { - blen = sprintf(before, "{\\uc%d\\u%d", multilen, - udata[uindex]); + blen = sprintf(before, "{\\uc%d\\u%d", (int)multilen, + (int)udata[uindex]); alen = 1; strcpy(after, "}"); } else { blen = sprintf(before, "\\u%d", udata[uindex]);