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

View File

@ -114,13 +114,13 @@ typedef struct {
unsigned int dbInit;
}EL737priv;
static void dummyAsynCallback(asynUser *pasynUser)
static void dummyAsynCallback([[maybe_unused]] asynUser *pasynUser)
{
}
static void connectSlaveRecords(EL737priv *priv)
{
char slaveName[PVNAME_SZ], errName[256];
char slaveName[PVNAME_SZ + 18], errName[256];
long status;
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);
}
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);
status = dbNameToAddr(slaveName,&priv->threshold);
if(status!= 0){
@ -419,7 +419,8 @@ static void runEvents(EL737priv *priv)
{
char command[COMLEN], reply[COMLEN], errName[256];
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

View File

@ -158,7 +158,7 @@ pAxes_ = (pmacAxis **)(asynMotorController::pAxes_);
createParam(PMAC_C_CommsErrorString, asynParamInt32, &PMAC_C_CommsError_);
// 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);
setIntegerParam(PMAC_C_CommsError_, 1);
} else {
@ -965,7 +965,7 @@ asynStatus pmacV3Controller::writeInt32(asynUser *pasynUser, epicsInt32 value) {
int encoder_id = 0;
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);
int number_of_axes = strtol(response, NULL, 10);