Mercurial > hg > octave-lyh > gnulib-hg
changeset 3978:55eb3920b607
Move to ANSI C.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Tue, 19 Nov 2002 13:48:57 +0000 |
parents | bbfbba55424c |
children | 7627246c7a83 |
files | lib/ChangeLog lib/mbswidth.c lib/mbswidth.h |
diffstat | 3 files changed, 10 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,5 +1,9 @@ 2002-11-19 Bruno Haible <bruno@clisp.org> + * mbswidth.h (PARAMS): Remove macro. + (mbswidth, mbsnwidth): Use ANSI C function declarations. + * mbswidth.c (mbswidth, mbsnwidth): Likewise. + * gcd.h (PARAMS): Remove macro. (gcd): Use ANSI C function declarations. * gcd.c (gcd): Likewise.
--- a/lib/mbswidth.c +++ b/lib/mbswidth.c @@ -1,5 +1,5 @@ /* Determine the number of screen columns needed for a string. - Copyright (C) 2000-2001 Free Software Foundation, Inc. + Copyright (C) 2000-2002 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 @@ -86,9 +86,7 @@ With flags = MBSW_REJECT_INVALID | MBSW_REJECT_UNPRINTABLE, this is the multibyte analogon of the wcswidth function. */ int -mbswidth (string, flags) - const char *string; - int flags; +mbswidth (const char *string, int flags) { return mbsnwidth (string, strlen (string), flags); } @@ -98,10 +96,7 @@ non-printable character occurs, and MBSW_REJECT_UNPRINTABLE is specified, -1 is returned. */ int -mbsnwidth (string, nbytes, flags) - const char *string; - size_t nbytes; - int flags; +mbsnwidth (const char *string, size_t nbytes, int flags) { const char *p = string; const char *plimit = p + nbytes;
--- a/lib/mbswidth.h +++ b/lib/mbswidth.h @@ -1,5 +1,5 @@ /* Determine the number of screen columns needed for a string. - Copyright (C) 2000-2001 Free Software Foundation, Inc. + Copyright (C) 2000-2002 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 @@ -15,14 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef PARAMS -# if defined (__GNUC__) || __STDC__ -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -#endif - /* Optional flags to influence mbswidth/mbsnwidth behavior. */ /* If this bit is set, return -1 upon finding an invalid or incomplete @@ -36,8 +28,8 @@ /* Returns the number of screen columns needed for STRING. */ #define mbswidth gnu_mbswidth /* avoid clash with UnixWare 7.1.1 function */ -extern int mbswidth PARAMS ((const char *string, int flags)); +extern int mbswidth (const char *string, int flags); /* Returns the number of screen columns needed for the NBYTES bytes starting at BUF. */ -extern int mbsnwidth PARAMS ((const char *buf, size_t nbytes, int flags)); +extern int mbsnwidth (const char *buf, size_t nbytes, int flags);