[PPL-devel] [GIT] ppl/ppl(master): The interface file shall contain declarations only.

Roberto Bagnara roberto.bagnara at bugseng.com
Sun Dec 21 22:30:40 CET 2014


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

Author: Roberto Bagnara <roberto.bagnara at bugseng.com>
Date:   Sun Dec 21 22:29:58 2014 +0100

The interface file shall contain declarations only.
Fixes violations of rule EP1.31 detected by ECLAIR.

---

 src/BDS_Status.cc         |   40 ++++++++++++++++++++++++++++++++++++++++
 src/BDS_Status_inlines.hh |   10 +++++-----
 src/Box_Status.cc         |   39 +++++++++++++++++++++++++++++++++++++++
 src/Box_Status_inlines.hh |    8 ++++----
 src/Makefile.am           |    3 +++
 src/Og_Status.cc          |   39 +++++++++++++++++++++++++++++++++++++++
 src/Og_Status_inlines.hh  |    8 ++++----
 7 files changed, 134 insertions(+), 13 deletions(-)

diff --git a/src/BDS_Status.cc b/src/BDS_Status.cc
new file mode 100644
index 0000000..81e979e
--- /dev/null
+++ b/src/BDS_Status.cc
@@ -0,0 +1,40 @@
+/* BD_Shape<T>::Status class implementation: data objects.
+   Copyright (C) 2001-2010 Roberto Bagnara <bagnara at cs.unipr.it>
+   Copyright (C) 2010-2014 BUGSENG srl (http://bugseng.com)
+
+This file is part of the Parma Polyhedra Library (PPL).
+
+The PPL is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+The PPL is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software Foundation,
+Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
+
+For the most up-to-date information see the Parma Polyhedra Library
+site: http://bugseng.com/products/ppl/ . */
+
+namespace Parma_Polyhedra_Library {
+
+namespace Implementation {
+
+namespace BD_Shapes {
+
+// These are the keywords that indicate the individual assertions.
+const char* zero_dim_univ = "ZE";
+const char* empty = "EM";
+const char* sp_closed = "SPC";
+const char* sp_reduced = "SPR";
+
+} // namespace BD_Shapes
+
+} // namespace Implementation
+
+} // namespace Parma_Polyhedra_Library
diff --git a/src/BDS_Status_inlines.hh b/src/BDS_Status_inlines.hh
index 8fade89..7a17cee 100644
--- a/src/BDS_Status_inlines.hh
+++ b/src/BDS_Status_inlines.hh
@@ -189,10 +189,10 @@ namespace Implementation {
 namespace BD_Shapes {
 
 // These are the keywords that indicate the individual assertions.
-const std::string zero_dim_univ = "ZE";
-const std::string empty = "EM";
-const std::string sp_closed = "SPC";
-const std::string sp_reduced = "SPR";
+extern const char* zero_dim_univ;
+extern const char* empty;
+extern const char* sp_closed;
+extern const char* sp_reduced;
 const char yes = '+';
 const char no = '-';
 const char separator = ' ';
@@ -205,7 +205,7 @@ const char separator = ' ';
   is on; it is set to <CODE>false</CODE> otherwise.
 */
 inline bool
-get_field(std::istream& s, const std::string& keyword, bool& positive) {
+get_field(std::istream& s, const char* keyword, bool& positive) {
   std::string str;
   if (!(s >> str)
       || (str[0] != yes && str[0] != no)
diff --git a/src/Box_Status.cc b/src/Box_Status.cc
new file mode 100644
index 0000000..b12709d
--- /dev/null
+++ b/src/Box_Status.cc
@@ -0,0 +1,39 @@
+/* Box<ITV>::Status class implementation: data objects.
+   Copyright (C) 2001-2010 Roberto Bagnara <bagnara at cs.unipr.it>
+   Copyright (C) 2010-2014 BUGSENG srl (http://bugseng.com)
+
+This file is part of the Parma Polyhedra Library (PPL).
+
+The PPL is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+The PPL is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software Foundation,
+Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
+
+For the most up-to-date information see the Parma Polyhedra Library
+site: http://bugseng.com/products/ppl/ . */
+
+namespace Parma_Polyhedra_Library {
+
+namespace Implementation {
+
+namespace Boxes {
+
+// These are the keywords that indicate the individual assertions.
+const char* empty_up_to_date = "EUP";
+const char* empty = "EM";
+const char* universe = "UN";
+
+} // namespace Boxes
+
+} // namespace Implementation
+
+} // namespace Parma_Polyhedra_Library
diff --git a/src/Box_Status_inlines.hh b/src/Box_Status_inlines.hh
index 99c6289..de06585 100644
--- a/src/Box_Status_inlines.hh
+++ b/src/Box_Status_inlines.hh
@@ -155,9 +155,9 @@ namespace Implementation {
 namespace Boxes {
 
 // These are the keywords that indicate the individual assertions.
-const std::string empty_up_to_date = "EUP";
-const std::string empty = "EM";
-const std::string universe = "UN";
+extern const char* empty_up_to_date;
+extern const char* empty;
+extern const char* universe;
 const char yes = '+';
 const char no = '-';
 const char separator = ' ';
@@ -170,7 +170,7 @@ const char separator = ' ';
   is on; it is set to <CODE>false</CODE> otherwise.
 */
 inline bool
-get_field(std::istream& s, const std::string& keyword, bool& positive) {
+get_field(std::istream& s, const char* keyword, bool& positive) {
   std::string str;
   if (!(s >> str)
       || (str[0] != yes && str[0] != no)
diff --git a/src/Makefile.am b/src/Makefile.am
index 963e58b..bcfb73b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -484,6 +484,9 @@ checked.cc \
 Checked_Number.cc \
 Float.cc \
 fpu-ia32.cc \
+BDS_Status.cc \
+Box_Status.cc \
+Og_Status.cc \
 Concrete_Expression.cc \
 Constraint.cc \
 Constraint_System.cc \
diff --git a/src/Og_Status.cc b/src/Og_Status.cc
new file mode 100644
index 0000000..b5314f6
--- /dev/null
+++ b/src/Og_Status.cc
@@ -0,0 +1,39 @@
+/* BD_Shape<T>::Status class implementation: data objects.
+   Copyright (C) 2001-2010 Roberto Bagnara <bagnara at cs.unipr.it>
+   Copyright (C) 2010-2014 BUGSENG srl (http://bugseng.com)
+
+This file is part of the Parma Polyhedra Library (PPL).
+
+The PPL is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+The PPL is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software Foundation,
+Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
+
+For the most up-to-date information see the Parma Polyhedra Library
+site: http://bugseng.com/products/ppl/ . */
+
+namespace Parma_Polyhedra_Library {
+
+namespace Implementation {
+
+namespace Octagonal_Shapes {
+
+// These are the keywords that indicate the individual assertions.
+const char* zero_dim_univ = "ZE";
+const char* empty = "EM";
+const char* strong_closed = "SC";
+
+} // namespace Octagonal_Shapes
+
+} // namespace Implementation
+
+} // namespace Parma_Polyhedra_Library
diff --git a/src/Og_Status_inlines.hh b/src/Og_Status_inlines.hh
index f29ce12..090947e 100644
--- a/src/Og_Status_inlines.hh
+++ b/src/Og_Status_inlines.hh
@@ -153,9 +153,9 @@ namespace Implementation {
 
 namespace Octagonal_Shapes {
 // These are the keywords that indicate the individual assertions.
-const std::string zero_dim_univ = "ZE";
-const std::string empty = "EM";
-const std::string strong_closed = "SC";
+extern const char* zero_dim_univ;
+extern const char* empty;
+extern const char* strong_closed;
 const char yes = '+';
 const char no = '-';
 const char separator = ' ';
@@ -168,7 +168,7 @@ const char separator = ' ';
   is on; it is set to <CODE>false</CODE> otherwise.
 */
 inline bool
-get_field(std::istream& s, const std::string& keyword, bool& positive) {
+get_field(std::istream& s, const char* keyword, bool& positive) {
   std::string str;
   if (!(s >> str)
       || (str[0] != yes && str[0] != no)




More information about the PPL-devel mailing list