]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Compilation and run-time problems on Win32: mutex initialization, copy-paste errors
authorsan <san@opencascade.com>
Mon, 20 Mar 2006 13:48:07 +0000 (13:48 +0000)
committersan <san@opencascade.com>
Mon, 20 Mar 2006 13:48:07 +0000 (13:48 +0000)
src/Basics/BasicsGenericDestructor.cxx
src/SALOMEDS/SALOMEDS_AttributeTableOfInteger.cxx
src/SALOMEDS/SALOMEDS_AttributeTableOfReal.cxx
src/SALOMEDS/SALOMEDS_AttributeTarget.cxx
src/SALOMELocalTrace/BaseTraceCollector.cxx
src/SALOMELocalTrace/LocalTraceCollector.cxx

index 91585a2ae1d1a92b4162e9f6b4c195575bfcde75..aefed245c4b89db8ea4f6cace0d3eda36af97033 100644 (file)
@@ -37,7 +37,12 @@ using namespace std;
 void HouseKeeping();
 
 std::list<PROTECTED_DELETE*> PROTECTED_DELETE::_objList;
+#ifndef WNT
 pthread_mutex_t PROTECTED_DELETE::_listMutex;
+#else
+pthread_mutex_t PROTECTED_DELETE::_listMutex =
+  PTHREAD_MUTEX_INITIALIZER;
+#endif
 
 std::list<GENERIC_DESTRUCTOR*> *GENERIC_DESTRUCTOR::Destructors = 0;
 static bool atExitSingletonDone = false ;
index 4d8bb55464cebb0028226952e330dd135c3afab1..24f624ec711fdc9a4f55081ecb24e3eab44e3d62 100644 (file)
@@ -297,6 +297,7 @@ std::vector<int> SALOMEDS_AttributeTableOfInteger::GetRow(int theRow)
   }
   else {
     SALOMEDS::LongSeq_var aRow = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetRow(theRow);
+       aLength = aRow->length();
     for (i = 0; i < aLength; i++) aVector.push_back(aRow[i]);
   }
 
@@ -366,6 +367,7 @@ std::vector<int> SALOMEDS_AttributeTableOfInteger::GetColumn(int theColumn)
   }
   else {
     SALOMEDS::LongSeq_var aColumn = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetColumn(theColumn);
+       aLength = aColumn->length();
     for (i = 0; i < aLength; i++) aVector.push_back(aColumn[i]);
   }
   return aVector;
@@ -433,6 +435,7 @@ std::vector<int> SALOMEDS_AttributeTableOfInteger::GetRowSetIndices(int theRow)
   else {
     SALOMEDS::LongSeq_var aSet =
       SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetRowSetIndices(theRow);
+       aLength = aSet->length();
     for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
   }
   return aVector;
index bb7cf1f26a0772eef615f41afa0deb4dd086759d..5ba2401255fb68f130c275e5fac81f377134b11e 100644 (file)
@@ -296,6 +296,7 @@ std::vector<double> SALOMEDS_AttributeTableOfReal::GetRow(int theRow)
   }
   else {
     SALOMEDS::DoubleSeq_var aRow = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetRow(theRow);
+       aLength = aRow->length();
     for (i = 0; i < aLength; i++) aVector.push_back(aRow[i]);
   }
 
@@ -365,6 +366,7 @@ std::vector<double> SALOMEDS_AttributeTableOfReal::GetColumn(int theColumn)
   }
   else {
     SALOMEDS::DoubleSeq_var aColumn = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetColumn(theColumn);
+       aLength = aColumn->length();
     for (i = 0; i < aLength; i++) aVector.push_back(aColumn[i]);
   }
   return aVector;
@@ -430,6 +432,7 @@ std::vector<int> SALOMEDS_AttributeTableOfReal::GetRowSetIndices(int theRow)
   }
   else {
     SALOMEDS::LongSeq_var aSet = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetRowSetIndices(theRow);
+       aLength = aSet->length();
     for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
   }
   return aVector;
index 8511dac238ce4415efa33435b3348d1f8d8b00fd..e0162cdfb6cc99e49c69f74dfebea97ad723d567 100644 (file)
@@ -71,8 +71,10 @@ std::vector<_PTR(SObject)> SALOMEDS_AttributeTarget::Get()
   else {
     SALOMEDS::Study::ListOfSObject_var aSeq = SALOMEDS::AttributeTarget::_narrow(_corba_impl)->Get();
     aLength = aSeq->length();
-    aSO = new SALOMEDS_SObject(aSeq[i].in());
-    for (i = 0; i < aLength; i++) aVector.push_back(_PTR(SObject)(aSO));
+       for (i = 0; i < aLength; i++) {
+         aSO = new SALOMEDS_SObject(aSeq[i].in());
+         aVector.push_back(_PTR(SObject)(aSO));
+       }
   }
 
   return aVector;
index de612189795aa8d5146864424325996766a9b9ca..88eccb51dbfdbccec1c78da03e513d56210f2537 100644 (file)
@@ -37,7 +37,12 @@ using namespace std;
 // Class attributes initialisation, for class method BaseTraceCollector::run
 
 BaseTraceCollector* BaseTraceCollector::_singleton = 0;
+#ifndef WNT
 pthread_mutex_t BaseTraceCollector::_singletonMutex;
+#else
+pthread_mutex_t BaseTraceCollector::_singletonMutex =
+  PTHREAD_MUTEX_INITIALIZER;
+#endif
 sem_t BaseTraceCollector::_sem;
 int BaseTraceCollector::_threadToClose = 0;
 pthread_t* BaseTraceCollector::_threadId = 0; // used to control single run
index edaa246904ae72e6e056d18605f24fc7e7c7391b..cf9bd9bded8d050be109674a55e26115914d8e16 100644 (file)
@@ -56,9 +56,8 @@ BaseTraceCollector* LocalTraceCollector::instance()
 
          sem_init(&_sem,0,0); // to wait until run thread is initialized
          pthread_t traceThread;
-         int bid;
          int re2 = pthread_create(&traceThread, NULL,
-                                  LocalTraceCollector::run, (void *)bid);
+                                  LocalTraceCollector::run, NULL);
          sem_wait(&_sem);
          _singleton = myInstance; // _singleton known only when init done
        }