changeset 38905:ac63ea1b1a28

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>
author Jia Zhang <qianyue.zj@alibaba-inc.com>
date Sat, 28 Oct 2017 02:14:01 -0400
parents 46445583d1fb
children 65b2e926ad93
files ChangeLog lib/gc-libgcrypt.c lib/gc.h
diffstat 3 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Oct 28 02:16:08 2017 -0400
+++ b/ChangeLog	Sat Oct 28 02:14:01 2017 -0400
@@ -1,3 +1,15 @@
+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
--- a/lib/gc-libgcrypt.c	Sat Oct 28 02:16:08 2017 -0400
+++ b/lib/gc-libgcrypt.c	Sat Oct 28 02:14:01 2017 -0400
@@ -310,7 +310,7 @@
 
   switch (mode)
     {
-    case 0:
+    case GC_NULL:
       gcrymode = 0;
       break;
 
--- a/lib/gc.h	Sat Oct 28 02:16:08 2017 -0400
+++ b/lib/gc.h	Sat Oct 28 02:14:01 2017 -0400
@@ -53,7 +53,8 @@
 
 enum Gc_hash_mode
 {
-  GC_HMAC = 1
+  GC_NULL,
+  GC_HMAC
 };
 typedef enum Gc_hash_mode Gc_hash_mode;