Fix a number of compiler warnings

This commit is contained in:
Simon Duquennoy 2017-06-21 11:56:12 +02:00
parent 75c17e15ca
commit 3d5ee21d69
5 changed files with 10 additions and 9 deletions

View File

@ -442,12 +442,13 @@ event(struct tcp_socket *tcps, void *ptr,
tcp_socket_send_str(tcps, "Range: bytes=");
if(s->length) {
if(s->pos >= 0) {
sprintf(str, "%llu-%llu", s->pos, s->pos + s->length - 1);
sprintf(str, "%llu-%llu",
(long long unsigned int)s->pos, (long long unsigned int)s->pos + s->length - 1);
} else {
sprintf(str, "-%llu", s->length);
sprintf(str, "-%llu", (long long unsigned int)s->length);
}
} else {
sprintf(str, "%llu-", s->pos);
sprintf(str, "%llu-", (long long unsigned int)s->pos);
}
tcp_socket_send_str(tcps, str);
tcp_socket_send_str(tcps, "\r\n");

View File

@ -184,7 +184,7 @@ typedef struct unit_test {
*/
#define UNIT_TEST_RESULT(name) (unit_test_##name.result)
/* The default print function. */
void unit_test_print_report(const unit_test_t *utp);
/* The print function. */
void UNIT_TEST_PRINT_FUNCTION(const unit_test_t *utp);
#endif /* !UNIT_TEST_H */

View File

@ -101,7 +101,7 @@ timesync_learn_drift_ticks(uint32_t time_delta_asn, int32_t drift_ticks)
TSCH_LOG_ADD(tsch_log_message,
snprintf(log->message, sizeof(log->message),
"drift %ld", drift_ppm / 256));
"drift %ld", (long int)drift_ppm / 256));
}
/*---------------------------------------------------------------------------*/
/* Either reset or update the neighbor's drift */
@ -147,7 +147,7 @@ compensate_internal(uint32_t time_delta_usec, int32_t drift_ppm, int32_t *remain
if(ABS(amount_ticks) > RTIMER_ARCH_SECOND / 128) {
TSCH_LOG_ADD(tsch_log_message,
snprintf(log->message, sizeof(log->message),
"!too big compensation %ld delta %ld", amount_ticks, time_delta_usec));
"!too big compensation %ld delta %ld", (long int)amount_ticks, (long int)time_delta_usec));
amount_ticks = (amount_ticks > 0 ? RTIMER_ARCH_SECOND : -RTIMER_ARCH_SECOND) / 128;
}

View File

@ -42,7 +42,7 @@ AUTOSTART_PROCESSES(&test_process);
static struct ringbufindex ri;
static const uint8_t ri_size = 2;
static void
void
test_print_report(const unit_test_t *utp)
{
printf("=check-me= ");

View File

@ -111,7 +111,7 @@ UNIT_TEST_REGISTER(panid_frame_ver_0b01, "PAN ID Cmpr Handing (frame-ver: 0b01)"
UNIT_TEST_REGISTER(panid_frame_ver_0b10, "PAN ID Cmpr Handing (frame-ver: 0b10)");
static void
void
test_print_report(const unit_test_t *utp)
{
printf("=check-me= ");