[Crash-utility] sial.c's apigetctype

baiwd baiwd at cn.fujitsu.com
Thu Jan 10 09:01:12 UTC 2008


Hi:
      I found some codes like
      case TYPE_CODE_ENUM:    if(sial_is_enum(ctype))     goto match; break;
      I wonder that whether it would be better if these codes could be 
changed as
following:

Signed-off-by: Bai Weidong <baiwd at cn.fujitsu.com>

--- crash-4.0-4.12/extensions/sial.c    2007-12-13 02:48:09.000000000 +0800
+++ crash-4.0-4.12/extensions/sial.new.c        2008-01-10 16:47:15.000000000 +0800
@@ -155,10 +155,10 @@ apigetctype(int ctype, char *name, TYPE_
         if(sial_is_typedef(ctype) && v) goto match;
         switch(TYPE_CODE(type)) {
             case TYPE_CODE_TYPEDEF: case TYPE_CODE_INT:
-                                    if(sial_is_typedef(ctype))  goto match; break;
-            case TYPE_CODE_ENUM:    if(sial_is_enum(ctype))     goto match; break;
-            case TYPE_CODE_STRUCT:  if(sial_is_struct(ctype))   goto match; break;
-            case TYPE_CODE_UNION:   if(sial_is_union(ctype))    goto match; break;
+                                    if(sial_is_typedef(ctype))  goto match;
+            case TYPE_CODE_ENUM:    if(sial_is_enum(ctype))     goto match;
+            case TYPE_CODE_STRUCT:  if(sial_is_struct(ctype))   goto match;
+            case TYPE_CODE_UNION:   if(sial_is_union(ctype))    goto match;
         }
         sial_dbg_named(DBG_TYPE, name, 2, "Found but no match.\n");
     }

Best Regards
Bai Weidong




More information about the Crash-utility mailing list