mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 15:20:02 +02:00
printf and uninitialized variables
This commit is contained in:
parent
0e120330f4
commit
cd738106ec
@ -7,13 +7,16 @@ option (USE_TEXTCLIENT "Text Client" OFF)
|
|||||||
option (USE_RECEIVER "Receiver" OFF)
|
option (USE_RECEIVER "Receiver" OFF)
|
||||||
option (USE_GUI "GUI" OFF)
|
option (USE_GUI "GUI" OFF)
|
||||||
|
|
||||||
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0)
|
# clang does not support -Wno-misleading-indentation
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++98 -Wno-misleading-indentation")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++98")
|
||||||
else ()
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++98")
|
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0)
|
||||||
endif ()
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++98 -Wno-misleading-indentation")
|
||||||
|
else ()
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++98")
|
||||||
|
endif ()
|
||||||
|
endif()
|
||||||
find_package(Qt4)
|
find_package(Qt4)
|
||||||
find_package(Qwt 6)
|
find_package(Qwt 6)
|
||||||
find_package(CBF)
|
find_package(CBF)
|
||||||
|
@ -2213,7 +2213,7 @@ string slsDetector::getLastClientIP() {
|
|||||||
|
|
||||||
int slsDetector::exitServer() {
|
int slsDetector::exitServer() {
|
||||||
|
|
||||||
int retval;
|
int retval = FAIL;
|
||||||
int fnum=F_EXIT_SERVER;
|
int fnum=F_EXIT_SERVER;
|
||||||
|
|
||||||
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
||||||
@ -3158,13 +3158,15 @@ string slsDetector::getSettingsDir() {
|
|||||||
return std::string(thisDetector->settingsDir);
|
return std::string(thisDetector->settingsDir);
|
||||||
}
|
}
|
||||||
string slsDetector::setSettingsDir(string s) {
|
string slsDetector::setSettingsDir(string s) {
|
||||||
sprintf(thisDetector->settingsDir, s.c_str()); return thisDetector->settingsDir;
|
sprintf(thisDetector->settingsDir, "%s", s.c_str());
|
||||||
|
return thisDetector->settingsDir;
|
||||||
}
|
}
|
||||||
string slsDetector::getCalDir() {
|
string slsDetector::getCalDir() {
|
||||||
return thisDetector->calDir;
|
return thisDetector->calDir;
|
||||||
}
|
}
|
||||||
string slsDetector::setCalDir(string s) {
|
string slsDetector::setCalDir(string s) {
|
||||||
sprintf(thisDetector->calDir, s.c_str()); return thisDetector->calDir;
|
sprintf(thisDetector->calDir, "%s", s.c_str());
|
||||||
|
return thisDetector->calDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -4338,7 +4340,7 @@ int64_t slsDetector::getTimeLeft(timerIndex index, int imod) {
|
|||||||
|
|
||||||
|
|
||||||
int fnum=F_GET_TIME_LEFT;
|
int fnum=F_GET_TIME_LEFT;
|
||||||
int64_t retval;
|
int64_t retval = FAIL;
|
||||||
char mess[MAX_STR_LENGTH]="";
|
char mess[MAX_STR_LENGTH]="";
|
||||||
int ret=OK;
|
int ret=OK;
|
||||||
|
|
||||||
@ -4627,7 +4629,7 @@ dacs_t slsDetector::setDAC(dacs_t val, dacIndex index, int mV, int imod) {
|
|||||||
|
|
||||||
dacs_t slsDetector::getADC(dacIndex index, int imod) {
|
dacs_t slsDetector::getADC(dacIndex index, int imod) {
|
||||||
|
|
||||||
dacs_t retval;
|
dacs_t retval = 0;
|
||||||
int fnum=F_GET_ADC;
|
int fnum=F_GET_ADC;
|
||||||
int ret=FAIL;
|
int ret=FAIL;
|
||||||
char mess[MAX_STR_LENGTH]="";
|
char mess[MAX_STR_LENGTH]="";
|
||||||
@ -6364,7 +6366,7 @@ int slsDetector::setFlippedData(dimension d, int value) {
|
|||||||
|
|
||||||
int slsDetector::setAllTrimbits(int val, int imod) {
|
int slsDetector::setAllTrimbits(int val, int imod) {
|
||||||
int fnum=F_SET_ALL_TRIMBITS;
|
int fnum=F_SET_ALL_TRIMBITS;
|
||||||
int retval;
|
int retval = FAIL;
|
||||||
char mess[MAX_STR_LENGTH]="";
|
char mess[MAX_STR_LENGTH]="";
|
||||||
int ret=OK;
|
int ret=OK;
|
||||||
|
|
||||||
@ -7665,17 +7667,13 @@ int slsDetector::setChip(int reg, int ichip, int imod) {
|
|||||||
int slsDetector::setChip(sls_detector_chip chip) {
|
int slsDetector::setChip(sls_detector_chip chip) {
|
||||||
|
|
||||||
int fnum=F_SET_CHIP;
|
int fnum=F_SET_CHIP;
|
||||||
int retval;
|
int retval = FAIL;
|
||||||
int ret=FAIL;
|
int ret=FAIL;
|
||||||
char mess[MAX_STR_LENGTH]="";
|
char mess[MAX_STR_LENGTH]="";
|
||||||
|
|
||||||
int ichi=chip.chip;
|
int ichi=chip.chip;
|
||||||
int im=chip.module;
|
int im=chip.module;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
||||||
if (connectControl() == OK){
|
if (connectControl() == OK){
|
||||||
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
|
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||||
@ -8492,7 +8490,7 @@ string slsDetector::getReceiverLastClientIP() {
|
|||||||
|
|
||||||
int slsDetector::exitReceiver() {
|
int slsDetector::exitReceiver() {
|
||||||
|
|
||||||
int retval;
|
int retval = FAIL;
|
||||||
int fnum=F_EXIT_RECEIVER;
|
int fnum=F_EXIT_RECEIVER;
|
||||||
|
|
||||||
if (thisDetector->receiverOnlineFlag==ONLINE_FLAG) {
|
if (thisDetector->receiverOnlineFlag==ONLINE_FLAG) {
|
||||||
@ -8664,7 +8662,7 @@ void slsDetector::sendMultiDetectorSize() {
|
|||||||
ret=thisReceiver->sendIntArray(fnum,retval,arg);
|
ret=thisReceiver->sendIntArray(fnum,retval,arg);
|
||||||
disconnectData();
|
disconnectData();
|
||||||
}
|
}
|
||||||
if((ret==FAIL)){
|
if(ret==FAIL){
|
||||||
std::cout << "Could not set position Id" << std::endl;
|
std::cout << "Could not set position Id" << std::endl;
|
||||||
setErrorMask((getErrorMask())|(RECEIVER_MULTI_DET_SIZE_NOT_SET));
|
setErrorMask((getErrorMask())|(RECEIVER_MULTI_DET_SIZE_NOT_SET));
|
||||||
}
|
}
|
||||||
|
@ -3434,33 +3434,26 @@ string slsDetectorCommand::cmdAngConv(int narg, char *args[], int action){
|
|||||||
} else {
|
} else {
|
||||||
return string("none");
|
return string("none");
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
return "unknown action";
|
||||||
}
|
}
|
||||||
} else if (string(args[0])==string("globaloff")) {
|
} else if (string(args[0])==string("globaloff")) {
|
||||||
c=GLOBAL_OFFSET;
|
c=GLOBAL_OFFSET;
|
||||||
|
|
||||||
|
|
||||||
} else if (string(args[0])==string("fineoff")) {
|
} else if (string(args[0])==string("fineoff")) {
|
||||||
c=FINE_OFFSET;
|
c=FINE_OFFSET;
|
||||||
|
|
||||||
|
|
||||||
} else if (string(args[0])==string("binsize")) {
|
} else if (string(args[0])==string("binsize")) {
|
||||||
c=BIN_SIZE;
|
c=BIN_SIZE;
|
||||||
|
|
||||||
} else if (string(args[0])==string("angdir")) {
|
} else if (string(args[0])==string("angdir")) {
|
||||||
c=ANGULAR_DIRECTION;
|
c=ANGULAR_DIRECTION;
|
||||||
|
|
||||||
} else if (string(args[0])==string("moveflag")) {
|
} else if (string(args[0])==string("moveflag")) {
|
||||||
c=MOVE_FLAG;
|
c=MOVE_FLAG;
|
||||||
} else if (string(args[0])==string("samplex")) {
|
} else if (string(args[0])==string("samplex")) {
|
||||||
c=SAMPLE_X;
|
c=SAMPLE_X;
|
||||||
} else if (string(args[0])==string("sampley")) {
|
} else if (string(args[0])==string("sampley")) {
|
||||||
c=SAMPLE_Y;
|
c=SAMPLE_Y;
|
||||||
}
|
}else{
|
||||||
|
|
||||||
|
|
||||||
else
|
|
||||||
return string("could not decode angular conversion parameter ")+cmd;
|
return string("could not decode angular conversion parameter ")+cmd;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (action==PUT_ACTION) {
|
if (action==PUT_ACTION) {
|
||||||
@ -3568,7 +3561,7 @@ string slsDetectorCommand::helpThreaded(int narg, char *args[], int action){
|
|||||||
|
|
||||||
string slsDetectorCommand::cmdImage(int narg, char *args[], int action){
|
string slsDetectorCommand::cmdImage(int narg, char *args[], int action){
|
||||||
string sval;
|
string sval;
|
||||||
int retval;
|
int retval = FAIL;
|
||||||
if (action==HELP_ACTION)
|
if (action==HELP_ACTION)
|
||||||
return helpImage(narg,args,HELP_ACTION);
|
return helpImage(narg,args,HELP_ACTION);
|
||||||
else if (action==GET_ACTION)
|
else if (action==GET_ACTION)
|
||||||
@ -3609,7 +3602,7 @@ string slsDetectorCommand::cmdCounter(int narg, char *args[], int action){
|
|||||||
int ival;
|
int ival;
|
||||||
char answer[100];
|
char answer[100];
|
||||||
string sval;
|
string sval;
|
||||||
int retval;
|
int retval = FAIL;
|
||||||
if (action==HELP_ACTION)
|
if (action==HELP_ACTION)
|
||||||
return helpCounter(narg,args,HELP_ACTION);
|
return helpCounter(narg,args,HELP_ACTION);
|
||||||
else if (action==PUT_ACTION)
|
else if (action==PUT_ACTION)
|
||||||
@ -6209,7 +6202,8 @@ string slsDetectorCommand::cmdConfiguration(int narg, char *args[], int action)
|
|||||||
myDet->setReceiverOnline(ONLINE_FLAG);
|
myDet->setReceiverOnline(ONLINE_FLAG);
|
||||||
if (action==PUT_ACTION)
|
if (action==PUT_ACTION)
|
||||||
return string("cannot put");
|
return string("cannot put");
|
||||||
return string(""+myDet->printReceiverConfiguration());
|
myDet->printReceiverConfiguration();
|
||||||
|
return string("");
|
||||||
}else if (cmd=="parameters") {
|
}else if (cmd=="parameters") {
|
||||||
myDet->setReceiverOnline(ONLINE_FLAG);
|
myDet->setReceiverOnline(ONLINE_FLAG);
|
||||||
if (action==PUT_ACTION) {
|
if (action==PUT_ACTION) {
|
||||||
|
@ -96,7 +96,7 @@ double angularConversionStatic::convertAngle(double pos, int ich, angleConversio
|
|||||||
// cout << "no ang conv " << endl;
|
// cout << "no ang conv " << endl;
|
||||||
|
|
||||||
double enc=0, trans=0;
|
double enc=0, trans=0;
|
||||||
double ang;
|
double ang=0;
|
||||||
|
|
||||||
switch (mF) {
|
switch (mF) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -93,7 +93,7 @@ class fileIO : public fileIOStatic, public virtual slsDetectorBase {
|
|||||||
*/
|
*/
|
||||||
virtual std::string setFilePath(std::string s) {
|
virtual std::string setFilePath(std::string s) {
|
||||||
pthread_mutex_lock(&mf);
|
pthread_mutex_lock(&mf);
|
||||||
sprintf(filePath, s.c_str());
|
sprintf(filePath, "%s", s.c_str());
|
||||||
pthread_mutex_unlock(&mf);
|
pthread_mutex_unlock(&mf);
|
||||||
return std::string(filePath);
|
return std::string(filePath);
|
||||||
};
|
};
|
||||||
@ -105,7 +105,7 @@ class fileIO : public fileIOStatic, public virtual slsDetectorBase {
|
|||||||
*/
|
*/
|
||||||
virtual std::string setFileName(std::string s) {
|
virtual std::string setFileName(std::string s) {
|
||||||
pthread_mutex_lock(&mf);
|
pthread_mutex_lock(&mf);
|
||||||
sprintf(fileName, s.c_str());
|
sprintf(fileName, "%s", s.c_str());
|
||||||
pthread_mutex_unlock(&mf);
|
pthread_mutex_unlock(&mf);
|
||||||
return std::string(fileName);};
|
return std::string(fileName);};
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef POSTPROCESSINGFUNCS_H
|
#ifndef POSTPROCESSINGFUNCS_H
|
||||||
#define POSTPROCESSINGFUNC_H
|
#define POSTPROCESSINGFUNCS_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -77,4 +77,4 @@ class postProcessingFuncs : public virtual angularConversionStatic
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif //POSTPROCESSINGFUNCS_H
|
||||||
|
@ -189,10 +189,6 @@ class DataStreamer : private virtual slsReceiverDefs, public ThreadObject {
|
|||||||
/** additional json header */
|
/** additional json header */
|
||||||
char* additionJsonHeader;
|
char* additionJsonHeader;
|
||||||
|
|
||||||
/** Silent Mode */
|
|
||||||
bool* silentMode;
|
|
||||||
|
|
||||||
|
|
||||||
/** Aquisition Started flag */
|
/** Aquisition Started flag */
|
||||||
bool acquisitionStartedFlag;
|
bool acquisitionStartedFlag;
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ void DataProcessor::ResetParametersforNewMeasurement(){
|
|||||||
delete [] tempBuffer;
|
delete [] tempBuffer;
|
||||||
tempBuffer = 0;
|
tempBuffer = 0;
|
||||||
}
|
}
|
||||||
if (*gapPixelsEnable >= 0) {
|
if (*gapPixelsEnable) {
|
||||||
tempBuffer = new char[generalData->imageSize];
|
tempBuffer = new char[generalData->imageSize];
|
||||||
memset(tempBuffer, 0, generalData->imageSize);
|
memset(tempBuffer, 0, generalData->imageSize);
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,6 @@ DataStreamer::DataStreamer(int ind, Fifo*& f, uint32_t* dr, std::vector<ROI>* r,
|
|||||||
fileIndex(fi),
|
fileIndex(fi),
|
||||||
flippedData(fd),
|
flippedData(fd),
|
||||||
additionJsonHeader(ajh),
|
additionJsonHeader(ajh),
|
||||||
silentMode(sm),
|
|
||||||
acquisitionStartedFlag(false),
|
acquisitionStartedFlag(false),
|
||||||
measurementStartedFlag(false),
|
measurementStartedFlag(false),
|
||||||
firstAcquisitionIndex(0),
|
firstAcquisitionIndex(0),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user