From 0b38ff0e5b8f665d51c0d31076e15040cb81ff95 Mon Sep 17 00:00:00 2001 From: Pan7 Date: Sun, 21 Aug 2016 12:02:15 +0200 Subject: [PATCH] Fix gcc warning suggest explicit braces to avoid ambiguous --- plugins/vfspk3/unzip.cpp | 14 ++++++++------ plugins/vfsqlpk3/unzip.cpp | 14 ++++++++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/plugins/vfspk3/unzip.cpp b/plugins/vfspk3/unzip.cpp index 1ef15059..aa5c2246 100644 --- a/plugins/vfspk3/unzip.cpp +++ b/plugins/vfspk3/unzip.cpp @@ -1618,12 +1618,12 @@ static int unzlocal_GetCurrentFileInfoInternal (unzFile file, /* we check the magic */ - if (err==UNZ_OK) + if (err==UNZ_OK) { if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK) err=UNZ_ERRNO; else if (uMagic!=0x02014b50) err=UNZ_BADZIPFILE; - + } if (unzlocal_getShort(s->file,&file_info.version) != UNZ_OK) err=UNZ_ERRNO; @@ -1698,11 +1698,12 @@ static int unzlocal_GetCurrentFileInfoInternal (unzFile file, else uSizeRead = extraFieldBufferSize; - if (lSeek!=0) + if (lSeek!=0) { if (fseek(s->file,lSeek,SEEK_CUR)==0) lSeek=0; else err=UNZ_ERRNO; + } if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0)) if (fread(extraField,(uInt)uSizeRead,1,s->file)!=1) err=UNZ_ERRNO; @@ -1723,11 +1724,12 @@ static int unzlocal_GetCurrentFileInfoInternal (unzFile file, else uSizeRead = commentBufferSize; - if (lSeek!=0) + if (lSeek!=0) { if (fseek(s->file,lSeek,SEEK_CUR)==0) lSeek=0; else err=UNZ_ERRNO; + } if ((file_info.size_file_comment>0) && (commentBufferSize>0)) if (fread(szComment,(uInt)uSizeRead,1,s->file)!=1) err=UNZ_ERRNO; @@ -1889,12 +1891,12 @@ static int unzlocal_CheckCurrentFileCoherencyHeader (unz_s* s, uInt* piSizeVar, return UNZ_ERRNO; - if (err==UNZ_OK) + if (err==UNZ_OK) { if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK) err=UNZ_ERRNO; else if (uMagic!=0x04034b50) err=UNZ_BADZIPFILE; - + } if (unzlocal_getShort(s->file,&uData) != UNZ_OK) err=UNZ_ERRNO; /* diff --git a/plugins/vfsqlpk3/unzip.cpp b/plugins/vfsqlpk3/unzip.cpp index cc1f13d5..b263c320 100644 --- a/plugins/vfsqlpk3/unzip.cpp +++ b/plugins/vfsqlpk3/unzip.cpp @@ -1615,12 +1615,12 @@ static int unzlocal_GetCurrentFileInfoInternal (unzFile file, /* we check the magic */ - if (err==UNZ_OK) + if (err==UNZ_OK) { if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK) err=UNZ_ERRNO; else if (uMagic!=0x02014b50) err=UNZ_BADZIPFILE; - + } if (unzlocal_getShort(s->file,&file_info.version) != UNZ_OK) err=UNZ_ERRNO; @@ -1695,11 +1695,12 @@ static int unzlocal_GetCurrentFileInfoInternal (unzFile file, else uSizeRead = extraFieldBufferSize; - if (lSeek!=0) + if (lSeek!=0) { if (fseek(s->file,lSeek,SEEK_CUR)==0) lSeek=0; else err=UNZ_ERRNO; + } if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0)) if (fread_ql(extraField,(uInt)uSizeRead,1,s->file)!=1) err=UNZ_ERRNO; @@ -1720,11 +1721,12 @@ static int unzlocal_GetCurrentFileInfoInternal (unzFile file, else uSizeRead = commentBufferSize; - if (lSeek!=0) + if (lSeek!=0) { if (fseek(s->file,lSeek,SEEK_CUR)==0) lSeek=0; else err=UNZ_ERRNO; + } if ((file_info.size_file_comment>0) && (commentBufferSize>0)) if (fread_ql(szComment,(uInt)uSizeRead,1,s->file)!=1) err=UNZ_ERRNO; @@ -1886,12 +1888,12 @@ static int unzlocal_CheckCurrentFileCoherencyHeader (unz_s* s, uInt* piSizeVar, return UNZ_ERRNO; - if (err==UNZ_OK) + if (err==UNZ_OK) { if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK) err=UNZ_ERRNO; else if (uMagic!=0x04034b50) err=UNZ_BADZIPFILE; - + } if (unzlocal_getShort(s->file,&uData) != UNZ_OK) err=UNZ_ERRNO; /*