fixed new eiger warnings

This commit is contained in:
maliakal_d committed 2026-10-27 16:57:12 +01:00
1 parent eb525e96be
commit 9c86c36534
4 files changed
+15 -20

No files matched your search

+7 -5
View File
@@ -6,6 +6,7 @@
#include "xparameters.h"
#include <fcntl.h>
#include <stddef.h>
#include <string.h>
#include <sys/mman.h>
#include <unistd.h>
@@ -127,7 +128,8 @@ int Beb_SetHeaderData(uint64_t src_mac, uint32_t src_ip, uint16_t src_port,
}
void Beb_AdjustIPChecksum(struct udp_header_type *ip) {
unsigned char *cptr = (unsigned char *)ip->ver_headerlen;
unsigned char *cptr =
(unsigned char *)ip + offsetof(struct udp_header_type, ver_headerlen);
ip->ip_header_checksum[0] = 0;
ip->ip_header_checksum[1] = 0;
@@ -330,7 +332,7 @@ int Beb_SetTop(enum TOPINDEX ind) {
}
char *top_names[] = {TOP_NAMES};
int newval = Beb_Write32(csp0base, BEB_CONFIG_WR_OFST, value);
u_int32_t newval = Beb_Write32(csp0base, BEB_CONFIG_WR_OFST, value);
if (newval != value) {
LOG(logERROR,
("Could not set Top flag to %s in Beb\n", top_names[ind]));
@@ -375,7 +377,7 @@ int Beb_SetMaster(enum MASTERINDEX ind) {
}
char *master_names[] = {MASTER_NAMES};
int newval = Beb_Write32(csp0base, BEB_CONFIG_WR_OFST, value);
u_int32_t newval = Beb_Write32(csp0base, BEB_CONFIG_WR_OFST, value);
if (newval != value) {
LOG(logERROR,
("Could not set Master flag to %s in Beb\n", master_names[ind]));
@@ -1125,7 +1127,7 @@ int Beb_SetDetectorPosition(int pos[]) {
value | ((posval << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK));
value = Beb_Read32(csp0base, UDP_HEADER_B_LEFT_OFST);
if ((value & UDP_HEADER_Y_MSK) !=
((posval << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK)) {
(uint32_t)((posval << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK)) {
LOG(logERROR, ("Could not set column position for left port\n"));
ret = FAIL;
}
@@ -1138,7 +1140,7 @@ int Beb_SetDetectorPosition(int pos[]) {
value | ((posval << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK));
value = Beb_Read32(csp0base, UDP_HEADER_B_RIGHT_OFST);
if ((value & UDP_HEADER_Y_MSK) !=
((posval << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK)) {
(uint32_t)((posval << UDP_HEADER_Y_OFST) & UDP_HEADER_Y_MSK)) {
LOG(logERROR, ("Could not set column position for right port\n"));
ret = FAIL;
}
@@ -137,13 +137,6 @@ void Feb_Control_CloseSerialCommunication() {
int Feb_Control_CheckSetup(int master) {
LOG(logDEBUG1, ("Checking Set up\n"));
for (unsigned int j = 0; j < 4; j++) {
if (Feb_Control_idelay[j] < 0) {
LOG(logERROR, ("idelay chip %d not set.\n", j));
return 0;
}
}
int value = 0;
if ((Feb_Control_master) && (!Feb_Control_GetHighVoltage(&value))) {
LOG(logERROR, ("high voltage not set.\n"));
@@ -491,7 +484,7 @@ float Feb_Control_DACToVoltage(unsigned int digital, unsigned int nsteps,
int Feb_Control_SetDAC(unsigned int ch, int value) {
unsigned int dst_num = Feb_Control_rightAddress;
if (ch < 0 || ch > 15) {
if (ch > 15) {
LOG(logERROR, ("invalid ch for SetDAC.\n"));
return 0;
}
@@ -663,7 +656,7 @@ int Feb_Control_SetTrimbits(unsigned int *trimbits, int top) {
int Feb_Control_SaveAllTrimbitsTo(int value, int top) {
unsigned int chanregs[Feb_Control_trimbit_size];
for (int i = 0; i < Feb_Control_trimbit_size; i++)
for (int i = 0; i < (int)Feb_Control_trimbit_size; i++)
chanregs[i] = value;
return Feb_Control_SetTrimbits(chanregs, top);
}
@@ -1999,7 +1992,7 @@ int Feb_Control_SetRateCorrectionTau(int64_t tau_in_Nsec) {
LOG(logINFO, ("Changing Rate Correction Table tau:%0.8f sec, period:%f sec",
tau_in_sec, period_in_sec));
LOG(logINFO, ("\tCalculating table for tau of %lld ns.\n", tau_in_Nsec));
for (int i = 0; i < np; i++) {
for (int i = 0; i < (int)np; i++) {
Feb_Control_rate_meas[i] = i * exp(-i / period_in_sec * tau_in_sec);
if (Feb_Control_rate_meas[i] > ratemax)
ratemax = Feb_Control_rate_meas[i];
@@ -2034,7 +2027,7 @@ int Feb_Control_SetRateCorrectionTau(int64_t tau_in_Nsec) {
double s = 0, sx = 0, sy = 0, sxx = 0, sxy = 0;
int filled = 0;
for (;; next_i++) {
if (next_i >= np) {
if (next_i >= (int)np) {
for (; b < 1024; b++) {
if (beforemax > ratemax)
b0[b] = beforemax;
@@ -95,7 +95,7 @@ int Local_Write(struct LocalLinkInterface *ll, unsigned int buffer_len,
LOG(logDEBUG1, ("LL Write - Len: %2d - If: %X - Data: ", buffer_len,
ll->ll_fifo_base));
for (int i = 0; i < buffer_len / 4; i++)
for (int i = 0; i < (int)buffer_len / 4; i++)
LOG(logDEBUG1, ("%.8X ", *(((unsigned *)buffer) + i)));
while (words_send <= last_word) {
@@ -890,7 +890,7 @@ int getDefaultDac(enum DACINDEX index, enum detectorSettings sett,
if (sett != UNDEFINED) {
return FAIL;
}
if (index < 0 || index >= NDAC)
if (index >= NDAC)
return FAIL;
*retval = defaultDacValues[index];
return OK;
@@ -900,7 +900,7 @@ int setDefaultDac(enum DACINDEX index, enum detectorSettings sett, int value) {
if (sett != UNDEFINED) {
return FAIL;
}
if (index < 0 || index >= NDAC)
if (index >= NDAC)
return FAIL;
char *dac_names[] = {DAC_NAMES};
@@ -1428,7 +1428,7 @@ int setThresholdEnergy(int ev) {
/* parameters - dac, adc, hv */
int validateDACIndex(enum DACINDEX ind, char *mess) {
// including E_VTHRESHOLD
if (ind < 0 || ind >= NDAC + 1) {
if (ind >= NDAC + 1) {
sprintf(mess, "Could not set DAC. Invalid index %d\n", ind);
LOG(logERROR, (mess));
return FAIL;