Skip to content
Draft
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
2 changes: 1 addition & 1 deletion src/hal/components/plasmac.comp
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ FUNCTION(_) {
probe_required = TRUE;
rtapi_print_msg(RTAPI_MSG_ERR,"arc voltage fell below safe level while THC active\n"
"target voltage = %.2f\n"
"low cut volts = %ld\n"
"low cut volts = %" PRId64 "\n"
"arc voltage = %.2f\n"
"program is paused.\n", target_volts, low_cut_volts, arc_voltage_out);
probe_inhibit = TRUE;
Expand Down
21 changes: 15 additions & 6 deletions src/hal/utils/halcmd_commands.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1763,12 +1763,21 @@ static void print_thread_info_print(const hal_query_t *q, const char **patterns)
int rvm = hal_getref_p(&qm);
if(!rvt && !rvm) {
// note that the scriptmode format string has no \n
halcmd_output((!scriptmode ? "%11ld %-3s %20s ( %8ld, %8ld )\n" : "%ld %s %s %8ld %ld"),
q->thread.period,
"YES", // Always uses FP
q->name,
hal_get_sint(qt.pp.ref.s),
hal_get_sint(qm.pp.ref.s));
if(!scriptmode) {
halcmd_output("%s", fmt::format("{:11d} {:<3s} {:>20s} ( {:8d}, {:8d} )\n",
q->thread.period,
"YES", // Always uses FP
q->name,
hal_get_sint(qt.pp.ref.s),
hal_get_sint(qm.pp.ref.s)).c_str());
} else {
halcmd_output("%s", fmt::format("{:d} {:s} {:s} {:8d} {:d}",
q->thread.period,
"YES", // Always uses FP
q->name,
hal_get_sint(qt.pp.ref.s),
hal_get_sint(qm.pp.ref.s)).c_str());
}
} else {
rtapi_print_msg(RTAPI_MSG_ERR, "unexpected: cannot find time/tmax pin for %s thread\n", q->name);
}
Expand Down
16 changes: 8 additions & 8 deletions src/libnml/cms/cms.hh
Original file line number Diff line number Diff line change
Expand Up @@ -135,22 +135,22 @@ enum CMS_REMOTE_PORT_TYPE {

/* This structure will be placed at the beginning of every CMS buffer. */
struct CMS_HEADER {
long was_read; /* Has the buffer been read since the last
int64_t was_read; /* Has the buffer been read since the last
write? */
long write_id; /* Id of last write. */
long in_buffer_size; /* How much of the buffer is currently used. */
int64_t write_id; /* Id of last write. */
int64_t in_buffer_size; /* How much of the buffer is currently used. */
};

class CMS_DIAG_PROC_INFO;
class CMS_DIAG_HEADER;
class CMS_DIAGNOSTICS_INFO;

struct CMS_QUEUING_HEADER {
long head;
long tail;
long queue_length;
long end_queue_space;
long write_id;
int64_t head;
int64_t tail;
int64_t queue_length;
int64_t end_queue_space;
int64_t write_id;
};

enum CMS_NEUTRAL_ENCODING_METHOD {
Expand Down
2 changes: 1 addition & 1 deletion src/libnml/nml/cmd_msg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ NMLTYPE nmltype;
#include "cmd_msg.hh"
#include "libnml/linklist/linklist.hh"

RCS_CMD_MSG::RCS_CMD_MSG(NMLTYPE t, long sz):NMLmsg(t, sz)
RCS_CMD_MSG::RCS_CMD_MSG(NMLTYPE t, int64_t sz):NMLmsg(t, sz)
{
serial_number = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/libnml/nml/cmd_msg.hh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

class RCS_CMD_MSG:public NMLmsg {
public:
RCS_CMD_MSG(NMLTYPE t, long sz);
RCS_CMD_MSG(NMLTYPE t, int64_t sz);
int serial_number;
};

Expand Down
4 changes: 2 additions & 2 deletions src/libnml/nml/nml.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1406,7 +1406,7 @@ NMLTYPE NML::peek()
int NML::format_output()
{
NMLTYPE new_type;
long new_size;
int64_t new_size;

/* Check pointers */
if (NULL == cms) {
Expand Down Expand Up @@ -1825,7 +1825,7 @@ int NML::write_if_read(NMLmsg * nml_msg, int *serial_number)
int NML::format_input(NMLmsg * nml_msg)
{
NMLTYPE new_type;
long new_size;
int64_t new_size;
if (NULL == cms) {
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/libnml/nml/nml.hh
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class NML:public virtual CMS_USER {

int fast_mode;
int *cms_status;
long *cms_inbuffer_header_size;
int64_t *cms_inbuffer_header_size;
NML(const char *, const char *, const char *, const int set_to_server = 0, const int set_to_master =
0);
void reconstruct(NML_FORMAT_PTR, const char *, const char *, const char *,
Expand Down
4 changes: 2 additions & 2 deletions src/libnml/nml/nmlmsg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/* NMLmsg Functions. */ int NMLmsg::automatically_clear = 1;

/* Constructor */
NMLmsg::NMLmsg(NMLTYPE t, long s)
NMLmsg::NMLmsg(NMLTYPE t, int64_t s)
{
_type = t;
size = s;
Expand Down Expand Up @@ -56,7 +56,7 @@ NMLmsg::NMLmsg(NMLTYPE t, size_t s)
}
}

NMLmsg::NMLmsg(NMLTYPE t, long s, int noclear)
NMLmsg::NMLmsg(NMLTYPE t, int64_t s, int noclear)
{
if (automatically_clear && !noclear) {
clear();
Expand Down
6 changes: 3 additions & 3 deletions src/libnml/nml/nmlmsg.hh
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@ class CMS; /* Use only partial definition to avoid */
/* and define their own update function. */
class NMLmsg {
protected:
NMLmsg(NMLTYPE t, long s);
NMLmsg(NMLTYPE t, int64_t s);
NMLmsg(NMLTYPE t, size_t s);

/* This second constructor never clears the message regardless of what is
in nmlmsg. The value of noclear is irrelevant but adding it changes
which constructor is called. */
NMLmsg(NMLTYPE t, long s, int noclear);
NMLmsg(NMLTYPE t, int64_t s, int noclear);

public:
void clear();

static int automatically_clear; /* controls whether NMLmsgs are set
to zero in the constructor. */
NMLTYPE _type; /* Each derived type should have a unique id */
long size; /* The size is used so that the entire buffer
int64_t size; /* The size is used so that the entire buffer
is not copied unnecessarily. */
};

Expand Down
9 changes: 9 additions & 0 deletions src/rtapi/rtapi_stdint.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ typedef u32 rtapi_u32;
typedef u64 rtapi_u64;
typedef unsigned long rtapi_uintptr_t;

// printk format macros for the fixed-width types; kernel s64/u64 are
// always long long. Mirrors what <inttypes.h> provides in uspace.
#ifndef PRId64
#define PRId64 "lld"
#endif
#ifndef PRIu64
#define PRIu64 "llu"
#endif

#define RTAPI_INT8_MAX (127)
#define RTAPI_INT8_MIN (-128)
#define RTAPI_UINT8_MAX (255)
Expand Down
Loading