Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 May 2012 16:54:06 +0300
From:      "Andrew Romero" <melanhit@gmail.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/168371: Fix warnings when build port ([-Wlogical-op-parentheses])
Message-ID:  <4fc23206.a46ab40a.36cd.ffff8ac9@mx.google.com>
Resent-Message-ID: <201205271400.q4RE05rQ022787@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         168371
>Category:       ports
>Synopsis:       Fix warnings when build port ([-Wlogical-op-parentheses])
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 27 14:00:04 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Romero
>Release:        FreeBSD 9.0-STABLE i386
>Organization:
Troya BSD
>Environment:
System: FreeBSD amazon.troya.bsd 9.0-STABLE FreeBSD 9.0-STABLE #0: Sat May 26 17:35:45 EEST 2012 root@troya.bsd:/usr/obj/usr/src/sys/TROYA i386

>Description:
	Fix non-critical warnings when build port ([-Wlogical-op-parentheses])
	Also fix warnings "argument unused during compilation: '-s'"
	P.S: after build, "make test" pass all steps

>How-To-Repeat:

>Fix:

--- patch-Makefile begins here ---
--- Makefile.orig	2012-05-27 14:55:08.000000000 +0300
+++ Makefile	2012-05-27 15:01:22.000000000 +0300
@@ -62,12 +62,14 @@
 .endif
 
 post-patch:
+	${ECHO} 'LDFLAGS=-s' >> ${WRKSRC}/makefile.freebsd6
 	${SED} -e 's!-O!${CFLAGS} ${PTHREAD_CFLAGS}!' \
 	       -e 's!g\+\+!${CXX}!' \
 	       -e 's!gcc!${CC}!' \
 	       -e 's/-D_LARGEFILE_SOURCE//' \
 	       -e 's/-D_FILE_OFFSET_BITS=64//' \
 	       -e 's/-lpthread/${PTHREAD_LIBS}/' \
+	       -e 's/${OPTFLAGS} -s/${OPTFLAGS}/' \
 	       ${WRKSRC}/makefile.freebsd6 > ${WRKSRC}/makefile.machine
 	${REINPLACE_CMD} -e 's|{DEST_SHARE_DOC}|${DOCSDIR}|' \
 		${WRKSRC}/man1/*
--- patch-Makefile ends here ---

--- patch-CPP_7zip_Archive_7z_7zIn.cpp begins here ---
--- CPP/7zip/Archive/7z/7zIn.cpp.orig	2012-05-27 15:11:14.000000000 +0300
+++ CPP/7zip/Archive/7z/7zIn.cpp	2012-05-27 15:12:13.000000000 +0300
@@ -1173,7 +1173,7 @@
 
     int i;
     for (i = (int)checkSize - 2; i >= 0; i--)
-      if (buf[i] == 0x17 && buf[i + 1] == 0x6 || buf[i] == 0x01 && buf[i + 1] == 0x04)
+      if (((buf[i] == 0x17) && (buf[i + 1] == 0x6)) || ((buf[i] == 0x01) && (buf[i + 1] == 0x04)))
         break;
     if (i < 0)
       return S_FALSE;
--- patch-CPP_7zip_Archive_7z_7zIn.cpp ends here ---

--- patch-CPP_7zip_Archive_Chm_ChmHandler.cpp begins here ---
--- CPP/7zip/Archive/Chm/ChmHandler.cpp.orig	2012-05-27 15:13:15.000000000 +0300
+++ CPP/7zip/Archive/Chm/ChmHandler.cpp	2012-05-27 15:14:35.000000000 +0300
@@ -134,11 +134,15 @@
     case kpidSize:  prop = item.Size; break;
     case kpidMethod:
     {
-      if (!item.IsDir())
+      if (!item.IsDir()) {
         if (item.Section == 0)
           prop = L"Copy";
-        else if (item.Section < m_Database.Sections.Size())
-          prop = m_Database.Sections[(int)item.Section].GetMethodName();
+        else {
+          if (item.Section < m_Database.Sections.Size()) {
+            prop = m_Database.Sections[(int)item.Section].GetMethodName();
+	  }
+        }
+      }
       break;
     }
     case kpidBlock:
--- patch-CPP_7zip_Archive_Chm_ChmHandler.cpp ends here ---

--- patch-CPP_7zip_Archive_Nsis_NsisHandler.cpp begins here ---
--- CPP/7zip/Archive/Nsis/NsisHandler.cpp.orig	2012-05-27 15:16:44.000000000 +0300
+++ CPP/7zip/Archive/Nsis/NsisHandler.cpp	2012-05-27 15:17:46.000000000 +0300
@@ -145,7 +145,7 @@
 {
   NMethodType::EEnum methodIndex = _archive.Method;
   AString method;
-  if (_archive.IsSolid && _archive.UseFilter || !_archive.IsSolid && useItemFilter)
+  if ((_archive.IsSolid && _archive.UseFilter) || ((!_archive.IsSolid) && useItemFilter))
   {
     method += kBcjMethod;
     method += ' ';
--- patch-CPP_7zip_Archive_Nsis_NsisHandler.cpp ends here ---

--- patch-CPP_7zip_Archive_SwfHandler.cpp begins here ---
--- CPP/7zip/Archive/SwfHandler.cpp.orig	2012-05-27 15:08:20.000000000 +0300
+++ CPP/7zip/Archive/SwfHandler.cpp	2012-05-27 15:09:00.000000000 +0300
@@ -128,11 +128,12 @@
 {
   Close();
   HRESULT res = _item.ReadHeader(stream);
-  if (res == S_OK)
+  if (res == S_OK) {
     if (_item.IsCompressed())
       _seqStream = stream;
     else
       res = S_FALSE;
+  }
   return res;
 }
 
--- patch-CPP_7zip_Archive_SwfHandler.cpp ends here ---

--- patch-CPP_7zip_Archive_Wim_WimIn.cpp begins here ---
--- CPP/7zip/Archive/Wim/WimIn.cpp.orig	2012-05-27 15:20:19.000000000 +0300
+++ CPP/7zip/Archive/Wim/WimIn.cpp	2012-05-27 15:20:50.000000000 +0300
@@ -812,11 +812,12 @@
     {
       CItem &item = Items[i];
       item.StreamIndex = -1;
-      if (item.HasStream())
+      if (item.HasStream()) {
         if (IsOldVersion)
           item.StreamIndex = FindId(Streams, sortedByHash, item.Id);
         else
           item.StreamIndex = FindHash(Streams, sortedByHash, item.Hash);
+      }
     }
   }
 
--- patch-CPP_7zip_Archive_Wim_WimIn.cpp ends here ---

--- patch-CPP_7zip_Compress_CodecExports.cpp begins here ---
--- CPP/7zip/Compress/CodecExports.cpp.orig	2012-05-27 15:21:50.000000000 +0300
+++ CPP/7zip/Compress/CodecExports.cpp	2012-05-27 15:24:32.000000000 +0300
@@ -54,10 +54,10 @@
   for (unsigned i = 0; i < g_NumCodecs; i++)
   {
     const CCodecInfo &codec = *g_Codecs[i];
-    if (id != codec.Id || encode && !codec.CreateEncoder || !encode && !codec.CreateDecoder)
+    if ((id != codec.Id) || (encode && (!codec.CreateEncoder)) || ((!encode) && (!codec.CreateDecoder)))
       continue;
-    if (!isFilter && codec.IsFilter || isFilter && !codec.IsFilter ||
-        codec.NumInStreams != 1 && !isCoder2 || codec.NumInStreams == 1 && isCoder2)
+    if (((!isFilter) && codec.IsFilter) || (isFilter && (!codec.IsFilter)) ||
+        ((codec.NumInStreams != 1) && (!isCoder2)) || ((codec.NumInStreams == 1) && isCoder2))
       return E_NOINTERFACE;
     index = i;
     return S_OK;
@@ -73,8 +73,8 @@
   bool isCoder2 = (*iid == IID_ICompressCoder2) != 0;
   bool isFilter = (*iid == IID_ICompressFilter) != 0;
   const CCodecInfo &codec = *g_Codecs[index];
-  if (!isFilter && codec.IsFilter || isFilter && !codec.IsFilter ||
-      codec.NumInStreams != 1 && !isCoder2 || codec.NumInStreams == 1 && isCoder2)
+  if (((!isFilter) && codec.IsFilter) || (isFilter && (!codec.IsFilter)) ||
+      ((codec.NumInStreams != 1) && (!isCoder2)) || ((codec.NumInStreams == 1) && isCoder2))
     return E_NOINTERFACE;
   if (encode)
   {
--- patch-CPP_7zip_Compress_CodecExports.cpp ends here ---

--- patch-CPP_7zip_Compress_DeflateEncoder.cpp begins here ---
--- CPP/7zip/Compress/DeflateEncoder.cpp.orig	2012-05-27 15:37:28.000000000 +0300
+++ CPP/7zip/Compress/DeflateEncoder.cpp	2012-05-27 15:39:02.000000000 +0300
@@ -609,8 +609,8 @@
   {
     if (m_OptimumCurrentIndex == m_OptimumEndIndex)
     {
-      if (m_Pos >= kMatchArrayLimit || BlockSizeRes >= blockSize || !m_SecondPass &&
-          ((Inline_MatchFinder_GetNumAvailableBytes(&_lzInWindow) == 0) || m_ValueIndex >= m_ValueBlockSize))
+      if ((m_Pos >= kMatchArrayLimit) || (BlockSizeRes >= blockSize) || (!m_SecondPass &&
+          ((Inline_MatchFinder_GetNumAvailableBytes(&_lzInWindow) == 0) || (m_ValueIndex >= m_ValueBlockSize))))
         break;
     }
     UInt32 pos;
--- patch-CPP_7zip_Compress_DeflateEncoder.cpp ends here ---

--- patch-CPP_7zip_Compress_Rar1Decoder.cpp begins here ---
--- CPP/7zip/Compress/Rar1Decoder.cpp.orig	2012-05-27 15:56:56.000000000 +0300
+++ CPP/7zip/Compress/Rar1Decoder.cpp	2012-05-27 15:58:32.000000000 +0300
@@ -224,21 +224,24 @@
   dist = ((dist & 0xff00) >> 1) | ReadBits(7);
 
   oldAvr3 = AvrLn3;
-  if (len != 1 && len != 4)
+  if (len != 1 && len != 4) {
     if (len == 0 && dist <= MaxDist3)
     {
       AvrLn3++;
       AvrLn3 -= AvrLn3 >> 8;
     }
-    else
-      if (AvrLn3 > 0)
+    else {
+      if (AvrLn3 > 0) {
         AvrLn3--;
+      }
+    }
+  }
   len += 3;
   if (dist >= MaxDist3)
     len++;
   if (dist <= 256)
     len += 8;
-  if (oldAvr3 > 0xb0 || AvrPlc >= 0x2a00 && oldAvr2 < 0x40)
+  if ((oldAvr3 > 0xb0) || ((AvrPlc >= 0x2a00) && (oldAvr2 < 0x40)))
     MaxDist3 = 0x7f00;
   else
     MaxDist3 = 0x2001;
--- patch-CPP_7zip_Compress_Rar1Decoder.cpp ends here ---

--- patch-CPP_7zip_Compress_Rar2Decoder.cpp begins here ---
--- CPP/7zip/Compress/Rar2Decoder.cpp.orig	2012-05-27 15:59:19.000000000 +0300
+++ CPP/7zip/Compress/Rar2Decoder.cpp	2012-05-27 16:00:10.000000000 +0300
@@ -170,7 +170,7 @@
   // it differs a little from pure RAR sources;
   // UInt64 ttt = m_InBitStream.GetProcessedSize() + 2;
   // + 2 works for: return 0xFF; in CInBuffer::ReadByte.
-  if (m_InBitStream.GetProcessedSize() + 7 <= m_PackSize) // test it: probably incorrect;
+  if (m_InBitStream.GetProcessedSize() + 7 <= m_PackSize) { // test it: probably incorrect;
   // if (m_InBitStream.GetProcessedSize() + 2 <= m_PackSize) // test it: probably incorrect;
     if (m_AudioMode)
     {
@@ -188,6 +188,7 @@
       if (number >= kMainTableSize)
         return false;
     }
+  }
   return true;
 }
 
--- patch-CPP_7zip_Compress_Rar2Decoder.cpp ends here ---

--- patch-CPP_7zip_Compress_Rar3Vm.cpp begins here ---
--- CPP/7zip/Compress/Rar3Vm.cpp.orig	2012-05-27 16:01:18.000000000 +0300
+++ CPP/7zip/Compress/Rar3Vm.cpp	2012-05-27 16:03:11.000000000 +0300
@@ -30,7 +30,7 @@
     if (numBits <= avail)
     {
       _bitPos += numBits;
-      return res | (b >> (avail - numBits)) & ((1 << numBits) - 1);
+      return res | ((b >> (avail - numBits)) & ((1 << numBits) - 1));
     }
     numBits -= avail;
     res |= (UInt32)(b & ((1 << avail) - 1)) << numBits;
@@ -286,7 +286,7 @@
           if (cmd->ByteMode)
             res &= 0xFF;
           SetOperand(cmd->ByteMode, &cmd->Op1, res);
-          Flags = (res < v1 || res == v1 && FC) | (res == 0 ? FLAG_Z : (res & FLAG_S));
+          Flags = ((res < v1) || ((res == v1) && FC)) | (res == 0 ? FLAG_Z : (res & FLAG_S));
         }
         break;
       case CMD_SUB:
@@ -314,7 +314,7 @@
           if (cmd->ByteMode)
             res &= 0xFF;
           SetOperand(cmd->ByteMode, &cmd->Op1, res);
-          Flags = (res > v1 || res == v1 && FC) | (res == 0 ? FLAG_Z : (res & FLAG_S));
+          Flags = ((res > v1) || ((res == v1) && FC)) | (res == 0 ? FLAG_Z : (res & FLAG_S));
         }
         break;
       case CMD_INC:
--- patch-CPP_7zip_Compress_Rar3Vm.cpp ends here ---

--- patch-CPP_7zip_UI_Common_LoadCodecs.cpp begins here ---
--- CPP/7zip/UI/Common/LoadCodecs.cpp.orig	2012-05-27 16:06:58.000000000 +0300
+++ CPP/7zip/UI/Common/LoadCodecs.cpp	2012-05-27 16:07:35.000000000 +0300
@@ -634,7 +634,7 @@
   for (int i = 0; i < Codecs.Size(); i++)
   {
     const CDllCodecInfo &codec = Codecs[i];
-    if (encode && !codec.EncoderIsAssigned || !encode && !codec.DecoderIsAssigned)
+    if ((encode && !codec.EncoderIsAssigned) || (!encode && !codec.DecoderIsAssigned))
       continue;
     const CCodecLib &lib = Libs[codec.LibIndex];
     UString res;
--- patch-CPP_7zip_UI_Common_LoadCodecs.cpp ends here ---

--- patch-CPP_Common_MyXml.cpp begins here ---
--- CPP/Common/MyXml.cpp.orig	2012-05-27 15:03:22.000000000 +0300
+++ CPP/Common/MyXml.cpp	2012-05-27 15:04:38.000000000 +0300
@@ -7,10 +7,10 @@
 static bool IsValidChar(char c)
 {
   return
-    c >= 'a' && c <= 'z' ||
-    c >= 'A' && c <= 'Z' ||
-    c >= '0' && c <= '9' ||
-    c == '-';
+    ((c >= 'a') && (c <= 'z')) ||
+    ((c >= 'A') && (c <= 'Z')) ||
+    ((c >= '0') && (c <= '9')) ||
+    (c == '-');
 }
 
 static bool IsSpaceChar(char c)
--- patch-CPP_Common_MyXml.cpp ends here ---

--- patch-CPP_Common_Wildcard.cpp begins here ---
--- CPP/Common/Wildcard.cpp.orig	2012-05-27 15:05:00.000000000 +0300
+++ CPP/Common/Wildcard.cpp	2012-05-27 15:05:37.000000000 +0300
@@ -402,11 +402,12 @@
     }
   }
   int numAbsParts = 0;
-  if (isAbs)
+  if (isAbs) {
     if (pathParts.Size() > 1)
       numAbsParts = pathParts.Size() - 1;
     else
       numAbsParts = 1;
+  }
   UString prefix;
   for (int i = 0; i < numAbsParts; i++)
   {
--- patch-CPP_Common_Wildcard.cpp ends here ---

--- patch-CPP_7zip_UI_Common_EnumDirItems.cpp begins here ---
--- CPP/7zip/UI/Common/EnumDirItems.cpp.orig	2012-05-27 16:05:25.000000000 +0300
+++ CPP/7zip/UI/Common/EnumDirItems.cpp	2012-05-27 16:06:01.000000000 +0300
@@ -219,7 +219,7 @@
           continue;
         }
         bool isDir = fi.IsDir();
-        if (isDir && !item.ForDir || !isDir && !item.ForFile)
+        if ((isDir && !item.ForDir) || (!isDir && !item.ForFile))
         {
           errorCodes.Add((DWORD)E_FAIL);
           errorPaths.Add(fullPath);
--- patch-CPP_7zip_UI_Common_EnumDirItems.cpp ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4fc23206.a46ab40a.36cd.ffff8ac9>