Skip to content

Commit 92f4639

Browse files
committed
Fix FTBFS with gcc-16 and unused variables
https://bugs.debian.org/1133458 (Closes: #1133458) Signed-off-by: Gianfranco Costamagna <locutusofborg@debian.org> Signed-off-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
1 parent fd1fbf8 commit 92f4639

42 files changed

Lines changed: 163 additions & 173 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

doc/dlt_filetransfer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ FLST | Package flag
5454
After the header package was sent, at least one or more data packages can be
5555
sent using:
5656

57-
` int dlt_user_log_file_data(DltContext *fileContext,const char *filename,int packageToTransfer, int timeout) `
57+
` int dlt_user_log_file_data(DltContext *fileContext,const char *filename,int packageToTransfer, unsigned int timeout) `
5858

5959
Data Data Package Protocol:
6060

include/dlt/dlt_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2308,7 +2308,7 @@ int dlt_execute_command(char *filename, char *command, ...);
23082308
* @param filename Only file names without prepended path allowed.
23092309
* @return pointer to extension
23102310
*/
2311-
char *get_filename_ext(const char *filename);
2311+
const char *get_filename_ext(const char *filename);
23122312

23132313
/**
23142314
* Extract the base name of given file name (without the extension).

include/dlt/dlt_filetransfer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
* @param timeout Timeout in ms to wait between some logs. Important that the FIFO of dlt will not be flooded with to many messages in a short period of time.
7171
* @return Returns 0 if everything was okey. If there was a failure value < 0 will be returned.
7272
*/
73-
extern int dlt_user_log_file_complete(DltContext *fileContext, const char *filename, int deleteFlag, int timeout);
73+
extern int dlt_user_log_file_complete(DltContext *fileContext, const char *filename, int deleteFlag, unsigned int timeout);
7474

7575

7676
/* !This method gives information about the number of packages the file have */
@@ -126,7 +126,7 @@ extern int dlt_user_log_file_header(DltContext *fileContext, const char *filenam
126126
* @param fileCancelTransferFlag is a bool pointer to cancel the filetransfer on demand. For example in case of application shutdown event outstanding file transfer should abort and return
127127
* @return Returns 0 if everything was okey. If there was a failure value < 0 will be returned.
128128
*/
129-
extern int dlt_user_log_file_data_cancelable(DltContext *fileContext, const char *filename, int packageToTransfer, int timeout, bool *const fileCancelTransferFlag);
129+
extern int dlt_user_log_file_data_cancelable(DltContext *fileContext, const char *filename, int packageToTransfer, unsigned int timeout, bool *const fileCancelTransferFlag);
130130

131131

132132
/* !Transfer the content data of a file. */
@@ -137,7 +137,7 @@ extern int dlt_user_log_file_data_cancelable(DltContext *fileContext, const char
137137
* @param timeout Timeout to wait between dlt logs. Important because the dlt FIFO should not be flooded. Default is defined by MIN_TIMEOUT. The given timeout in ms can not be smaller than MIN_TIMEOUT.
138138
* @return Returns 0 if everything was okey. If there was a failure value < 0 will be returned.
139139
*/
140-
extern int dlt_user_log_file_data(DltContext *fileContext, const char *filename, int packageToTransfer, int timeout);
140+
extern int dlt_user_log_file_data(DltContext *fileContext, const char *filename, int packageToTransfer, unsigned int timeout);
141141

142142

143143

src/console/dlt-control-common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ static int prepare_headers(DltMessage *msg, uint8_t *header)
349349
return -1;
350350
}
351351

352-
msg->standardheader->len = DLT_HTOBE_16(len);
352+
msg->standardheader->len = DLT_HTOBE_16((uint16_t)len);
353353

354354
return 0;
355355
}

src/console/dlt-control-v2.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -787,8 +787,8 @@ int main(int argc, char *argv[])
787787
/*dlt_client_main_loop(&dltclient, &dltdata, dltdata.vflag); */
788788

789789
/* Wait timeout */
790-
ts.tv_sec = (dltdata.tvalue * NANOSEC_PER_MILLISEC) / NANOSEC_PER_SEC;
791-
ts.tv_nsec = (dltdata.tvalue * NANOSEC_PER_MILLISEC) % NANOSEC_PER_SEC;
790+
ts.tv_sec = (long int)(dltdata.tvalue * NANOSEC_PER_MILLISEC) / NANOSEC_PER_SEC;
791+
ts.tv_nsec = (long int)(dltdata.tvalue * NANOSEC_PER_MILLISEC) % NANOSEC_PER_SEC;
792792
nanosleep(&ts, NULL);
793793
} else {
794794
ret = -1;
@@ -934,4 +934,4 @@ int dlt_receive_message_callback_v2(DltMessageV2 *message, void *data)
934934
}
935935

936936
return ret;
937-
}
937+
}

src/console/dlt-control.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,8 +754,8 @@ int main(int argc, char *argv[])
754754
/*dlt_client_main_loop(&dltclient, &dltdata, dltdata.vflag); */
755755

756756
/* Wait timeout */
757-
ts.tv_sec = (dltdata.tvalue * NANOSEC_PER_MILLISEC) / NANOSEC_PER_SEC;
758-
ts.tv_nsec = (dltdata.tvalue * NANOSEC_PER_MILLISEC) % NANOSEC_PER_SEC;
757+
ts.tv_sec = (long int)(dltdata.tvalue * NANOSEC_PER_MILLISEC) / NANOSEC_PER_SEC;
758+
ts.tv_nsec = (long int)(dltdata.tvalue * NANOSEC_PER_MILLISEC) % NANOSEC_PER_SEC;
759759
nanosleep(&ts, NULL);
760760
} else {
761761
ret = -1;

src/console/logstorage/dlt-logstorage-ctrl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ static int parse_args(int argc, char *argv[])
545545
}
546546

547547
#if !defined(DLT_SYSTEMD_ENABLE)
548-
int sd_notify(int unset_environment, const char *state)
548+
int sd_notify(int unset_environment, char *state)
549549
{
550550
/* Satisfy Compiler for warnings */
551551
(void)unset_environment;

src/console/logstorage/dlt-logstorage-udev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ static int logstorage_udev_udevd_callback(void)
247247
* and/or for hot unplug (without unmount).
248248
*/
249249
ts.tv_sec = 0;
250-
ts.tv_nsec = 500 * NANOSEC_PER_MILLISEC;
250+
ts.tv_nsec = (long int) 500 * NANOSEC_PER_MILLISEC;
251251
nanosleep(&ts, NULL);
252252
ret = check_mountpoint_from_partition(EVENT_MOUNTED, partition);
253253
}

src/daemon/dlt-daemon.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,15 +1604,15 @@ int main(int argc, char *argv[])
16041604
{
16051605
char *watchdogUSec = getenv("WATCHDOG_USEC");
16061606
// set a sensible default, in case the environment variable is not set
1607-
int watchdogTimeoutSeconds = 30;
1607+
unsigned int watchdogTimeoutSeconds = 30;
16081608

16091609
dlt_log(LOG_DEBUG, "Systemd watchdog initialization\n");
16101610

16111611
if (watchdogUSec) {
16121612
// WATCHDOG_USEC is the timeout in micrsoseconds
16131613
// divide this by 2*10^6 to get the interval in seconds
16141614
// 2 * because we notify systemd after half the timeout
1615-
watchdogTimeoutSeconds = atoi(watchdogUSec) / 2000000;
1615+
watchdogTimeoutSeconds = (unsigned int)atoi(watchdogUSec) / 2000000;
16161616
}
16171617

16181618
if (watchdogTimeoutSeconds == 0) {
@@ -2874,7 +2874,7 @@ int dlt_daemon_log_internal(DltDaemon *daemon, DltDaemonLocal *daemon_local,
28742874
msg.datasize += (int32_t)uiSize;
28752875

28762876
/* Calc length */
2877-
msg.standardheader->len = DLT_HTOBE_16((size_t)msg.headersize - sizeof(DltStorageHeader) + (size_t)msg.datasize);
2877+
msg.standardheader->len = DLT_HTOBE_16((uint16_t)((size_t)msg.headersize - sizeof(DltStorageHeader) + (size_t)msg.datasize));
28782878

28792879
dlt_daemon_client_send(DLT_DAEMON_SEND_TO_ALL, daemon,daemon_local,
28802880
msg.headerbuffer, sizeof(DltStorageHeader),
@@ -5660,8 +5660,8 @@ static void *timer_thread(void *data)
56605660
#endif
56615661

56625662
int create_timer_fd(DltDaemonLocal *daemon_local,
5663-
int period_sec,
5664-
int starts_in,
5663+
unsigned int period_sec,
5664+
unsigned int starts_in,
56655665
DltTimers timer_id)
56665666
{
56675667
int local_fd = DLT_FD_INIT;
@@ -5679,7 +5679,7 @@ int create_timer_fd(DltDaemonLocal *daemon_local,
56795679
return -1;
56805680
}
56815681

5682-
if ((period_sec <= 0) || (starts_in <= 0)) {
5682+
if ((period_sec == 0) || (starts_in == 0)) {
56835683
/* timer not activated via the service file */
56845684
dlt_vlog(LOG_INFO, "<%s> not set: period=0\n", timer_name);
56855685
local_fd = DLT_FD_INIT;
@@ -5693,10 +5693,10 @@ int create_timer_fd(DltDaemonLocal *daemon_local,
56935693
dlt_vlog(LOG_WARNING, "<%s> timerfd_create failed: %s\n",
56945694
timer_name, strerror(errno));
56955695

5696-
l_timer_spec.it_interval.tv_sec = period_sec;
5697-
l_timer_spec.it_interval.tv_nsec = 0;
5698-
l_timer_spec.it_value.tv_sec = starts_in;
5699-
l_timer_spec.it_value.tv_nsec = 0;
5696+
l_timer_spec.it_interval.tv_sec = (long int) period_sec;
5697+
l_timer_spec.it_interval.tv_nsec = (long int) 0;
5698+
l_timer_spec.it_value.tv_sec = (long int) starts_in;
5699+
l_timer_spec.it_value.tv_nsec = (long int) 0;
57005700

57015701
if (timerfd_settime(local_fd, 0, &l_timer_spec, NULL) < 0) {
57025702
dlt_vlog(LOG_WARNING, "<%s> timerfd_settime failed: %s\n",

src/daemon/dlt-daemon.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ typedef struct
190190
typedef struct
191191
{
192192
unsigned long long wakeups_missed;
193-
int period_sec;
194-
int starts_in;
193+
unsigned int period_sec;
194+
unsigned int starts_in;
195195
int timer_id;
196196
} DltDaemonPeriodicData;
197197

@@ -232,7 +232,7 @@ int dlt_daemon_process_client_messages_serial(DltDaemon *daemon,
232232
int dlt_daemon_process_user_messages(DltDaemon *daemon, DltDaemonLocal *daemon_local, DltReceiver *recv, int verbose);
233233
int dlt_daemon_process_one_s_timer(DltDaemon *daemon, DltDaemonLocal *daemon_local, DltReceiver *recv, int verbose);
234234
int dlt_daemon_process_sixty_s_timer(DltDaemon *daemon, DltDaemonLocal *daemon_local, DltReceiver *recv, int verbose);
235-
int dlt_daemon_process_systemd_timer(DltDaemon *daemon, DltDaemonLocal *daemon_local, DltReceiver *recv, int verbose);
235+
ssize_t dlt_daemon_process_systemd_timer(DltDaemon *daemon, DltDaemonLocal *daemon_local, DltReceiver *recv, int verbose);
236236

237237
int dlt_daemon_process_control_connect(DltDaemon *daemon, DltDaemonLocal *daemon_local, DltReceiver *recv, int verbose);
238238
#if defined DLT_DAEMON_USE_UNIX_SOCKET_IPC || defined DLT_DAEMON_VSOCK_IPC_ENABLE
@@ -300,7 +300,7 @@ void dlt_daemon_ecu_version_thread(void *ptr);
300300
void dlt_daemon_systemd_watchdog_thread(void *ptr);
301301
#endif
302302

303-
int create_timer_fd(DltDaemonLocal *daemon_local, int period_sec, int starts_in, DltTimers timer);
303+
int create_timer_fd(DltDaemonLocal *daemon_local, unsigned int period_sec, unsigned int starts_in, DltTimers timer);
304304

305305
int dlt_daemon_close_socket(int sock, DltDaemon *daemon, DltDaemonLocal *daemon_local, int verbose);
306306

0 commit comments

Comments
 (0)