diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp index 21549e26d..c9765f4f1 100644 --- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp +++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp @@ -96,7 +96,6 @@ int multiSlsDetector::initSharedMemory(int id=0) { multiSlsDetector::multiSlsDetector(int id) : slsDetectorUtils(), shmId(-1) { - cout << "Contrustor" << endl; while (shmId<0) { shmId=initSharedMemory(id); id++; @@ -4394,7 +4393,6 @@ int* multiSlsDetector::readFrameFromReceiver(char* fName, int &fIndex){ int *retdet, *p=retval; string fullFName=""; string ext=""; - char * pch; for (int id=0; idnumberOfDetectors; id++) { @@ -4413,7 +4411,10 @@ int* multiSlsDetector::readFrameFromReceiver(char* fName, int &fIndex){ if (strrchr(fName,'.')!=NULL){ ext.assign(fName); size_t dot = ext.rfind("."); - ext = ext.erase(0,dot); + if(dot != string::npos) + ext = ext.erase(0,dot); + else + ext = ""; } } fullFName.append(getReceiverFileNameToConcatenate(fName)); diff --git a/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp b/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp index f18a0ea66..d0dcd0870 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp @@ -2565,7 +2565,7 @@ string slsDetectorCommand::cmdDetectorSize(int narg, char *args[], int action) { return helpDetectorSize(narg,args,action); ROI allroi[val]; pos=2; - for(int i=0;iregisterCallBackAcquisitionFinished(func,arg); } -int slsReceiverUsers::registerCallBackRawDataReady(void (*func)(int, char*, FILE*, char*, void*),void *arg){ +void slsReceiverUsers::registerCallBackRawDataReady(void (*func)(int, char*, FILE*, char*, void*),void *arg){ receiver->registerCallBackRawDataReady(func,arg); } diff --git a/slsDetectorSoftware/slsReceiver/slsReceiverUsers.h b/slsDetectorSoftware/slsReceiver/slsReceiverUsers.h index 932173ff4..52b911276 100644 --- a/slsDetectorSoftware/slsReceiver/slsReceiverUsers.h +++ b/slsDetectorSoftware/slsReceiver/slsReceiverUsers.h @@ -58,7 +58,7 @@ public: */ - int registerCallBackAcquisitionFinished(void (*func)(int nf, void*),void *arg); + void registerCallBackAcquisitionFinished(void (*func)(int nf, void*),void *arg); @@ -68,7 +68,7 @@ public: \returns nothing */ - int registerCallBackRawDataReady(void (*func)(int framenumber, char* datapointer, FILE* filedescriptor, char* guidatapointer, void*),void *arg); + void registerCallBackRawDataReady(void (*func)(int framenumber, char* datapointer, FILE* filedescriptor, char* guidatapointer, void*),void *arg); private: diff --git a/slsDetectorSoftware/slsReceiver/slsReceiver_funcs.cpp b/slsDetectorSoftware/slsReceiver/slsReceiver_funcs.cpp index 172c46981..da0a6f7af 100644 --- a/slsDetectorSoftware/slsReceiver/slsReceiver_funcs.cpp +++ b/slsDetectorSoftware/slsReceiver/slsReceiver_funcs.cpp @@ -24,7 +24,7 @@ slsReceiverFuncs::~slsReceiverFuncs() { slsReceiverFuncs::closeFile(0); cout << "Goodbye!" << endl; - delete socket; + if(socket) delete socket; } @@ -34,15 +34,14 @@ slsReceiverFuncs::slsReceiverFuncs(int argc, char *argv[], int &success): ret(OK), lockStatus(0), shortFrame(-1), - packetsPerFrame(2){ + packetsPerFrame(PACKETS_PER_FRAME){ int port_no = DEFAULT_PORTNO+2; ifstream infile; string sLine,sargname; int iline = 0; - success=slsDetectorDefs::OK; - + success=OK; string fname = ""; //parse command line for config @@ -260,8 +259,6 @@ int slsReceiverFuncs::M_nofunc(){ void slsReceiverFuncs::closeFile(int p){ - char *buf; - char buffer[1]; if(slsReceiverFunctionList::listening_thread_running) @@ -723,7 +720,6 @@ int slsReceiverFuncs::get_frame_index(){ int slsReceiverFuncs::reset_frames_caught(){ ret=OK; - int index=-1; strcpy(mess,"Could not reset frames caught\n"); @@ -759,7 +755,7 @@ int slsReceiverFuncs::reset_frames_caught(){ int slsReceiverFuncs::read_frame(){ ret=OK; - char fName[MAX_STR_LENGTH]; + char fName[MAX_STR_LENGTH]=""; int arg = -1,i; //retval is a full frame @@ -777,7 +773,6 @@ int slsReceiverFuncs::read_frame(){ int bufferSize = BUFFER_SIZE; if(shortFrame!=-1) bufferSize=SHORT_BUFFER_SIZE; - int nel = bufferSize/(sizeof(int)); char* raw = new char[bufferSize]; int* origVal = new int[rnel]; diff --git a/slsDetectorSoftware/slsReceiver/slsReceiver_funcs.h b/slsDetectorSoftware/slsReceiver/slsReceiver_funcs.h index 7240e8a31..7dd6a6193 100644 --- a/slsDetectorSoftware/slsReceiver/slsReceiver_funcs.h +++ b/slsDetectorSoftware/slsReceiver/slsReceiver_funcs.h @@ -63,7 +63,7 @@ public: */ - int registerCallBackAcquisitionFinished(void (*func)(int, void*),void *arg){slsReceiverList->registerCallBackAcquisitionFinished(func,arg);}; + void registerCallBackAcquisitionFinished(void (*func)(int, void*),void *arg){slsReceiverList->registerCallBackAcquisitionFinished(func,arg);}; @@ -75,7 +75,7 @@ public: guidatapointer (NULL, no data required) */ - int registerCallBackRawDataReady(void (*func)(int, char*, FILE*, char*, void*),void *arg){slsReceiverList->registerCallBackRawDataReady(func,arg);}; + void registerCallBackRawDataReady(void (*func)(int, char*, FILE*, char*, void*),void *arg){slsReceiverList->registerCallBackRawDataReady(func,arg);}; private: