use UINT32_C and PRIu32 macros instead of 0x...U and %u.

This commit is contained in:
tshiozak 2003-03-03 08:49:15 +00:00
parent 8bc967f427
commit 498e0550aa
3 changed files with 27 additions and 26 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: runetype.h,v 1.11 2003/03/02 22:18:15 tshiozak Exp $ */
/* $NetBSD: runetype.h,v 1.12 2003/03/03 08:49:15 tshiozak Exp $ */
/*-
* Copyright (c) 1993
@ -63,26 +63,26 @@ extern size_t __mb_len_max_runtime;
* The lower 8 bits of runetype[] contain the digit value of the rune.
*/
typedef uint32_t _RuneType;
#define _CTYPE_A 0x00000100U /* Alpha */
#define _CTYPE_C 0x00000200U /* Control */
#define _CTYPE_D 0x00000400U /* Digit */
#define _CTYPE_G 0x00000800U /* Graph */
#define _CTYPE_L 0x00001000U /* Lower */
#define _CTYPE_P 0x00002000U /* Punct */
#define _CTYPE_S 0x00004000U /* Space */
#define _CTYPE_U 0x00008000U /* Upper */
#define _CTYPE_X 0x00010000U /* X digit */
#define _CTYPE_B 0x00020000U /* Blank */
#define _CTYPE_R 0x00040000U /* Print */
#define _CTYPE_I 0x00080000U /* Ideogram */
#define _CTYPE_T 0x00100000U /* Special */
#define _CTYPE_Q 0x00200000U /* Phonogram */
#define _CTYPE_SWM 0xc0000000U /* Mask to get screen width data */
#define _CTYPE_A UINT32_C(0x00000100) /* Alpha */
#define _CTYPE_C UINT32_C(0x00000200) /* Control */
#define _CTYPE_D UINT32_C(0x00000400) /* Digit */
#define _CTYPE_G UINT32_C(0x00000800) /* Graph */
#define _CTYPE_L UINT32_C(0x00001000) /* Lower */
#define _CTYPE_P UINT32_C(0x00002000) /* Punct */
#define _CTYPE_S UINT32_C(0x00004000) /* Space */
#define _CTYPE_U UINT32_C(0x00008000) /* Upper */
#define _CTYPE_X UINT32_C(0x00010000) /* X digit */
#define _CTYPE_B UINT32_C(0x00020000) /* Blank */
#define _CTYPE_R UINT32_C(0x00040000) /* Print */
#define _CTYPE_I UINT32_C(0x00080000) /* Ideogram */
#define _CTYPE_T UINT32_C(0x00100000) /* Special */
#define _CTYPE_Q UINT32_C(0x00200000) /* Phonogram */
#define _CTYPE_SWM UINT32_C(0xc0000000)/* Mask to get screen width data */
#define _CTYPE_SWS 30 /* Bits to shift to get width */
#define _CTYPE_SW0 0x00000000U /* 0 width character */
#define _CTYPE_SW1 0x40000000U /* 1 width character */
#define _CTYPE_SW2 0x80000000U /* 2 width character */
#define _CTYPE_SW3 0xc0000000U /* 3 width character */
#define _CTYPE_SW0 UINT32_C(0x00000000) /* 0 width character */
#define _CTYPE_SW1 UINT32_C(0x40000000) /* 1 width character */
#define _CTYPE_SW2 UINT32_C(0x80000000) /* 2 width character */
#define _CTYPE_SW3 UINT32_C(0xc0000000) /* 3 width character */
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: lex.l,v 1.5 2003/01/27 01:22:10 uwe Exp $ */
/* $NetBSD: lex.l,v 1.6 2003/03/03 08:49:16 tshiozak Exp $ */
%{
/*-
@ -46,10 +46,11 @@
#if 0
static char sccsid[] = "@(#)lex.l 8.1 (Berkeley) 6/6/93";
#else
__RCSID("$NetBSD: lex.l,v 1.5 2003/01/27 01:22:10 uwe Exp $");
__RCSID("$NetBSD: lex.l,v 1.6 2003/03/03 08:49:16 tshiozak Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include <stdint.h>
#if !defined(__FreeBSD__)
#define _BSD_RUNE_T_ int
#define _BSD_CT_RUNE_T_ rune_t

View File

@ -1,4 +1,4 @@
/* $NetBSD: yacc.y,v 1.12 2003/03/03 08:30:21 tshiozak Exp $ */
/* $NetBSD: yacc.y,v 1.13 2003/03/03 08:49:16 tshiozak Exp $ */
%{
/*-
@ -47,7 +47,7 @@
static char sccsid[] = "@(#)yacc.y 8.1 (Berkeley) 6/6/93";
static char rcsid[] = "$FreeBSD$";
#else
__RCSID("$NetBSD: yacc.y,v 1.12 2003/03/03 08:30:21 tshiozak Exp $");
__RCSID("$NetBSD: yacc.y,v 1.13 2003/03/03 08:49:16 tshiozak Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -866,7 +866,7 @@ dump_tables()
fprintf(stderr, " %4s", (r & _CTYPE_I) ? "ideo" : "");
fprintf(stderr, " %4s", (r & _CTYPE_T) ? "spec" : "");
fprintf(stderr, " %4s", (r & _CTYPE_Q) ? "phon" : "");
fprintf(stderr, " %1u", ((unsigned)r&_CTYPE_SWM)>>_CTYPE_SWS);
fprintf(stderr, " %1" PRIu32, (r & _CTYPE_SWM)>>_CTYPE_SWS);
fprintf(stderr, "\n");
} else
for (x = list->min; x <= list->max; ++x) {
@ -889,7 +889,7 @@ dump_tables()
fprintf(stderr, " %4s", (r & _CTYPE_I) ? "ideo" : "");
fprintf(stderr, " %4s", (r & _CTYPE_T) ? "spec" : "");
fprintf(stderr, " %4s", (r & _CTYPE_Q) ? "phon" : "");
fprintf(stderr, " %1u", ((unsigned)r&_CTYPE_SWM)>>_CTYPE_SWS);
fprintf(stderr, " %1" PRIu32, (r & _CTYPE_SWM)>>_CTYPE_SWS);
fprintf(stderr, "\n");
}
}