[exim-cvs] cvs commit: exim/exim-src/src dkim.c expand.c

Top Page
Delete this message
Reply to this message
Author: Tom Kistner
Date:  
To: exim-cvs
Subject: [exim-cvs] cvs commit: exim/exim-src/src dkim.c expand.c
tom 2009/08/31 22:14:51 BST

  Modified files:
    exim-src/src         dkim.c expand.c 
  Log:
  Fix compiler warnings, some of those not being harmless. Thanks Phil and David. Fixes #870


  Revision  Changes    Path
  1.3       +21 -9     exim/exim-src/src/dkim.c
  1.100     +1 -1      exim/exim-src/src/expand.c


  Index: dkim.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/dkim.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- dkim.c    10 Jun 2009 07:34:04 -0000    1.2
  +++ dkim.c    31 Aug 2009 21:14:50 -0000    1.3
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/dkim.c,v 1.2 2009/06/10 07:34:04 tom Exp $ */
  +/* $Cambridge: exim/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 @@


     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)


  Index: expand.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/expand.c,v
  retrieving revision 1.99
  retrieving revision 1.100
  diff -u -r1.99 -r1.100
  --- expand.c    27 Jun 2009 19:37:17 -0000    1.99
  +++ expand.c    31 Aug 2009 21:14:50 -0000    1.100
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/expand.c,v 1.99 2009/06/27 19:37:17 tom Exp $ */
  +/* $Cambridge: exim/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 @@


       #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


       }