diff options
author | Yaakov Selkowitz <yselkowi@redhat.com> | 2017-12-04 05:25:16 +0300 |
---|---|---|
committer | Yaakov Selkowitz <yselkowi@redhat.com> | 2018-01-17 20:47:08 +0300 |
commit | 0bda30e1ffd23488aa4a9b73f228089463fbee1a (patch) | |
tree | b0efb851be762c4d530cc259070005318702321d /newlib/libc/posix | |
parent | 6783860a2e4e4183c073f62e4bb938cea0e096c3 (diff) |
ansification: remove _CONST
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Diffstat (limited to 'newlib/libc/posix')
-rw-r--r-- | newlib/libc/posix/execl.c | 14 | ||||
-rw-r--r-- | newlib/libc/posix/execle.c | 18 | ||||
-rw-r--r-- | newlib/libc/posix/execlp.c | 14 | ||||
-rw-r--r-- | newlib/libc/posix/execv.c | 2 | ||||
-rw-r--r-- | newlib/libc/posix/execvp.c | 4 | ||||
-rw-r--r-- | newlib/libc/posix/posix_spawn.c | 52 |
6 files changed, 52 insertions, 52 deletions
diff --git a/newlib/libc/posix/execl.c b/newlib/libc/posix/execl.c index beb48c6ae..fbad9f3f8 100644 --- a/newlib/libc/posix/execl.c +++ b/newlib/libc/posix/execl.c @@ -19,8 +19,8 @@ static char ***p_environ = &environ; int _DEFUN(execl, (path, arg0, ...), - _CONST char *path, - _CONST char *arg0 _DOTS) + const char *path, + const char *arg0 _DOTS) #else @@ -28,8 +28,8 @@ _DEFUN(execl, (path, arg0, ...), int _DEFUN(execl, (path, arg0, va_alist), - _CONST char *path, - _CONST char *arg0, + const char *path, + const char *arg0, va_dcl) #endif @@ -37,16 +37,16 @@ _DEFUN(execl, (path, arg0, va_alist), { int i; va_list args; - _CONST char *argv[256]; + const char *argv[256]; va_start (args, arg0); argv[0] = arg0; i = 1; do - argv[i] = va_arg (args, _CONST char *); + argv[i] = va_arg (args, const char *); while (argv[i++] != NULL); va_end (args); - return _execve (path, (char * _CONST *) argv, *p_environ); + return _execve (path, (char * const *) argv, *p_environ); } #endif /* !_NO_EXECVE */ diff --git a/newlib/libc/posix/execle.c b/newlib/libc/posix/execle.c index f4c759250..c18555c02 100644 --- a/newlib/libc/posix/execle.c +++ b/newlib/libc/posix/execle.c @@ -14,8 +14,8 @@ int _DEFUN(execle, (path, arg0, ...), - _CONST char *path, - _CONST char *arg0 _DOTS) + const char *path, + const char *arg0 _DOTS) #else @@ -23,8 +23,8 @@ _DEFUN(execle, (path, arg0, ...), int _DEFUN(execle, (path, arg0, va_alist), - _CONST char *path, - _CONST char *arg0, + const char *path, + const char *arg0, va_dcl) #endif @@ -32,19 +32,19 @@ _DEFUN(execle, (path, arg0, va_alist), { int i; va_list args; - _CONST char * _CONST *envp; - _CONST char *argv[256]; + const char * const *envp; + const char *argv[256]; va_start (args, arg0); argv[0] = arg0; i = 1; do - argv[i] = va_arg (args, _CONST char *); + argv[i] = va_arg (args, const char *); while (argv[i++] != NULL); - envp = va_arg (args, _CONST char * _CONST *); + envp = va_arg (args, const char * const *); va_end (args); - return _execve (path, (char * _CONST *) argv, (char * _CONST *) envp); + return _execve (path, (char * const *) argv, (char * const *) envp); } #endif /* !_NO_EXECVE */ diff --git a/newlib/libc/posix/execlp.c b/newlib/libc/posix/execlp.c index 6731bb905..6b9c2f7e9 100644 --- a/newlib/libc/posix/execlp.c +++ b/newlib/libc/posix/execlp.c @@ -14,8 +14,8 @@ int _DEFUN(execlp, (path, arg0, ...), - _CONST char *path, - _CONST char *arg0 _DOTS) + const char *path, + const char *arg0 _DOTS) #else @@ -23,8 +23,8 @@ _DEFUN(execlp, (path, arg0, ...), int _DEFUN(execlp, (path, arg0, va_alist), - _CONST char *path, - _CONST char *arg0, + const char *path, + const char *arg0, va_dcl) #endif @@ -32,17 +32,17 @@ _DEFUN(execlp, (path, arg0, va_alist), { int i; va_list args; - _CONST char *argv[256]; + const char *argv[256]; va_start (args, arg0); argv[0] = arg0; i = 1; do - argv[i] = va_arg (args, _CONST char *); + argv[i] = va_arg (args, const char *); while (argv[i++] != NULL); va_end (args); - return execvp (path, (char * _CONST *) argv); + return execvp (path, (char * const *) argv); } #endif /* !_NO_EXECVE */ diff --git a/newlib/libc/posix/execv.c b/newlib/libc/posix/execv.c index 049a5381d..96220dd98 100644 --- a/newlib/libc/posix/execv.c +++ b/newlib/libc/posix/execv.c @@ -18,7 +18,7 @@ _DEFUN (execv, (path, argv), const char *path, char * const argv[]) { - return _execve (path, (char * _CONST *) argv, *p_environ); + return _execve (path, (char * const *) argv, *p_environ); } #endif /* !_NO_EXECVE */ diff --git a/newlib/libc/posix/execvp.c b/newlib/libc/posix/execvp.c index db7e03456..1c1fd3a01 100644 --- a/newlib/libc/posix/execvp.c +++ b/newlib/libc/posix/execvp.c @@ -37,8 +37,8 @@ _DEFUN (strccpy, (s1, s2, c), int _DEFUN (execvp, (file, argv), - _CONST char *file, - char * _CONST argv[]) + const char *file, + char * const argv[]) { char *path = getenv ("PATH"); char buf[MAXNAMLEN]; diff --git a/newlib/libc/posix/posix_spawn.c b/newlib/libc/posix/posix_spawn.c index 8e54de7fa..cade6b005 100644 --- a/newlib/libc/posix/posix_spawn.c +++ b/newlib/libc/posix/posix_spawn.c @@ -147,7 +147,7 @@ typedef struct __posix_spawn_file_actions_entry { */ static int -process_spawnattr(_CONST posix_spawnattr_t sa) +process_spawnattr(const posix_spawnattr_t sa) { struct sigaction sigact = { .sa_flags = 0, .sa_handler = SIG_DFL }; int i; @@ -240,7 +240,7 @@ process_file_actions_entry(posix_spawn_file_actions_entry_t *fae) } static int -process_file_actions(_CONST posix_spawn_file_actions_t fa) +process_file_actions(const posix_spawn_file_actions_t fa) { posix_spawn_file_actions_entry_t *fae; int error; @@ -255,10 +255,10 @@ process_file_actions(_CONST posix_spawn_file_actions_t fa) } static int -do_posix_spawn(pid_t *pid, _CONST char *path, - _CONST posix_spawn_file_actions_t *fa, - _CONST posix_spawnattr_t *sa, - char * _CONST argv[], char * _CONST envp[], int use_env_path) +do_posix_spawn(pid_t *pid, const char *path, + const posix_spawn_file_actions_t *fa, + const posix_spawnattr_t *sa, + char * const argv[], char * const envp[], int use_env_path) { pid_t p; volatile int error = 0; @@ -296,11 +296,11 @@ do_posix_spawn(pid_t *pid, _CONST char *path, int _DEFUN(posix_spawn, (pid, path, fa, sa, argv, envp), pid_t *pid, - _CONST char *path, - _CONST posix_spawn_file_actions_t *fa, - _CONST posix_spawnattr_t *sa, - char * _CONST argv[], - char * _CONST envp[]) + const char *path, + const posix_spawn_file_actions_t *fa, + const posix_spawnattr_t *sa, + char * const argv[], + char * const envp[]) { return do_posix_spawn(pid, path, fa, sa, argv, envp, 0); } @@ -308,11 +308,11 @@ _DEFUN(posix_spawn, (pid, path, fa, sa, argv, envp), int _DEFUN(posix_spawnp, (pid, path, fa, sa, argv, envp), pid_t *pid, - _CONST char *path, - _CONST posix_spawn_file_actions_t *fa, - _CONST posix_spawnattr_t *sa, - char * _CONST argv[], - char * _CONST envp[]) + const char *path, + const posix_spawn_file_actions_t *fa, + const posix_spawnattr_t *sa, + char * const argv[], + char * const envp[]) { return do_posix_spawn(pid, path, fa, sa, argv, envp, 1); } @@ -360,7 +360,7 @@ int _DEFUN(posix_spawn_file_actions_addopen, (fa, fildes, path, oflag, mode), posix_spawn_file_actions_t * __restrict fa, int fildes, - _CONST char * __restrict path, + const char * __restrict path, int oflag, mode_t mode) { @@ -468,7 +468,7 @@ _DEFUN(posix_spawnattr_destroy, (sa), int _DEFUN(posix_spawnattr_getflags, (sa, flags), - _CONST posix_spawnattr_t * __restrict sa, + const posix_spawnattr_t * __restrict sa, short * __restrict flags) { *flags = (*sa)->sa_flags; @@ -477,7 +477,7 @@ _DEFUN(posix_spawnattr_getflags, (sa, flags), int _DEFUN(posix_spawnattr_getpgroup, (sa, pgroup), - _CONST posix_spawnattr_t * __restrict sa, + const posix_spawnattr_t * __restrict sa, pid_t * __restrict pgroup) { *pgroup = (*sa)->sa_pgroup; @@ -486,7 +486,7 @@ _DEFUN(posix_spawnattr_getpgroup, (sa, pgroup), int _DEFUN(posix_spawnattr_getschedparam, (sa, schedparam), - _CONST posix_spawnattr_t * __restrict sa, + const posix_spawnattr_t * __restrict sa, struct sched_param * __restrict schedparam) { *schedparam = (*sa)->sa_schedparam; @@ -495,7 +495,7 @@ _DEFUN(posix_spawnattr_getschedparam, (sa, schedparam), int _DEFUN(posix_spawnattr_getschedpolicy, (sa, schedpolicy), - _CONST posix_spawnattr_t * __restrict sa, + const posix_spawnattr_t * __restrict sa, int * __restrict schedpolicy) { *schedpolicy = (*sa)->sa_schedpolicy; @@ -504,7 +504,7 @@ _DEFUN(posix_spawnattr_getschedpolicy, (sa, schedpolicy), int _DEFUN(posix_spawnattr_getsigdefault, (sa, sigdefault), - _CONST posix_spawnattr_t * __restrict sa, + const posix_spawnattr_t * __restrict sa, sigset_t * __restrict sigdefault) { *sigdefault = (*sa)->sa_sigdefault; @@ -513,7 +513,7 @@ _DEFUN(posix_spawnattr_getsigdefault, (sa, sigdefault), int _DEFUN(posix_spawnattr_getsigmask, (sa, sigmask), - _CONST posix_spawnattr_t * __restrict sa, + const posix_spawnattr_t * __restrict sa, sigset_t * __restrict sigmask) { *sigmask = (*sa)->sa_sigmask; @@ -541,7 +541,7 @@ _DEFUN(posix_spawnattr_setpgroup, (sa, pgroup), int _DEFUN(posix_spawnattr_setschedparam, (sa, schedparam), posix_spawnattr_t * __restrict sa, - _CONST struct sched_param * __restrict schedparam) + const struct sched_param * __restrict schedparam) { (*sa)->sa_schedparam = *schedparam; return (0); @@ -559,7 +559,7 @@ _DEFUN(posix_spawnattr_setschedpolicy, (sa, schedpolicy), int _DEFUN(posix_spawnattr_setsigdefault, (sa, sigdefault), posix_spawnattr_t * __restrict sa, - _CONST sigset_t * __restrict sigdefault) + const sigset_t * __restrict sigdefault) { (*sa)->sa_sigdefault = *sigdefault; return (0); @@ -568,7 +568,7 @@ _DEFUN(posix_spawnattr_setsigdefault, (sa, sigdefault), int _DEFUN(posix_spawnattr_setsigmask, (sa, sigmask), posix_spawnattr_t * __restrict sa, - _CONST sigset_t * __restrict sigmask) + const sigset_t * __restrict sigmask) { (*sa)->sa_sigmask = *sigmask; return (0); |