Mercurial > hg > octave-kai > gnulib-hg
changeset 1557:38fd8f5d359d
ansideclify
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Mon, 07 Dec 1998 03:12:10 +0000 |
parents | 44617e0f6ffe |
children | db3dc1c514e1 |
files | lib/alloca.c lib/chown.c lib/dirname.c lib/euidaccess.c lib/fileblocks.c lib/fnmatch.c lib/fsusage.c lib/ftruncate.c lib/getline.c lib/getversion.c lib/isdir.c lib/malloc.c lib/memcmp.c lib/memset.c lib/mkdir.c lib/mktime.c lib/path-concat.c lib/rename.c lib/rpmatch.c lib/save-cwd.c lib/savedir.c lib/stpcpy.c lib/strdup.c lib/strftime.c lib/stripslash.c lib/strndup.c lib/strstr.c lib/strverscmp.c lib/userspec.c lib/xmalloc.c |
diffstat | 30 files changed, 68 insertions(+), 188 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/alloca.c +++ b/lib/alloca.c @@ -161,8 +161,7 @@ implementations of C, for example under Gould's UTX/32. */ pointer -alloca (size) - unsigned size; +alloca (unsigned size) { auto char probe; /* Probes stack depth: */ register char *depth = ADDRESS_FUNCTION (probe);
--- a/lib/chown.c +++ b/lib/chown.c @@ -34,10 +34,7 @@ /* FIXME: describe. */ int -rpl_chown (file, uid, gid) - const char *file; - uid_t uid; - gid_t gid; +rpl_chown (const char *file, uid_t uid, gid_t gid) { if (gid == (gid_t) -1 || uid == (uid_t) -1) {
--- a/lib/dirname.c +++ b/lib/dirname.c @@ -39,8 +39,7 @@ removed. */ char * -dirname (path) - char *path; +dirname (char *path) { char *newpath; char *slash;
--- a/lib/euidaccess.c +++ b/lib/euidaccess.c @@ -1,5 +1,5 @@ /* euidaccess -- check if effective user id can access file - Copyright (C) 1990, 1991, 1995 Free Software Foundation, Inc. + Copyright (C) 1990, 1991, 1995, 1998 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -127,9 +127,7 @@ filesystem, text busy, etc. */ int -euidaccess (path, mode) - const char *path; - int mode; +euidaccess (const char *path, int mode) { struct stat stats; int granted;
--- a/lib/fileblocks.c +++ b/lib/fileblocks.c @@ -50,8 +50,7 @@ /* Return the number of 512-byte blocks in a file of SIZE bytes. */ off_t -st_blocks (size) - off_t size; +st_blocks (off_t size) { off_t datablks = size / 512 + (size % 512 != 0); off_t indrblks = 0;
--- a/lib/fnmatch.c +++ b/lib/fnmatch.c @@ -55,10 +55,7 @@ /* Match STRING against the filename pattern PATTERN, returning zero if it matches, nonzero if not. */ int -fnmatch (pattern, string, flags) - const char *pattern; - const char *string; - int flags; +fnmatch (const char *pattern, const char *string, int flags) { register const char *p = pattern, *n = string; register char c;
--- a/lib/fsusage.c +++ b/lib/fsusage.c @@ -101,10 +101,7 @@ ERRNO is either a system error value, or zero if DISK is NULL on a system that requires a non-NULL value. */ int -get_fs_usage (path, disk, fsp) - const char *path; - const char *disk; - struct fs_usage *fsp; +get_fs_usage (const char *path, const char *disk, struct fs_usage *fsp) { #ifdef STAT_STATFS3_OSF1 @@ -262,9 +259,7 @@ /* AIX PS/2 does not supply statfs. */ int -statfs (path, fsb) - char *path; - struct statfs *fsb; +statfs (char *path, struct statfs *fsb) { struct stat stats; struct dustat fsd;
--- a/lib/ftruncate.c +++ b/lib/ftruncate.c @@ -11,9 +11,7 @@ #ifdef F_CHSIZE int -ftruncate (fd, length) - int fd; - off_t length; +ftruncate (int fd, off_t length) { return fcntl (fd, F_CHSIZE, length); } @@ -30,9 +28,7 @@ # endif int -ftruncate (fd, length) - int fd; - off_t length; +ftruncate (int fd, off_t length) { struct flock fl; struct stat filebuf; @@ -75,9 +71,7 @@ # if HAVE_CHSIZE int -ftruncate (fd, length) - int fd; - off_t length; +ftruncate (int fd, off_t length) { return chsize (fd, length); } @@ -90,9 +84,7 @@ # endif int -ftruncate (fd, length) - int fd; - off_t length; +ftruncate (int fd, off_t length) { errno = EIO; return -1;
--- a/lib/getline.c +++ b/lib/getline.c @@ -1,6 +1,6 @@ /* getline.c -- Replacement for GNU C library function getline -Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc. +Copyright (C) 1993, 1996, 1997, 1998 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -34,10 +34,7 @@ #if defined __GNU_LIBRARY__ && HAVE_GETDELIM int -getline (lineptr, n, stream) - char **lineptr; - size_t *n; - FILE *stream; +getline (char **lineptr, size_t *n, FILE *stream) { return getdelim (lineptr, n, '\n', stream); } @@ -64,12 +61,7 @@ null terminator), or -1 on error or EOF. */ int -getstr (lineptr, n, stream, terminator, offset) - char **lineptr; - size_t *n; - FILE *stream; - char terminator; - size_t offset; +getstr (char **lineptr, size_t *n, FILE *stream, char terminator, size_t offset) { int nchars_avail; /* Allocated but unused chars in *LINEPTR. */ char *read_pos; /* Where we're reading into *LINEPTR. */ @@ -138,20 +130,13 @@ } int -getline (lineptr, n, stream) - char **lineptr; - size_t *n; - FILE *stream; +getline (char **lineptr, size_t *n, FILE *stream) { return getstr (lineptr, n, stream, '\n', 0); } int -getdelim (lineptr, n, delimiter, stream) - char **lineptr; - size_t *n; - int delimiter; - FILE *stream; +getdelim (char **lineptr, size_t *n, int delimiter, FILE *stream) { return getstr (lineptr, n, stream, delimiter, 0); }
--- a/lib/getversion.c +++ b/lib/getversion.c @@ -1,5 +1,5 @@ /* getversion.c -- select backup filename type - Copyright (C) 1990 Free Software Foundation, Inc. + Copyright (C) 1990, 1998 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -46,8 +46,7 @@ Unique abbreviations are accepted. */ enum backup_type -get_version (version) - char *version; +get_version (const char *version) { int i;
--- a/lib/isdir.c +++ b/lib/isdir.c @@ -34,8 +34,7 @@ return nonzero, else 0. */ int -isdir (path) - char *path; +isdir (const char *path) { struct stat stats;
--- a/lib/malloc.c +++ b/lib/malloc.c @@ -1,5 +1,5 @@ /* Work around bug on some systems where malloc (0) fails. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 1998 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,8 +30,7 @@ If N is zero, allocate a 1-byte block. */ char * -rpl_malloc (n) - size_t n; +rpl_malloc (size_t n) { if (n == 0) n = 1;
--- a/lib/memcmp.c +++ b/lib/memcmp.c @@ -104,8 +104,7 @@ __inline # endif static int -memcmp_bytes (a, b) - op_t a, b; +memcmp_bytes (long unsigned int a, long unsigned int b) { long int srcp1 = (long int) &a; long int srcp2 = (long int) &b; @@ -132,10 +131,7 @@ __inline #endif static int -memcmp_common_alignment (srcp1, srcp2, len) - long int srcp1; - long int srcp2; - size_t len; +memcmp_common_alignment (long int srcp1, long int srcp2, size_t len) { op_t a0, a1; op_t b0, b1; @@ -222,10 +218,7 @@ __inline #endif static int -memcmp_not_common_alignment (srcp1, srcp2, len) - long int srcp1; - long int srcp2; - size_t len; +memcmp_not_common_alignment (long int srcp1, long int srcp2, size_t len) { op_t a0, a1, a2, a3; op_t b0, b1, b2, b3; @@ -325,10 +318,7 @@ } int -rpl_memcmp (s1, s2, len) - const __ptr_t s1; - const __ptr_t s2; - size_t len; +rpl_memcmp (const void *s1, const void *s2, size_t len) { op_t a0; op_t b0;
--- a/lib/memset.c +++ b/lib/memset.c @@ -16,10 +16,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ char * -memset (str, c, len) - char *str; - int c; - unsigned len; +memset (char *str, int c, unsigned int len) { register char *st = str;
--- a/lib/mkdir.c +++ b/lib/mkdir.c @@ -1,5 +1,5 @@ /* BSD compatible make directory function for System V - Copyright (C) 1988, 1990 Free Software Foundation, Inc. + Copyright (C) 1988, 1990, 1998 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -48,9 +48,7 @@ subroutine didn't return EEXIST. It does now. */ int -mkdir (dpath, dmode) - char *dpath; - int dmode; +mkdir (const char *dpath, int dmode) { int cpid, status; struct stat statbuf;
--- a/lib/mktime.c +++ b/lib/mktime.c @@ -126,9 +126,7 @@ are buggy. */ static struct tm *my_mktime_localtime_r __P ((const time_t *, struct tm *)); static struct tm * -my_mktime_localtime_r (t, tp) - const time_t *t; - struct tm *tp; +my_mktime_localtime_r (const time_t *t, struct tm *tp) { struct tm *l = localtime (t); if (! l) @@ -146,9 +144,8 @@ If TP is null, return a nonzero value. If overflow occurs, yield the low order bits of the correct answer. */ static time_t -ydhms_tm_diff (year, yday, hour, min, sec, tp) - int year, yday, hour, min, sec; - const struct tm *tp; +ydhms_tm_diff (int year, int yday, int hour, int min, int sec, + const struct tm *tp) { if (!tp) return 1; @@ -180,8 +177,7 @@ /* Convert *TP to a time_t value. */ time_t -mktime (tp) - struct tm *tp; +mktime (struct tm *tp) { #ifdef _LIBC /* POSIX.1 8.1.1 requires that whenever mktime() is called, the @@ -197,10 +193,8 @@ If *T is out of range for conversion, adjust it so that it is the nearest in-range value and then convert that. */ static struct tm * -ranged_convert (convert, t, tp) - struct tm *(*convert) __P ((const time_t *, struct tm *)); - time_t *t; - struct tm *tp; +ranged_convert (struct tm *(*convert) (const time_t *, struct tm *), + time_t *t, struct tm *tp) { struct tm *r; @@ -247,10 +241,9 @@ compared to what the result would be for UTC without leap seconds. If *OFFSET's guess is correct, only one CONVERT call is needed. */ time_t -__mktime_internal (tp, convert, offset) - struct tm *tp; - struct tm *(*convert) __P ((const time_t *, struct tm *)); - time_t *offset; +__mktime_internal (struct tm *tp, + struct tm *(*convert) (const time_t *, struct tm *), + time_t *offset) { time_t t, dt, t0, t1, t2; struct tm tm;
--- a/lib/path-concat.c +++ b/lib/path-concat.c @@ -42,10 +42,7 @@ BASE in the returned concatenation. */ char * -path_concat (dir, base, base_in_result) - const char *dir; - const char *base; - char **base_in_result; +path_concat (const char *dir, const char *base, char **base_in_result) { char *p; char *p_concat;
--- a/lib/rename.c +++ b/lib/rename.c @@ -38,9 +38,7 @@ Return 0 if successful, -1 if not. */ int -rename (from, to) - char *from; - char *to; +rename (char *from, char *to) { struct stat from_stats, to_stats; int pid, status;
--- a/lib/rpmatch.c +++ b/lib/rpmatch.c @@ -40,13 +40,7 @@ #endif static int -try (response, pattern, match, nomatch, lastp, re) - const char *response; - const char *pattern; - const int match; - const int nomatch; - const char **lastp; - regex_t *re; +try (const char *response, const char *pattern, const int match, const int nomatch, const char **lastp, regex_t *re) { if (pattern != *lastp) { @@ -69,8 +63,7 @@ int -rpmatch (response) - const char *response; +rpmatch (const char *response) { /* Match against one of the response patterns, compiling the pattern first if necessary. */
--- a/lib/save-cwd.c +++ b/lib/save-cwd.c @@ -57,8 +57,7 @@ called, but doing so is ok. Otherwise, return zero. */ int -save_cwd (cwd) - struct saved_cwd *cwd; +save_cwd (struct saved_cwd *cwd) { static int have_working_fchdir = 1; @@ -118,10 +117,7 @@ */ int -restore_cwd (cwd, dest, from) - const struct saved_cwd *cwd; - const char *dest; - const char *from; +restore_cwd (const struct saved_cwd *cwd, const char *dest, const char *from) { int fail = 0; if (cwd->desc >= 0) @@ -144,8 +140,7 @@ } void -free_cwd (cwd) - struct saved_cwd *cwd; +free_cwd (struct saved_cwd *cwd) { if (cwd->desc >= 0) close (cwd->desc);
--- a/lib/savedir.c +++ b/lib/savedir.c @@ -76,9 +76,7 @@ Return NULL if DIR cannot be opened or if out of memory. */ char * -savedir (dir, name_size) - const char *dir; - unsigned int name_size; +savedir (const char *dir, unsigned int name_size) { DIR *dirp; struct dirent *dp;
--- a/lib/stpcpy.c +++ b/lib/stpcpy.c @@ -34,9 +34,7 @@ /* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ char * -__stpcpy (dest, src) - char *dest; - const char *src; +__stpcpy (char *dest, const char *src) { register char *d = dest; register const char *s = src;
--- a/lib/strdup.c +++ b/lib/strdup.c @@ -31,8 +31,7 @@ or 0 if out of memory. */ char * -strdup (str) - const char *str; +strdup (const char *str) { char *newstr;
--- a/lib/strftime.c +++ b/lib/strftime.c @@ -157,9 +157,7 @@ # if ! HAVE_TM_GMTOFF static struct tm *my_strftime_gmtime_r __P ((const time_t *, struct tm *)); static struct tm * -my_strftime_gmtime_r (t, tp) - const time_t *t; - struct tm *tp; +my_strftime_gmtime_r (const time_t *t, struct tm *tp) { struct tm *l = gmtime (t); if (! l) @@ -171,9 +169,7 @@ static struct tm *my_strftime_localtime_r __P ((const time_t *, struct tm *)); static struct tm * -my_strftime_localtime_r (t, tp) - const time_t *t; - struct tm *tp; +my_strftime_localtime_r (const time_t *t, struct tm *tp) { struct tm *l = localtime (t); if (! l) @@ -274,10 +270,7 @@ static char *memcpy_lowcase __P ((char *dest, const char *src, size_t len)); static char * -memcpy_lowcase (dest, src, len) - char *dest; - const char *src; - size_t len; +memcpy_lowcase (char *dest, const char *src, size_t len) { while (len-- > 0) dest[len] = TOLOWER ((unsigned char) src[len]); @@ -287,10 +280,7 @@ static char *memcpy_uppcase __P ((char *dest, const char *src, size_t len)); static char * -memcpy_uppcase (dest, src, len) - char *dest; - const char *src; - size_t len; +memcpy_uppcase (char *dest, const char *src, size_t len) { while (len-- > 0) dest[len] = TOUPPER ((unsigned char) src[len]); @@ -304,9 +294,7 @@ # define tm_diff ftime_tm_diff static int tm_diff __P ((const struct tm *, const struct tm *)); static int -tm_diff (a, b) - const struct tm *a; - const struct tm *b; +tm_diff (const struct tm *a, const struct tm *b) { /* Compute intervening leap days correctly even if year is negative. Take care to avoid int overflow in leap day calculations, @@ -341,9 +329,7 @@ __inline__ #endif static int -iso_week_days (yday, wday) - int yday; - int wday; +iso_week_days (int yday, int wday) { /* Add enough to the first operand of % to make it nonnegative. */ int big_enough_multiple_of_7 = (-YDAY_MINIMUM / 7 + 2) * 7; @@ -411,12 +397,8 @@ anywhere, so to determine how many characters would be written, use NULL for S and (size_t) UINT_MAX for MAXSIZE. */ size_t -my_strftime (s, maxsize, format, tp ut_argument) - char *s; - size_t maxsize; - const char *format; - const struct tm *tp; - ut_argument_spec +my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp + ut_argument_spec) { int hour12 = tp->tm_hour; #ifdef _NL_CURRENT
--- a/lib/stripslash.c +++ b/lib/stripslash.c @@ -32,8 +32,7 @@ when given a path that ends in "/" (except for the root directory). */ void -strip_trailing_slashes (path) - char *path; +strip_trailing_slashes (char *path) { int last;
--- a/lib/strndup.c +++ b/lib/strndup.c @@ -33,9 +33,7 @@ /* Duplicate S, returning an identical malloc'd string. */ char * -strndup (s, n) - const char *s; - size_t n; +strndup (const char *s, size_t n) { char *new = malloc (n + 1);
--- a/lib/strstr.c +++ b/lib/strstr.c @@ -30,9 +30,7 @@ typedef unsigned chartype; char * -strstr (phaystack, pneedle) - const char *phaystack; - const char *pneedle; +strstr (const char *phaystack, const char *pneedle) { register const unsigned char *haystack, *needle; register chartype b, c;
--- a/lib/strverscmp.c +++ b/lib/strverscmp.c @@ -43,9 +43,7 @@ */ int -strverscmp (s1, s2) - const char *s1; - const char *s2; +strverscmp (const char *s1, const char *s2) { const unsigned char *p1 = (const unsigned char *) s1; const unsigned char *p2 = (const unsigned char *) s2;
--- a/lib/userspec.c +++ b/lib/userspec.c @@ -93,8 +93,7 @@ otherwise return 0. */ static int -is_number (str) - const char *str; +is_number (const char *str) { for (; *str; str++) if (!isdigit (*str)) @@ -115,11 +114,7 @@ Return NULL if successful, a static error message string if not. */ const char * -parse_user_spec (spec_arg, uid, gid, username_arg, groupname_arg) - const char *spec_arg; - uid_t *uid; - gid_t *gid; - char **username_arg, **groupname_arg; +parse_user_spec (const char *spec_arg, uid_t *uid, gid_t *gid, char **username_arg, char **groupname_arg) { static const char *tired = "virtual memory exhausted"; const char *error_msg;
--- a/lib/xmalloc.c +++ b/lib/xmalloc.c @@ -1,5 +1,5 @@ /* xmalloc.c -- malloc with out of memory checking - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc. + Copyright (C) 1990-1997, 98 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -78,7 +78,7 @@ #endif static void -xalloc_fail () +xalloc_fail (void) { if (xalloc_fail_func) (*xalloc_fail_func) (); @@ -88,8 +88,7 @@ /* Allocate N bytes of memory dynamically, with error checking. */ void * -xmalloc (n) - size_t n; +xmalloc (size_t n) { void *p; @@ -104,9 +103,7 @@ If P is NULL, run xmalloc. */ void * -xrealloc (p, n) - void *p; - size_t n; +xrealloc (void *p, size_t n) { p = realloc (p, n); if (p == 0) @@ -119,8 +116,7 @@ /* Allocate memory for N elements of S bytes, with error checking. */ void * -xcalloc (n, s) - size_t n, s; +xcalloc (size_t n, size_t s) { void *p;