From 02e60c843c1a2e8a0720660ad467a74e04cc4933 Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Tue, 29 Mar 2011 08:47:53 -0700 Subject: [PATCH] Bug 624410: Add gcc-suggested parentheses in nsReadableUtils.cpp to silence build warning. r=dwitte --- xpcom/string/src/nsReadableUtils.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/xpcom/string/src/nsReadableUtils.cpp b/xpcom/string/src/nsReadableUtils.cpp index 0ef0db2e90d2..3251c6d2f94e 100644 --- a/xpcom/string/src/nsReadableUtils.cpp +++ b/xpcom/string/src/nsReadableUtils.cpp @@ -573,14 +573,16 @@ IsUTF8( const nsACString& aString ) --state; // non-character : EF BF [BE-BF] or F[0-7] [89AB]F BF [BE-BF] - if ( nonchar && ( !state && c < 0xBE || - state == 1 && c != 0xBF || - state == 2 && 0x0F != (0x0F & c) )) - nonchar = PR_FALSE; + if ( nonchar && + ( ( !state && c < 0xBE ) || + ( state == 1 && c != 0xBF ) || + ( state == 2 && 0x0F != (0x0F & c) ))) + nonchar = PR_FALSE; - if ( !UTF8traits::isInSeq(c) || overlong && c <= olupper || - surrogate && slower <= c || nonchar && !state ) + if ( !UTF8traits::isInSeq(c) || ( overlong && c <= olupper ) || + ( surrogate && slower <= c ) || ( nonchar && !state )) return PR_FALSE; // Not UTF-8 string + overlong = surrogate = PR_FALSE; } }