From af7d73c7ab76ad81fed78b7f5c024daf1af87d9d Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Wed, 14 Jan 2009 01:56:15 +0000 Subject: Fix a few compiler warnings around implicit conversion or extra ";". svn path=/branches/BRANCH_6-3/; revision=5261 --- env.c | 2 +- fetchmail.c | 2 +- imap.c | 4 ++-- interface.c | 4 ++-- pop3.c | 2 +- rcfile_l.l | 2 +- rcfile_y.y | 2 +- report.c | 8 ++++---- rfc2047e.c | 8 ++++---- rfc822.c | 2 +- sink.c | 2 +- socket.c | 4 ++-- transact.c | 6 +++--- uid.c | 2 +- unmime.c | 4 ++-- 15 files changed, 27 insertions(+), 27 deletions(-) diff --git a/env.c b/env.c index 46733f3b..939753c5 100644 --- a/env.c +++ b/env.c @@ -292,7 +292,7 @@ char *visbuf(const char *buf) if (needed > vbufs) { vbufs = needed; - vbuf = xrealloc(vbuf, vbufs); + vbuf = (char *)xrealloc(vbuf, vbufs); } tp = vbuf; diff --git a/fetchmail.c b/fetchmail.c index bf88b4dd..e7f48668 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -532,7 +532,7 @@ int main(int argc, char **argv) const char* password_prompt = GT_("Enter password for %s@%s: "); size_t pplen = strlen(password_prompt) + strlen(ctl->remotename) + strlen(ctl->server.pollname) + 1; - tmpbuf = xmalloc(pplen); + tmpbuf = (char *)xmalloc(pplen); snprintf(tmpbuf, pplen, password_prompt, ctl->remotename, ctl->server.pollname); ctl->password = xstrdup((char *)fm_getpassword(tmpbuf)); diff --git a/imap.c b/imap.c index ab446777..dd303f78 100644 --- a/imap.c +++ b/imap.c @@ -617,8 +617,8 @@ static int imap_getauth(int sock, struct query *ctl, char *greeting) size_t rnl, pwl; rnl = 2 * strlen(ctl->remotename) + 1; pwl = 2 * strlen(ctl->password) + 1; - remotename = xmalloc(rnl); - password = xmalloc(pwl); + remotename = (char *)xmalloc(rnl); + password = (char *)xmalloc(pwl); imap_canonicalize(remotename, ctl->remotename, rnl); imap_canonicalize(password, ctl->password, pwl); diff --git a/interface.c b/interface.c index 70e99ba9..0b0d5791 100644 --- a/interface.c +++ b/interface.c @@ -418,7 +418,7 @@ get_ifinfo(const char *ifname, ifinfo_t *ifinfo) GT_("get_ifinfo: sysctl (iflist estimate) failed")); exit(1); } - if ((buf = malloc(needed)) == NULL) + if ((buf = (char *)malloc(needed)) == NULL) { report(stderr, GT_("get_ifinfo: malloc failed")); @@ -736,5 +736,5 @@ int interface_approve(struct hostdata *hp, flag domonitor) #endif /* CAN_MONITOR */ #ifndef have_interface_init -void interface_init(void) {}; +void interface_init(void) {} #endif diff --git a/pop3.c b/pop3.c index 561a4b59..14cfde82 100644 --- a/pop3.c +++ b/pop3.c @@ -687,7 +687,7 @@ static int pop3_getauth(int sock, struct query *ctl, char *greeting) } /* copy timestamp and password into digestion buffer */ - msg = xmalloc((end-start+1) + strlen(ctl->password) + 1); + msg = (char *)xmalloc((end-start+1) + strlen(ctl->password) + 1); strcpy(msg,start); strcat(msg,ctl->password); strcpy(ctl->digest, MD5Digest((unsigned char *)msg)); diff --git a/rcfile_l.l b/rcfile_l.l index 03a1e55c..f19360d1 100644 --- a/rcfile_l.l +++ b/rcfile_l.l @@ -55,7 +55,7 @@ int prc_lineno = 1; if ((size_t)yyleng + 1 > ins) { ins = yyleng + 1; - in = xrealloc(in, ins); + in = (char *)xrealloc(in, ins); } memcpy(in, yytext, yyleng); in[yyleng] = '\0'; diff --git a/rcfile_y.y b/rcfile_y.y index 7503bee0..cb9a262f 100644 --- a/rcfile_y.y +++ b/rcfile_y.y @@ -573,7 +573,7 @@ char *prependdir (const char *file, const char *dir) strcmp(file, "-") == 0 || /* stdin/stdout */ !dir[0]) /* we don't HAVE_GETCWD */ return xstrdup (file); - newfile = xmalloc (strlen (dir) + 1 + strlen (file) + 1); + newfile = (char *)xmalloc (strlen (dir) + 1 + strlen (file) + 1); if (dir[strlen(dir) - 1] != '/') sprintf (newfile, "%s/%s", dir, file); else diff --git a/report.c b/report.c index 320e60be..17bd8f94 100644 --- a/report.c +++ b/report.c @@ -211,13 +211,13 @@ static void rep_ensuresize(void) { { partial_message_size_used = 0; partial_message_size = 2048; - partial_message = MALLOC (partial_message_size); + partial_message = (char *)MALLOC (partial_message_size); } else if (partial_message_size - partial_message_size_used < 1024) { partial_message_size += 2048; - partial_message = REALLOC (partial_message, partial_message_size); + partial_message = (char *)REALLOC (partial_message, partial_message_size); } } @@ -258,7 +258,7 @@ report_build (FILE *errfp, message, va_alist) } partial_message_size += 2048; - partial_message = REALLOC (partial_message, partial_message_size); + partial_message = (char *)REALLOC (partial_message, partial_message_size); } #else for ( ; ; ) @@ -326,7 +326,7 @@ report_complete (FILE *errfp, message, va_alist) } partial_message_size += 2048; - partial_message = REALLOC (partial_message, partial_message_size); + partial_message = (char *)REALLOC (partial_message, partial_message_size); } #else for ( ; ; ) diff --git a/rfc2047e.c b/rfc2047e.c index fd6ae2bc..87c9c5c5 100644 --- a/rfc2047e.c +++ b/rfc2047e.c @@ -52,7 +52,7 @@ static char *encode_words(char *const *words, int nwords, const char *charset) l += strlen(words[i]) * 3; /* worst case, encode everything */ l += (strlen(charset) + 8) * (l/60 + 1); - out = v = xmalloc(l); + out = v = (char *)xmalloc(l); t = stpcpy(out, "=?"); t = stpcpy(t, charset); t = stpcpy(t, "?Q?"); @@ -110,14 +110,14 @@ char *rfc2047e(const char *string, const char *charset) { r = string; while (*r) { l = strcspn(r, ws); - words[idx] = xmalloc(l+1); + words[idx] = (char *)xmalloc(l+1); memcpy(words[idx], r, l); words[idx][l] = '\0'; idx++; r += l; if (!*r) break; l = strspn(r, ws); - words[idx] = xmalloc(l+1); + words[idx] = (char *)xmalloc(l+1); memcpy(words[idx], r, l); words[idx][l] = '\0'; idx++; @@ -157,7 +157,7 @@ char *rfc2047e(const char *string, const char *charset) { /* phase 3: limit lengths */ minlen = strlen(charset) + 7; /* allocate ample memory */ - out = xmalloc(l + (l / (72 - minlen) + 1) * (minlen + 2) + 1); + out = (char *)xmalloc(l + (l / (72 - minlen) + 1) * (minlen + 2) + 1); if (count) t = stpcpy(out, words[0]); diff --git a/rfc822.c b/rfc822.c index 38ff48b7..345ced02 100644 --- a/rfc822.c +++ b/rfc822.c @@ -79,7 +79,7 @@ char *reply_hack( for (cp = buf; *cp; cp++) if (*cp == ',' || isspace((unsigned char)*cp)) addresscount++; - buf = xrealloc(buf, strlen(buf) + addresscount * (strlen(host) + 1) + 1); + buf = (char *)xrealloc(buf, strlen(buf) + addresscount * (strlen(host) + 1) + 1); #endif /* MAIN */ /* diff --git a/sink.c b/sink.c index 47a40427..09e9e7e3 100644 --- a/sink.c +++ b/sink.c @@ -1155,7 +1155,7 @@ static int open_mda_sink(struct query *ctl, struct msgblk *msg, sp += 2; } - after = xmalloc(length + 1); + after = (char *)xmalloc(length + 1); /* copy mda source string to after, while expanding %[sTF] */ for (dp = after, sp = before; (*dp = *sp); dp++, sp++) { diff --git a/socket.c b/socket.c index f0691b97..3a03a6eb 100644 --- a/socket.c +++ b/socket.c @@ -468,7 +468,7 @@ int SockRead(int sock, char *buf, int len) * We don't have a string to pass through * the strchr at this point yet */ newline = NULL; - } else if ((newline = memchr(bp, '\n', n)) != NULL) + } else if ((newline = (char *)memchr(bp, '\n', n)) != NULL) n = newline - bp + 1; /* Matthias Andree: SSL_read can return 0, in that case * we must call SSL_get_error to figure if there was @@ -638,7 +638,7 @@ static int SSL_verify_callback( int ok_return, X509_STORE_CTX *ctx, int strict ) /* RFC 2595 section 2.4: find a matching name * first find a match among alternative names */ - gens = X509_get_ext_d2i(x509_cert, NID_subject_alt_name, NULL, NULL); + gens = (STACK_OF(GENERAL_NAME) *)X509_get_ext_d2i(x509_cert, NID_subject_alt_name, NULL, NULL); if (gens) { int i, r; for (i = 0, r = sk_GENERAL_NAME_num(gens); i < r; ++i) { diff --git a/transact.c b/transact.c index 88a5aacf..7f3d8dc2 100644 --- a/transact.c +++ b/transact.c @@ -446,7 +446,7 @@ int readheaders(int sock, { char *line, *rline; - line = xmalloc(sizeof(buf)); + line = (char *)xmalloc(sizeof(buf)); linelen = 0; line[0] = '\0'; do { @@ -807,7 +807,7 @@ int readheaders(int sock, if (!msgblk.headers) { oldlen = linelen; - msgblk.headers = xmalloc(oldlen + 1); + msgblk.headers = (char *)xmalloc(oldlen + 1); (void) memcpy(msgblk.headers, line, linelen); msgblk.headers[oldlen] = '\0'; free(line); @@ -1300,7 +1300,7 @@ int readheaders(int sock, if (idp->val.status.mark == XMIT_RCPTBAD) errlen += strlen(idp->id) + 2; - errmsg = xmalloc(errlen + 3); + errmsg = (char *)xmalloc(errlen + 3); strcpy(errmsg, errhd); for (idp = msgblk.recipients; idp; idp = idp->next) if (idp->val.status.mark == XMIT_RCPTBAD) diff --git a/uid.c b/uid.c index a4164b44..fdc6f5da 100644 --- a/uid.c +++ b/uid.c @@ -619,7 +619,7 @@ void write_saved_lists(struct query *hostlist, const char *idfile) if (unlink(idfile) && errno != ENOENT) report(stderr, GT_("Error deleting %s: %s\n"), idfile, strerror(errno)); } else { - char *newnam = xmalloc(strlen(idfile) + 2); + char *newnam = (char *)xmalloc(strlen(idfile) + 2); strcpy(newnam, idfile); strcat(newnam, "_"); if (outlevel >= O_DEBUG) diff --git a/unmime.c b/unmime.c index a518da2c..1c0c8245 100644 --- a/unmime.c +++ b/unmime.c @@ -434,7 +434,7 @@ int MimeBodyType(char *hdrs, int WantDecode) if (p == NULL) p = NxtHdr + strlen(NxtHdr); xfree(CntType); - CntType = xmalloc(p-NxtHdr+1); + CntType = (char *)xmalloc(p-NxtHdr+1); strlcpy(CntType, NxtHdr, p-NxtHdr+1); HdrsFound++; } @@ -707,7 +707,7 @@ int main(int argc, char *argv[]) buf_p++; if ((unsigned)(buf_p - buffer) == BufSize) { /* Buffer is full! Get more room. */ - buffer = xrealloc(buffer, BufSize+BUFSIZE_INCREMENT); + buffer = (char *)xrealloc(buffer, BufSize+BUFSIZE_INCREMENT); buf_p = buffer + BufSize; BufSize += BUFSIZE_INCREMENT; } -- cgit v1.2.3