From 2bf8e114f933de08045517978fcbb3caf7745e7e Mon Sep 17 00:00:00 2001 From: Bertho Stultiens Date: Fri, 10 Jan 2025 20:02:32 +0100 Subject: [PATCH] Fix ignored const|volatile return qualifier. Fix ignored volatile qualifier on cast. --- src/emc/motion/axis.c | 2 +- src/emc/motion/axis.h | 2 +- src/emc/nml_intf/canon_position.cc | 2 +- src/emc/nml_intf/canon_position.hh | 2 +- src/hal/halmodule.cc | 8 ++++---- src/hal/user_comps/xhc-whb04b-6/usb.cc | 2 +- src/hal/user_comps/xhc-whb04b-6/usb.h | 2 +- src/libnml/inifile/inifile.cc | 4 ++-- src/libnml/inifile/inifile.h | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/emc/motion/axis.c b/src/emc/motion/axis.c index 05ebf97ccd3..4b8f37d3298 100644 --- a/src/emc/motion/axis.c +++ b/src/emc/motion/axis.c @@ -457,7 +457,7 @@ void axis_apply_ext_offsets_to_carte_pos(int extfactor, double *pcmd_p[]) } } -hal_bit_t axis_plan_external_offsets(double servo_period, bool motion_enable_flag, bool all_homed) +bool axis_plan_external_offsets(double servo_period, bool motion_enable_flag, bool all_homed) { static int first_pass = 1; int n; diff --git a/src/emc/motion/axis.h b/src/emc/motion/axis.h index 3ec5bbd8641..58017b39063 100644 --- a/src/emc/motion/axis.h +++ b/src/emc/motion/axis.h @@ -14,7 +14,7 @@ void axis_initialize_external_offsets(void); int axis_init_hal_io(int mot_comp_id); void axis_handle_jogwheels(bool motion_teleop_flag, bool motion_enable_flag, bool homing_is_active); -hal_bit_t axis_plan_external_offsets(double servo_period, bool motion_enable_flag, bool all_homed); +bool axis_plan_external_offsets(double servo_period, bool motion_enable_flag, bool all_homed); void axis_check_constraints(double pos[], int failing_axes[]); void axis_jog_cont(int axis_num, double vel, long servo_period); diff --git a/src/emc/nml_intf/canon_position.cc b/src/emc/nml_intf/canon_position.cc index 1734ec5732a..35525bbd6ac 100644 --- a/src/emc/nml_intf/canon_position.cc +++ b/src/emc/nml_intf/canon_position.cc @@ -165,7 +165,7 @@ const CANON_POSITION CANON_POSITION::operator-(const EmcPose &o) const { return result; } -const double CANON_POSITION::max() const{ +double CANON_POSITION::max() const{ double res = x; res = fmax(res, this->y); res = fmax(res, this->z); diff --git a/src/emc/nml_intf/canon_position.hh b/src/emc/nml_intf/canon_position.hh index e0d3cc733eb..a7cb2c5f9ac 100644 --- a/src/emc/nml_intf/canon_position.hh +++ b/src/emc/nml_intf/canon_position.hh @@ -58,7 +58,7 @@ struct CANON_POSITION { const CANON_POSITION abs() const; const CANON_POSITION absdiff(const CANON_POSITION &o) const; - const double max() const; + double max() const; const EmcPose toEmcPose() const; diff --git a/src/hal/halmodule.cc b/src/hal/halmodule.cc index 5f251fc5971..e016c115af6 100644 --- a/src/hal/halmodule.cc +++ b/src/hal/halmodule.cc @@ -87,7 +87,7 @@ bool from_python(PyObject *o, hal_u32_t *u) { l = PyLong_AsLongLong(tmp); if(PyErr_Occurred()) goto fail; - if(l < 0 || l != (hal_u32_t)l) { + if(l < 0 || l != (rtapi_u32)l) { PyErr_Format(PyExc_OverflowError, "Value %lld out of range", l); goto fail; } @@ -108,7 +108,7 @@ bool from_python(PyObject *o, hal_s32_t *i) { l = PyLong_AsLongLong(tmp); if(PyErr_Occurred()) goto fail; - if(l != (hal_s32_t)l) { + if(l != (rtapi_s32)l) { PyErr_Format(PyExc_OverflowError, "Value %lld out of range", l); goto fail; } @@ -129,7 +129,7 @@ bool from_python(PyObject *o, hal_u64_t *u) { l = PyLong_AsLongLong(tmp); if(PyErr_Occurred()) goto fail; - if(l < 0 || l != (hal_u64_t)l) { + if(l < 0 || l != (rtapi_u64)l) { PyErr_Format(PyExc_OverflowError, "Value %lld out of range", l); goto fail; } @@ -150,7 +150,7 @@ bool from_python(PyObject *o, hal_s64_t *i) { l = PyLong_AsLongLong(tmp); if(PyErr_Occurred()) goto fail; - if(l != (hal_s64_t)l) { + if(l != (rtapi_s64)l) { PyErr_Format(PyExc_OverflowError, "Value %lld out of range", l); goto fail; } diff --git a/src/hal/user_comps/xhc-whb04b-6/usb.cc b/src/hal/user_comps/xhc-whb04b-6/usb.cc index 8532376c372..c011b8c3831 100644 --- a/src/hal/user_comps/xhc-whb04b-6/usb.cc +++ b/src/hal/user_comps/xhc-whb04b-6/usb.cc @@ -135,7 +135,7 @@ uint16_t Usb::getUsbProductId() const return usbProductId; } // ---------------------------------------------------------------------- -const bool Usb::isDeviceOpen() const +bool Usb::isDeviceOpen() const { return deviceHandle != nullptr; } diff --git a/src/hal/user_comps/xhc-whb04b-6/usb.h b/src/hal/user_comps/xhc-whb04b-6/usb.h index 0878fe1dab8..fc0dd596f70 100644 --- a/src/hal/user_comps/xhc-whb04b-6/usb.h +++ b/src/hal/user_comps/xhc-whb04b-6/usb.h @@ -280,7 +280,7 @@ class Usb : public UsbRawInputListener ~Usb(); uint16_t getUsbVendorId() const; uint16_t getUsbProductId() const; - const bool isDeviceOpen() const; + bool isDeviceOpen() const; libusb_context** getContextReference(); libusb_context* getContext(); void setContext(libusb_context* context); diff --git a/src/libnml/inifile/inifile.cc b/src/libnml/inifile/inifile.cc index 8c8894f1b6b..4ba8876ff43 100644 --- a/src/libnml/inifile/inifile.cc +++ b/src/libnml/inifile/inifile.cc @@ -601,14 +601,14 @@ iniFind(FILE *fp, const char *tag, const char *section) return(f.Find(tag, section).value_or(nullptr)); } -extern "C" const int +extern "C" int iniFindInt(FILE *fp, const char *tag, const char *section, int *result) { IniFile f(false, fp); return(f.Find(result, tag, section)); } -extern "C" const int +extern "C" int iniFindDouble(FILE *fp, const char *tag, const char *section, double *result) { IniFile f(false, fp); diff --git a/src/libnml/inifile/inifile.h b/src/libnml/inifile/inifile.h index 871c4022155..09a8c338d50 100644 --- a/src/libnml/inifile/inifile.h +++ b/src/libnml/inifile/inifile.h @@ -26,8 +26,8 @@ extern "C" #endif extern const char *iniFind(FILE *fp, const char *tag, const char *section); -extern const int iniFindInt(FILE *fp, const char *tag, const char *section, int *result); -extern const int iniFindDouble(FILE *fp, const char *tag, const char *section, double *result); +extern int iniFindInt(FILE *fp, const char *tag, const char *section, int *result); +extern int iniFindDouble(FILE *fp, const char *tag, const char *section, double *result); extern int TildeExpansion(const char *file, char *path, size_t size); #ifdef __cplusplus