just adds some warnings for potentially incorrect code

This commit is contained in:
2024-09-11 15:07:25 +02:00
parent 6dbd0fc0d7
commit f61daf0b49
4 changed files with 17 additions and 10 deletions

3
.gitignore vendored
View File

@ -5,6 +5,9 @@
# Ignore text editor (e.g. emacs) autosave files # Ignore text editor (e.g. emacs) autosave files
*~ *~
# Build Artifacts
O.*_Common/
O.*_RHEL8-x86_64/
# Compiled Object files # Compiled Object files
*.slo *.slo

View File

@ -12,18 +12,18 @@ REQUIRED+=stream
REQUIRED+=scaler REQUIRED+=scaler
REQUIRED+=asynMotor REQUIRED+=asynMotor
# using a test version # Release version
#scaler_VERSION=2024
LIBVERSION=2024-v2 LIBVERSION=2024-v2
# DB files to include in the release
TEMPLATES += sinqEPICSApp/Db/dimetix.db TEMPLATES += sinqEPICSApp/Db/dimetix.db
TEMPLATES += sinqEPICSApp/Db/slsvme.db TEMPLATES += sinqEPICSApp/Db/slsvme.db
TEMPLATES += sinqEPICSApp/Db/spsamor.db TEMPLATES += sinqEPICSApp/Db/spsamor.db
# DBD files to include in the release
DBDS += sinqEPICSApp/src/sinq.dbd DBDS += sinqEPICSApp/src/sinq.dbd
# What we need at SINQ # Source files to build
SOURCES += sinqEPICSApp/src/devScalerEL737.c SOURCES += sinqEPICSApp/src/devScalerEL737.c
SOURCES += sinqEPICSApp/src/SINQController.cpp SOURCES += sinqEPICSApp/src/SINQController.cpp
SOURCES += sinqEPICSApp/src/SINQAxis.cpp SOURCES += sinqEPICSApp/src/SINQAxis.cpp
@ -36,4 +36,7 @@ SOURCES += sinqEPICSApp/src/pmacAsynIPPort.c
SOURCES += sinqEPICSApp/src/pmacAxis.cpp SOURCES += sinqEPICSApp/src/pmacAxis.cpp
SOURCES += sinqEPICSApp/src/pmacController.cpp SOURCES += sinqEPICSApp/src/pmacController.cpp
SOURCES += sinqEPICSApp/src/MasterMACSDriver.cpp SOURCES += sinqEPICSApp/src/MasterMACSDriver.cpp
USR_CFLAGS += -Wall -Wextra # -Werror
# MISCS would be the place to keep the stream device template files # MISCS would be the place to keep the stream device template files

View File

@ -114,13 +114,13 @@ typedef struct {
unsigned int dbInit; unsigned int dbInit;
}EL737priv; }EL737priv;
static void dummyAsynCallback(asynUser *pasynUser) static void dummyAsynCallback([[maybe_unused]] asynUser *pasynUser)
{ {
} }
static void connectSlaveRecords(EL737priv *priv) static void connectSlaveRecords(EL737priv *priv)
{ {
char slaveName[PVNAME_SZ], errName[256]; char slaveName[PVNAME_SZ + 18], errName[256];
long status; long status;
priv->dbInit = 1; priv->dbInit = 1;
@ -168,7 +168,7 @@ static void connectSlaveRecords(EL737priv *priv)
errlogPrintf("dbNameToAddr succeded for %s, record access %s\n",slaveName, priv->threshCounter.precord->name); errlogPrintf("dbNameToAddr succeded for %s, record access %s\n",slaveName, priv->threshCounter.precord->name);
} }
snprintf(slaveName,sizeof(slaveName),"%s:Threshold", priv->psr->name); snprintf(slaveName, sizeof(slaveName), "%s:Threshold", priv->psr->name);
errlogPrintf("Name of thresholdCounter variable: %s\n", slaveName); errlogPrintf("Name of thresholdCounter variable: %s\n", slaveName);
status = dbNameToAddr(slaveName,&priv->threshold); status = dbNameToAddr(slaveName,&priv->threshold);
if(status!= 0){ if(status!= 0){
@ -419,7 +419,8 @@ static void runEvents(EL737priv *priv)
{ {
char command[COMLEN], reply[COMLEN], errName[256]; char command[COMLEN], reply[COMLEN], errName[256];
int status; int status;
long dbStatus, myThreshold, nElements = 1, options = 0, threshCounter; long dbStatus, nElements = 1, options = 0, threshCounter;
long unsigned int myThreshold;
/* /*
This is the better way to set the threshold rather then the old way below which uses This is the better way to set the threshold rather then the old way below which uses

View File

@ -158,7 +158,7 @@ pAxes_ = (pmacAxis **)(asynMotorController::pAxes_);
createParam(PMAC_C_CommsErrorString, asynParamInt32, &PMAC_C_CommsError_); createParam(PMAC_C_CommsErrorString, asynParamInt32, &PMAC_C_CommsError_);
// Connect our Asyn user to the low level port that is a parameter to this constructor // Connect our Asyn user to the low level port that is a parameter to this constructor
if (lowLevelPortConnect(lowLevelPortName, lowLevelPortAddress, &lowLevelPortUser_, "\006", (char *)"\r") != asynSuccess) { if (lowLevelPortConnect(lowLevelPortName, lowLevelPortAddress, &lowLevelPortUser_, "\006", "\r") != asynSuccess) {
printf("%s: Failed to connect to low level asynOctetSyncIO port %s\n", functionName, lowLevelPortName); printf("%s: Failed to connect to low level asynOctetSyncIO port %s\n", functionName, lowLevelPortName);
setIntegerParam(PMAC_C_CommsError_, 1); setIntegerParam(PMAC_C_CommsError_, 1);
} else { } else {
@ -965,7 +965,7 @@ asynStatus pmacV3Controller::writeInt32(asynUser *pasynUser, epicsInt32 value) {
int encoder_id = 0; int encoder_id = 0;
sscanf(response + (reponse_length - 3), "%2X", &encoder_id); sscanf(response + (reponse_length - 3), "%2X", &encoder_id);
snprintf(command, sizeof(command), "P46", pAxis->axisNo_); snprintf(command, sizeof(command), "P46");
this->lowLevelWriteRead(pAxis->axisNo_, command, response); this->lowLevelWriteRead(pAxis->axisNo_, command, response);
int number_of_axes = strtol(response, NULL, 10); int number_of_axes = strtol(response, NULL, 10);