]> git.mxchange.org Git - flightgear.git/commitdiff
Print an error message before terminating on parse errors.
authorandy <andy>
Fri, 15 Mar 2002 19:02:07 +0000 (19:02 +0000)
committerandy <andy>
Fri, 15 Mar 2002 19:02:07 +0000 (19:02 +0000)
src/FDM/YASim/FGFDM.cpp

index 4fa0cee11c3c1ea3bf604ac6b96a2933b0fd8c46..dc34a075955c8f25abf1f7d37ee0a7c406c6c583 100644 (file)
@@ -275,7 +275,9 @@ void FGFDM::startElement(const char* name, const XMLAttributes &atts)
         
         cm->setTransitionTime(handle, time);
     } else {
-       *(int*)0=0; // unexpected tag, boom
+        SG_LOG(SG_FLIGHT,SG_ALERT,"Unexpected tag '"
+               << name << "' found in YASim aircraft description");
+        exit(1);
     }
 }
 
@@ -493,7 +495,10 @@ int FGFDM::parseOutput(const char* name)
     if(eq(name, "FLAP1"))     return ControlMap::FLAP1;
     if(eq(name, "SLAT"))      return ControlMap::SLAT;
     if(eq(name, "SPOILER"))   return ControlMap::SPOILER;
-    *(int*)0=0;
+    SG_LOG(SG_FLIGHT,SG_ALERT,"Unrecognized control type '"
+           << name << "' in YASim aircraft description.");
+    exit(1);
+
 }
 
 void FGFDM::parseWeight(XMLAttributes* a)
@@ -532,7 +537,11 @@ char* FGFDM::dup(const char* s)
 
 int FGFDM::attri(XMLAttributes* atts, char* attr)
 {
-    if(!atts->hasAttribute(attr)) *(int*)0=0; // boom
+    if(!atts->hasAttribute(attr)) {
+        SG_LOG(SG_FLIGHT,SG_ALERT,"Missing '" << attr <<
+               "' in YASim aircraft description");
+        exit(1);
+    }
     return attri(atts, attr, 0);
 }
 
@@ -545,7 +554,11 @@ int FGFDM::attri(XMLAttributes* atts, char* attr, int def)
 
 float FGFDM::attrf(XMLAttributes* atts, char* attr)
 {
-    if(!atts->hasAttribute(attr)) *(int*)0=0; // boom
+    if(!atts->hasAttribute(attr)) {
+        SG_LOG(SG_FLIGHT,SG_ALERT,"Missing '" << attr <<
+               "' in YASim aircraft description");
+        exit(1);
+    }
     return attrf(atts, attr, 0);
 }