From e3e2689cbfd41d7f675373f8286eec57fe7d62a2 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 4 Mar 2012 13:33:07 +0000 Subject: [PATCH] [GENDIB] - Generate ansi style indentation - Fix signed/unsigned MSVC warnings in generated code svn path=/trunk/; revision=55998 --- reactos/tools/gendib/gendib.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/reactos/tools/gendib/gendib.c b/reactos/tools/gendib/gendib.c index 13e7e8f494c..c48d9402fe6 100644 --- a/reactos/tools/gendib/gendib.c +++ b/reactos/tools/gendib/gendib.c @@ -177,14 +177,11 @@ Output(FILE *Out, const char *Fmt, ...) unsigned n; va_list Args; - if (NULL != strchr(Fmt, '{') && 0 != Indent) + if (strchr(Fmt, '}')) { - Indent += 2; - } - else if (NULL != strchr(Fmt, '}')) - { - Indent -= 2; + Indent -= 4; } + if (AtBOL) { for (n = 0; n < Indent; n++) @@ -198,14 +195,11 @@ Output(FILE *Out, const char *Fmt, ...) vfprintf(Out, Fmt, Args); va_end(Args); - if (NULL != strchr(Fmt, '{')) + if (strchr(Fmt, '{')) { - Indent += 2; - } - else if (NULL != strchr(Fmt, '}') && 0 != Indent) - { - Indent -= 2; + Indent += 4; } + AtBOL = '\n' == Fmt[strlen(Fmt) - 1]; } @@ -460,7 +454,7 @@ CreateCounts(FILE *Out, unsigned Bpp) else { Output(Out, "LeftCount = (ULONG_PTR) DestBase & 0x03;\n"); - Output(Out, "if (BltInfo->DestRect.right - BltInfo->DestRect.left < " + Output(Out, "if ((ULONG)(BltInfo->DestRect.right - BltInfo->DestRect.left) < " "LeftCount)\n"); Output(Out, "{\n"); Output(Out, "LeftCount = BltInfo->DestRect.right - " @@ -800,7 +794,7 @@ CreatePrimitive(FILE *Out, unsigned Bpp, PROPINFO RopInfo) Output(Out, "ULONG i;\n"); if (RopInfo->UsesPattern) { - Output(Out, "ULONG PatternX =0, PatternY = 0, BasePatternX = 0;\n"); + Output(Out, "LONG PatternX =0, PatternY = 0, BasePatternX = 0;\n"); } First = 1; if (RopInfo->UsesSource)