From ac05b399430392b05469db3dded230ae8afd5b07 Mon Sep 17 00:00:00 2001 From: secher Date: Wed, 21 Jan 2004 09:15:18 +0000 Subject: [PATCH] portage CCRT : alpha/osf --- src/SALOMEDS/SALOMEDS_StudyManager_i.cxx | 32 +++++++++++++----------- src/SALOME_PYQT/Makefile.in | 4 +-- src/SALOME_PYQT/SALOME_PYQT_GUI.cxx | 2 +- src/SALOME_PYQT/SalomePyQt.cxx | 2 +- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx b/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx index 1aadb70d0..92ea84be1 100644 --- a/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyManager_i.cxx @@ -90,9 +90,10 @@ static void ReadAttributes(Handle(TDF_Data)& DF, if (!strncmp(hdf_dataset->GetName(),"AttributeTreeNode",17)) { MESSAGE("Create a Attribute : AttributeTreeNode"); - char **current_strings = (char**)malloc(5*sizeof(char*)); - for(int i=0;i<5;i++) - current_strings[i] = (char*)malloc((hdf_dataset->GetSize()/5)*sizeof(char)); + char current_strings[5][hdf_dataset->GetSize()/5]; +// char **current_strings = new (char*)[5]; +// for(int i=0;i<5;i++) +// current_strings[i] = new char[hdf_dataset->GetSize()/5+1]; hdf_dataset->ReadFromDisk(current_strings); MESSAGE("Create an Attribute : AttributeTreeNode"); @@ -120,9 +121,9 @@ static void ReadAttributes(Handle(TDF_Data)& DF, if (!aLabel.FindAttribute(aGUID,aNode)) aNode = TDataStd_TreeNode::Set(aLabel,aGUID); aNewNode->SetFirst(aNode); } - for(int i=0;i<5;i++) - free(current_strings[i]); - free(current_strings); +// for(int i=0;i<5;i++) +// delete[] current_strings[i]; +// delete[] current_strings; } else { int size = hdf_dataset->GetSize(); @@ -570,7 +571,8 @@ SALOMEDS::Study_ptr SALOMEDS_StudyManager_i::Open(const char* aUrl) // MESSAGE( "HDFexception ! " ); // cerr << "HDFexception ! " << endl; delete aHDFUrl; - char *eStr = (char*)malloc((strlen(aUrl)+17)*sizeof(char*)); + char eStr[strlen(aUrl)+17]; +// char *eStr = new char[strlen(aUrl)+17+1]; sprintf(eStr,"Can't open file %s",aUrl); THROW_SALOME_CORBA_EXCEPTION(CORBA::string_dup(eStr),SALOME::BAD_PARAM); } @@ -637,7 +639,8 @@ SALOMEDS::Study_ptr SALOMEDS_StudyManager_i::Open(const char* aUrl) // MESSAGE( "HDFexception ! " ); // cerr << "HDFexception ! " << endl; delete aHDFUrl; - char *eStr = (char*)malloc((strlen(aUrl)+17)*sizeof(char*)); + char eStr[strlen(aUrl)+17]; +// char *eStr = new char[strlen(aUrl)+17+1]; sprintf(eStr,"Can't open file %s",aUrl); THROW_SALOME_CORBA_EXCEPTION(CORBA::string_dup(eStr),SALOME::BAD_PARAM); } @@ -1182,9 +1185,10 @@ static void SaveAttributes(SALOMEDS::SObject_ptr SO, HDFgroup *hdf_group_sobject TNsize[0]=5; TNsize[1]=maxSize+1; - char **Data = (char**)malloc(5*sizeof(char*)); - for(int i=0;i<5;i++) - Data[i] = (char*)malloc((maxSize+1)*sizeof(char)); + char Data[5][maxSize+1]; +// char **Data = new (char*)[5]; +// for(int i=0;i<5;i++) +// Data[i] = new char[maxSize+1+1]; for(index=0;index<5;index++) { strcpy(Data[index],Val[index]); for(int a = strlen(Data[index]) + 1; a < maxSize; a++) Data[index][a] = ' '; // mpv: for ASCII format @@ -1200,9 +1204,9 @@ static void SaveAttributes(SALOMEDS::SObject_ptr SO, HDFgroup *hdf_group_sobject MESSAGE("attribute AttributeTreeNode with various GUID wrote on file:"); MESSAGE(aDataSetName); delete(aDataSetName); - for(int i=0;i<5;i++) - free(Data[i]); - free(Data); +// for(int i=0;i<5;i++) +// delete[] Data[i]; +// delete[] Data; } } } diff --git a/src/SALOME_PYQT/Makefile.in b/src/SALOME_PYQT/Makefile.in index 525764d5d..0e2b775b3 100644 --- a/src/SALOME_PYQT/Makefile.in +++ b/src/SALOME_PYQT/Makefile.in @@ -20,7 +20,7 @@ VPATH=.:@srcdir@:@top_srcdir@/idl # SIP C++ Python # SIP defined in make_commence.in -SIP_FLAGS = -t WS_X11 -t Qt_3_0_5 -s ".cc" -c $(CURDIR) -I $(PYQT_SIPS) +SIP_FLAGS = -t WS_X11 -t Qt_3_0_5 -s ".cc" -c $(CURDIR) $(PYQT_INCLUDES) # SIP input file(s) @@ -50,7 +50,7 @@ LIB_CLIENT_IDL = SALOME_Exception.idl CPPFLAGS+=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(SIP_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) LIBS+= $(PYTHON_LIBS) $(SIP_LIBS) $(PYQT_LIBS) $(OCC_LIBS) $(VTK_LIBS) $(OGL_LIBS) -LDFLAGS+= -lSalomeGUI -lqtcmodule +LDFLAGS+= -lSalomeGUI # Custom build step: generate C++ wrapping according to $(SIP_FILES) diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUI.cxx index 6d6e6b92a..f2a23e6a9 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUI.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUI.cxx @@ -1,4 +1,3 @@ -using namespace std; //============================================================================= // File : SALOME_PYQT_GUI.cxx // Created : mer jun 4 17:17:20 UTC 2003 @@ -26,6 +25,7 @@ using namespace std; #include #include +using namespace std; static PyInterp_PyQt *interp = NULL; static map mapInterp; diff --git a/src/SALOME_PYQT/SalomePyQt.cxx b/src/SALOME_PYQT/SalomePyQt.cxx index 9f7c1afa2..c1946bfcc 100644 --- a/src/SALOME_PYQT/SalomePyQt.cxx +++ b/src/SALOME_PYQT/SalomePyQt.cxx @@ -5,7 +5,6 @@ // File : SalomePyQt.cxx // Module : SALOME -using namespace std; #include "SalomePyQt.hxx" #include "QAD_Application.h" @@ -15,6 +14,7 @@ using namespace std; #include "QAD_Config.h" #include "QAD_Settings.h" +using namespace std; QWidget* SalomePyQt::getDesktop() { -- 2.39.2