Revision: 50331
          http://brlcad.svn.sourceforge.net/brlcad/?rev=50331&view=rev
Author:   n_reed
Date:     2012-04-26 20:26:01 +0000 (Thu, 26 Apr 2012)
Log Message:
-----------
add default switch cases as in SCL git b10a697, but avoid using abort if the 
error can be logged and/or returned

Modified Paths:
--------------
    brlcad/trunk/src/other/step/src/cleditor/STEPfile.cc
    brlcad/trunk/src/other/step/src/cleditor/STEPfile.h
    brlcad/trunk/src/other/step/src/clstepcore/STEPcomplex.cc
    brlcad/trunk/src/other/step/src/express/type.c
    brlcad/trunk/src/other/step/src/fedex_plus/classes.c
    brlcad/trunk/src/other/step/src/fedex_plus/classes_misc.c
    brlcad/trunk/src/other/step/src/fedex_plus/selects.c

Modified: brlcad/trunk/src/other/step/src/cleditor/STEPfile.cc
===================================================================
--- brlcad/trunk/src/other/step/src/cleditor/STEPfile.cc        2012-04-26 
20:24:55 UTC (rev 50330)
+++ brlcad/trunk/src/other/step/src/cleditor/STEPfile.cc        2012-04-26 
20:26:01 UTC (rev 50331)
@@ -1761,12 +1761,13 @@
         case VERSION_CURRENT:
         case VERSION_OLD:
         case VERSION_UNKNOWN:
-            valid_insts = ReadData2( *in2, useTechCor );
-            break;
-
         case WORKING_SESSION:
             valid_insts = ReadData2( *in2, useTechCor );
             break;
+        default:
+            _error.AppendToUserMsg( "STEPfile::AppendFile: STEP file version 
set to unrecognized value.\n" );
+            CloseInputFile( in2 );
+            return  SEVERITY_BUG;
     }
 
     //check for "ENDSEC;"

Modified: brlcad/trunk/src/other/step/src/cleditor/STEPfile.h
===================================================================
--- brlcad/trunk/src/other/step/src/cleditor/STEPfile.h 2012-04-26 20:24:55 UTC 
(rev 50330)
+++ brlcad/trunk/src/other/step/src/cleditor/STEPfile.h 2012-04-26 20:26:01 UTC 
(rev 50331)
@@ -33,12 +33,10 @@
 #define READ_INCOMPLETE  20
 
 enum  FileTypeCode {
-    TYPE_UNKNOWN    = -2,
     VERSION_OLD     = -1,
     VERSION_UNKNOWN =  0,
     VERSION_CURRENT =  1,
-    WORKING_SESSION =  2,
-    OLD_WORKING_SESSION =  3
+    WORKING_SESSION =  2
 };
 
 class STEPfile {

Modified: brlcad/trunk/src/other/step/src/clstepcore/STEPcomplex.cc
===================================================================
--- brlcad/trunk/src/other/step/src/clstepcore/STEPcomplex.cc   2012-04-26 
20:24:55 UTC (rev 50330)
+++ brlcad/trunk/src/other/step/src/clstepcore/STEPcomplex.cc   2012-04-26 
20:26:01 UTC (rev 50331)
@@ -498,6 +498,10 @@
                         a = new STEPattribute( *ad,  aggrD->CreateAggregate() 
);
                         break;
                     }
+                    default:
+                        _error.AppendToDetailMsg( "STEPcomplex::BuildAttrs: 
Found attribute of unknown type. Creating default attribute.\n" );
+                        _error.GreaterSeverity( SEVERITY_WARNING );
+                        a = new STEPattribute();
                 }
 
                 a -> set_null();

Modified: brlcad/trunk/src/other/step/src/express/type.c
===================================================================
--- brlcad/trunk/src/other/step/src/express/type.c      2012-04-26 20:24:55 UTC 
(rev 50330)
+++ brlcad/trunk/src/other/step/src/express/type.c      2012-04-26 20:26:01 UTC 
(rev 50331)
@@ -279,6 +279,8 @@
             return( ( tb->type == set_ ) ? true : TYPE_inherits_from( 
tb->base, e ) );
         case list_:
             return( ( tb->type == list_ ) ? true : TYPE_inherits_from( 
tb->base, e ) );
+        default:
+            break;
     }
     return ( tb->type == e );
 }

Modified: brlcad/trunk/src/other/step/src/fedex_plus/classes.c
===================================================================
--- brlcad/trunk/src/other/step/src/fedex_plus/classes.c        2012-04-26 
20:24:55 UTC (rev 50330)
+++ brlcad/trunk/src/other/step/src/fedex_plus/classes.c        2012-04-26 
20:26:01 UTC (rev 50331)
@@ -1882,6 +1882,8 @@
         case number_:
         case logical_:
             return 1;
+        default:
+            break;
     }
     return 0;
 }

Modified: brlcad/trunk/src/other/step/src/fedex_plus/classes_misc.c
===================================================================
--- brlcad/trunk/src/other/step/src/fedex_plus/classes_misc.c   2012-04-26 
20:24:55 UTC (rev 50330)
+++ brlcad/trunk/src/other/step/src/fedex_plus/classes_misc.c   2012-04-26 
20:26:01 UTC (rev 50331)
@@ -693,6 +693,10 @@
         case number_:
         case generic_:
             return "TypeDescriptor";
+        default:
+            fprintf(stderr, "GetTypeDescriptor: can't handle unknown type 
%d\n",
+                    TYPEget_body(t)->type);
+            abort();
     }
 }
 

Modified: brlcad/trunk/src/other/step/src/fedex_plus/selects.c
===================================================================
--- brlcad/trunk/src/other/step/src/fedex_plus/selects.c        2012-04-26 
20:24:55 UTC (rev 50330)
+++ brlcad/trunk/src/other/step/src/fedex_plus/selects.c        2012-04-26 
20:26:01 UTC (rev 50331)
@@ -428,6 +428,10 @@
         case number_:
             tvec[tnumber]++;
             break;
+        default:
+            fprintf(stderr, "non_unique_types_vector: can't handle unknow type 
%d\n",
+                    TYPEget_body( t )->type);
+            abort();
     }
     LISTod;
 }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to