Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/hal/components/sampler_usr.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
*/

#include <stdio.h>
#include <inttypes.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
Expand Down Expand Up @@ -221,10 +222,10 @@ int main(int argc, char **argv)
}
break;
case HAL_UINT:
printf ( "%llu ", (unsigned long long)buf[n].k);
printf ( "%" PRIu64 " ", buf[n].k);
break;
case HAL_SINT:
printf ( "%lld ", (long long)buf[n].l);
printf ( "%" PRId64 " ", buf[n].l);
break;
default:
/* better not happen */
Expand Down
8 changes: 4 additions & 4 deletions src/hal/drivers/mesa-hostmot2/hm2_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,9 +900,9 @@ static int hm2_eth_read(hm2_lowlevel_io_t *this, rtapi_u32 addr, void *buffer, i
t2 = rtapi_get_time();

if (recv == 4) {
LL_PRINT_IF(debug, "read(%d) : PACKET RECV [DATA: %08X | SIZE: %d | TIME: %llu]\n", board->read_cnt, *tmp_buffer, recv, t2 - t1);
LL_PRINT_IF(debug, "read(%d) : PACKET RECV [DATA: %08X | SIZE: %d | TIME: %lld]\n", board->read_cnt, *tmp_buffer, recv, t2 - t1);
} else {
LL_PRINT_IF(debug, "read(%d) : PACKET RECV [SIZE: %d | TIME: %llu]\n", board->read_cnt, recv, t2 - t1);
LL_PRINT_IF(debug, "read(%d) : PACKET RECV [SIZE: %d | TIME: %lld]\n", board->read_cnt, recv, t2 - t1);
}
if (recv < 0)
return 0;
Expand Down Expand Up @@ -1035,7 +1035,7 @@ static int hm2_eth_receive_queued_reads(hm2_lowlevel_io_t *this) {
return -EAGAIN;
}

LL_PRINT_IF(debug, "receive_queued_reads(%d) : PACKET RECV [SIZE: %d | TIME: %llu]\n", board->read_cnt, recv, t2 - t1);
LL_PRINT_IF(debug, "receive_queued_reads(%d) : PACKET RECV [SIZE: %d | TIME: %lld]\n", board->read_cnt, recv, t2 - t1);

for (i = 0; i < board->queue_reads_count; i++) {
memcpy(board->queue_reads[i].buffer, &tmp_buffer[board->queue_reads[i].from], board->queue_reads[i].size);
Expand Down Expand Up @@ -1154,7 +1154,7 @@ static int hm2_eth_send_queued_writes(hm2_lowlevel_io_t *this) {
LL_PRINT("ERROR: sending packet: %s\n", strerror(errno));
}
t1 = rtapi_get_time();
LL_PRINT_IF(debug, "enqueue_write(%d) : PACKET SEND [SIZE: %d | TIME: %llu]\n", board->write_cnt, send, t1 - t0);
LL_PRINT_IF(debug, "enqueue_write(%d) : PACKET SEND [SIZE: %d | TIME: %lld]\n", board->write_cnt, send, t1 - t0);
board->write_packet_ptr = board->write_packet;
return send < 0 ? 0 : 1;
}
Expand Down
13 changes: 7 additions & 6 deletions src/hal/utils/halcmd_commands.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <rtapi_string.h> // rtapi_strlcpy

#include <stdio.h>
#include <inttypes.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
Expand Down Expand Up @@ -1704,18 +1705,18 @@ static void print_funct_info_print(const hal_query_t *q, const char **patterns)
if(!match(patterns, q->name))
return;
if(!scriptmode) {
halcmd_output(" %05d %08llx %08llx %-3s %5d %s\n",
halcmd_output(" %05d %08" PRIxPTR " %08" PRIxPTR " %-3s %5d %s\n",
q->funct.comp_id,
(long long)q->funct.funct,
(long long)q->funct.arg,
q->funct.funct,
q->funct.arg,
"YES", // Always uses FP
q->funct.users,
q->name);
} else {
halcmd_output("%s %08llx %08llx %s %3d %s\n",
halcmd_output("%s %08" PRIxPTR " %08" PRIxPTR " %s %3d %s\n",
q->funct.comp,
(long long)q->funct.funct,
(long long)q->funct.arg,
q->funct.funct,
q->funct.arg,
"YES", // Always uses FP
q->funct.users,
q->name);
Expand Down
5 changes: 3 additions & 2 deletions src/hal/utils/halsh.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
#include <tcl.h>
#include "halcmd.h"
#include <hal.h>
Expand Down Expand Up @@ -113,8 +114,8 @@ static int halsh_format_one(Tcl_Interp *interp,
switch(hal_stream_element_type(s, idx)) {
case HAL_BOOL: snprintf(buf, sizeof(buf), "%d", v.b ? 1 : 0); break;
case HAL_REAL: snprintf(buf, sizeof(buf), "%g", v.f); break;
case HAL_SINT: snprintf(buf, sizeof(buf), "%lld", (long long)v.l); break;
case HAL_UINT: snprintf(buf, sizeof(buf), "%llu", (unsigned long long)v.k); break;
case HAL_SINT: snprintf(buf, sizeof(buf), "%" PRId64, v.l); break;
case HAL_UINT: snprintf(buf, sizeof(buf), "%" PRIu64, v.k); break;
default: snprintf(buf, sizeof(buf), "0"); break;
}
Tcl_AppendElement(interp, buf);
Expand Down
7 changes: 4 additions & 3 deletions src/hal/utils/meter.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#define _(x) gettext(x)

#include <sys/types.h>
#include <inttypes.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -544,12 +545,12 @@ static const char *data_value(hal_type_t type, hal_refs_u ref)
value_str = buf;
break;
case HAL_SINT:
snprintf(buf, sizeof(buf), "%10lld", (long long)hal_get_sint(ref.s));
snprintf(buf, sizeof(buf), "%10" PRId64, hal_get_sint(ref.s));
value_str = buf;
break;
case HAL_UINT: {
unsigned long long v = hal_get_uint(ref.u);
snprintf(buf, sizeof(buf), "%10llu (0x%08llX)", v, v);
uint64_t v = hal_get_uint(ref.u);
snprintf(buf, sizeof(buf), "%10" PRIu64 " (0x%08" PRIX64 ")", v, v);
value_str = buf;
}
break;
Expand Down
Loading