Xcos MVC: fix includes 72/16172/6
Paul Bignier [Wed, 18 Mar 2015 12:45:00 +0000 (13:45 +0100)]
 * Added "utilities.hxx" to all files using 'ScicosID'
 * Added "charEncoding.h" to all files calling 'wide_string_to_UTF8'
 * Also fixed a compilation warning in scicos_log.cpp (unsigned int comparison with 0)

Change-Id: I86e8850eb9d5176f2c4554f7988a4510eec3796e

31 files changed:
scilab/modules/scicos/includes/Controller.hxx
scilab/modules/scicos/sci_gateway/cpp/sci_buildouttb.cpp
scilab/modules/scicos/sci_gateway/cpp/sci_scicos_log.cpp
scilab/modules/scicos/sci_gateway/cpp/sci_scicosim.cpp
scilab/modules/scicos/src/cpp/Controller.cpp
scilab/modules/scicos/src/cpp/LoggerView.cpp
scilab/modules/scicos/src/cpp/LoggerView.hxx
scilab/modules/scicos/src/cpp/Model.cpp
scilab/modules/scicos/src/cpp/model/Annotation.hxx
scilab/modules/scicos/src/cpp/model/Block.hxx
scilab/modules/scicos/src/cpp/model/Diagram.hxx
scilab/modules/scicos/src/cpp/model/Link.hxx
scilab/modules/scicos/src/cpp/model/Port.hxx
scilab/modules/scicos/src/cpp/var2vec.cpp
scilab/modules/scicos/src/cpp/view_scilab/Adapters.hxx
scilab/modules/scicos/src/cpp/view_scilab/BaseAdapter.hxx
scilab/modules/scicos/src/cpp/view_scilab/BlockAdapter.cpp
scilab/modules/scicos/src/cpp/view_scilab/BlockAdapter.hxx
scilab/modules/scicos/src/cpp/view_scilab/CprAdapter.hxx
scilab/modules/scicos/src/cpp/view_scilab/DiagramAdapter.cpp
scilab/modules/scicos/src/cpp/view_scilab/DiagramAdapter.hxx
scilab/modules/scicos/src/cpp/view_scilab/GraphicsAdapter.cpp
scilab/modules/scicos/src/cpp/view_scilab/GraphicsAdapter.hxx
scilab/modules/scicos/src/cpp/view_scilab/LinkAdapter.hxx
scilab/modules/scicos/src/cpp/view_scilab/ParamsAdapter.cpp
scilab/modules/scicos/src/cpp/view_scilab/ParamsAdapter.hxx
scilab/modules/scicos/src/cpp/view_scilab/ScsAdapter.hxx
scilab/modules/scicos/src/cpp/view_scilab/StateAdapter.hxx
scilab/modules/scicos/src/cpp/view_scilab/TextAdapter.cpp
scilab/modules/scicos/src/cpp/view_scilab/TextAdapter.hxx
scilab/modules/scicos/src/cpp/view_scilab/ports_management.hxx

index 4667a36..7e6fff0 100644 (file)
@@ -13,6 +13,7 @@
 #ifndef CONTROLLER_HXX_
 #define CONTROLLER_HXX_
 
+#include <string>
 #include <vector>
 #include <map>
 
index 7139dbe..66b25b1 100644 (file)
@@ -10,6 +10,7 @@
  *
  */
 
+#include <cstring>
 #include <string>
 #include <algorithm>
 
@@ -23,8 +24,6 @@
 
 extern "C"
 {
-#include <string.h>
-
 #include "localization.h"
 #include "Scierror.h"
 }
index 5860f26..a9c9e1b 100644 (file)
@@ -49,7 +49,7 @@ LoggerView* get_or_allocate_logger()
 
 types::Function::ReturnValue sci_scicos_log(types::typed_list &in, int _iRetCount, types::typed_list &out)
 {
-    if (!(0 <= in.size() && in.size() <= 2))
+    if (in.size() > 2)
     {
         Scierror(999, _("%s: Wrong number of input arguments: %d to %d expected.\n"), funame.data(), 0, 2);
         return types::Function::Error;
index b8f78e9..5af66da 100644 (file)
@@ -38,6 +38,7 @@ extern "C"
 #include "sci_malloc.h"
 #include "scicos.h" /* funnum2() */
 #include "scicos-def.h"
+#include "charEncoding.h"
 
 #include "localization.h"
 #include "Scierror.h"
index 30bafa1..aef2c39 100644 (file)
@@ -15,7 +15,9 @@
 #include <map>
 #include <utility>
 #include <algorithm>
+#include <iterator>
 
+#include "utilities.hxx"
 
 #define REF_DEBUG 0
 #if REF_DEBUG
index 3020815..17550a3 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <iostream>
 #include <sstream>
+#include <string>
 #include <cwchar>
 
 #include "scilabWrite.hxx"
index 610d914..abc0520 100644 (file)
 #ifndef LOGGERVIEW_HXX_
 #define LOGGERVIEW_HXX_
 
+#include <cwchar>
 #include <sstream>
 #include "View.hxx"
+#include "utilities.hxx"
 
 namespace org_scilab_modules_scicos
 {
index 881758e..4dc5184 100644 (file)
@@ -11,6 +11,7 @@
  */
 
 #include <string>
+#include <vector>
 #include <utility>
 #include <algorithm>
 
index 7884e32..dad6b0e 100644 (file)
@@ -16,6 +16,7 @@
 #include <string>
 #include <vector>
 
+#include "utilities.hxx"
 #include "Model.hxx"
 #include "model/BaseObject.hxx"
 
index 2e4366a..40c390f 100644 (file)
@@ -16,6 +16,7 @@
 #include <string>
 #include <vector>
 
+#include "utilities.hxx"
 #include "Model.hxx"
 #include "model/BaseObject.hxx"
 
index fe94143..1cb3e1d 100644 (file)
@@ -16,6 +16,7 @@
 #include <string>
 #include <vector>
 
+#include "utilities.hxx"
 #include "Model.hxx"
 #include "model/BaseObject.hxx"
 
index e2df126..a6caf80 100644 (file)
@@ -16,6 +16,7 @@
 #include <string>
 #include <vector>
 
+#include "utilities.hxx"
 #include "Model.hxx"
 #include "model/BaseObject.hxx"
 
index bfa2d47..f6bd13e 100644 (file)
@@ -16,6 +16,7 @@
 #include <string>
 #include <vector>
 
+#include "utilities.hxx"
 #include "Model.hxx"
 #include "model/BaseObject.hxx"
 
index 9219902..2ed990d 100644 (file)
@@ -30,6 +30,7 @@
 
 extern "C"
 {
+#include "charEncoding.h"
 #include "Scierror.h"
 #include "localization.h"
 }
index b297266..9f5984a 100644 (file)
@@ -10,8 +10,8 @@
  *
  */
 
-#ifndef ADAPTERS_H_
-#define ADAPTERS_H_
+#ifndef ADAPTERS_HXX_
+#define ADAPTERS_HXX_
 
 #include <vector>
 #include <string>
@@ -79,4 +79,4 @@ private:
 } /* namespace view_scilab */
 } /* namespace org_scilab_modules_scicos */
 
-#endif /* ADAPTERS_H_ */
+#endif /* ADAPTERS_HXX_ */
index 579be80..9a96a59 100644 (file)
@@ -30,6 +30,7 @@
 #include "overload.hxx"
 #include "scilabexception.hxx"
 
+#include "utilities.hxx"
 #include "Controller.hxx"
 #include "Adapters.hxx"
 #include "model/BaseObject.hxx"
index d4733f2..c7ddebc 100644 (file)
@@ -20,7 +20,6 @@
 #include "mlist.hxx"
 #include "string.hxx"
 #include "types.hxx"
-#include "user.hxx"
 
 #include "utilities.hxx"
 #include "adapters_utilities.hxx"
@@ -66,10 +65,10 @@ struct model
     static types::InternalType* get(const BlockAdapter& adaptor, const Controller& controller)
     {
         ModelAdapter localAdaptor(controller, controller.referenceObject(adaptor.getAdaptee()), adaptor.getDiagram());
-        types::InternalType* tlist = localAdaptor.getAsTList(new types::MList(), controller)->getAs<types::MList>();
+        types::InternalType* mlist = localAdaptor.getAsTList(new types::MList(), controller)->getAs<types::MList>();
 
         const_cast<BlockAdapter&>(adaptor).setDiagram(localAdaptor.getDiagram());
-        return tlist;
+        return mlist;
     }
 
     static bool set(BlockAdapter& adaptor, types::InternalType* v, Controller& controller)
index 0ce6012..08520e6 100644 (file)
@@ -15,7 +15,8 @@
 
 #include <string>
 
-#include "utilities.hxx"
+#include "internal.hxx"
+
 #include "BaseAdapter.hxx"
 #include "DiagramAdapter.hxx"
 #include "model/Block.hxx"
index 537c156..8ff6ab5 100644 (file)
@@ -16,7 +16,6 @@
 #include <string>
 
 #include "BaseAdapter.hxx"
-
 #include "model/Diagram.hxx"
 
 namespace org_scilab_modules_scicos
index d9a5113..59643dc 100644 (file)
@@ -14,7 +14,6 @@
 #include <vector>
 #include <sstream>
 #include <algorithm>
-#include <iterator>
 
 #include "internal.hxx"
 #include "double.hxx"
index b134e46..3de9a44 100644 (file)
@@ -16,9 +16,9 @@
 #include <string>
 #include <vector>
 
+#include "internal.hxx"
 #include "list.hxx"
 
-#include "utilities.hxx"
 #include "adapters_utilities.hxx"
 #include "BaseAdapter.hxx"
 #include "model/Diagram.hxx"
index 2a8b9f0..c4b84d6 100644 (file)
@@ -21,6 +21,7 @@
 #include "double.hxx"
 #include "string.hxx"
 
+#include "utilities.hxx"
 #include "Controller.hxx"
 #include "GraphicsAdapter.hxx"
 #include "ports_management.hxx"
index 4842f5a..2619b3b 100644 (file)
 
 #include <string>
 
-#include "utilities.hxx"
 #include "adapters_utilities.hxx"
 #include "BaseAdapter.hxx"
-
 #include "model/Link.hxx"
 
 namespace org_scilab_modules_scicos
index 436151f..001fc13 100644 (file)
@@ -19,6 +19,7 @@
 #include "list.hxx"
 #include "tlist.hxx"
 
+#include "utilities.hxx"
 #include "Controller.hxx"
 #include "ParamsAdapter.hxx"
 
index f794377..7b6cbc3 100644 (file)
@@ -15,8 +15,9 @@
 
 #include <string>
 
-#include "BaseAdapter.hxx"
+#include "internal.hxx"
 
+#include "BaseAdapter.hxx"
 #include "model/Diagram.hxx"
 
 namespace org_scilab_modules_scicos
index 328ec81..54c9724 100644 (file)
@@ -16,7 +16,6 @@
 #include <string>
 
 #include "BaseAdapter.hxx"
-
 #include "model/Diagram.hxx"
 
 namespace org_scilab_modules_scicos
index 3657877..4349aee 100644 (file)
@@ -16,7 +16,6 @@
 #include <string>
 
 #include "BaseAdapter.hxx"
-
 #include "model/Diagram.hxx"
 
 namespace org_scilab_modules_scicos
index 6f373fb..7919a57 100644 (file)
@@ -18,6 +18,7 @@
 #include "mlist.hxx"
 #include "internal.hxx"
 
+#include "utilities.hxx"
 #include "Controller.hxx"
 #include "TextAdapter.hxx"
 
index 2405d2b..8e93ca7 100644 (file)
@@ -15,9 +15,6 @@
 
 #include <string>
 
-#include "internal.hxx"
-
-#include "utilities.hxx"
 #include "BaseAdapter.hxx"
 #include "model/Annotation.hxx"
 
index 12cbf98..805cc53 100644 (file)
 #ifndef PORTS_MANAGEMENT_HXX_
 #define PORTS_MANAGEMENT_HXX_
 
+#include <cmath>
+
 #include <deque>
 #include <string>
 #include <vector>
 #include <algorithm>
+#include <iterator>
 
 #include "internal.hxx"
 #include "bool.hxx"
@@ -79,10 +82,10 @@ types::InternalType* get_ports_property(const Adaptor& adaptor, const object_pro
                 return new types::Double(1);
             }
             datatypeIndex++;
-        // no break
+            // no break
         case DATATYPE_COLS:
             datatypeIndex++;
-        // no break
+            // no break
         case DATATYPE_ROWS:
         {
             datatypeIndex++;
@@ -273,10 +276,10 @@ bool set_ports_property(const Adaptor& adaptor, const object_properties_t port_k
 
             case DATATYPE_TYPE:
                 datatypeIndex++;
-            // no break
+                // no break
             case DATATYPE_COLS:
                 datatypeIndex++;
-            // no break
+                // no break
             case DATATYPE_ROWS:
             {
                 datatypeIndex++;
@@ -427,10 +430,10 @@ inline bool updateNewPort(const ScicosID oldPort, int newPort, Controller& contr
         {
             case DATATYPE_TYPE:
                 datatypeIndex++;
-            // no break
+                // no break
             case DATATYPE_COLS:
                 datatypeIndex++;
-            // no break
+                // no break
             case DATATYPE_ROWS:
             {
                 datatypeIndex++;
@@ -477,10 +480,10 @@ inline bool addNewPort(const ScicosID newPortID, int newPort, const std::vector<
         {
             case DATATYPE_TYPE:
                 datatypeIndex++;
-            // no break
+                // no break
             case DATATYPE_COLS:
                 datatypeIndex++;
-            // no break
+                // no break
             case DATATYPE_ROWS:
             {
                 datatypeIndex++;
@@ -634,7 +637,7 @@ bool update_ports_property(const Adaptor& adaptor, const object_properties_t por
     // remove objects from the model after de-association
     if (parentDiagram != 0)
     {
-        for (const ScicosID& id : children)
+        for (const ScicosID & id : children)
         {
             controller.referenceObject(id);
         }