From 2c9de618ece4a75fc9920d0e4604a097b892633f Mon Sep 17 00:00:00 2001 From: smathis Date: Tue, 23 Dec 2025 14:00:08 +0100 Subject: [PATCH] Made code compile with compiler flags --- src/seleneAngleAxis.cpp | 9 ++++++++- src/seleneAngleAxis.h | 4 ++-- src/seleneGuideController.cpp | 6 ++++-- src/seleneLiftAxis.cpp | 27 ++++++++++++++++++++++++--- src/seleneLiftAxis.h | 4 ++-- src/seleneOffsetAxis.cpp | 15 ++++++++++++--- src/seleneOffsetAxis.h | 4 ++-- 7 files changed, 54 insertions(+), 15 deletions(-) diff --git a/src/seleneAngleAxis.cpp b/src/seleneAngleAxis.cpp index 0407441..f33d442 100644 --- a/src/seleneAngleAxis.cpp +++ b/src/seleneAngleAxis.cpp @@ -50,8 +50,15 @@ asynStatus seleneAngleAxis::stop(double acceleration) { } asynStatus seleneAngleAxis::doMove(double position, int relative, - double min_velocity, double max_velocity, + double minVelocity, double maxVelocity, double acceleration) { + + // Suppress unused variable warnings + (void)relative; + (void)minVelocity; + (void)maxVelocity; + (void)acceleration; + double motorRecResolution = 0.0; getAxisParamChecked(this, motorRecResolution, &motorRecResolution); diff --git a/src/seleneAngleAxis.h b/src/seleneAngleAxis.h index cbab966..5134dc9 100644 --- a/src/seleneAngleAxis.h +++ b/src/seleneAngleAxis.h @@ -48,12 +48,12 @@ class HIDDEN seleneAngleAxis : public turboPmacAxis { * * @param position * @param relative - * @param min_velocity + * @param minVelocity * @param maxOffset_velocity * @param acceleration * @return asynStatus */ - asynStatus doMove(double position, int relative, double min_velocity, + asynStatus doMove(double position, int relative, double minVelocity, double maxOffset_velocity, double acceleration); /** diff --git a/src/seleneGuideController.cpp b/src/seleneGuideController.cpp index 0b52e76..d040ca2 100644 --- a/src/seleneGuideController.cpp +++ b/src/seleneGuideController.cpp @@ -23,7 +23,8 @@ seleneGuideController::seleneGuideController( const char *portName, const char *ipPortConfigName, int numAxes, double movingPollPeriod, double idlePollPeriod, double comTimeout) : turboPmacController(portName, ipPortConfigName, numAxes, movingPollPeriod, - idlePollPeriod, NUM_seleneGuide_DRIVER_PARAMS) + idlePollPeriod, comTimeout, + NUM_seleneGuide_DRIVER_PARAMS) { @@ -145,7 +146,8 @@ static const iocshArg *const CreateControllerArgs[] = { &CreateControllerArg0, &CreateControllerArg1, &CreateControllerArg2, &CreateControllerArg3, &CreateControllerArg4, &CreateControllerArg5}; static const iocshFuncDef configSeleneGuideCreateController = { - "seleneGuideController", 6, CreateControllerArgs}; + "seleneGuideController", 6, CreateControllerArgs, + "Create a new instance of a Selene controller."}; static void configSeleneGuideCreateControllerCallFunc(const iocshArgBuf *args) { seleneGuideCreateController(args[0].sval, args[1].sval, args[2].ival, args[3].dval, args[4].dval, args[5].dval); diff --git a/src/seleneLiftAxis.cpp b/src/seleneLiftAxis.cpp index 47f409b..969eafd 100644 --- a/src/seleneLiftAxis.cpp +++ b/src/seleneLiftAxis.cpp @@ -381,8 +381,15 @@ asynStatus seleneLiftAxis::doPoll(bool *moving) { } asynStatus seleneLiftAxis::doMove(double position, int relative, - double min_velocity, double max_velocity, + double minVelocity, double maxVelocity, double acceleration) { + + // Suppress unused variable warnings + (void)relative; + (void)minVelocity; + (void)maxVelocity; + (void)acceleration; + double motorRecResolution = 0.0; getAxisParamChecked(this, motorRecResolution, &motorRecResolution); setTargetPosition(position * motorRecResolution); @@ -440,6 +447,9 @@ asynStatus seleneLiftAxis::stop(double acceleration) { // ========================================================================= + // Suppress unused variable warnings + (void)acceleration; + // Stop all axes status = pC_->writeRead(axisNo_, "P150=8", response, 0); @@ -466,6 +476,10 @@ asynStatus seleneLiftAxis::doReset() { } asynStatus seleneLiftAxis::enable(bool on) { + + // Suppress unused variable warnings + (void)on; + setAxisParamChecked(this, motorMessageText, "Axis cannot be enabled / disabled"); return asynSuccess; @@ -479,6 +493,12 @@ asynStatus seleneLiftAxis::readEncoderType() { asynStatus seleneLiftAxis::doHome(double minVelocity, double maxVelocity, double acceleration, int forwards) { + // Suppress unused variable warnings + (void)minVelocity; + (void)maxVelocity; + (void)acceleration; + (void)forwards; + char response[pC_->MAXBUF_] = {0}; // No answer expected @@ -636,8 +656,9 @@ static const iocshArg *const CreateAxisArgs[] = { &CreateAxisArg3, &CreateAxisArg4, &CreateAxisArg5, &CreateAxisArg6, &CreateAxisArg7, &CreateAxisArg8, }; -static const iocshFuncDef configSeleneVirtualCreateAxes = {"seleneVirtualAxes", - 9, CreateAxisArgs}; +static const iocshFuncDef configSeleneVirtualCreateAxes = { + "seleneVirtualAxes", 9, CreateAxisArgs, + "Creates instances of Selene axes."}; static void configSeleneVirtualCreateAxesCallFunc(const iocshArgBuf *args) { seleneVirtualCreateAxes(args[0].sval, args[1].ival, args[2].ival, args[3].ival, args[4].ival, args[5].ival, diff --git a/src/seleneLiftAxis.h b/src/seleneLiftAxis.h index d92041f..75b831a 100644 --- a/src/seleneLiftAxis.h +++ b/src/seleneLiftAxis.h @@ -65,12 +65,12 @@ class HIDDEN seleneLiftAxis : public turboPmacAxis { * * @param position * @param relative - * @param min_velocity + * @param minVelocity * @param maxOffset_velocity * @param acceleration * @return asynStatus */ - asynStatus doMove(double position, int relative, double min_velocity, + asynStatus doMove(double position, int relative, double minVelocity, double maxOffset_velocity, double acceleration); /** diff --git a/src/seleneOffsetAxis.cpp b/src/seleneOffsetAxis.cpp index 94ef284..4a4c250 100644 --- a/src/seleneOffsetAxis.cpp +++ b/src/seleneOffsetAxis.cpp @@ -283,10 +283,15 @@ seleneOffsetAxis::setPositionsFromEncoderPosition(double encoderPosition) { } asynStatus seleneOffsetAxis::doMove(double position, int relative, - double min_velocity, - double maxOffset_velocity, + double minVelocity, double maxVelocity, double acceleration) { + // Suppress unused variable warnings + (void)relative; + (void)minVelocity; + (void)maxVelocity; + (void)acceleration; + double motorRecResolution = 0.0; getAxisParamChecked(this, motorRecResolution, &motorRecResolution); @@ -299,6 +304,9 @@ asynStatus seleneOffsetAxis::doMove(double position, int relative, } asynStatus seleneOffsetAxis::enable(bool on) { + // Suppress unused variable warnings + (void)on; + setAxisParamChecked(this, motorMessageText, "Axis cannot be enabled / disabled"); return asynSuccess; @@ -384,7 +392,8 @@ static const iocshArg *const CreateAxisArgs[] = { &CreateAxisArg3, }; static const iocshFuncDef configSeleneOffsetAxisCreateAxis = { - "seleneOffsetAxis", 4, CreateAxisArgs}; + "seleneOffsetAxis", 4, CreateAxisArgs, + "Creates a new instance of a Selene offset axis."}; static void configSeleneOffsetAxisCreateAxisCallFunc(const iocshArgBuf *args) { seleneOffsetAxisCreateAxis(args[0].sval, args[1].ival, args[2].dval, args[3].dval); diff --git a/src/seleneOffsetAxis.h b/src/seleneOffsetAxis.h index 3d1a3dd..253ed86 100644 --- a/src/seleneOffsetAxis.h +++ b/src/seleneOffsetAxis.h @@ -51,12 +51,12 @@ class HIDDEN seleneOffsetAxis : public turboPmacAxis { * * @param position * @param relative - * @param min_velocity + * @param minVelocity * @param maxOffset_velocity * @param acceleration * @return asynStatus */ - asynStatus doMove(double position, int relative, double min_velocity, + asynStatus doMove(double position, int relative, double minVelocity, double maxOffset_velocity, double acceleration); /**