mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-11-10 02:53:53 +01:00
fixes to remove the new warnings
This commit is contained in:
1 parent
85a1af470f
commit
eb525e96be
5 files changed
+16
-19
No files matched your search
@@ -1355,7 +1355,7 @@ int setVLimit(int val, char *mess) {
|
||||
}
|
||||
|
||||
int validateDACIndex(enum DACINDEX ind, char *mess) {
|
||||
if (ind < 0 || ind >= NDAC_ONLY) {
|
||||
if (ind >= NDAC_ONLY) {
|
||||
sprintf(mess, "Could not set/get DAC. Invalid index %d\n", ind);
|
||||
LOG(logERROR, (mess));
|
||||
return FAIL;
|
||||
@@ -1464,7 +1464,7 @@ int setDAC(enum DACINDEX ind, int val, bool mV, char *mess) {
|
||||
}
|
||||
|
||||
int validatePowerDACIndex(enum powerIndex ind, char *mess) {
|
||||
if (ind < 0 || ind > V_POWER_IO) {
|
||||
if (ind > V_POWER_IO) {
|
||||
sprintf(mess, "Could not set/get Power DAC. Invalid index %d\n", ind);
|
||||
LOG(logERROR, (mess));
|
||||
return FAIL;
|
||||
@@ -2330,7 +2330,7 @@ int validatePhaseinDegrees(enum CLKINDEX ind, int val, int retval) {
|
||||
}
|
||||
|
||||
int setFrequency(enum CLKINDEX ind, int val) {
|
||||
if (ind < 0 || ind >= NUM_CLOCKS) {
|
||||
if (ind >= NUM_CLOCKS) {
|
||||
LOG(logERROR, ("Unknown clock index %d to set frequency\n", ind));
|
||||
return FAIL;
|
||||
}
|
||||
@@ -2380,7 +2380,7 @@ int setFrequency(enum CLKINDEX ind, int val) {
|
||||
}
|
||||
|
||||
int getFrequency(enum CLKINDEX ind) {
|
||||
if (ind < 0 || ind >= NUM_CLOCKS) {
|
||||
if (ind >= NUM_CLOCKS) {
|
||||
LOG(logERROR, ("Unknown clock index %d to get frequency\n", ind));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -416,7 +416,7 @@ int setChipIndex(enum CHIPINDEX ind, char *mess) {
|
||||
enum CHIPINDEX getChipIndex() { return chipIndex; }
|
||||
|
||||
int validateChipIndex(enum CHIPINDEX ind, char *mess) {
|
||||
if (ind < 0 || ind >= NUM_CHIP_INDICES) {
|
||||
if (ind >= NUM_CHIP_INDICES) {
|
||||
sprintf(mess, "Invalid chip index %d. Options: %s\n", (int)ind,
|
||||
CHIP_VALS_HELP);
|
||||
LOG(logERROR, (mess));
|
||||
@@ -846,7 +846,7 @@ int getDefaultDac(enum DACINDEX index, enum detectorSettings sett,
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
if (index < 0 || index >= NDAC)
|
||||
if (index >= NDAC)
|
||||
return FAIL;
|
||||
*retval = defaultDacValues[index];
|
||||
return OK;
|
||||
@@ -882,7 +882,7 @@ int setDefaultDac(enum DACINDEX index, enum detectorSettings sett, int value) {
|
||||
// not a special dac
|
||||
return FAIL;
|
||||
}
|
||||
if (index < 0 || index >= NDAC)
|
||||
if (index >= NDAC)
|
||||
return FAIL;
|
||||
LOG(logINFO, ("Setting Default Dac [%d - %s]: %d\n", (int)index,
|
||||
dac_names[index], value));
|
||||
@@ -1564,7 +1564,7 @@ void setGainMode(enum gainMode mode) {
|
||||
|
||||
/* parameters - dac, adc, hv */
|
||||
int validateDACIndex(enum DACINDEX ind, char *mess) {
|
||||
if (ind < 0 || ind >= NDAC) {
|
||||
if (ind >= NDAC) {
|
||||
sprintf(mess, "Could not set DAC. Invalid index %d\n", ind);
|
||||
LOG(logERROR, (mess));
|
||||
return FAIL;
|
||||
|
||||
@@ -548,7 +548,7 @@ int resetToDefaultDacs(int hardReset, char *mess) {
|
||||
|
||||
int getDefaultDac(enum DACINDEX index, enum detectorSettings sett,
|
||||
int *retval) {
|
||||
if (index < 0 || index >= NDAC)
|
||||
if (index >= NDAC)
|
||||
return FAIL;
|
||||
*retval = defaultDacValues[index];
|
||||
return OK;
|
||||
@@ -556,7 +556,7 @@ int getDefaultDac(enum DACINDEX index, enum detectorSettings sett,
|
||||
|
||||
int setDefaultDac(enum DACINDEX index, enum detectorSettings sett, int value) {
|
||||
char *dac_names[] = {DAC_NAMES};
|
||||
if (index < 0 || index >= NDAC)
|
||||
if (index >= NDAC)
|
||||
return FAIL;
|
||||
LOG(logINFO, ("Setting Default Dac [%d - %s]: %d\n", (int)index,
|
||||
dac_names[index], value));
|
||||
@@ -913,7 +913,7 @@ enum detectorSettings getSettings() {
|
||||
/* parameters - dac, adc, hv */
|
||||
/* parameters - dac, adc, hv */
|
||||
int validateDACIndex(enum DACINDEX ind, char *mess) {
|
||||
if (ind < 0 || ind >= NDAC) {
|
||||
if (ind >= NDAC) {
|
||||
sprintf(mess, "Could not set DAC. Invalid index %d\n", ind);
|
||||
LOG(logERROR, (mess));
|
||||
return FAIL;
|
||||
|
||||
@@ -94,16 +94,13 @@ int LTC2620_D_SetDacValue(int dacnum, int val, char *dacname, char *mess) {
|
||||
// fname to write to
|
||||
char fname[MAX_STR_LENGTH];
|
||||
memset(fname, 0, MAX_STR_LENGTH);
|
||||
char fnameFormat[MAX_STR_LENGTH];
|
||||
memset(fnameFormat, 0, MAX_STR_LENGTH);
|
||||
strcpy(fnameFormat, LTC2620_D_DriverFileName);
|
||||
sprintf(fname, "%s%d", fnameFormat, dacnum);
|
||||
snprintf(fname, sizeof(fname), "%s%d", LTC2620_D_DriverFileName, dacnum);
|
||||
#if defined(XILINX_CHIPTESTBOARDD)
|
||||
if (val == LTC2620_D_PWR_DOWN_VAL) {
|
||||
strcpy(fnameFormat, LTC2620_D_PowerDownDriverFileName);
|
||||
snprintf(fname, sizeof(fname), "%s%d",
|
||||
LTC2620_D_PowerDownDriverFileName, dacnum);
|
||||
val = 1; //-100?:Invalid Argument
|
||||
}
|
||||
sprintf(fname, fnameFormat, dacnum);
|
||||
#endif
|
||||
LOG(logDEBUG1, ("fname %s\n", fname));
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ void basictests() {
|
||||
}
|
||||
|
||||
// check for API compatibility - old server
|
||||
if (sw_fw_apiversion > requiredfwversion) {
|
||||
if ((uint64_t)sw_fw_apiversion > requiredfwversion) {
|
||||
sprintf(initErrorMessage,
|
||||
"This firmware-software api version (0x%lx) is incompatible "
|
||||
"with the software's minimum required firmware version "
|
||||
@@ -158,7 +158,7 @@ void basictests() {
|
||||
}
|
||||
|
||||
// check for firmware compatibility - old firmware
|
||||
if (requiredfwversion > fwversion) {
|
||||
if (requiredfwversion > (uint64_t)fwversion) {
|
||||
sprintf(initErrorMessage,
|
||||
"This firmware version (0x%lx) is incompatible.\n"
|
||||
"Please update firmware (min. 0x%lx) to be compatible with "
|
||||
|
||||
Reference in new issue
Block a user