bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnulib] mbswidth.h fix


From: Bruno Haible
Subject: [Bug-gnulib] mbswidth.h fix
Date: Tue, 19 Nov 2002 14:55:12 +0100 (CET)

Hi,

I'm committing these changes to mbswidth.c and mbswidth.h.

I've now taken the habit to #include the .h file in the .c file at the
beginning, right after <config.h> and possibly #pragma alloca. This
has three advantages:

  1) It tells the reader where to look for general comments and
     typedefs.

  2) It makes a consistency check between the function declaration in
     the .h file and the function definition.

  3) It verifies that the .h file is self contained.

And in fact mbswidth.h was not self contained - it used 'size_t'
without #include <stddef.h>

Bruno


*** mbswidth.c.old      Tue Nov 19 14:47:05 2002
--- mbswidth.c  Thu Nov 14 15:53:38 2002
***************
*** 21,26 ****
--- 21,29 ----
  # include <config.h>
  #endif
  
+ /* Specification.  */
+ #include "mbswidth.h"
+ 
  /* Get MB_CUR_MAX.  */
  #include <stdlib.h>
  
***************
*** 78,85 ****
  #undef ISCNTRL
  #define ISCNTRL(c) (IN_CTYPE_DOMAIN (c) && iscntrl (c))
  
- #include "mbswidth.h"
- 
  /* Returns the number of columns needed to represent the multibyte
     character string pointed to by STRING.  If a non-printable character
     occurs, and MBSW_REJECT_UNPRINTABLE is specified, -1 is returned.
--- 81,86 ----
*** mbswidth.h.old      Tue Nov 19 14:47:05 2002
--- mbswidth.h  Thu Nov 14 15:53:38 2002
***************
*** 15,20 ****
--- 15,22 ----
     along with this program; if not, write to the Free Software Foundation,
     Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
  
+ #include <stddef.h>
+ 
  /* Optional flags to influence mbswidth/mbsnwidth behavior.  */
  
  /* If this bit is set, return -1 upon finding an invalid or incomplete




reply via email to

[Prev in Thread] Current Thread [Next in Thread]