[PPL-devel] [GIT] ppl/ppl(master): Avoid the `unexpected' identifier.

Roberto Bagnara roberto.bagnara at bugseng.com
Sun Dec 14 16:19:36 CET 2014


Module: ppl/ppl
Branch: master
Commit: 02d0ea73daf86b970a879e84b16c08a4281842c2
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=02d0ea73daf86b970a879e84b16c08a4281842c2

Author: Roberto Bagnara <roberto.bagnara at bugseng.com>
Date:   Sun Dec 14 15:54:42 2014 +0100

Avoid the `unexpected' identifier.
The C++ standard, ISO/IEC 14882:2003(E), reserves it for header <exception>.

---

 src/Interval_templates.hh |    6 +++---
 src/checked.cc            |   26 +++++++++++++-------------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/Interval_templates.hh b/src/Interval_templates.hh
index 2c9b0f9..319ced5 100644
--- a/src/Interval_templates.hh
+++ b/src/Interval_templates.hh
@@ -277,7 +277,7 @@ operator>>(std::istream& is, Interval<Boundary, Info>& x) {
     }
   }
   else {
-    goto unexpected;
+    goto unexpected_char;
   }
 
   // Get the lower bound.
@@ -294,7 +294,7 @@ operator>>(std::istream& is, Interval<Boundary, Info>& x) {
     }
   } while (is_space(c));
   if (c != ',') {
-    goto unexpected;
+    goto unexpected_char;
   }
 
   // Get the upper bound.
@@ -314,7 +314,7 @@ operator>>(std::istream& is, Interval<Boundary, Info>& x) {
     upper_open = true;
   }
   else if (c != ']') {
-  unexpected:
+  unexpected_char:
     is.unget();
   fail:
     is.setstate(std::ios::failbit);
diff --git a/src/checked.cc b/src/checked.cc
index 45785b8..270c598 100644
--- a/src/checked.cc
+++ b/src/checked.cc
@@ -179,13 +179,13 @@ parse_number_part(std::istream& is, number_struct& numer) {
       return V_CVT_STR_UNK;
     }
     if (c != 'a' && c != 'A') {
-      goto unexpected;
+      goto unexpected_char;
     }
     if (!is.get(c)) {
       return V_CVT_STR_UNK;
     }
     if (c != 'n' && c != 'N') {
-      goto unexpected;
+      goto unexpected_char;
     }
     return V_NAN;
   inf:
@@ -195,19 +195,19 @@ parse_number_part(std::istream& is, number_struct& numer) {
       return V_CVT_STR_UNK;
     }
     if (c != 'n' && c != 'n') {
-      goto unexpected;
+      goto unexpected_char;
     }
     if (!is.get(c)) {
       return V_CVT_STR_UNK;
     }
     if (c != 'f' && c != 'F') {
-      goto unexpected;
+      goto unexpected_char;
     }
     return numer.neg_mantissa ? V_EQ_MINUS_INFINITY : V_EQ_PLUS_INFINITY;
   }
   if (state != FRACTIONAL) {
     if (get_digit(c, 10) < 0) {
-      goto unexpected;
+      goto unexpected_char;
     }
     char d;
     if (c == '0' && !is.get(d).fail()) {
@@ -239,18 +239,18 @@ parse_number_part(std::istream& is, number_struct& numer) {
           return V_CVT_STR_UNK;
         }
         if (c != '^') {
-          goto unexpected;
+          goto unexpected_char;
         }
         numer.base = 0;
         for (std::string::const_iterator
                i = numer.mantissa.begin(); i != numer.mantissa.end(); ++i) {
           numer.base = numer.base * 10 + static_cast<unsigned>(get_digit(*i, 10));
           if (numer.base > 36) {
-            goto unexpected;
+            goto unexpected_char;
           }
         }
         if (numer.base < 2) {
-          goto unexpected;
+          goto unexpected_char;
         }
         numer.base_for_exponent = numer.base;
         numer.mantissa.erase();
@@ -284,7 +284,7 @@ parse_number_part(std::istream& is, number_struct& numer) {
       }
     fractional:
       if (empty_mantissa) {
-        goto unexpected;
+        goto unexpected_char;
       }
       if (c == 'e' || c == 'E') {
         goto exp;
@@ -296,7 +296,7 @@ parse_number_part(std::istream& is, number_struct& numer) {
           goto exp;
         }
         else {
-          goto unexpected;
+          goto unexpected_char;
         }
       }
       if (c == '*') {
@@ -304,7 +304,7 @@ parse_number_part(std::istream& is, number_struct& numer) {
           return V_CVT_STR_UNK;
         }
         if (c != '^') {
-          goto unexpected;
+          goto unexpected_char;
         }
       exp:
         state = EXPONENT;
@@ -338,7 +338,7 @@ parse_number_part(std::istream& is, number_struct& numer) {
         break;
       }
       if (empty_exponent) {
-        goto unexpected;
+        goto unexpected_char;
       }
       is.unget();
       goto ok;
@@ -371,7 +371,7 @@ parse_number_part(std::istream& is, number_struct& numer) {
     return V_EQ;
   }
 
- unexpected:
+ unexpected_char:
   is.unget();
   return V_CVT_STR_UNK;
 }




More information about the PPL-devel mailing list