forked from epics_driver_modules/motorBase
send_mess() uses 'const char *' (and more const char*)
The 2nd and 3rd parameter in send_mess() can and should
be a 'const char *' instead of just 'char *'.
Modern compilers complain here, so that the signature now
gets the const.
Update drivers from the following list to use the new send_mess():
modules/motorAcs
modules/motorAcsTech80
modules/motorAerotech
modules/motorFaulhaber
modules/motorIms
modules/motorKohzu
modules/motorMclennan
modules/motorMicos
modules/motorMicroMo
modules/motorNewFocus
modules/motorNewport
modules/motorOms
modules/motorOriel
modules/motorPI
modules/motorParker
modules/motorPiJena
modules/motorSmartMotor
modules/motorThorLabs
And while there, fix one more "const char *" in motordrvCom.cc
This commit is contained in:
@@ -219,6 +219,19 @@ Modification Log for R6-10
|
||||
|
||||
File modified: OmsSrc/drvMAXv.cc
|
||||
|
||||
8) Changed axis names from 'char *' to 'const char*' to avoid compiler warnings.
|
||||
(Assigning literal string to char* is deprecated).
|
||||
This affects driver_table.axis_names and driver_table.sendmsg used in
|
||||
every motor driver.
|
||||
*** THIS CHANGE BREAKS BACKWARD COMPATIBILITY! ***
|
||||
All external motor drivers need to change their send_mess() function
|
||||
to use 'const char*' as the last argument:
|
||||
RTN_STATUS send_mess(int, const char *, const char *);
|
||||
|
||||
Files modified: motorApp/MotorSrc/motordrvCom.h
|
||||
motorApp/MotorSrc/motordrvCom.cc
|
||||
motorApp/*Src/drv*.cc
|
||||
|
||||
|
||||
Modification Log for R6-9
|
||||
=========================
|
||||
|
||||
+1
-1
Submodule modules/motorAcs updated: 577fbcb73e...ba3193b340
+1
-1
Submodule modules/motorAcsTech80 updated: c00e941403...f409282bba
+1
-1
Submodule modules/motorAerotech updated: d3f02c5f9a...1b8e4c0023
+1
-1
Submodule modules/motorFaulhaber updated: f7b018822e...e028325b50
+1
-1
Submodule modules/motorIms updated: 3f95ae51a3...10c502c8dc
+1
-1
Submodule modules/motorKohzu updated: 5b72942e16...d4f694d586
+1
-1
Submodule modules/motorMclennan updated: 89fe35d107...f4f1708497
+1
-1
Submodule modules/motorMicos updated: 1f341b271d...e92135f37c
+1
-1
Submodule modules/motorMicroMo updated: ba3e575aec...04331b5cfa
+1
-1
Submodule modules/motorNewFocus updated: 1ec6839b0e...9b5dc61554
+1
-1
Submodule modules/motorNewport updated: 374a937086...6201b85711
+1
-1
Submodule modules/motorOms updated: 49c7fce59b...ee078b399c
+1
-1
Submodule modules/motorOriel updated: 6f151eabf5...e325636dbb
+1
-1
Submodule modules/motorPI updated: 13c2b1c75b...3e8d6cc3fc
+1
-1
Submodule modules/motorParker updated: 1f978b4fd8...efe069c2c2
+1
-1
Submodule modules/motorPiJena updated: b1c586075f...1dd01ea908
+1
-1
Submodule modules/motorSmartMotor updated: ee30ba9cc4...23eb223b1d
+1
-1
Submodule modules/motorThorLabs updated: 0a9ec8f118...11365b26a6
@@ -312,7 +312,7 @@ static void process_messages(struct driver_table *tabptr, epicsTime tick,
|
||||
struct mess_info *motor_info;
|
||||
struct controller *brdptr;
|
||||
char inbuf[MAX_MSG_SIZE];
|
||||
char *axis_name;
|
||||
const char *axis_name;
|
||||
|
||||
if (tabptr->axis_names == NULL)
|
||||
axis_name = (char *) NULL;
|
||||
|
||||
@@ -196,13 +196,13 @@ struct driver_table
|
||||
struct controller ***card_array;
|
||||
int *cardcnt_ptr;
|
||||
int *any_inmotion_ptr;
|
||||
RTN_STATUS (*sendmsg) (int, char const *, char *);
|
||||
RTN_STATUS (*sendmsg) (int, const char *, const char *);
|
||||
int (*getmsg) (int, char *, int);
|
||||
int (*setstat) (int, int);
|
||||
void (*query_done) (int, int, struct mess_node *);
|
||||
void (*strtstat) (int); /* Optional; start status function or NULL. */
|
||||
const bool *const init_indicator; /* Driver initialized indicator. */
|
||||
char **axis_names; /* Axis name array or NULL. */
|
||||
const char **axis_names; /* Axis name array or NULL. */
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user