Fix operator precedence order.
authorThiago Macieira <thiago.macieira@intel.com>
Thu, 29 Mar 2012 00:03:38 +0000 (21:03 -0300)
committerQt by Nokia <qt-info@nokia.com>
Thu, 29 Mar 2012 00:07:38 +0000 (02:07 +0200)
Clang (I guess it was clang) reports:

io/qipaddress.cpp:276:34: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Wparentheses]

Fix the precedence by wrapping the ternary expression in parentheses.

Change-Id: I1c995dc8e2b1b831480ea8f8a695f7f89c08fcac
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
src/corelib/io/qipaddress.cpp

index e996c86..c885726 100644 (file)
@@ -273,7 +273,7 @@ void toString(QString &appendTo, IPv6Address address)
 
     // QString::reserve doesn't shrink, so it's fine to us
     appendTo.reserve(appendTo.size() +
-                     embeddedIp4 ? Ip6WithIp4AddressMaxLen : Ip6AddressMaxLen);
+                     (embeddedIp4 ? Ip6WithIp4AddressMaxLen : Ip6AddressMaxLen));
 
     // for finding where to place the "::"
     int zeroRunLength = 0; // in octets