deutex/deutex-braces.diff

106 lines
3.6 KiB
Diff

From: Jan Engelhardt <jengelh@medozas.de>
Fix build warnings.
src/mkwad.c: In function "WADRreadBytes":
src/mkwad.c:386:6: warning: suggest explicit braces to avoid ambiguous "else"
src/mkwad.c: In function "WADRreadShort":
src/mkwad.c:405:6: warning: suggest explicit braces to avoid ambiguous "else"
src/mkwad.c: In function "WADRreadLong":
src/mkwad.c:417:6: warning: suggest explicit braces to avoid ambiguous "else"
src/mkwad.c: In function "WADRreadEntry2":
src/mkwad.c:492:6: warning: suggest explicit braces to avoid ambiguous "else"
src/color.c: In function "COLinit":
src/color.c:224:6: warning: suggest explicit braces to avoid ambiguous "else"
---
src/color.c | 3 ++-
src/mkwad.c | 12 ++++++++----
2 files changed, 10 insertions(+), 5 deletions(-)
Index: deutex-4.4.902/src/color.c
===================================================================
--- deutex-4.4.902.orig/src/color.c
+++ deutex-4.4.902/src/color.c
@@ -221,12 +221,13 @@ void COLinit( UInt8 invR, UInt8 invG, UI
const char *name = NULL;
/*Int16 R,G,B;*/
if(COLok!=FALSE) Bug("PL02", "COLok");
- if(Colsz< 256*sizeof(struct PIXEL))
+ if(Colsz< 256*sizeof(struct PIXEL)) {
if (lumpname == NULL)
ProgError ("PL03", "%s: wrong size for PLAYPAL", fname (pathname));
else
ProgError ("PL04", "%s: %s: wrong size for PLAYPAL",
fname (pathname), lump_name (lumpname));
+ }
COLok=TRUE;
COLpal= (struct PIXEL *)Malloc(256*sizeof(struct PIXEL));
for(i=0;i< NCOLOURS;i++)
Index: deutex-4.4.902/src/mkwad.c
===================================================================
--- deutex-4.4.902.orig/src/mkwad.c
+++ deutex-4.4.902/src/mkwad.c
@@ -383,7 +383,7 @@ iolen_t WADRreadBytes (struct WADINFO *i
{
long ofs = ftell (info->fd);
iolen_t result = WADRreadBytes2 (info, buffer, nbytes);
- if (result != nbytes)
+ if (result != nbytes) {
if (ferror (info->fd))
ProgError ("WR43", "%s: read error (got %lu/%lu bytes)",
fnameofs (info->filename, ofs),
@@ -394,6 +394,7 @@ iolen_t WADRreadBytes (struct WADINFO *i
fnameofs (info->filename, ofs),
(unsigned long) result,
(unsigned long) nbytes);
+ }
return nbytes;
}
@@ -402,11 +403,12 @@ Int16 WADRreadShort(struct WADINFO *info
{ Int16 res;
long ofs = ftell (info->fd);
if (!(info->ok&WADR_READ)) Bug("WR51", "WadRdS");
- if (wad_read_i16 (info->fd, &res))
+ if (wad_read_i16 (info->fd, &res)) {
if (ferror (info->fd))
ProgError ("WR53", "%s: read error", fnameofs (info->filename, ofs));
else
ProgError ("WR55", "%s: unexpected EOF", fnameofs (info->filename, ofs));
+ }
return res;
}
@@ -414,11 +416,12 @@ Int32 WADRreadLong(struct WADINFO *info)
{ Int32 res;
long ofs = ftell (info->fd);
if (!(info->ok&WADR_READ)) Bug("WR61", "WadRdL");
- if (wad_read_i32 (info->fd, &res))
+ if (wad_read_i32 (info->fd, &res)) {
if (ferror (info->fd))
ProgError ("WR63", "%s: read error", fnameofs (info->filename, ofs));
else
ProgError ("WR65", "%s: unexpected EOF", fnameofs (info->filename, ofs));
+ }
return res;
}
@@ -489,7 +492,7 @@ char *WADRreadEntry2 (struct WADINFO *in
buffer = Malloc (size);
WADRseek (info, start);
actual_size = WADRreadBytes2 (info, buffer, size);
- if (actual_size < size)
+ if (actual_size < size) {
if (ferror (info->fd))
ProgError ("WR78", "%s: Lump %s: read error at byte %ld",
fnameofs (info->filename, start + actual_size),
@@ -500,6 +503,7 @@ char *WADRreadEntry2 (struct WADINFO *in
fnameofs (info->filename, start + actual_size),
lump_name (info->dir[n].name),
(long) actual_size);
+ }
*psize = actual_size;
return buffer;
}