summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scilab/modules/boolean/sci_gateway/cpp/sci_bool2s.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/scilab/modules/boolean/sci_gateway/cpp/sci_bool2s.cpp b/scilab/modules/boolean/sci_gateway/cpp/sci_bool2s.cpp
index dc78b12..5150ac5 100644
--- a/scilab/modules/boolean/sci_gateway/cpp/sci_bool2s.cpp
+++ b/scilab/modules/boolean/sci_gateway/cpp/sci_bool2s.cpp
@@ -52,7 +52,8 @@ types::Function::ReturnValue sci_bool2s(types::typed_list &in, int _iRetCount, t
52 double* pdblIn = pIn->get(); 52 double* pdblIn = pIn->get();
53 double* pdblOut = pD->get(); 53 double* pdblOut = pD->get();
54 54
55 for (int i = 0 ; i < pIn->getSize() ; i++) 55 int iSize = pIn->getSize();
56 for (int i = 0 ; i < iSize ; i++)
56 { 57 {
57 pdblOut[i] = static_cast<double>(pdblIn[i] != 0); 58 pdblOut[i] = static_cast<double>(pdblIn[i] != 0);
58 } 59 }
@@ -66,7 +67,8 @@ types::Function::ReturnValue sci_bool2s(types::typed_list &in, int _iRetCount, t
66 int* piIn = pIn->get(); 67 int* piIn = pIn->get();
67 double* pdblOut = pD->get(); 68 double* pdblOut = pD->get();
68 69
69 for (int i = 0 ; i < pIn->getSize() ; i++) 70 int iSize = pIn->getSize();
71 for (int i = 0 ; i < iSize ; i++)
70 { 72 {
71 pdblOut[i] = static_cast<double>(piIn[i]); 73 pdblOut[i] = static_cast<double>(piIn[i]);
72 } 74 }