Skip to content
Open
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
7 changes: 7 additions & 0 deletions src/emc/rs274ngc/interp_setup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,13 @@ setup::setup() :
disable_fanuc_style_sub(false),
loop_on_main_m99(false),
disable_g92_persistence(0),
heading(0.0),
radius(0.0),
center_x(0.0),
center_y(0.0),
center_z(0.0),
normal_heading(0.0),
iscircle(false),
pythis(),
on_abort_command(NULL),
init_once(CANON_STOPPED)
Expand Down
9 changes: 7 additions & 2 deletions src/emc/usr_intf/schedrmt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ static int initSockets()
server_address.sin_addr.s_addr = htonl(INADDR_ANY);
server_address.sin_port = htons(port);
server_len = sizeof(server_address);
bind(server_sockfd, (struct sockaddr *)&server_address, server_len);
bind(server_sockfd, reinterpret_cast<struct sockaddr *>(&server_address), server_len);
listen(server_sockfd, 5);
signal(SIGCHLD, SIG_IGN);
return 0;
Expand Down Expand Up @@ -1153,6 +1153,10 @@ void *readClient(void * /*arg*/)

// res = 1;
context = (connectionRecType *) malloc(sizeof(connectionRecType));
if (!context) {
fprintf(stderr, "emcrsh: no memory\n");
goto fail;
}
context->cliSock = client_sockfd;
context->linked = false;
context->echo = true;
Expand Down Expand Up @@ -1196,6 +1200,7 @@ void *readClient(void * /*arg*/)
finished:
close(context->cliSock);
free(context);
fail:
pthread_exit((void *)0);
sessions--; // FIXME: not reached
}
Expand All @@ -1209,7 +1214,7 @@ int sockMain()

client_len = sizeof(client_address);
client_sockfd = accept(server_sockfd,
(struct sockaddr *)&client_address, &client_len);
reinterpret_cast<struct sockaddr *>(&client_address), &client_len);
if (client_sockfd < 0) exit(0);
sessions++;
if ((maxSessions == -1) || (sessions <= maxSessions))
Expand Down
2 changes: 0 additions & 2 deletions src/hal/drivers/mesa-hostmot2/hm2_7i43.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@

static int comp_id;

#ifdef MODULE_INFO
MODULE_INFO(linuxcnc, "component:hm2_7i43:LinuxCNC HAL driver for the Mesa Electronics 7i43 EPP Anything IO board with HostMot2 firmware.");
MODULE_INFO(linuxcnc, "license:GPL");
#endif // MODULE_INFO

MODULE_LICENSE("GPL");

Expand Down
2 changes: 0 additions & 2 deletions src/hal/drivers/mesa-hostmot2/hm2_7i90.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@

static int comp_id;

#ifdef MODULE_INFO
MODULE_INFO(linuxcnc, "component:hm2_7i90:LinuxCNC HAL driver for the Mesa Electronics 7i90 EPP Anything IO board with HostMot2 firmware.");
MODULE_INFO(linuxcnc, "license:GPL");
#endif // MODULE_INFO

MODULE_LICENSE("GPL");

Expand Down
2 changes: 0 additions & 2 deletions src/hal/drivers/mesa-hostmot2/hm2_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ static void kvlist_free(struct rtapi_list_head *head) {
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Michael Geszkiewicz");
MODULE_DESCRIPTION("Driver for HostMot2 on the 7i80 Anything I/O board from Mesa Electronics");
#ifdef MODULE_SUPPORTED_DEVICE
MODULE_SUPPORTED_DEVICE("Mesa-AnythingIO-7i80");
#endif

static char *board_ip[MAX_ETH_BOARDS];
RTAPI_MP_ARRAY_STRING(board_ip, MAX_ETH_BOARDS, "ip address of ethernet board(s)");
Expand Down
8 changes: 6 additions & 2 deletions src/hal/user_comps/hy_gt_vfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,15 +524,19 @@ int main(int argc, char **argv) {
// Set the response timeout.
t.tv_sec = 0;
t.tv_usec = 16 * 1000;
#if (LIBMODBUS_VERSION_CHECK(3, 1, 2))
// Cppcheck fails to parse the function-like macro
//#if (LIBMODBUS_VERSION_CHECK(3, 1, 2))
#if LIBMODBUS_VERSION_HEX >= 0x030102
modbus_set_response_timeout(mb, t.tv_sec, t.tv_usec);
#else
modbus_set_response_timeout(mb, &t);
#endif

// Disable the byte timeout so it just waits for the complete
// response timeout instead.
#if (LIBMODBUS_VERSION_CHECK(3, 1, 2))
// Cppcheck fails to parse the function-like macro
//#if (LIBMODBUS_VERSION_CHECK(3, 1, 2))
#if LIBMODBUS_VERSION_HEX >= 0x030102
t.tv_sec = 0;
t.tv_usec = 0;
modbus_set_byte_timeout(mb, t.tv_sec, t.tv_usec);
Expand Down
8 changes: 6 additions & 2 deletions src/hal/user_comps/mb2hal/mb2hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,9 @@ retCode get_tx_connection(const int this_mb_tx_num, int *ret_connected)
//set response and byte timeout according to each mb_tx
timeout.tv_sec = this_mb_tx->mb_response_timeout_ms / 1000;
timeout.tv_usec = (this_mb_tx->mb_response_timeout_ms % 1000) * 1000;
#if LIBMODBUS_VERSION_CHECK(3, 1, 2)
// Cppcheck fails to parse the function-like macro
//#if (LIBMODBUS_VERSION_CHECK(3, 1, 2))
# if LIBMODBUS_VERSION_HEX >= 0x030102
modbus_set_response_timeout(this_mb_link->modbus, timeout.tv_sec, timeout.tv_usec);
#else
modbus_set_response_timeout(this_mb_link->modbus, &timeout);
Expand All @@ -386,7 +388,9 @@ retCode get_tx_connection(const int this_mb_tx_num, int *ret_connected)

timeout.tv_sec = this_mb_tx->mb_byte_timeout_ms / 1000;
timeout.tv_usec = (this_mb_tx->mb_byte_timeout_ms % 1000) * 1000;
#if LIBMODBUS_VERSION_CHECK(3, 1, 2)
// Cppcheck fails to parse the function-like macro
//#if (LIBMODBUS_VERSION_CHECK(3, 1, 2))
# if LIBMODBUS_VERSION_HEX >= 0x030102
modbus_set_byte_timeout(this_mb_link->modbus, timeout.tv_sec, timeout.tv_usec);
#else
modbus_set_byte_timeout(this_mb_link->modbus, &timeout);
Expand Down
8 changes: 6 additions & 2 deletions src/hal/user_comps/svd-ps_vfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,15 +473,19 @@ int main(int argc, char **argv) {
// Set the response timeout.
t.tv_sec = 0;
t.tv_usec = 30 * 1000;
#if (LIBMODBUS_VERSION_CHECK(3, 1, 2))
// Cppcheck fails to parse the function-like macro
//#if (LIBMODBUS_VERSION_CHECK(3, 1, 2))
# if LIBMODBUS_VERSION_HEX >= 0x030102
modbus_set_response_timeout(mb, t.tv_sec, t.tv_usec);
#else
modbus_set_response_timeout(mb, &t);
#endif

// Disable the byte timeout so it just waits for the complete
// response timeout instead.
#if (LIBMODBUS_VERSION_CHECK(3, 1, 2))
// Cppcheck fails to parse the function-like macro
//#if (LIBMODBUS_VERSION_CHECK(3, 1, 2))
# if LIBMODBUS_VERSION_HEX >= 0x030102
t.tv_sec = 0;
t.tv_usec = 0;
modbus_set_byte_timeout(mb, t.tv_sec, t.tv_usec);
Expand Down
2 changes: 1 addition & 1 deletion src/hal/utils/halsh.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ static int halStreamCmd(ClientData cd, Tcl_Interp *interp, int argc, const char
return TCL_OK;
}
if (strcmp(sub, "maxdepth") == 0) {
char buf[16]; snprintf(buf, sizeof(buf), "%d", hal_stream_maxdepth(s));
char buf[16]; snprintf(buf, sizeof(buf), "%u", hal_stream_maxdepth(s));
Tcl_AppendResult(interp, buf, NULL);
return TCL_OK;
}
Expand Down
3 changes: 2 additions & 1 deletion src/rtapi/uspace_rtapi_app.hh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <unistd.h>
#include <pthread.h>
#include "rtapi_atomic.h"
#include "rtapi_stdint.h"

static inline void rtapi_timespec_add(timespec &result, const timespec &ta, const timespec &tb) {
result.tv_sec = ta.tv_sec + tb.tv_sec;
Expand Down Expand Up @@ -78,7 +79,7 @@ struct RtapiTask {

#define MAX_TASKS 64
#define TASK_MAGIC 21979 /* random numbers used as signatures */
#define TASK_MAGIC_INIT ((RtapiTask *)(-1))
#define TASK_MAGIC_INIT ((RtapiTask *)(rtapi_intptr_t)(-1))

struct RtapiApp {

Expand Down
Loading