From fab49aa45f18c257e312b8c01731d1710e1dc3e4 Mon Sep 17 00:00:00 2001
From: Marcus Comstedt <marcus@mc.pp.se>
Date: Sun, 29 Jun 2008 23:14:00 +0200
Subject: [PATCH] Use p_wchar2 instead of unsigned.

Rev: src/cpp.c:1.176
Rev: src/lex.c:1.122
Rev: src/lex.h:1.38
Rev: src/lexer.h:1.83
Rev: src/preprocessor.h:1.95
---
 src/cpp.c          |  6 +++---
 src/lex.c          |  4 ++--
 src/lex.h          |  8 ++++----
 src/lexer.h        | 12 ++++++------
 src/preprocessor.h |  4 ++--
 5 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/cpp.c b/src/cpp.c
index 97185ade94..33ae930310 100644
--- a/src/cpp.c
+++ b/src/cpp.c
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: cpp.c,v 1.175 2008/06/29 12:40:47 marcus Exp $
+|| $Id: cpp.c,v 1.176 2008/06/29 21:14:00 marcus Exp $
 */
 
 #include "global.h"
@@ -1023,7 +1023,7 @@ while(1)					\
   case '"':  break;				\
   case '\\':					\
   {						\
-    unsigned tmp;				\
+    p_wchar2 tmp;				\
     if(data[pos+1]=='\n')			\
     {						\
       pos++;					\
@@ -1114,7 +1114,7 @@ while(1)					\
   case '"':  break;				\
   case '\\':					\
   {						\
-    unsigned tmp;				\
+    p_wchar2 tmp;				\
     if(data[pos+1]=='\n')			\
     {						\
       pos++;					\
diff --git a/src/lex.c b/src/lex.c
index 0ccfea6a80..3b12fc6515 100644
--- a/src/lex.c
+++ b/src/lex.c
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: lex.c,v 1.121 2008/04/14 10:14:40 grubba Exp $
+|| $Id: lex.c,v 1.122 2008/06/29 21:14:00 marcus Exp $
 */
 
 #include "global.h"
@@ -18,7 +18,7 @@
 
 /* Must do like this since at least gcc is a little too keen on
  * optimizing INT_TYPE_MUL_OVERFLOW otherwise. */
-static unsigned INT32 eight = 8, sixteen = 16, ten = 10;
+static p_wchar2 eight = 8, sixteen = 16, ten = 10;
 
 /* Make lexers for shifts 0, 1 and 2. */
 
diff --git a/src/lex.h b/src/lex.h
index 47b7cd79d4..27d817b3c8 100644
--- a/src/lex.h
+++ b/src/lex.h
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: lex.h,v 1.37 2008/05/01 20:39:40 mast Exp $
+|| $Id: lex.h,v 1.38 2008/06/29 21:14:00 marcus Exp $
 */
 
 #ifndef LEX_H
@@ -31,9 +31,9 @@ struct lex
 
 /* Prototypes begin here */
 
-int parse_esc_seq0 (p_wchar0 *buf, unsigned *chr, ptrdiff_t *len);
-int parse_esc_seq1 (p_wchar1 *buf, unsigned *chr, ptrdiff_t *len);
-int parse_esc_seq2 (p_wchar2 *buf, unsigned *chr, ptrdiff_t *len);
+int parse_esc_seq0 (p_wchar0 *buf, p_wchar2 *chr, ptrdiff_t *len);
+int parse_esc_seq1 (p_wchar1 *buf, p_wchar2 *chr, ptrdiff_t *len);
+int parse_esc_seq2 (p_wchar2 *buf, p_wchar2 *chr, ptrdiff_t *len);
 
 int yylex0(struct lex *, YYSTYPE *);
 int yylex1(struct lex *, YYSTYPE *);
diff --git a/src/lexer.h b/src/lexer.h
index 390fbd07d3..50decc26b5 100644
--- a/src/lexer.h
+++ b/src/lexer.h
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: lexer.h,v 1.82 2008/06/29 11:07:04 nilsson Exp $
+|| $Id: lexer.h,v 1.83 2008/06/29 21:14:00 marcus Exp $
 */
 
 /*
@@ -181,7 +181,7 @@ static double lex_strtod(char *buf, char **end)
  * is removed and the escape remains otherwise intact.
  */
 
-int parse_esc_seq (WCHAR *buf, unsigned *chr, ptrdiff_t *len)
+int parse_esc_seq (WCHAR *buf, p_wchar2 *chr, ptrdiff_t *len)
 /* buf is assumed to be after the backslash. Return codes:
  * 0: All ok. The char's in *chr, consumed length in *len.
  * 1: Found a literal \r at *buf.
@@ -194,7 +194,7 @@ int parse_esc_seq (WCHAR *buf, unsigned *chr, ptrdiff_t *len)
  * 8: Not 8 digits in \U escape. *len is up to the last found digit. */
 {
   ptrdiff_t l = 1;
-  unsigned c;
+  p_wchar2 c;
 
   switch ((c = *buf))
   {
@@ -314,9 +314,9 @@ int parse_esc_seq (WCHAR *buf, unsigned *chr, ptrdiff_t *len)
   return 0;
 }
 
-static unsigned char_const(struct lex *lex)
+static p_wchar2 char_const(struct lex *lex)
 {
-  unsigned c;
+  p_wchar2 c;
   ptrdiff_t l;
   switch (parse_esc_seq ((WCHAR *)lex->pos, &c, &l)) {
     case 0:
@@ -335,7 +335,7 @@ static unsigned char_const(struct lex *lex)
     case 4: case 5: case 6:
       if( Pike_compiler->compiler_pass == 1 )
         yywarning ("Too large character value in escape.");
-      c = MAX_UINT32;
+      c = -1;
       break;
     case 7:
       if( Pike_compiler->compiler_pass == 1 )
diff --git a/src/preprocessor.h b/src/preprocessor.h
index b7137018b8..a80bf8dae7 100644
--- a/src/preprocessor.h
+++ b/src/preprocessor.h
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: preprocessor.h,v 1.94 2008/06/28 01:26:36 mast Exp $
+|| $Id: preprocessor.h,v 1.95 2008/06/29 21:14:00 marcus Exp $
 */
 
 /*
@@ -494,7 +494,7 @@ static ptrdiff_t calcC(struct cpp *this, WCHAR *data, ptrdiff_t len,
 
   case '\'':
   {
-    unsigned tmp = data[++pos];
+    p_wchar2 tmp = data[++pos];
     if (tmp == '\\') READCHAR(tmp);
     pos++;
     if(!GOBBLE('\''))
-- 
GitLab