From: Tom Kistner Date: Mon, 31 Aug 2009 21:14:50 +0000 (+0000) Subject: Fix compiler warnings, some of those not being harmless. Thanks Phil and David. Fixes... X-Git-Tag: exim-4_70_RC3~61 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=da5dfc3ab22a3189116ea5c78927e9884529c0c0;p=exim.git Fix compiler warnings, some of those not being harmless. Thanks Phil and David. Fixes #870 --- diff --git a/src/src/dkim.c b/src/src/dkim.c index 2a53f154f..63140e854 100644 --- a/src/src/dkim.c +++ b/src/src/dkim.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/dkim.c,v 1.2 2009/06/10 07:34:04 tom Exp $ */ +/* $Cambridge: exim/src/src/dkim.c,v 1.3 2009/08/31 21:14:50 tom Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -235,21 +235,33 @@ uschar *dkim_exim_expand_query(int what) { switch(what) { case DKIM_ALGO: - return dkim_cur_sig->algo? - (uschar *)(dkim_cur_sig->algo) - :dkim_exim_expand_defaults(what); + switch(dkim_cur_sig->algo) { + case PDKIM_ALGO_RSA_SHA1: + return US"rsa-sha1"; + case PDKIM_ALGO_RSA_SHA256: + default: + return US"rsa-sha256"; + } case DKIM_BODYLENGTH: return (dkim_cur_sig->bodylength >= 0)? (uschar *)string_sprintf(OFF_T_FMT,(LONGLONG_T)dkim_cur_sig->bodylength) :dkim_exim_expand_defaults(what); case DKIM_CANON_BODY: - return dkim_cur_sig->canon_body? - (uschar *)(dkim_cur_sig->canon_body) - :dkim_exim_expand_defaults(what); + switch(dkim_cur_sig->canon_body) { + case PDKIM_CANON_RELAXED: + return US"relaxed"; + case PDKIM_CANON_SIMPLE: + default: + return US"simple"; + } case DKIM_CANON_HEADERS: - return dkim_cur_sig->canon_headers? - (uschar *)(dkim_cur_sig->canon_headers) - :dkim_exim_expand_defaults(what); + switch(dkim_cur_sig->canon_headers) { + case PDKIM_CANON_RELAXED: + return US"relaxed"; + case PDKIM_CANON_SIMPLE: + default: + return US"simple"; + } case DKIM_COPIEDHEADERS: return dkim_cur_sig->copiedheaders? (uschar *)(dkim_cur_sig->copiedheaders) diff --git a/src/src/expand.c b/src/src/expand.c index 7d6d15041..943ec76ec 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/expand.c,v 1.99 2009/06/27 19:37:17 tom Exp $ */ +/* $Cambridge: exim/src/src/expand.c,v 1.100 2009/08/31 21:14:50 tom Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -1567,7 +1567,7 @@ while (last > first) #ifndef DISABLE_DKIM case vtype_dkim: - return dkim_exim_expand_query((int)var_table[middle].value); + return dkim_exim_expand_query((int)(long)var_table[middle].value); #endif }