OSDN Git Service

Make compile quiet phase 2
authorKyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Fri, 10 Apr 2015 06:27:08 +0000 (15:27 +0900)
committerKyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Fri, 10 Apr 2015 06:27:08 +0000 (15:27 +0900)
MacOS X Maverics and later offers only LLVM compiler (clang) and it
warns for implicit type conversions between enums. This program uses
some enum types for a member in the same struct type but they cannot
be merged because one of them is defined in PostgreSQL. The situation
is safe as long as an enumeration and a word table are in one-to-one
correspondence so I decided to change the type of the member to
integer. This change make the commit
78415c006cd24f41d722a41014c526b43731968f useless so it is reverted
along with this commit.

Reported by Fujii Masao.

pgsp_json_int.h
pgsp_json_text.c

index eeaa0af..61d780a 100644 (file)
@@ -107,7 +107,7 @@ typedef enum
 
 typedef struct
 {
-       pgsp_prop_tags tag;             /* Tag to identify words */
+       int       tag;                          /* Tag to identify words */
        char *shortname;                /* Property name for short-style JSON */
        char *longname;                 /* Property name for long(normal)-style JSON */
        char *textname;                 /* Property name for Text representation */
index be54e8c..454c49a 100644 (file)
@@ -86,14 +86,9 @@ SETTERDECL(strategy)
                        break;
 
                case T_SetOp:
-                       switch (p->tag)
-                       {
-                               case S_Hashed:
-                                       vals->node_type = "HashSetOp";
-                                       break;
-                               default:
-                                       break;
-                       }
+                       if (p->tag == S_Hashed)
+                               vals->node_type = "HashSetOp";
+                       break;
 
                default:
                        break;