From 34d7b92b27af2a782204121572417536f46a02b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Sat, 8 Oct 2005 12:43:38 +0000 Subject: [PATCH] Sync to Wine-20050930: Alexandre Julliard - Fixed a number of pointer to integer conversions that wouldn't work right on a 64-bit platform. - Now that we are requiring bison anyway, make the .tab.c file use the same base name as the .y file, so that we can generate correct dependencies in all cases. svn path=/trunk/; revision=18327 --- reactos/tools/wrc/Makefile.in | 13 ++++++------- reactos/tools/wrc/lex.yy.c | 2 +- reactos/tools/wrc/newstruc.c | 6 ++---- reactos/tools/wrc/parser.l | 2 +- reactos/tools/wrc/{y.tab.c => parser.tab.c} | 6 +++--- reactos/tools/wrc/{y.tab.h => parser.tab.h} | 2 +- reactos/tools/wrc/wrc.mak | 4 ++-- 7 files changed, 16 insertions(+), 19 deletions(-) rename reactos/tools/wrc/{y.tab.c => parser.tab.c} (99%) rename reactos/tools/wrc/{y.tab.h => parser.tab.h} (99%) diff --git a/reactos/tools/wrc/Makefile.in b/reactos/tools/wrc/Makefile.in index 382ae165f34..c6f8bf8f15e 100644 --- a/reactos/tools/wrc/Makefile.in +++ b/reactos/tools/wrc/Makefile.in @@ -4,7 +4,6 @@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ LEXOPT = -Cf #-w -b -YACCOPT = #-v EXEEXT = @EXEEXT@ PROGRAMS = wrc$(EXEEXT) @@ -21,7 +20,7 @@ C_SRCS = \ writeres.c EXTRA_SRCS = parser.y parser.l -EXTRA_OBJS = y.tab.o @LEX_OUTPUT_ROOT@.o +EXTRA_OBJS = parser.tab.o @LEX_OUTPUT_ROOT@.o all: $(PROGRAMS) @@ -30,17 +29,17 @@ all: $(PROGRAMS) wrc$(EXEEXT): $(OBJS) $(LIBDIR)/wpp/libwpp.a $(CC) $(CFLAGS) -o $@ $(OBJS) -L$(LIBDIR) -lwpp -lwine_unicode -lwine_port $(LEXLIB) $(LDFLAGS) -y.tab.c y.tab.h: parser.y - $(YACC) $(YACCOPT) -d -t $(SRCDIR)/parser.y +parser.tab.c parser.tab.h: parser.y + $(BISON) -d -t $(SRCDIR)/parser.y -o parser.tab.c # hack to allow parallel make -y.tab.h: y.tab.c -y.tab.o: y.tab.h +parser.tab.h: parser.tab.c +parser.tab.o: parser.tab.h @LEX_OUTPUT_ROOT@.c: parser.l $(LEX) $(LEXOPT) -d -8 $(SRCDIR)/parser.l -@LEX_OUTPUT_ROOT@.o: y.tab.h +@LEX_OUTPUT_ROOT@.o: parser.tab.h install:: $(PROGRAMS) $(MKINSTALLDIRS) $(bindir) $(mandir)/man$(prog_manext) diff --git a/reactos/tools/wrc/lex.yy.c b/reactos/tools/wrc/lex.yy.c index 69c6fb0a100..e9a3e4d47fb 100644 --- a/reactos/tools/wrc/lex.yy.c +++ b/reactos/tools/wrc/lex.yy.c @@ -7002,7 +7002,7 @@ char *yytext; #include "parser.h" #include "newstruc.h" -#include "y.tab.h" +#include "parser.tab.h" #define YY_USE_PROTOS #define YY_NO_UNPUT diff --git a/reactos/tools/wrc/newstruc.c b/reactos/tools/wrc/newstruc.c index f0774ea1cd3..5d3ce95cb0b 100644 --- a/reactos/tools/wrc/newstruc.c +++ b/reactos/tools/wrc/newstruc.c @@ -819,8 +819,7 @@ static void handle_ani_list(riff_tag_t *lst, enum res_e type, int isswapped) isprint(rtp->tag[2]) ? rtp->tag[2] : '.', isprint(rtp->tag[3]) ? rtp->tag[3] : '.'); - /* FIXME: This relies in sizeof(DWORD) == sizeof(pointer_type) */ - if((DWORD)rtp & 1) + if((UINT_PTR)rtp & 1) rtp = SKIP_TAG(rtp,1); } } @@ -930,8 +929,7 @@ ani_curico_t *new_ani_curico(enum res_e type, raw_data_t *rd, int *memopt) isprint(rtp->tag[2]) ? rtp->tag[2] : '.', isprint(rtp->tag[3]) ? rtp->tag[3] : '.'); - /* FIXME: This relies in sizeof(DWORD) == sizeof(pointer_type) */ - if((DWORD)rtp & 1) + if((UINT_PTR)rtp & 1) rtp = SKIP_TAG(rtp,1); } diff --git a/reactos/tools/wrc/parser.l b/reactos/tools/wrc/parser.l index 9983d107cea..d8abcad9c7e 100644 --- a/reactos/tools/wrc/parser.l +++ b/reactos/tools/wrc/parser.l @@ -109,7 +109,7 @@ cident [a-zA-Z_][0-9a-zA-Z_]* #include "parser.h" #include "newstruc.h" -#include "y.tab.h" +#include "parser.tab.h" #define YY_USE_PROTOS #define YY_NO_UNPUT diff --git a/reactos/tools/wrc/y.tab.c b/reactos/tools/wrc/parser.tab.c similarity index 99% rename from reactos/tools/wrc/y.tab.c rename to reactos/tools/wrc/parser.tab.c index c047f64da2c..fb29627c889 100644 --- a/reactos/tools/wrc/y.tab.c +++ b/reactos/tools/wrc/parser.tab.c @@ -527,7 +527,7 @@ typedef union YYSTYPE { ani_any_t *ani; } YYSTYPE; /* Line 191 of yacc.c. */ -#line 531 "y.tab.c" +#line 531 "parser.tab.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -539,7 +539,7 @@ typedef union YYSTYPE { /* Line 214 of yacc.c. */ -#line 543 "y.tab.c" +#line 543 "parser.tab.c" #if ! defined (yyoverflow) || YYERROR_VERBOSE @@ -4167,7 +4167,7 @@ yyreduce: } /* Line 1000 of yacc.c. */ -#line 4171 "y.tab.c" +#line 4171 "parser.tab.c" yyvsp -= yylen; yyssp -= yylen; diff --git a/reactos/tools/wrc/y.tab.h b/reactos/tools/wrc/parser.tab.h similarity index 99% rename from reactos/tools/wrc/y.tab.h rename to reactos/tools/wrc/parser.tab.h index 0e1d5da12dc..1d2044871e3 100644 --- a/reactos/tools/wrc/y.tab.h +++ b/reactos/tools/wrc/parser.tab.h @@ -247,7 +247,7 @@ typedef union YYSTYPE { ani_any_t *ani; } YYSTYPE; /* Line 1275 of yacc.c. */ -#line 251 "y.tab.h" +#line 251 "parser.tab.h" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 diff --git a/reactos/tools/wrc/wrc.mak b/reactos/tools/wrc/wrc.mak index 5f3992b1b63..c1d6d094ec6 100644 --- a/reactos/tools/wrc/wrc.mak +++ b/reactos/tools/wrc/wrc.mak @@ -44,7 +44,7 @@ WRC_SOURCES = $(addprefix $(WRC_BASE_), \ utils.c \ wrc.c \ writeres.c \ - y.tab.c \ + parser.tab.c \ lex.yy.c \ port$(SEP)mkstemps.c \ ) @@ -104,7 +104,7 @@ $(WRC_INT_)writeres.o: $(WRC_BASE_)writeres.c | $(WRC_INT) $(ECHO_CC) ${host_gcc} $(WRC_HOST_CFLAGS) -c $< -o $@ -$(WRC_INT_)y.tab.o: $(WRC_BASE_)y.tab.c | $(WRC_INT) +$(WRC_INT_)parser.tab.o: $(WRC_BASE_)parser.tab.c | $(WRC_INT) $(ECHO_CC) ${host_gcc} $(WRC_HOST_CFLAGS) -c $< -o $@