diff --git a/src/cpp.c b/src/cpp.c
index 97185ade9446d63e050c7a64afc2e9957968ff3c..33ae93031058fd54d37fa10d906c6acbd0fb1609 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 0ccfea6a807a6e9abceb7571aff6a2a2b8c9af01..3b12fc6515d68f0e7d0248b5d644971008ac4d32 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 47b7cd79d47d618b044199c05ac3360cccbc7459..27d817b3c8e00982153c252339a3ae26fe0019e3 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 390fbd07d338c3e2c40081ddf549430aa41aa99b..50decc26b5241fbfd956b969abfafeba8d21fa51 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 b7137018b857af514e7dedfb53f4d498564ddd63..a80bf8dae73c536b80c515cbd3223e60bc3e786d 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('\''))