@@ -83,8 +83,8 @@ static const char *pin_data_dir(int dir);
8383static const char * param_data_dir (int dir );
8484static const char * data_arrow1 (int dir );
8585static const char * data_arrow2 (int dir );
86- static char * data_value (int type , void * valptr );
87- static char * data_value2 (int type , void * valptr );
86+ static const char * data_value (int type , void * valptr );
87+ static const char * data_value2 (int type , void * valptr );
8888static void save_comps (FILE * dst );
8989static void save_aliases (FILE * dst );
9090static void save_signals (FILE * dst , int only_unlinked );
@@ -1093,7 +1093,7 @@ int do_loadrt_cmd(char *mod_name, char *args[])
10931093 char arg_string [MAX_CMD_LEN + 1 ];
10941094 int m = 0 , n = 0 , retval ;
10951095 hal_comp_t * comp ;
1096- char * argv [MAX_TOK + 3 ];
1096+ const char * argv [MAX_TOK + 3 ];
10971097 char * cp1 ;
10981098#if defined(RTAPI_USPACE )
10991099 argv [m ++ ] = "-Wn" ;
@@ -1357,7 +1357,7 @@ int do_unloadrt_cmd(char *mod_name)
13571357static int unloadrt_comp (char * mod_name )
13581358{
13591359 int retval ;
1360- char * argv [4 ];
1360+ const char * argv [4 ];
13611361
13621362#if defined(RTAPI_USPACE )
13631363 argv [0 ] = EMC2_BIN_DIR "/rtapi_app" ;
@@ -1404,13 +1404,13 @@ int do_unload_cmd(char *mod_name) {
14041404 }
14051405}
14061406
1407- static char * guess_comp_name (char * prog_name )
1407+ static const char * guess_comp_name (const char * prog_name )
14081408{
14091409 static char name [HAL_NAME_LEN + 1 ];
1410- char * last_slash = strrchr (prog_name , '/' );
1411- char * st = last_slash ? last_slash + 1 : prog_name ;
1412- char * last_dot = strrchr (st , '.' );
1413- char * en = last_dot ? last_dot : prog_name + strlen (prog_name );
1410+ const char * last_slash = strrchr (prog_name , '/' );
1411+ const char * st = last_slash ? last_slash + 1 : prog_name ;
1412+ const char * last_dot = strrchr (st , '.' );
1413+ const char * en = last_dot ? last_dot : prog_name + strlen (prog_name );
14141414 size_t len = en - st ;
14151415
14161416 snprintf (name , sizeof (name ), "%.*s" , (int )len , st );
@@ -1440,11 +1440,11 @@ is not fixed or has regressed by debian jessie)
14401440#endif
14411441}
14421442
1443- int do_loadusr_cmd (char * args [])
1443+ int do_loadusr_cmd (const char * args [])
14441444{
14451445 int wait_flag , wait_comp_flag , ignore_flag ;
1446- char * prog_name , * new_comp_name = NULL ;
1447- char * argv [MAX_TOK + 1 ];
1446+ const char * prog_name , * new_comp_name = NULL ;
1447+ const char * argv [MAX_TOK + 1 ];
14481448 int n , m , retval , status ;
14491449 pid_t pid ;
14501450
@@ -1464,7 +1464,7 @@ int do_loadusr_cmd(char *args[])
14641464 /* check for options (-w, -i, and/or -r) */
14651465 reset_getopt_state ();
14661466 while (1 ) {
1467- int c = getopt (argc , args , "+wWin:" );
1467+ int c = getopt (argc , ( char * const * ) args , "+wWin:" );
14681468 if (c == -1 ) break ;
14691469
14701470 switch (c ) {
@@ -2341,9 +2341,9 @@ static const char *data_arrow2(int dir)
23412341
23422342/* Switch function to return var value for the print_*_list functions */
23432343/* the value is printed in a 12 character wide field */
2344- static char * data_value (int type , void * valptr )
2344+ static const char * data_value (int type , void * valptr )
23452345{
2346- char * value_str ;
2346+ const char * value_str ;
23472347 static char buf [15 ];
23482348
23492349 switch (type ) {
@@ -2378,9 +2378,9 @@ static char *data_value(int type, void *valptr)
23782378
23792379/* Switch function to return var value in string form */
23802380/* the value is printed as a packed string (no whitespace */
2381- static char * data_value2 (int type , void * valptr )
2381+ static const char * data_value2 (int type , void * valptr )
23822382{
2383- char * value_str ;
2383+ const char * value_str ;
23842384 static char buf [15 ];
23852385
23862386 switch (type ) {
@@ -2414,7 +2414,7 @@ static char *data_value2(int type, void *valptr)
24142414 return value_str ;
24152415}
24162416
2417- int do_save_cmd (char * type , char * filename )
2417+ int do_save_cmd (const char * type , char * filename )
24182418{
24192419 FILE * dst ;
24202420
0 commit comments