diff options
author | Jia Zhang <qianyue.zj@alibaba-inc.com> | 2017-10-28 02:14:01 -0400 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2017-10-28 14:42:40 +0200 |
commit | 038d1385d424bafab4c6e5e8305b6ed3121ef4e9 (patch) | |
tree | aa9b058c43fbf83fbd93a841c3fe3ed6cf99a816 | |
parent | 33a9adc3a26269f5e592eae88d718b730162d868 (diff) | |
download | gnulib-038d1385d424bafab4c6e5e8305b6ed3121ef4e9.tar.gz |
gc-libgcrypt: fix undefined enum type in switch statement
Resolve the following build failure:
lib/gc-libgcrypt.c: In function 'gc_hash_open':
lib/gc-libgcrypt.c:317:5: error: case value '0' not in enumerated type
'Gc_hash_mode {aka enum Gc_hash_mode}' [-Werror=switch]
case 0:
^~~~
* lib/gc.h (enum Gc_hash_mode): Add value GC_NULL.
* lib/gc-libgcrypt.c (gc_hash_open): Use this enum value instead of 0.
Signed-off-by: Jia Zhang <qianyue.zj@alibaba-inc.com>
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | lib/gc-libgcrypt.c | 2 | ||||
-rw-r--r-- | lib/gc.h | 3 |
3 files changed, 15 insertions, 2 deletions
@@ -1,5 +1,17 @@ 2017-10-28 Jia Zhang <qianyue.zj@alibaba-inc.com> + gc-libgcrypt: fix undefined enum type in switch statement + Resolve the following build failure: + lib/gc-libgcrypt.c: In function 'gc_hash_open': + lib/gc-libgcrypt.c:317:5: error: case value '0' not in enumerated type + 'Gc_hash_mode {aka enum Gc_hash_mode}' [-Werror=switch] + case 0: + ^~~~ + * lib/gc.h (enum Gc_hash_mode): Add value GC_NULL. + * lib/gc-libgcrypt.c (gc_hash_open): Use this enum value instead of 0. + +2017-10-28 Jia Zhang <qianyue.zj@alibaba-inc.com> + gc-libgcrypt: fix assignment error due to -Werror=pointer-sign Resolve the following build failure: lib/gc-libgcrypt.c: In function 'gc_hash_read': diff --git a/lib/gc-libgcrypt.c b/lib/gc-libgcrypt.c index 968b599926..f0c8d82293 100644 --- a/lib/gc-libgcrypt.c +++ b/lib/gc-libgcrypt.c @@ -310,7 +310,7 @@ gc_hash_open (Gc_hash hash, Gc_hash_mode mode, gc_hash_handle * outhandle) switch (mode) { - case 0: + case GC_NULL: gcrymode = 0; break; @@ -53,7 +53,8 @@ typedef enum Gc_hash Gc_hash; enum Gc_hash_mode { - GC_HMAC = 1 + GC_NULL, + GC_HMAC }; typedef enum Gc_hash_mode Gc_hash_mode; |