[GH-ISSUE #31] Eliminating warnings and making life easier for future generations #18

Closed
opened 2026-05-05 03:34:14 -06:00 by gitea-mirror · 16 comments
Owner

Originally created by @mingodad on GitHub (Jan 7, 2021).
Original GitHub issue: https://github.com/ultimatepp/ultimatepp/issues/31

I noticed that the IDE hide the compilation commands and it's warnings from the user (I'm used to Codeblocks and Netbeans) so I exported a Makefile for the IDE and created a Netbeans project to build it.

To the exported Makefile I added the following compiler options -Wall -pipe and noticed lots of warnings related to parentheses around boolean expressions and found this interesting one in uppsrc/ide/RepoSync.cpp:

if(pass == action < 0 && action != DELETEC) {

Also to suppress the warnings from GTK-3 headers I added this to uppsrc/CtrlCore/Gtk.h:

#ifdef __GNUC__
#pragma GCC diagnostic push 
#pragma GCC diagnostic ignored "-Wparentheses"
#endif
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif

I'm trying to fix as much warnings I can and I'll add then here later.

Originally created by @mingodad on GitHub (Jan 7, 2021). Original GitHub issue: https://github.com/ultimatepp/ultimatepp/issues/31 I noticed that the IDE hide the compilation commands and it's warnings from the user (I'm used to Codeblocks and Netbeans) so I exported a Makefile for the IDE and created a Netbeans project to build it. To the exported Makefile I added the following compiler options `-Wall -pipe` and noticed lots of warnings related to parentheses around boolean expressions and found this interesting one in uppsrc/ide/RepoSync.cpp: ``` if(pass == action < 0 && action != DELETEC) { ``` Also to suppress the warnings from GTK-3 headers I added this to uppsrc/CtrlCore/Gtk.h: ``` #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wparentheses" #endif #include <gtk/gtk.h> #include <gdk/gdkkeysyms.h> #ifdef __GNUC__ #pragma GCC diagnostic pop #endif ``` I'm trying to fix as much warnings I can and I'll add then here later.
Author
Owner

@mingodad commented on GitHub (Jan 7, 2021):

Another joy found in uppsrc/ide/Builders/GccBuilder.cpp:

				if(findarg(ext, ".c", ".cpp", ".cc", ".cxx", ".brc", ".s", ".ss") >= 0 ||
				   objectivec && findarg(ext, ".mm", ".m") >= 0 ||
				   +
				   (!release && blitz && ext == ".icpp") ||
				   ext == ".rc" && HasFlag("WIN32")) {
<!-- gh-comment-id:756113040 --> @mingodad commented on GitHub (Jan 7, 2021): Another joy found in uppsrc/ide/Builders/GccBuilder.cpp: ``` if(findarg(ext, ".c", ".cpp", ".cc", ".cxx", ".brc", ".s", ".ss") >= 0 || objectivec && findarg(ext, ".mm", ".m") >= 0 || + (!release && blitz && ext == ".icpp") || ext == ".rc" && HasFlag("WIN32")) { ```
Author
Owner

@mingodad commented on GitHub (Jan 7, 2021):

Another joy in uppsrc/Core/Socket.cpp:

			if(rp->ai_family == AF_INET == !pass && // Try to connect IPv4 in the first pass
			   Open(rp->ai_family, rp->ai_socktype, rp->ai_protocol)) {
<!-- gh-comment-id:756134320 --> @mingodad commented on GitHub (Jan 7, 2021): Another joy in uppsrc/Core/Socket.cpp: ``` if(rp->ai_family == AF_INET == !pass && // Try to connect IPv4 in the first pass Open(rp->ai_family, rp->ai_socktype, rp->ai_protocol)) { ```
Author
Owner

@mingodad commented on GitHub (Jan 7, 2021):

Today in Lua mailing list there is several messages about operator precedence here is one interesting message:

Parentheses are free
In any programming language, as well as plain text documentation, I almost always use parentheses to indicate the exact order of things.

As a corollary, if the parens would end up making the expression unwieldy or too complex then I take that as an indication that the original expression is too complex and I try to rewrite it.

Frank

<!-- gh-comment-id:756157166 --> @mingodad commented on GitHub (Jan 7, 2021): Today in Lua mailing list there is several messages about operator precedence here is one interesting message: > Parentheses are free In any programming language, as well as plain text documentation, I almost always use parentheses to indicate the exact order of things. > As a corollary, if the parens would end up making the expression unwieldy or too complex then I take that as an indication that the original expression is too complex and I try to rewrite it. > Frank
Author
Owner

@mingodad commented on GitHub (Jan 7, 2021):

There is this warning that probably need a review:

c++ -c -x c++ -D_DEBUG -O0 -ggdb -g2  -std=c++14 -Wall -pipe  `pkg-config --cflags freetype2` `pkg-config --cflags x11` `pkg-config --cflags fontconfig` `pkg-config --cflags xcb` `pkg-config --cflags expat` `pkg-config --cflags xinerama` `pkg-config --cflags xrender` `pkg-config --cflags xft` `pkg-config --cflags xdmcp` `pkg-config --cflags xext` `pkg-config --cflags gtk+-3.0` `pkg-config --cflags libnotify` `pkg-config --cflags libpng` -I./ -I_out/ -DflagGUI -DflagGCC -DflagDEBUG -DflagSHARED -DflagDEBUG_FULL -DflagPOSIX -DflagLINUX -DflagBLITZ  CtrlCore/GtkEvent.cpp -o _out/CtrlCore/GCC-Blitz-Debug-Debug_Full-Gcc-Gui-Linux-Posix-Shared/GtkEvent.o
In file included from ./Core/Core.h:277,
                 from ./Draw/Draw.h:6,
                 from ./RichText/RichText.h:4,
                 from ./CtrlCore/CtrlCore.h:4,
                 from CtrlCore/GtkEvent.cpp:1:
./Core/Fn.h: In instantiation of ‘constexpr int Upp::findarg(const T&, const K&, const L& ...) [with T = unsigned int; K = int; L = {int}]’:
CtrlCore/GtkEvent.cpp:208:32:   required from here
./Core/Fn.h:55:9: warning: comparison of integer expressions of different signedness: ‘const unsigned int’ and ‘const int’ [-Wsign-compare]
   55 |  if(sel == k)
      |     ~~~~^~~~
./Core/Fn.h: In instantiation of ‘constexpr int Upp::findarg(const T&, const K&) [with T = unsigned int; K = int]’:
./Core/Fn.h:57:17:   required from ‘constexpr int Upp::findarg(const T&, const K&, const L& ...) [with T = unsigned int; K = int; L = {int}]’
CtrlCore/GtkEvent.cpp:208:32:   required from here
./Core/Fn.h:49:11: warning: comparison of integer expressions of different signedness: ‘const unsigned int’ and ‘const int’ [-Wsign-compare]
   49 |  return x == k ? 0 : -1;
      |         ~~^~~~
<!-- gh-comment-id:756168167 --> @mingodad commented on GitHub (Jan 7, 2021): There is this warning that probably need a review: ``` c++ -c -x c++ -D_DEBUG -O0 -ggdb -g2 -std=c++14 -Wall -pipe `pkg-config --cflags freetype2` `pkg-config --cflags x11` `pkg-config --cflags fontconfig` `pkg-config --cflags xcb` `pkg-config --cflags expat` `pkg-config --cflags xinerama` `pkg-config --cflags xrender` `pkg-config --cflags xft` `pkg-config --cflags xdmcp` `pkg-config --cflags xext` `pkg-config --cflags gtk+-3.0` `pkg-config --cflags libnotify` `pkg-config --cflags libpng` -I./ -I_out/ -DflagGUI -DflagGCC -DflagDEBUG -DflagSHARED -DflagDEBUG_FULL -DflagPOSIX -DflagLINUX -DflagBLITZ CtrlCore/GtkEvent.cpp -o _out/CtrlCore/GCC-Blitz-Debug-Debug_Full-Gcc-Gui-Linux-Posix-Shared/GtkEvent.o In file included from ./Core/Core.h:277, from ./Draw/Draw.h:6, from ./RichText/RichText.h:4, from ./CtrlCore/CtrlCore.h:4, from CtrlCore/GtkEvent.cpp:1: ./Core/Fn.h: In instantiation of ‘constexpr int Upp::findarg(const T&, const K&, const L& ...) [with T = unsigned int; K = int; L = {int}]’: CtrlCore/GtkEvent.cpp:208:32: required from here ./Core/Fn.h:55:9: warning: comparison of integer expressions of different signedness: ‘const unsigned int’ and ‘const int’ [-Wsign-compare] 55 | if(sel == k) | ~~~~^~~~ ./Core/Fn.h: In instantiation of ‘constexpr int Upp::findarg(const T&, const K&) [with T = unsigned int; K = int]’: ./Core/Fn.h:57:17: required from ‘constexpr int Upp::findarg(const T&, const K&, const L& ...) [with T = unsigned int; K = int; L = {int}]’ CtrlCore/GtkEvent.cpp:208:32: required from here ./Core/Fn.h:49:11: warning: comparison of integer expressions of different signedness: ‘const unsigned int’ and ‘const int’ [-Wsign-compare] 49 | return x == k ? 0 : -1; | ~~^~~~ ```
Author
Owner

@mingodad commented on GitHub (Jan 7, 2021):

Here is the changes I made to eliminate the compiler warnings (that ended up messing up a bit see the screenshot attached where we can see that the editor comes up with an HEX view of the file):

----------------------- uppsrc/CodeEditor/CHighlight.cpp -----------------------
index ceb2674f5..a353e7055 100644
@@ -182,7 +182,7 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls
 	
 	Grounding(p, e);
 	if(highlight == HIGHLIGHT_CALC) {
-		if(editor && line == editor->GetLineCount() - 1 || *p == '$')
+		if((editor && line == editor->GetLineCount() - 1) || *p == '$')
 			hls.SetPaper(0, linelen + 1, hl_style[PAPER_BLOCK1].color);
 	}
 	else
@@ -196,7 +196,7 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls
 			while(bid < this->bid.GetCount() - 1
 			&& (i >= linelen || p[i] == ' ' || p[i] == '\t')) {
 				hls.SetPaper(i, 1, BlockColor(bid));
-				if(i < linelen && p[i] == '\t' || ++pos >= tabsize) {
+				if((i < linelen && p[i] == '\t') || ++pos >= tabsize) {
 					pos = 0;
 					bid++;
 				}
@@ -242,7 +242,7 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls
 	while(p < e) {
 		int  raw_n = 0;
 		dword pair = MAKELONG(p[0], p[1]);
-		if(pair == MAKELONG('/', '*') && highlight != HIGHLIGHT_JSON || comment) {
+		if((pair == MAKELONG('/', '*') && highlight != HIGHLIGHT_JSON) || comment) {
 			if(!comment) {
 				hls.Put(2, hl_style[INK_COMMENT]);
 				p += 2;
@@ -289,16 +289,16 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls
 				hls.Put(int(p - b), hl_style[INK_RAW_STRING]);
 		}
 		else
-		if(linecomment && linecont || pair == MAKELONG('/', '/') &&
-		   highlight != HIGHLIGHT_CSS && highlight != HIGHLIGHT_JSON ||
-		   highlight == HIGHLIGHT_PHP && *p == '#') {
+		if((linecomment && linecont) || (pair == MAKELONG('/', '/') &&
+		   highlight != HIGHLIGHT_CSS && highlight != HIGHLIGHT_JSON) ||
+		   (highlight == HIGHLIGHT_PHP && *p == '#')) {
 			while(p < e)
 				p = DoComment(hls, p, e);
 			is_comment = true;
 			break;
 		}
 		else
-		if((*p == '\"' || *p == '\'') || linecont && string)
+		if((*p == '\"' || *p == '\'') || (linecont && string))
 			p = hls.CString(p);
 		else
 		if(*p == '(') {
@@ -336,7 +336,7 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls
 				hls.SetPaper(hls.pos, linelen + 1 - hls.pos, BlockColor(--block_level));
 			Bracket(int(p - ltext) + pos, hls, editor);
 			int& l = *p == ')' ? pl : *p == '}' ? cl : bl;
-			if(bc && (bc != *p || l <= 0) || bc == 0 && *p != '}') {
+			if((bc && (bc != *p || l <= 0)) || (bc == 0 && *p != '}')) {
 				hls.Put(p == ltext || ignore_errors ? hl_style[INK_PAR0] : hl_style[INK_ERROR]);
 				brk.Clear();
 				cl = bl = pl = 0;
@@ -379,7 +379,7 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls
 		if(iscib(*p)) {
 			const wchar *q = p;
 			StringBuffer id;
-			while((iscidl(*q) || highlight == HIGHLIGHT_CSS && *q == '-') && q < e)
+			while((iscidl(*q) || (highlight == HIGHLIGHT_CSS && *q == '-')) && q < e)
 				id.Cat(*q++);
 			String iid = id;
 			if(highlight == HIGHLIGHT_SQL)

------------------------- uppsrc/CodeEditor/CLogic.cpp -------------------------
index da40f77a0..639d88688 100644
@@ -20,8 +20,8 @@ int CSyntax::GetCommentPos(CodeEditor& e, int l, WString& ch) const
 	sSpaces(cp, ln);
 	One<EditorSyntax> esyntax = e.GetSyntax(e.GetCursorLine());
 	CSyntax *syntax = dynamic_cast<CSyntax *>(~esyntax);
-	if(syntax && syntax->comment && ln.Find("*/") < 0 ||
-	   cp < ln.GetCount() - 2 && ln[cp] == '/' && ln[cp + 1] == '/') {
+	if((syntax && syntax->comment && ln.Find("*/") < 0) ||
+	   (cp < ln.GetCount() - 2 && ln[cp] == '/' && ln[cp + 1] == '/')) {
 	    while(cp < ln.GetLength() && findarg(ln[cp], '/', '*', '!', '<', '>', '%', '#', '@', '|') >= 0)
 	        cp++;
 	    ch = ln.Mid(0, cp);
@@ -75,7 +75,7 @@ void CSyntax::IndentInsert0(CodeEditor& e, int chr, int count, bool reformat)
 				e.InsertChar(*s++, 1);
 			if(!syntax)
 				return;
-			if(syntax->stmtline == cl || syntax->blk.GetCount() && syntax->blk.Top() == cl // statement (if, while..) || first line of block
+			if(syntax->stmtline == cl || (syntax->blk.GetCount() && syntax->blk.Top() == cl) // statement (if, while..) || first line of block
 			   || *pl.Last() == ':') { // label
 				if(indent_spaces || (s > pl && s[-1] == ' '))
 					e.InsertChar(' ', indent_amount);
@@ -128,7 +128,7 @@ void CSyntax::IndentInsert0(CodeEditor& e, int chr, int count, bool reformat)
 	// {, } inserted on line alone should be moved left sometimes:
 	int cl = e.GetCursorLine();
 	WString l = e.GetWLine(cl);
-	if(chr != '{' && chr != '}' || count > 1) {
+	if((chr != '{' && chr != '}') || count > 1) {
 		e.InsertChar(chr, 1, true);
 		return;
 	}

------------------------ uppsrc/CodeEditor/CSyntax.cpp ------------------------
index 12526f906..47cb3e280 100644
@@ -127,8 +127,8 @@ void CSyntax::ScanSyntax(const wchar *ln, const wchar *e, int line, int tab_size
 			p++;
 		int idlen = int(p - id);
 		if(id[0] == 'i' && id[1] == 'f'
-		&& (idlen == 2 || idlen == 5 && id[2] == 'd' && id[3] == 'e' && id[4] == 'f'
-		|| idlen == 6 && id[2] == 'n' && id[3] == 'd' && id[4] == 'e' && id[5] == 'f')) {
+		&& (idlen == 2 || (idlen == 5 && id[2] == 'd' && id[3] == 'e' && id[4] == 'f')
+		|| (idlen == 6 && id[2] == 'n' && id[3] == 'd' && id[4] == 'e' && id[5] == 'f'))) {
 			IfState& ifstate = ifstack.Add();
 			ifstate.state = IfState::IF;
 			ifstate.iftext = sReadLn(ln);

----------------------- uppsrc/CodeEditor/CodeEditor.cpp -----------------------
index 8c79116be..023ac14e6 100644
@@ -81,7 +81,7 @@ void CodeEditor::DirtyFrom(int line) {
 }
 
 inline bool IsComment(int a, int b) {
-	return a == '/' && b == '*' || a == '*' && b == '/' || a == '/' && b == '/';
+	return (a == '/' && b == '*') || (a == '*' && b == '/') || (a == '/' && b == '/');
 }
 
 inline bool RBR(int c) {
@@ -193,7 +193,7 @@ bool CodeEditor::IsCursorBracket(int64 pos) const
 
 bool CodeEditor::IsMatchingBracket(int64 pos) const
 {
-	return pos == highlight_bracket_pos && (hilite_bracket == 1 || hilite_bracket == 2 && bracket_flash);
+	return pos == highlight_bracket_pos && (hilite_bracket == 1 || (hilite_bracket == 2 && bracket_flash));
 }
 
 void CodeEditor::CheckBrackets()
@@ -1086,7 +1086,7 @@ void CodeEditor::HighlightLine(int line, Vector<LineEdit::Highlight>& hl, int64
 				break;
 			int n = illuminated.GetCount();
 			if(n > 1 || !iscid(illuminated[0]) ||
-			   (q == 0 || !iscid(l[q - 1])) && (q + n >= l.GetCount() || !iscid(l[q + n])))
+			   ((q == 0 || !iscid(l[q - 1])) && (q + n >= l.GetCount() || !iscid(l[q + n]))))
 				while(n-- && q < hl.GetCount()) {
 					const HlStyle& st = hl_style[PAPER_SELWORD];
 					hl[q].paper = st.color;

----------------------- uppsrc/CodeEditor/LogSyntax.cpp -----------------------
index 491a32a92..4b373a814 100644
@@ -53,7 +53,7 @@ void LogSyntax::Highlight(const wchar *s, const wchar *end, HighlightOutput& hls
 				sws << "ok" << "success";
 			}
 			String w;
-			while(s < end && IsAlNum(*s) || *s == '_')
+			while((s < end && IsAlNum(*s)) || *s == '_')
 				w.Cat(ToLower(*s++));
 			bool hl = rws.Find(w) >= 0;
 			bool st = sws.Find(w) >= 0;

---------------------- uppsrc/CodeEditor/PythonSyntax.cpp ----------------------
index 053866820..c6f1a08bc 100644
@@ -42,7 +42,7 @@ void PythonSyntax::Highlight(const wchar *s, const wchar *end, HighlightOutput&
 			                             "not", "with", "async", "elif", "if", "or", "yield" };
 			static Index<String> sws = { "self", "NotImplemented", "Ellipsis", "__debug__", "__file__", "__name__" };
 			String w;
-			while(s < end && IsAlNum(*s) || *s == '_')
+			while((s < end && IsAlNum(*s)) || *s == '_')
 				w.Cat(*s++);
 			hls.Put(w.GetCount(), kws.Find(w) >= 0 ? hl_style[INK_KEYWORD] :
 			                      sws.Find(w) >= 0 ? hl_style[INK_UPP] :

------------------------- uppsrc/Core/BlockStream.cpp -------------------------
index 025dce011..a6b627ecf 100644
@@ -473,7 +473,7 @@ bool FileStream::Open(const char *name, dword mode, mode_t tmode) {
 		struct stat st[1];
 		fstat(handle, st);
 		if(!(st->st_mode & S_IFREG) ||  // not a regular file, e.g. folder - bad things would happen
-		   (mode & NOWRITESHARE) && flock(handle, LOCK_EX|LOCK_NB) < 0) { // lock if not sharing
+		   ((mode & NOWRITESHARE) && flock(handle, LOCK_EX|LOCK_NB) < 0)) { // lock if not sharing
 			close(handle);
 			handle = -1;
 			return false;

---------------------------- uppsrc/Core/CharSet.h ----------------------------
index a389fbb3a..13a7a3305 100644
@@ -185,12 +185,12 @@ inline char  ToUpperAscii(wchar c)  { return ToUpperAscii((dword) c); }
 inline char  ToLowerAscii(wchar c)  { return ToLowerAscii((dword) c); }
 
 inline bool IsDigit(int c)         { return c >= '0' && c <= '9'; }
-inline bool IsAlpha(int c)         { return c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z'; }
+inline bool IsAlpha(int c)         { return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'); }
 inline bool IsAlNum(int c)         { return IsDigit(c) || IsAlpha(c); }
 inline bool IsLeNum(int c)         { return IsDigit(c) || IsLetter(c); }
 inline bool IsPunct(int c)         { return c != ' ' && !IsAlNum(c); }
 inline bool IsSpace(int c)         { return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\v' || c == '\t'; }
-inline bool IsXDigit(int c)        { return IsDigit(c) || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f'; }
+inline bool IsXDigit(int c)        { return IsDigit(c) || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'); }
 
 bool IsDoubleWidth(int c);
 
@@ -255,7 +255,7 @@ bool    SaveFileBOMUtf8(const char *path, const String& data);
 
 word UnicodeCombine(word chr, word combine);
 
-inline bool IsCJKIdeograph(int c)  { return c >= 0x2e80 && c <= 0xdfaf || c >= 0xf900 && c <= 0xfaff; }
+inline bool IsCJKIdeograph(int c)  { return (c >= 0x2e80 && c <= 0xdfaf) || (c >= 0xf900 && c <= 0xfaff); }
 
 int  ToUnicode(int chr, byte charset);
 int  FromUnicode(wchar wchr, byte charset, int defchar = DEFAULTCHAR);

----------------------------- uppsrc/Core/CoAlgo.h -----------------------------
index fdf855dd8..300793528 100644
@@ -128,7 +128,7 @@ int CoFindBest(const Range& r, const Better& better)
 				i++;
 			}
 			CoWork::FinLock();
-			if(better(*b, *best) || !better(*best, *b) && b < best)
+			if(better(*b, *best) || (!better(*best, *b) && b < best))
 				best = b;
 		}
 	);

---------------------------- uppsrc/Core/Color.cpp ----------------------------
index 0fea74ed3..9de8ff032 100644
@@ -189,7 +189,7 @@ static int sCharFilterNoDigit(int c)
 
 static int sCharFilterHex(int c)
 {
-	return c >= 'a' && c <= 'f' || c >= 'A' && c <= 'F' || IsDigit(c) ? c : 0;
+	return (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F') || IsDigit(c) ? c : 0;
 }
 
 Color ColorFromText(const char *s)

--------------------------- uppsrc/Core/Convert.cpp ---------------------------
index 4aac022e9..8e8f4f5d1 100644
@@ -125,7 +125,7 @@ double ScanDoubleT(const T *p, const T **endptr, bool accept_comma)
 		*endptr = p;
 	if(*p == '+' || *p == '-')
 		neg = (*p++ == '-');
-	if((byte)(*p - '0') >= 10 && !((*p == '.' || accept_comma && *p == ',') && (byte)(p[1] - '0') < 10)) {
+	if((byte)(*p - '0') >= 10 && !((*p == '.' || (accept_comma && *p == ',')) && (byte)(p[1] - '0') < 10)) {
 		if(endptr) *endptr = begin;
 		return Null;
 	}
@@ -140,7 +140,7 @@ double ScanDoubleT(const T *p, const T **endptr, bool accept_comma)
 		else
 			exp++;
 	int raise = exp;
-	if(*p == '.' || accept_comma && *p == ',') // decimal part
+	if(*p == '.' || (accept_comma && *p == ',')) // decimal part
 		while((byte)((c = *++p) - '0') < 10) {
 			if(c != '0') {
 				if(raise) {

---------------------------- uppsrc/Core/Format.cpp ----------------------------
index 6ab51bd1c..63bd8bd0b 100644
@@ -46,7 +46,7 @@ String FormatIntBase(int i, int base, int width, char lpad, int sign, bool upper
 		while(x /= base);
 	}
 	bool minus = (sign >= 0 && i < 0 && !IsNull(i));
-	bool do_sign = (sign > 0 || sign >= 0 && minus);
+	bool do_sign = (sign > 0 || (sign >= 0 && minus));
 	if(do_sign && lpad != '0')
 		*--p = (minus ? '-' : '+');
 	if(width > e - p)
@@ -316,7 +316,7 @@ String FormatDoubleFix(double d, int digits, int flags)
 	if(flags & FD_REL)
 		digits = max(0, digits - Nvl(exp, 0) - 1);
 	String out;
-	if(flags & FD_SIGN || d < 0 && !IsNull(exp))
+	if(flags & FD_SIGN || (d < 0 && !IsNull(exp)))
 		out.Cat(d >= 0 ? '+' : '-');
 	int pointchar = (flags & FD_COMMA) ? ',' : '.';
 	if(IsNull(exp) || exp < -digits) {
@@ -372,7 +372,7 @@ String FormatDoubleExp(double d, int digits, int flags, int fill_exp)
 	String dig = FormatDoubleDigits(d, digits, flags | FD_REL, exp);
 	exp = Nvl(exp, 0);
 	StringBuffer out;
-	if(flags & FD_SIGN || d < 0 && !IsNull(exp))
+	if(flags & FD_SIGN || (d < 0 && !IsNull(exp)))
 		out.Cat(d >= 0 ? '+' : '-');
 	out.Cat(dig[0]);
 	if(dig.GetLength() > 1)
@@ -621,7 +621,7 @@ String RealFormatter(const Formatting& f)
 		flags |= FD_SIGN;
 		s++;
 	}
-	if(IsDigit(*s) || *s == '-' && IsDigit(s[1])) {
+	if(IsDigit(*s) || (*s == '-' && IsDigit(s[1]))) {
 		digits = (int)strtol(s, NULL, 10);
 		while(IsDigit(*++s))
 			;

----------------------------- uppsrc/Core/Http.cpp -----------------------------
index b97c4c95f..b0daecb1b 100644
@@ -783,7 +783,7 @@ void HttpRequest::Out(const void *ptr, int size)
 		HttpError("content length exceeded " + AsString(max_content_size));
 		return;
 	}
-	if(WhenContent && (status_code >= 200 && status_code < 300 || all_content))
+	if(WhenContent && ((status_code >= 200 && status_code < 300) || all_content))
 		WhenContent(ptr, size);
 	else
 		body.Cat((const char *)ptr, size);
@@ -797,7 +797,7 @@ bool HttpRequest::ReadingBody()
 	if(has_content_length && content_length == 0)
 		return false;
 
-	String s = TcpSocket::Get(has_content_length && content_length > 0 || chunked_encoding ?
+	String s = TcpSocket::Get((has_content_length && content_length > 0) || chunked_encoding ?
 	                          (int)min((int64)chunk, count) : chunk);
 	if(s.GetCount()) {
 	#ifndef ENDZIP

----------------------------- uppsrc/Core/Parser.h -----------------------------
index 084697e5d..38bac6a03 100644
@@ -1,9 +1,9 @@
 inline bool iscib(int c) {
-	return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '_' || c == '$';
+	return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_' || c == '$';
 }
 
 inline bool iscid(int c) {
-	return iscib(c) || c >= '0' && c <= '9';
+	return iscib(c) || ((c >= '0') && (c <= '9'));
 }
 
 class CParser {

----------------------------- uppsrc/Core/Path.cpp -----------------------------
index edfa2afe4..1043f59e5 100644
@@ -525,8 +525,8 @@ bool FindFile::CanMode(dword usr, dword grp, dword oth) const
 	static uid_t uid = getuid();
 	static gid_t gid = getgid();
 	return (mode & oth) ||
-	       (mode & grp) && gid == s.st_gid ||
-	       (mode & usr) && uid == s.st_uid;
+	       ((mode & grp) && gid == s.st_gid) ||
+	       ((mode & usr) && uid == s.st_uid);
 }
 
 bool FindFile::IsSymLink() const

---------------------------- uppsrc/Core/Socket.cpp ----------------------------
index 408b571d5..f237b9091 100644
@@ -452,7 +452,7 @@ bool TcpSocket::RawConnect(addrinfo *arp)
 	for(int pass = 0; pass < 2; pass++) {
 		addrinfo *rp = arp;
 		while(rp) {
-			if(rp->ai_family == AF_INET == !pass && // Try to connect IPv4 in the first pass
+			if(rp->ai_family == AF_INET && !pass && // Try to connect IPv4 in the first pass
 			   Open(rp->ai_family, rp->ai_socktype, rp->ai_protocol)) {
 				if(connect(socket, rp->ai_addr, (int)rp->ai_addrlen) == 0 ||
 				   GetErrorCode() == SOCKERR(EINPROGRESS) || GetErrorCode() == SOCKERR(EWOULDBLOCK)
@@ -645,7 +645,7 @@ bool TcpSocket::RawWait(dword flags, int end_time)
 		#endif
 			return true;
 		}
-		if(IsGlobalTimeout() || to <= 0 && timeout) {
+		if(IsGlobalTimeout() || (to <= 0 && timeout)) {
 			is_timeout = true;
 			return false;
 		}
@@ -703,7 +703,7 @@ int TcpSocket::Put(const void *s_, int length)
 			return done;
 		peek = false;
 		int count = Send(s + done, length - done);
-		if(IsError() || timeout == 0 && count == 0 && peek)
+		if(IsError() || (timeout == 0 && count == 0 && peek))
 			return done;
 		if(count > 0)
 			done += count;
@@ -767,7 +767,7 @@ void TcpSocket::ReadBuffer(int end_time)
 
 bool TcpSocket::IsEof() const
 {
-	return is_eof && ptr == end || IsAbort() || !IsOpen() || IsError();
+	return (is_eof && ptr == end) || IsAbort() || !IsOpen() || IsError();
 }
 
 int TcpSocket::Get_()

---------------------------- uppsrc/Core/Stream.cpp ----------------------------
index 92e9df196..0b6862c1b 100644
@@ -1373,7 +1373,7 @@ Stream& Pack16(Stream& s, int& i1, int& i2, int& i3, int& i4, int& i5) {
 
 int StreamHeading(Stream& stream, int ver, int minver, int maxver, const char* tag)
 {
-	if(stream.IsLoading() && stream.IsEof() || stream.IsError())
+	if((stream.IsLoading() && stream.IsEof()) || stream.IsError())
 		return Null;
 	String text = tag;
 	dword len = text.GetLength();

----------------------------- uppsrc/Core/String.h -----------------------------
index 88c8b7fdc..6ca076104 100644
@@ -290,7 +290,7 @@ public:
 	bool IsEqual(const String0& s) const {
 		uint64 q1 = q[1];
 		uint64 sq1 = s.q[1];
-		return q1 == sq1 && q[0] == s.q[0] || ((q1 | sq1) & MAKE8B(0,0,0,0,0,0,255,0)) && LEq(s);
+		return (q1 == sq1 && q[0] == s.q[0]) || (((q1 | sq1) & MAKE8B(0,0,0,0,0,0,255,0)) && LEq(s));
 	}
 	bool IsEqual(const char *s) const;
 

--------------------------- uppsrc/Core/TimeDate.cpp ---------------------------
index 3289f2349..c5c360681 100644
@@ -27,7 +27,7 @@ int  GetDaysOfMonth(int m, int y) {
 }
 
 bool Date::IsValid() const {
-	return year == -32768 || month >= 1 && month <= 12 && day >= 1 && day <= GetDaysOfMonth(month, year);
+	return year == -32768 || (month >= 1 && month <= 12 && day >= 1 && day <= GetDaysOfMonth(month, year));
 }
 
 String DayName(int i, int lang)
@@ -499,7 +499,7 @@ int64 Time::Get() const
 bool Time::IsValid() const
 {
 	return year == -32768 ||
-	       Date::IsValid() && hour >= 0 && hour < 24 && minute >= 0 && minute < 60 && second >= 0 && second < 60;
+	       (Date::IsValid() && hour >= 0 && hour < 24 && minute >= 0 && minute < 60 && second >= 0 && second < 60);
 }
 
 int64 operator-(Time a, Time b) {

---------------------------- uppsrc/Core/Value.hpp ----------------------------
index f420b8b84..ae4c67607 100644
@@ -11,15 +11,15 @@ Value::Value(const Value& v)
 
 template<>
 inline bool IsPolyEqual(const bool& x, const Value& v) {
-	return v.Is<double>() && int(x) == double(v)
-	    || v.Is<int64>() && int(x) == int64(v)
-	    || v.Is<int>() && int(x) == int(v);
+	return (v.Is<double>() && int(x) == double(v))
+	    || (v.Is<int64>() && int(x) == int64(v))
+	    || (v.Is<int>() && int(x) == int(v));
 }
 
 template<>
 inline bool IsPolyEqual(const int& x, const Value& v) {
-	return v.Is<double>() && x == double(v)
-	    || v.Is<int64>() && x == int64(v);
+	return (v.Is<double>() && x == double(v))
+	    || (v.Is<int64>() && x == int64(v));
 }
 
 template<>

---------------------------- uppsrc/Core/Vcont.hpp ----------------------------
index 95e0f1905..30b7c850d 100644
@@ -378,7 +378,7 @@ void Vector<T>::Insert(int i, Vector<T>&& v) {
 template <class T>
 void Vector<T>::InsertSplit(int i, Vector<T>& v, int from)
 {
-	ASSERT(!vector || v.vector != vector && from <= v.GetCount());
+	ASSERT(!vector || (v.vector != vector && from <= v.GetCount()));
 	int n = v.GetCount() - from;
 	if(n) {
 		RawInsert(i, n);

----------------------------- uppsrc/Core/XML.cpp -----------------------------
index f90bf8d73..71918e160 100644
@@ -11,7 +11,7 @@ static inline void sDeXmlChar(StringBuffer& result, char chr, byte charset, bool
 	else if(chr == '&')  result.Cat("&amp;");
 	else if(chr == '\'') result.Cat("&apos;");
 	else if(chr == '\"') result.Cat("&quot;");
-	else if((byte)chr < ' ' && (escapelf || chr != '\n' && chr != '\t' && chr != '\r'))
+	else if((byte)chr < ' ' && (escapelf || (chr != '\n' && chr != '\t' && chr != '\r')))
 		result.Cat(Format("&#x%02x;", (byte)chr));
 	else if(!(chr & 0x80) || charset == CHARSET_UTF8) result.Cat(chr);
 	else result.Cat(ToUtf8(ToUnicode(chr, charset)));
@@ -962,9 +962,9 @@ XmlNode::XmlNode(const XmlNode& n, int)
 
 bool Ignore(XmlParser& p, dword style)
 {
-	if((XML_IGNORE_DECLS & style) && p.IsDecl() ||
-	   (XML_IGNORE_PIS & style) && p.IsPI() ||
-	   (XML_IGNORE_COMMENTS & style) && p.IsComment()) {
+	if(((XML_IGNORE_DECLS & style) && p.IsDecl()) ||
+	   ((XML_IGNORE_PIS & style) && p.IsPI()) ||
+	   ((XML_IGNORE_COMMENTS & style) && p.IsComment())) {
 		p.Skip();
 		return true;
 	}
@@ -1086,7 +1086,7 @@ bool ShouldPreserve(const String& s)
 		return true;
 	l = s.End();
 	for(const char *x = s; x < l; x++)
-		if(*x == '\t' || *x == '\n' || *x == ' ' && x[1] == ' ')
+		if(*x == '\t' || *x == '\n' || (*x == ' ' && x[1] == ' '))
 			return true;
 	return false;
 }

---------------------------- uppsrc/Core/parser.cpp ----------------------------
index 89fa1353d..66afba18f 100644
@@ -190,7 +190,7 @@ String CParser::ReadIdt() {
 	StringBuffer result;
 	int lvl = 0;
 	while(IsAlNum(*term) || *term == '_' || *term == '<' || *term == '>' ||
-	      *term == ':' || (*term == ',' || *term == ' ' ) && lvl > 0 ) {
+	      *term == ':' || ((*term == ',' || *term == ' ' ) && lvl > 0 )) {
 		if(*term == '<') lvl++;
 		if(*term == '>') lvl--;
 		result.Cat(*term++);
@@ -410,7 +410,7 @@ String CParser::ReadOneString(int delim, bool chkend) {
 							if(!ReadHex(hex2, 4))
 								ThrowError("Incomplete universal character");
 							if(hex2 >= 0xDC00 && hex2 <= 0xDFFF) {
-								result.Cat(ToUtf8(((hex & 0x3ff) << 10) | (hex2 & 0x3ff) + 0x10000));
+								result.Cat(ToUtf8((((hex & 0x3ff) << 10) | (hex2 & 0x3ff)) + 0x10000));
 								break;
 							}
 						}
@@ -683,7 +683,7 @@ String AsCString(const char *s, const char *lim, int linemax, const char *linepf
 				continue; // skip s++
 			}
 			else {
-				if(byte(*s) < 32 || (byte)*s >= 0x7f && (flags & ASCSTRING_OCTALHI) || (byte)*s == 0xff || (byte)*s == 0x7f) {
+				if(byte(*s) < 32 || ((byte)*s >= 0x7f && (flags & ASCSTRING_OCTALHI)) || (byte)*s == 0xff || (byte)*s == 0x7f) {
 					char h[4];
 					int q = (byte)*s;
 					h[0] = '\\';

------------------------------ uppsrc/Core/t.cpp ------------------------------
index a41c31651..93f8c9d7a 100644
@@ -19,8 +19,8 @@ static int sIdLen(const char *txt)
 static bool sIdEq(const char *a, const char *b)
 {
 	for(;;) {
-		if((*a == '\0' || *a == '\a' && a[1] != '\a') &&
-		   (*b == '\0' || *b == '\a' && b[1] != '\a'))
+		if((*a == '\0' || (*a == '\a' && a[1] != '\a')) &&
+		   (*b == '\0' || (*b == '\a' && b[1] != '\a')))
 			return true;
 		if(*a != *b)
 			return false;

--------------------------- uppsrc/CppBase/Body.cpp ---------------------------
index 5699f53bb..1db7cb6b0 100644
@@ -200,7 +200,7 @@ void Parser::Statement()
 			if(lex == t_eof)
 				ThrowError("");
 			TryLambda();
-			if(Key(';') || lex == '{' || lex == '}' || lex >= tk_if && lex <= tk_do)
+			if(Key(';') || lex == '{' || lex == '}' || (lex >= tk_if && lex <= tk_do))
 				break;
 			++lex;
 		}

--------------------------- uppsrc/CppBase/CppBase.h ---------------------------
index d1efa9efc..86d174aa0 100644
@@ -40,7 +40,7 @@ enum Kind {
 
 inline bool IsCppType(int i)
 {
-	return i >= STRUCT && i <= TYPEDEF || i == FRIENDCLASS;
+	return (i >= STRUCT && i <= TYPEDEF) || i == FRIENDCLASS;
 }
 
 inline bool IsCppCode(int i) {
@@ -56,7 +56,7 @@ inline bool IsCppMacro(int i) {
 }
 
 inline bool IsCppTemplate(int i) {
-	return i == STRUCTTEMPLATE || i >= FUNCTIONTEMPLATE && i <= CLASSFUNCTIONTEMPLATE;
+	return i == STRUCTTEMPLATE || (i >= FUNCTIONTEMPLATE && i <= CLASSFUNCTIONTEMPLATE);
 }
 
 void   CleanPP();

-------------------------- uppsrc/CppBase/Parser.cpp --------------------------
index f18a75251..3f12439b1 100644
@@ -79,7 +79,7 @@ String FnItem(const char *s, const char *pname, const char *qname, const String&
 				res.Cat(*s++);
 				plvl--;
 			}
-			if(iscid(*s) || *s == '~' || *s && lvl)
+			if(iscid(*s) || *s == '~' || (*s && lvl))
 				res.Cat(*s++);
 			else
 				break;
@@ -128,7 +128,7 @@ String FnItem(const char *s, const char *pname, const char *qname, const String&
 			s++;
 			int l = 0;
 			int tl = 0;
-			while(*s && !(l == 0 && (*s == ',' && tl == 0 || *s == ')'))) {
+			while(*s && !(l == 0 && ((*s == ',' && tl == 0) || *s == ')'))) {
 				if(*s == '(' || *s == '[')
 					l++;
 				else
@@ -255,7 +255,7 @@ void TpSkip(CParser& p)
 {
 	int lvl = 0;
 	for(;;) {
-		if(lvl == 0 && (p.IsChar(',') || p.IsChar('>')) || p.IsEof())
+		if((lvl == 0 && (p.IsChar(',') || p.IsChar('>'))) || p.IsEof())
 			break;
 		if(p.Char('<'))
 			lvl++;
@@ -461,7 +461,7 @@ String Parser::ReadOper(bool& castoper) {
 	if(Key('('))
 		level++;
 	for(;;) {
-		if(lex == t_eof || level <= 0 && lex == '(') break;
+		if(lex == t_eof || (level <= 0 && lex == '(')) break;
 		if(Key('(') || Key('[')) level++;
 		else
 		if(Key(')')  || Key(']')) level--;
@@ -837,7 +837,7 @@ int Parser::RPtr()
 			n++;
 		}
 		else
-		if(t == t_dblcolon || lex.IsId(n) || t == ',' && tlevel > 0)
+		if(t == t_dblcolon || lex.IsId(n) || (t == ',' && tlevel > 0))
 			n++;
 		else
 			return 0;
@@ -903,8 +903,8 @@ void Parser::Declarator(Decl& d, const char *p)
 		}
 	}
 	if(Key('(')) {
-		if(inbody || (lex < 256 || lex == tk_true || lex == tk_false)
-		   && lex != ')' && lex != '[' && lex != t_dblcolon) {
+		if(inbody || ((lex < 256 || lex == tk_true || lex == tk_false)
+		   && lex != ')' && lex != '[' && lex != t_dblcolon)) {
 			int level = 0;
 			for(;;) {
 				if(lex == t_eof) break;
@@ -955,7 +955,7 @@ void Parser::Declarator(Decl& d, const char *p)
 		for(;;) {
 			TryLambda();
 			if(lex == t_eof  || lex == ';'
-			   || level == 0 && ((lex == ',' && tlevel == 0) || lex == ')'))
+			   || (level == 0 && ((lex == ',' && tlevel == 0) || lex == ')')))
 				break;
 			if(Key('<')) // we ignore < > as operators, always consider them template bracket
 				tlevel++;
@@ -1232,7 +1232,7 @@ CppItem& Parser::Item(const String& scope, const String& using_namespace, const
 void Parser::Resume(int bl)
 {
 	for(;;) {
-		if(lex == t_eof || lex.GetBracesLevel() == bl && lex == ';')
+		if(lex == t_eof || (lex.GetBracesLevel() == bl && lex == ';'))
 			break;
 		++lex;
 	}
@@ -1581,7 +1581,7 @@ void Parser::Do()
 	}
 	else
 	if(Key(tk_template)) {
-		if(lex.IsId() || lex == tk_class && lex.IsId(1)) {
+		if(lex.IsId() || (lex == tk_class && lex.IsId(1))) {
 			Key(tk_class);
 			for(;;) {
 				if(lex.IsId())

---------------------------- uppsrc/CppBase/Pre.cpp ----------------------------
index e78ada2d1..f465440ab 100644
@@ -36,7 +36,7 @@ SrcFile PreProcess(Stream& in, Parser& parser) // This is not really C preproces
 			const char *s = ln;
 			bool islbl = false;
 			bool wassemi = false;
-			while(*s && iscid(*s) || findarg(*s, '\t', ' ', ':') >= 0) { // check for label, labeled lines are not grounded
+			while((*s && iscid(*s)) || findarg(*s, '\t', ' ', ':') >= 0) { // check for label, labeled lines are not grounded
 				if(*s == ':' && !wassemi) {
 					islbl = true;
 					wassemi = true; // second ':' cancels label

-------------------------- uppsrc/CppBase/ppfile.cpp --------------------------
index fc5e6fd12..eac26e5eb 100644
@@ -92,7 +92,7 @@ PPMacro *FindPPMacro(const String& id, Index<int>& segment_id, int& segmenti)
 			else
 			if(pass == 0 || m.segment_id == 0 || undef.Find(m.undef_segment_id) < 0) {
 				int si = m.segment_id == 0 ? INT_MAX : segment_id.Find(m.segment_id); // defs macros always override
-				if(si > best || si >= 0 && si == best && m.line > line) {
+				if(si > best || (si >= 0 && si == best && m.line > line)) {
 					best = si;
 					line = m.line;
 					r = &m;

---------------------------- uppsrc/CtrlCore/Gtk.h ----------------------------
index 281464c20..08ed036be 100644
@@ -9,8 +9,16 @@
 #pragma clang diagnostic ignored "-Wdeprecated"
 #endif
 
+#ifdef __GNUC__
+#pragma GCC diagnostic push 
+#pragma GCC diagnostic ignored "-Wparentheses"
+#endif
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
+
 
 #ifdef __clang__
 #pragma clang diagnostic pop

-------------------------- uppsrc/CtrlCore/GtkTop.cpp --------------------------
index 9e1c94d5a..d56b6b430 100644
@@ -68,7 +68,7 @@ void TopWindow::CenterRect(Ctrl *owner)
 {
 	GuiLock __;
 	SetupRect(owner);
-	if(owner && center == 1 || center == 2) {
+	if((owner && center == 1) || center == 2) {
 		Size sz = GetRect().Size();
 		Rect r, wr;
 		wr = Ctrl::GetWorkArea();

------------------------- uppsrc/CtrlCore/GtkUtil.cpp -------------------------
index 415a6c422..051bd7650 100644
@@ -17,8 +17,8 @@ String ImageClipFromPixbufUnref(GdkPixbuf *pixbuf)
 	Image img;
 	if(pixbuf) {
 		int chn = gdk_pixbuf_get_n_channels(pixbuf);
-		if((chn == 3 && !gdk_pixbuf_get_has_alpha(pixbuf) ||
-		    chn == 4 && gdk_pixbuf_get_has_alpha(pixbuf)) &&
+		if(((chn == 3 && !gdk_pixbuf_get_has_alpha(pixbuf)) ||
+		    (chn == 4 && gdk_pixbuf_get_has_alpha(pixbuf))) &&
 		   gdk_pixbuf_get_colorspace(pixbuf) == GDK_COLORSPACE_RGB &&
 		   gdk_pixbuf_get_bits_per_sample(pixbuf) == 8) {
 			Size sz(gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height(pixbuf));

------------------------- uppsrc/CtrlCore/ParseRTF.cpp -------------------------
index c4208bcd6..4a21a4529 100644
@@ -223,7 +223,7 @@ RTFParser::RTFParser(const char *rtf)
 
 RichText RTFParser::Run()
 {
-	if(!PassGroup() || !PassCmd("rtf") || command_arg != 1 && !IsNull(command_arg))
+	if(!PassGroup() || !PassCmd("rtf") || (command_arg != 1 && !IsNull(command_arg)))
 		return pick(output);
 	while(Token() != T_EOF)
 		ReadItem();
@@ -307,7 +307,7 @@ void RTFParser::FlushTable(int level)
 					int& out_wd = (outer_border[b] ? tbl_border : tbl_grid);
 					Color& out_co = (outer_border[b] ? clr_border : clr_grid);
 					if(IsNull(cell.info.format.bordercolor) || border_width[b] <= 0
-					|| !IsNull(out_co) && out_co != cell.info.format.bordercolor)
+					|| (!IsNull(out_co) && out_co != cell.info.format.bordercolor))
 						out_wd = 0;
 					else if(IsNull(out_wd) || border_width[b] < out_wd) {
 						out_wd = border_width[b];
@@ -469,7 +469,7 @@ RTFParser::TOKEN RTFParser::Fetch()
 				}
 
 				default: {
-					if(IsAlpha(*--rtf) || *rtf == '*' && rtf[1] == '\\' && IsAlpha(rtf[2])) {
+					if(IsAlpha(*--rtf) || (*rtf == '*' && rtf[1] == '\\' && IsAlpha(rtf[2]))) {
 						if(*rtf == '*') {
 							rtf += 2;
 							state.new_dest = true;
@@ -541,7 +541,7 @@ bool RTFParser::PassEndGroup(int level)
 void RTFParser::Skip()
 {
 	LLOG("Skip");
-	bool is_group = (token == T_GROUP || token == T_COMMAND && state.new_dest);
+	bool is_group = (token == T_GROUP || (token == T_COMMAND && state.new_dest));
 	is_full = false;
 	if(is_group)
 		SkipGroup();

------------------------- uppsrc/CtrlLib/ArrayCtrl.cpp -------------------------
index b58f6a742..bc049e412 100644
@@ -856,7 +856,7 @@ const Display& ArrayCtrl::GetCellInfo(int i, int j, bool f0,
 		bg = array[i].paper;
 	fg = i & 1 ? evenink : oddink;
 	if((st & Display::SELECT) ||
-	    !multiselect && (st & Display::CURSOR) && !nocursor ||
+	    (!multiselect && (st & Display::CURSOR) && !nocursor) ||
 	    drop) {
 		fg = hasfocus ? SColorHighlightText : SColorText;
 		bg = hasfocus ? SColorHighlight : Blend(SColorDisabled, SColorPaper);
@@ -897,7 +897,7 @@ Size  ArrayCtrl::DoPaint(Draw& w, bool sample) {
 	int sy = 0;
 	if(!IsNull(i))
 		while(i < GetCount()) {
-			if((!sample || i == cursor || i < array.GetCount() && array[i].select) && IsLineVisible(i)) {
+			if((!sample || i == cursor || ((i < array.GetCount() && array[i].select) && IsLineVisible(i)))) {
 				r.top = sample ? sy : GetLineY(i) - sb;
 				if(r.top > size.cy)
 					break;
@@ -922,7 +922,7 @@ Size  ArrayCtrl::DoPaint(Draw& w, bool sample) {
 							if(spanwidecells)
 								SpanWideCell(d, q, cm, cw, r, i, j);
 							
-							if(cw < 2 * cm || editmode && i == cursor && column[jj].edit)
+							if(cw < 2 * cm || (editmode && i == cursor && column[jj].edit))
 								d.PaintBackground(w, r, q, fg, bg, st);
 							else {
 								d.PaintBackground(w, RectC(r.left, r.top, cm, r.Height()), q, fg, bg, st);
@@ -2299,7 +2299,7 @@ String ArrayCtrl::RowFormat(const char *s)
 bool ArrayCtrl::DoRemove()
 {
 	if(IsReadOnly()) return false;
-	if(!IsCursor() || askremove && !PromptOKCancel(RowFormat(t_("Do you really want to delete the selected %s ?"))))
+	if(!IsCursor() || (askremove && !PromptOKCancel(RowFormat(t_("Do you really want to delete the selected %s ?")))))
 		return false;
 	if(multiselect) {
 		Bits sel;

---------------------------- uppsrc/CtrlLib/Bar.cpp ----------------------------
index 0dda29380..89cff51e9 100644
@@ -680,7 +680,7 @@ void BarCtrl::Layout()
 {
 	LLOG("BarCtrl::Layout");
 	if(IsChild()) {
-		bool dowrap = InFrame() && wrap >= 0 || wrap > 0;
+		bool dowrap = (InFrame() && wrap >= 0) || wrap > 0;
 		if(GetAlign() == BAR_LEFT || GetAlign() == BAR_RIGHT)
 			pane.Repos(false, dowrap ? GetSize().cy : INT_MAX);
 		else

-------------------------- uppsrc/CtrlLib/Button.cpp --------------------------
index df4407d05..a077524df 100644
@@ -396,8 +396,8 @@ bool Button::HotKey(dword key) {
 	}
 	bool up = key & K_KEYUP;
 	key = key & ~K_KEYUP;
-	if(key == K_ENTER && (type == OK || type == EXIT) ||
-	   key == K_ESCAPE && (type == CANCEL || type == EXIT)) {
+	if((key == K_ENTER && (type == OK || type == EXIT)) ||
+	   (key == K_ESCAPE && (type == CANCEL || type == EXIT))) {
 		if(up) {
 			if(IsKeyPush())
 				return FinishPush();

------------------------ uppsrc/CtrlLib/ColumnList.cpp ------------------------
index 7ffc43820..e6960b2e0 100644
@@ -370,7 +370,7 @@ void ColumnList::GetItemStyle(int i, Color& fg, Color& bg, dword& st)
 	if(nobg)
 		bg = Null;
 	if((st & Display::SELECT) ||
-	   (!multi || !item[i].canselect && selcount == 0) && (st & Display::CURSOR) ||
+	   ((!multi || (!item[i].canselect && selcount == 0)) && (st & Display::CURSOR)) ||
 	   drop) {
 		fg = hasfocus ? SColorHighlightText : SColorText;
 		bg = hasfocus ? SColorHighlight : Blend(SColorDisabled, SColorPaper);
@@ -908,7 +908,7 @@ void ColumnList::DragAndDrop(Point p, PasteClip& d)
 		if(DnDInsert(i, p.y, d, 2))
 			return;
 	}
-	if(GetCount() == 0 && p.y < 4 || !WhenDrop) {
+	if((GetCount() == 0 && p.y < 4) || !WhenDrop) {
 		WhenDropInsert(GetCount(), d);
 		if(d.IsAccepted()) {
 			DnD(GetCount(), true);

----------------------- uppsrc/CtrlLib/DateTimeCtrl.cpp -----------------------
index b94f32e45..dca9cd5f0 100644
@@ -902,8 +902,8 @@ void Clock::Paint(Draw& w)
 int Clock::GetDir(int pp, int cp)
 {
 	dir = 0;
-	if(cp >= 1 && cp <= 30 && pp >= 1 && pp <= 30 ||
-	   cp > 30 && cp <= 60 && pp > 30 && pp <= 60)
+	if((cp >= 1 && cp <= 30 && pp >= 1 && pp <= 30) ||
+	   (cp > 30 && cp <= 60 && pp > 30 && pp <= 60))
 	{
 		dir = pp < cp ? 1 : -1;
 	}

----------------------- uppsrc/CtrlLib/DisplayPopup.cpp -----------------------
index f1c65e7a4..9f4fd27ef 100644
@@ -186,7 +186,7 @@ bool DisplayPopup::IsOpen()
 
 bool DisplayPopup::HasMouse()
 {
-	return Ctrl::HasMouse() || ctrl && ctrl->HasMouse();
+	return Ctrl::HasMouse() || (ctrl && ctrl->HasMouse());
 }
 
 void DisplayPopup::Set(Ctrl *_ctrl, const Rect& _item,

-------------------------- uppsrc/CtrlLib/DocEdit.cpp --------------------------
index 13d2fea2a..5edb9b40a 100644
@@ -438,7 +438,7 @@ bool DocEdit::Key(dword key, int cnt)
 		default:
 			if(filter && key >= 32 && key < 65535)
 				key = (*filter)(key);
-			if(key >= ' ' && key < 65536 || key == '\n' || key == '\t' || key == K_SHIFT_SPACE) {
+			if((key >= ' ' && key < 65536) || key == '\n' || key == '\t' || key == K_SHIFT_SPACE) {
 				if(key == K_TAB && !processtab)
 					return false;
 				if(key >= 128 && key < 65536 && (charset != CHARSET_UNICODE && charset != CHARSET_UTF8_BOM)

------------------------ uppsrc/CtrlLib/DropChoice.cpp ------------------------
index 9458e3f87..12b22dd15 100644
@@ -36,7 +36,7 @@ void DropChoice::PseudoPush()
 }
 
 void DropChoice::Drop() {
-	if(!owner || owner->IsReadOnly() && !rodrop || list.GetCount() == 0 && !WhenDrop) return;
+	if(!owner || (owner->IsReadOnly() && !rodrop) || (list.GetCount() == 0 && !WhenDrop)) return;
 	WhenDrop();
 	if(dropfocus)
 		owner->SetWantFocus();
@@ -46,12 +46,12 @@ void DropChoice::Drop() {
 }
 
 void DropChoice::Select() {
-	if(!owner || owner->IsReadOnly() && !rodrop) return;
+	if(!owner || (owner->IsReadOnly() && !rodrop)) return;
 	WhenSelect();
 }
 
 Value DropChoice::Get() const {
-	if(!owner || owner->IsReadOnly() && !rodrop) return Value();
+	if(!owner || (owner->IsReadOnly() && !rodrop)) return Value();
 	int c = list.GetCursor();
 	if(c < 0) return Value();
 	return list.Get(c, 0);
@@ -59,7 +59,7 @@ Value DropChoice::Get() const {
 
 int DropChoice::GetIndex() const
 {
-	if(!owner || owner->IsReadOnly() && !rodrop) return -1;
+	if(!owner || (owner->IsReadOnly() && !rodrop)) return -1;
 	return list.GetCursor();
 }
 

------------------------- uppsrc/CtrlLib/EditField.cpp -------------------------
index a62ac67b5..e68ef15ec 100644
@@ -274,7 +274,7 @@ Color EditField::GetPaper()
 	                                       : style->disabled;
 	if(nobg)
 		paper = Null;
-	if(enabled && (convert && convert->Scan(text).IsError() || errorbg))
+	if(enabled && ((convert && convert->Scan(text).IsError()) || errorbg))
 		paper = style->invalid;
 	return paper;
 }
@@ -941,7 +941,7 @@ bool EditField::Key(dword key, int rep)
 		}
 		return false;
 	default:
-		if(key >= ' ' && key < 65536 || key == K_SHIFT_SPACE) {
+		if((key >= ' ' && key < 65536) || key == K_SHIFT_SPACE) {
 			if(!RemoveSelection()) SaveUndo();
 			while(rep--)
 				Insert(key == K_SHIFT_SPACE ? ' ' : key);

-------------------------- uppsrc/CtrlLib/FileSel.cpp --------------------------
index c1e2b4112..44a968918 100644
@@ -909,7 +909,7 @@ void FileSel::SearchLoad()
 		list.Renaming(true);
 	}
 	if(filesystem->IsPosix())
-		if(d == "/" || !IsEmpty(basedir) && String(~dir).IsEmpty())
+		if(d == "/" || (!IsEmpty(basedir) && String(~dir).IsEmpty()))
 			dirup.Disable();
 	if(filesystem->IsWin32())
 		if(!IsEmpty(basedir) && String(~dir).IsEmpty())
@@ -1282,8 +1282,8 @@ void FileSel::Open() {
 			}
 			if(!IsFullPath(fn))
 				fn = AppendFileName(~dir, fn);
-			if(filesystem->IsWin32() && (!fn.IsEmpty() && (*fn.Last() == '\\' || *fn.Last() == '/'))
-			|| filesystem->IsPosix() && (fn != "/" && (*fn.Last() == '\\' || *fn.Last() == '/')))
+			if((filesystem->IsWin32() && (!fn.IsEmpty() && (*fn.Last() == '\\' || *fn.Last() == '/')))
+			|| (filesystem->IsPosix() && (fn != "/" && (*fn.Last() == '\\' || *fn.Last() == '/'))))
 			{
 				fn.Trim(fn.GetLength() - 1);
 				SetDir(TrimDot(fn));
@@ -1625,7 +1625,7 @@ void FileSel::FileUpdate() {
 	}
 	bool b = list.IsCursor() || !String(~file).IsEmpty();
 	ok.Enable(b);
-	if(mode != SAVEAS || list.IsCursor() && list[list.GetCursor()].isdir)
+	if(mode != SAVEAS || (list.IsCursor() && list[list.GetCursor()].isdir))
 		ok.SetLabel(t_("Open"));
 	else
 		ok.SetLabel(t_("Save"));
@@ -1993,8 +1993,8 @@ bool FileSel::Execute(int _mode) {
 		type.Trim(dlc);
 
 	String d = ~dir;
-	if(filesystem->IsWin32() && d.GetLength() == 3 && d[1] == ':' ||
-	   filesystem->IsPosix() && d == "/" ||
+	if((filesystem->IsWin32() && d.GetLength() == 3 && d[1] == ':') ||
+	   (filesystem->IsPosix() && d == "/") ||
 	   !IsFullPath(d))
 		d.Clear();
 

------------------------- uppsrc/CtrlLib/LabelBase.cpp -------------------------
index 197ccee4d..89b57dd73 100644
@@ -80,7 +80,7 @@ int  ExtractAccessKey(const char *s, String& label)
 	String text;
 	bool qtf = *s == '\1';
 	while(*s)
-		if((*s == '&' && !qtf || *s == '\b') && s[1] && s[1] != '&') {
+		if(((*s == '&' && !qtf) || *s == '\b') && s[1] && s[1] != '&') {
 			akey = ToAscii(ToUpper(s[1]));
 			pos = text.GetLength() + 1; 
 			s++;

------------------------- uppsrc/CtrlLib/LineEdit.cpp -------------------------
index 3017d7b96..87d1232e5 100644
@@ -411,7 +411,7 @@ void   LineEdit::Paint0(Draw& w) {
 	int cursorline = GetLine(cursor);
 	Highlight ih;
 	ih.ink = color[IsShowEnabled() ? INK_NORMAL : INK_DISABLED];
-	ih.paper = color[IsReadOnly() && showreadonly || !IsShowEnabled() ? PAPER_READONLY : PAPER_NORMAL];
+	ih.paper = color[(IsReadOnly() && showreadonly) || !IsShowEnabled() ? PAPER_READONLY : PAPER_NORMAL];
 	if(nobg)
 		ih.paper = Null;
 	ih.font = font;
@@ -609,7 +609,7 @@ void   LineEdit::Paint0(Draw& w) {
 		selh -= len + 1;
 		pos += len + 1;
 	}
-	w.DrawRect(0, y, sz.cx, sz.cy - y, color[IsReadOnly() && showreadonly || !IsShowEnabled() ? PAPER_READONLY : PAPER_NORMAL]);
+	w.DrawRect(0, y, sz.cx, sz.cy - y, color[(IsReadOnly() && showreadonly) || !IsShowEnabled() ? PAPER_READONLY : PAPER_NORMAL]);
 	DrawTiles(w, DropCaret(), CtrlImg::checkers());
 	vlinex = caretpos.x;
 }
@@ -1010,8 +1010,8 @@ bool LineEdit::InsertChar(dword key, int count, bool canow) {
 		return false;
 	if(filter && key >= 32 && key < 65535)
 		key = (*filter)(key);
-	if(!IsReadOnly() && (key >= 32 && key < 65536 || key == '\t' || key == '\n' ||
-	   key == K_ENTER && processenter || key == K_SHIFT_SPACE)) {
+	if(!IsReadOnly() && ((key >= 32 && key < 65536) || key == '\t' || key == '\n' ||
+	   (key == K_ENTER && processenter) || key == K_SHIFT_SPACE)) {
 		if(key >= 128 && key < 65536 && (charset != CHARSET_UNICODE && charset != CHARSET_UTF8_BOM)
 		   && FromUnicode((wchar)key, charset) == DEFAULTCHAR)
 			return true;

-------------------------- uppsrc/CtrlLib/MenuBar.cpp --------------------------
index f82fc3d4c..efb43ecd8 100644
@@ -368,7 +368,7 @@ bool MenuBar::Key(dword key, int count)
 		if(IterateFocusBackward(pane.GetLastChild(), &pane, false, true)) return true;
 	}
 	else
-	if(parentmenu && !parentmenu->IsChild() && key == K_LEFT || key == K_ESCAPE) {
+	if((parentmenu && !parentmenu->IsChild() && key == K_LEFT) || key == K_ESCAPE) {
 		if(HasMouseDeep())
 			GetMouseCtrl()->Refresh();
 		if(parentmenu && parentmenu->submenu)
@@ -449,7 +449,7 @@ bool MenuBar::HotKey(dword key)
 			s_doaltkey = true;
 			return true;
 		}
-		if((key == K_F10 || key == (K_ALT_KEY|K_KEYUP) && s_doaltkey)
+		if((key == K_F10 || (key == (K_ALT_KEY|K_KEYUP) && s_doaltkey))
 		   && !submenu && !HasFocusDeep() && GetTopWindow() && GetTopWindow()->IsForeground()) {
 			LLOG("Open menu by F10 or ALT-UP");
 			SetupRestoreFocus();

------------------------- uppsrc/CtrlLib/MenuItem.cpp -------------------------
index b4be0b8d8..bbfdf38bd 100644
@@ -266,7 +266,7 @@ void MenuItem::LostFocus()
 int MenuItem::GetVisualState()
 {
 	return HasFocus() ?
-	       (HasMouse() && GetMouseLeft() || GetMouseRight()) ? PUSH : HIGHLIGHT : NORMAL;
+	       ((HasMouse() && GetMouseLeft()) || GetMouseRight()) ? PUSH : HIGHLIGHT : NORMAL;
 }
 
 void MenuItem::SyncState()
@@ -395,7 +395,7 @@ void MenuItem::RightUp(Point p, dword w)
 bool MenuItem::HotKey(dword key)
 {
 	if(isenabled && (key == accel || CompareAccessKey(accesskey, key)
-	|| key < 256 && IsAlNum((char)key) && CompareAccessKey(accesskey, ToUpper((char)key) + K_DELTA + K_ALT))) {
+	|| (key < 256 && IsAlNum((char)key) && CompareAccessKey(accesskey, ToUpper((char)key) + K_DELTA + K_ALT)))) {
 		LLOG("MenuItem::HotKey(" << key << ") -> SetFocus");
 		SetFocus();
 		Sync();
@@ -517,8 +517,8 @@ Size TopSubMenuItem::GetMinSize() const
 int  TopSubMenuItem::GetState()
 {
 	if(parentmenu && parentmenu->GetActiveSubmenu() == &menu) return PUSH;
-	if(HasMouse() && GetParent() && !GetParent()->HasFocusDeep() &&
-	                 (!parentmenu || !parentmenu->GetActiveSubmenu() || parentmenu->GetActiveSubmenu() == &menu)
+	if((HasMouse() && GetParent() && !GetParent()->HasFocusDeep() &&
+	                 (!parentmenu || !parentmenu->GetActiveSubmenu() || parentmenu->GetActiveSubmenu() == &menu))
 	   || HasFocus())
 		return HIGHLIGHT;
 	return NORMAL;
@@ -609,7 +609,7 @@ void TopSubMenuItem::SyncState()
 int  TopMenuItem::GetState()
 {
 	if(!IsEnabled()) return NORMAL;
-	if(HasMouse() && GetMouseLeft() || GetMouseRight()) return PUSH;
+	if((HasMouse() && GetMouseLeft()) || GetMouseRight()) return PUSH;
 	if(HasFocus() || HasMouse()) return HIGHLIGHT;
 	return NORMAL;
 }

------------------------ uppsrc/CtrlLib/MultiButton.cpp ------------------------
index 0bfe7f7dd..2173d0337 100644
@@ -286,13 +286,13 @@ int MultiButton::ChState(int i)
 	if(i == MAIN && frm && style->activeedge) {
 		int q = 0;
 		if(p)
-			q = !p->IsEnabled() || !IsEnabled() || p->IsReadOnly() || i >= 0 && !button[i].enabled ? CTRL_DISABLED
+			q = !p->IsEnabled() || !IsEnabled() || p->IsReadOnly() || (i >= 0 && !button[i].enabled) ? CTRL_DISABLED
 			    : p->HasFocus() || push ? CTRL_PRESSED
 			    : p->HasMouse() || hl >= 0 ? CTRL_HOT
 			    : CTRL_NORMAL;
 		return q;
 	}
-	if(!IsShowEnabled() || IsReadOnly() || frm && p && p->IsReadOnly() || i >= 0 && !button[i].enabled)
+	if(!IsShowEnabled() || IsReadOnly() || (frm && p && p->IsReadOnly()) || (i >= 0 && !button[i].enabled))
 		return CTRL_DISABLED;
 	if(IsTrivial() && !frm)
 		i = 0;

----------------------- uppsrc/CtrlLib/RichTextView.cpp -----------------------
index 3b2c0d482..e4d80ac8d 100644
@@ -188,7 +188,7 @@ void  RichTextView::RefreshSel()
 {
 	int l = minmax(min(cursor, anchor), 0, text.GetLength());
 	int h = minmax(max(cursor, anchor), 0, text.GetLength());
-	if(sell == l && selh == h || sell == selh && l == h)
+	if((sell == l && selh == h) || (sell == selh && l == h))
 		return;
 	RichPos pl = text.GetRichPos(l);
 	RichPos ph = text.GetRichPos(h);

------------------------ uppsrc/CtrlLib/SuggestCtrl.cpp ------------------------
index fab48acf3..a8047aad9 100644
@@ -89,7 +89,7 @@ bool SuggestCtrl::Key(dword key, int count)
 	if(cc)
 		key = cc;
 	if(EditString::Key(key, count)) {
-		if(key >= 32 && key < 65536 || key == K_BACKSPACE || key == K_CTRL_SPACE) {
+		if((key >= 32 && key < 65536) || key == K_BACKSPACE || key == K_CTRL_SPACE) {
 			int h;
 			WString x = CF(ReadLast(h));
 			list.Clear();

-------------------------- uppsrc/CtrlLib/Switch.cpp --------------------------
index b7e59cdda..e4fa3f9dc 100644
@@ -217,7 +217,7 @@ void Switch::Paint(Draw& w) {
 				DrawSmartText(w, x + isz.cx + DPI(4), y + ty, sz.cx, v.label, font,
 				              dv || IsReadOnly() ? SColorDisabled : GetLabelTextColor(this), ///////
 				              VisibleAccessKeys() ? v.accesskey : 0);
-				if(HasFocus() && (pushindex == i || v.value == value && pushindex < 0))
+				if(HasFocus() && (pushindex == i || (v.value == value && pushindex < 0)))
 					DrawFocus(w, RectC(x + isz.cx + DPI(2), y + ty - DPI(1), tsz.cx + DPI(3), tsz.cy + DPI(2)) & sz);
 			}
 			v.rect = hr;

-------------------------- uppsrc/CtrlLib/ToolTip.cpp --------------------------
index 8c82fc164..00ca2c60b 100644
@@ -93,7 +93,7 @@ void SyncToolTip(Ctrl *ctrl)
 {
 	if(!GUI_ToolTips())
 		return;
-	if(ctrl != tipctrl || ctrl && ctrl->GetTip() != AppToolTip().Get()) {
+	if(ctrl != tipctrl || (ctrl && ctrl->GetTip() != AppToolTip().Get())) {
 		LLOG("ToolTipHook / ctrl change " << UPP::Name(ctrl) << " -> " << UPP::Name(ctrl));
 		tipctrl = ctrl;
 		KillTimeCallback((void *)SyncToolTip);

------------------------- uppsrc/CtrlLib/TreeCtrl.cpp -------------------------
index bae192b99..4e38ca752 100644
@@ -803,7 +803,7 @@ bool TreeCtrl::IsSel(int id) const
 
 bool TreeCtrl::IsSelDeep(int id) const
 {
-	return IsSel(id) || id && IsSelDeep(GetParent(id));
+	return IsSel(id) || (id && IsSelDeep(GetParent(id)));
 }
 
 void TreeCtrl::SelectOne0(int id, bool sel, bool cb)
@@ -1073,7 +1073,7 @@ const Display *TreeCtrl::GetStyle(int i, Color& fg, Color& bg, dword& st)
 	if(hasfocus)
 		st |= Display::FOCUS;
 	if((st & Display::SELECT) ||
-	    !multiselect && (st & Display::CURSOR) && !nocursor ||
+	    (!multiselect && (st & Display::CURSOR) && !nocursor) ||
 	    drop) {
 		fg = hasfocus ? SColorHighlightText : SColorText;
 		bg = hasfocus ? SColorHighlight : Blend(SColorDisabled, SColorPaper);
@@ -1156,7 +1156,7 @@ void TreeCtrl::Paint(Draw& w)
 				const Display *d = GetStyle(i, fg, bg, st);
 				int ctx = highlight_ctrl * csz.cx;
 				Rect br = RectC(x, y, vsz.cx + 2 * m.margin + ctx, msz.cy);
-				if(!IsNull(m.value) || m.ctrl && highlight_ctrl) {
+				if(!IsNull(m.value) || (m.ctrl && highlight_ctrl)) {
 					w.DrawRect(br, bg);
 					Rect r = RectC(x + ctx + m.margin, y + (msz.cy - vsz.cy) / 2, vsz.cx, vsz.cy);
 					w.Clip(r);
@@ -1871,7 +1871,7 @@ void OptionTree::SetOption(int id)
 		}
 		opt = option[id];
 		if(opt) {
-			if(t && f || n) {
+			if((t && f) || n) {
 				opt->Set(Null);
 			}
 			else

----------------------------- uppsrc/Draw/Font.cpp -----------------------------
index 19d91f89d..8cad5d592 100644
@@ -90,7 +90,7 @@ void Font::SetFace(int index, const String& name)
 
 int FontFilter(int c)
 {
-	return c >= 'a' && c <= 'z' || c >= '0' && c <= '9' ? c : c >= 'A' && c <= 'Z' ? ToLower(c) : 0;
+	return (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9' ? c : c >= 'A' && c <= 'Z' ? ToLower(c) : 0);
 }
 
 int  Font::FindFaceNameIndex(const String& name) {

---------------------------- uppsrc/Draw/Image.cpp ----------------------------
index 63a1f8478..bb44cc61f 100644
@@ -274,12 +274,12 @@ bool Image::operator==(const Image& img) const
 {
 	static_assert(sizeof(RGBA) == 4, "sizeof(RGBA)");
 	return IsSame(img) ||
-	   GetSize() == img.GetSize() &&
+	   (GetSize() == img.GetSize() &&
 	   GetHotSpot() == img.GetHotSpot() &&
 	   Get2ndSpot() == img.Get2ndSpot() &&
 	   GetDots() == img.GetDots() &&
 	   GetResolution() == img.GetResolution() &&
-	   memeq32(~*this, ~img, GetLength());
+	   memeq32(~*this, ~img, GetLength()));
 }
 
 bool Image::operator!=(const Image& img) const

------------------------------ uppsrc/Esc/Esc.cpp ------------------------------
index 829d5c7aa..d3b08a43a 100644
@@ -169,7 +169,7 @@ EscValue Esc::ExecuteLambda(const String& id, EscValue lambda, SRVal self, Vecto
 	if(!lambda.IsLambda())
 		ThrowError(Format("'%s' is not a lambda", id));
 	const EscLambda& l = lambda.GetLambda();
-	if(!l.varargs && arg.GetCount() > l.arg.GetCount()
+	if((!l.varargs && arg.GetCount() > l.arg.GetCount())
 	   || arg.GetCount() < l.arg.GetCount() - l.def.GetCount())
 		ThrowError("invalid number of arguments in call to '" + id + "'");
 	Esc sub(global, l.code, op_limit, l.filename, l.line);

-------------------------- uppsrc/Painter/OnPath.cpp --------------------------
index b94a2aab8..df3645320 100644
@@ -13,7 +13,7 @@ void BufferPainter::BeginOnPathOp(double q, bool abs)
 		Pointf pos(0, 0);
 		for(int i = 0; i < onpath.GetCount(); i++) {
 			PathLine& l = onpath[i];
-			if(l.len > 0 && (l.len > q || q >= 1.0 && i == onpath.GetCount() - 1)) {
+			if(l.len > 0 && (l.len > q || (q >= 1.0 && i == onpath.GetCount() - 1))) {
 				Pointf v = l.p - pos;
 				Translate(q / l.len * v + pos);
 				Rotate(Bearing(v));

---------------------- uppsrc/Painter/RadialGradient.cpp ----------------------
index 9a9ed8f1d..5794afa82 100644
@@ -46,7 +46,7 @@ struct PainterRadialSpan : SpanSource {
 				h = h & 2047;
 			else
 			if(style == GRADIENT_REFLECT)
-				h = (h & 2048) ? (2047 - h & 2047) : (h & 2047);
+				h = (h & 2048) ? (2047 - (h & 2047)) : (h & 2047);
 			else
 				h = minmax(h, 0, 2047);
 			*span++ = gradient[h];

-------------------------- uppsrc/Painter/Render.cpp --------------------------
index 7205edf9d..8e0872655 100644
@@ -147,7 +147,7 @@ Buffer<ClippingLine> BufferPainter::RenderPath(double width, Event<One<SpanSourc
 
 	current = Null;
 
-	if(width == 0 || !ss && color.a == 0 && width >= FILL)
+	if(width == 0 || (!ss && color.a == 0 && width >= FILL))
 		return newclip;
 	
 	if(pathattr.mtx_serial != preclip_mtx_serial) {

-------------------------- uppsrc/Painter/Stroker.cpp --------------------------
index 317d67090..f7a654c53 100644
@@ -41,10 +41,10 @@ void Stroker::Round(const Pointf& p, const Pointf& v1, const Pointf& v2, double
 
 inline bool Stroker::PreClipped(Pointf p2, Pointf p3)
 {
-	return p2.x + tw < preclip.left && p3.x + tw < preclip.left ||
-	       p2.x - tw > preclip.right && p3.x - tw > preclip.right ||
-           p2.y + tw < preclip.top && p3.y + tw < preclip.top ||
-	       p2.y - tw > preclip.bottom && p3.y - tw > preclip.bottom;
+	return (p2.x + tw < preclip.left && p3.x + tw < preclip.left) ||
+	       (p2.x - tw > preclip.right && p3.x - tw > preclip.right) ||
+           (p2.y + tw < preclip.top && p3.y + tw < preclip.top) ||
+	       (p2.y - tw > preclip.bottom && p3.y - tw > preclip.bottom);
 }
 
 void Stroker::Line(const Pointf& p3)

------------------------- uppsrc/Painter/SvgParser.cpp -------------------------
index 61fcbc380..84ba2f614 100644
@@ -449,7 +449,7 @@ void SvgParser::Element(const XmlNode& n, int depth, bool dosymbols)
 		FinishElement();
 	}
 	else
-	if(n.IsTag("g") || n.IsTag("symbol") && dosymbols)
+	if(n.IsTag("g") || (n.IsTag("symbol") && dosymbols))
 		Items(n, depth);
 	else
 	if(n.IsTag("use")) {

--------------------------- uppsrc/RichEdit/Clip.cpp ---------------------------
index 5d943aa7e..6da88b655 100644
@@ -38,7 +38,7 @@ bool RichEdit::Accept(PasteClip& d, RichText& clip, String& fmt)
 				if(d.Accept() && GetFileLength(fn) < 17000000) {
 					String data = LoadFile(fn);
 					StringStream ss(data);
-					if(StreamRaster::OpenAny(ss) || ext == ".svg" && IsSVG(LoadFile(fn))) {
+					if(StreamRaster::OpenAny(ss) || (ext == ".svg" && IsSVG(LoadFile(fn)))) {
 						RichPara p;
 						p.Cat(CreateRawImageObject(data), formatinfo);
 						clip.Cat(p);

-------------------------- uppsrc/RichEdit/Editor.cpp --------------------------
index 30ba8cff4..2e9484b05 100644
@@ -328,7 +328,7 @@ int  RichEdit::GetNearestPos(int x, PageY py)
 	String dummy;
 	RichPos p = text.GetRichPos(c);
 	if(c >= text.GetLength() - 1 || c < 0 || p.object || p.field
-	   || p.table && (p.posincell == 0 || p.posincell == p.celllen))
+	   || (p.table && (p.posincell == 0 || p.posincell == p.celllen)))
 		return c;
 	Rect r1 = text.GetCaret(c, pagesz);
 	Rect r2 = text.GetCaret(c + 1, pagesz);

--------------------------- uppsrc/RichEdit/Find.cpp ---------------------------
index 739af1971..06c2ceefb 100644
@@ -45,8 +45,8 @@ struct RichFindIterator : RichText::Iterator {
 				q += cursor - pos;
 			while(q <= e) {
 				if(compare3(q, upperw, lowerw, len) &&
-				   (!ww || (q + len == e || !IsLetter(q[len])) &&
-				           (q == ptext || !IsLetter(q[-1])))) {
+				   (!ww || ((q + len == e || !IsLetter(q[len])) &&
+				           (q == ptext || !IsLetter(q[-1]))))) {
 					fpos = int(q - ~ptext + pos);
 					return true;
 				}

--------------------------- uppsrc/RichEdit/Kbd.cpp ---------------------------
index 5022551fc..af687930a 100644
@@ -184,7 +184,7 @@ bool RichEdit::Key(dword key, int count)
 		}
 		if(key == K_SHIFT_SPACE)
 			key = ' ';
-		if(key == 9 || key >= 32 && key < 65536) {
+		if(key == 9 || (key >= 32 && key < 65536)) {
 			RichPara::Format f;
 			if(IsSelection()) {
 				f = text.GetRichPos(min(cursor, anchor)).format;

------------------------- uppsrc/RichEdit/Speller.cpp -------------------------
index b52898ec1..037626ad1 100644
@@ -36,7 +36,7 @@ Bits RichEdit::SpellParagraph(const RichPara& para)
 	while(s < end) {
 		if(IsLetter(*s)) {
 			const wchar *q = s;
-			while(s < end && IsLetter(*s) || s + 1 < end && *s == '\'' && IsLetter(s[1]))
+			while((s < end && IsLetter(*s)) || (s + 1 < end && *s == '\'' && IsLetter(s[1])))
 				s++;
 			if(!SpellWord(q, int(s - q), lang[q - text]))
 				e.SetN(int(q - text), int(s - q));

-------------------------- uppsrc/RichEdit/Table.cpp --------------------------
index 92eeebe3a..d39cf48cc 100644
@@ -323,7 +323,7 @@ void RichEdit::SplitCell()
 
 void RichEdit::CellProperties()
 {
-	if(!(tablesel || cursorp.table && !IsSelection()))
+	if(!(tablesel || (cursorp.table && !IsSelection())))
 		return;
 	WithCellPropertiesLayout<TopWindow> dlg;
 	CtrlLayoutOKCancel(dlg, t_("Cell properties"));

--------------------------- uppsrc/RichEdit/Tool.cpp ---------------------------
index 458c3507e..d568d235d 100644
@@ -297,7 +297,7 @@ void RichEdit::RedoTool(Bar& bar, dword key)
 
 void RichEdit::CutTool(Bar& bar, dword key)
 {
-	bar.Add(!IsReadOnly() && IsSelection() || objectpos >= 0, t_("Cut"), CtrlImg::cut(), USERBACK(Cut))
+	bar.Add((!IsReadOnly() && IsSelection()) || objectpos >= 0, t_("Cut"), CtrlImg::cut(), USERBACK(Cut))
 	   .Key(K_SHIFT_DELETE)
 	   .Key(key);
 }

------------------------- uppsrc/RichText/ParaType.cpp -------------------------
index 45db631fa..4ccb6bf5f 100644
@@ -317,9 +317,9 @@ RichPara::Lines RichPara::FormatLines(int acx) const
 				t = GetNextTab(cx + format.lm, rcx);
 				space = NULL;
 			}
-			if(cx + *w > rcx && s > text ||
-			   *s == '\t' && (t.align == ALIGN_RIGHT ? t.pos - format.lm > rcx
-			                                         : t.pos - format.lm >= rcx)) {
+			if((cx + *w > rcx && s > text) ||
+			   (*s == '\t' && (t.align == ALIGN_RIGHT ? t.pos - format.lm > rcx
+			                                         : t.pos - format.lm >= rcx))) {
 				Line& l = lines.line.Add();
 				l.withtabs = withtabs;
 				l.pos = (int)(text - lines.text);

------------------------- uppsrc/RichText/ParseQtf.cpp -------------------------
index 866144131..59fe1ae2d 100644
@@ -325,11 +325,11 @@ void RichQtfParser::ReadObject()
 			StringBuffer data;
 			for(;;) {
 				while(*term < 32 && *term > 0) term++;
-				if((byte)*term >= ' ' && (byte)*term <= 127 || *term == '\0') break;
+				if(((byte)*term >= ' ' && (byte)*term <= 127) || *term == '\0') break;
 				byte seven = *term++;
 				for(int i = 0; i < 7; i++) {
 					while((byte)*term < 32 && (byte)*term > 0) term++;
-					if((byte)*term >= ' ' && (byte)*term <= 127 || *term == '\0') break;
+					if(((byte)*term >= ' ' && (byte)*term <= 127) || *term == '\0') break;
 					data.Cat((*term++ & 0x7f) | ((seven << 7) & 0x80));
 					seven >>= 1;
 				}

------------------------- uppsrc/RichText/TxtData.cpp -------------------------
index cb5e9bd9a..579c30630 100644
@@ -203,7 +203,7 @@ RichPara RichTxt::Get(int i, const RichStyles& s) const
 
 bool RichTxt::IsEmpty() const
 {
-	return part.IsEmpty() || part.GetCount() == 1 && ComputeLength() == 0;
+	return part.IsEmpty() || (part.GetCount() == 1 && ComputeLength() == 0);
 }
 
 int RichTxt::ComputeLength() const

------------------------- uppsrc/RichText/TxtPaint.cpp -------------------------
index 123c6de37..b002d1715 100644
@@ -100,7 +100,7 @@ void RichTxt::Advance(int parti, RichContext& rc, RichContext& begin) const
 			}
 			if(pp.newhdrftr && rc.text == this)
 				rc.HeaderFooter(~pp.header, ~pp.footer);
-			if(pp.newpage || rc.py.y + cy + nbefore + nline > rc.page.bottom && cy < rc.page.Height())
+			if(pp.newpage || (rc.py.y + cy + nbefore + nline > rc.page.bottom && cy < rc.page.Height()))
 				rc.Page();
 			begin = rc;
 			rc.py.y += pp.before + pp.ruler;

--------------------------- uppsrc/TabBar/TabBar.cpp ---------------------------
index 0295ae22a..6f9fbe37c 100644
@@ -2279,7 +2279,7 @@ bool TabBar::ProcessMouse(int i, const Point& p)
 		if (stacking && ProcessStackMouse(i, p))
 			return true;
 		bool iscross = crosses && !IsCancelClose(i) ? tabs[i].HasMouseCross(p) : false;
-		if(highlight != i || (iscross && cross != i || !iscross && cross == i))
+		if(highlight != i || ((iscross && cross != i) || (!iscross && cross == i)))
 		{
 			cross = iscross ? i : -1;
 			SetHighlight(i);

----------------------- uppsrc/TextDiffCtrl/DirDiff.cpp -----------------------
index 5042053a1..7d4f95748 100644
@@ -197,8 +197,8 @@ void DirDiffDlg::ShowResult()
 	for(int i = 0; i < list.GetCount(); i++)
 	{
 		int n = list[i].d;
-		if((n == NORMAL_FILE && modified || n == DELETED_FILE && removed
-		    || n == NEW_FILE && added || n == FAILED_FILE || n == PATCHED_FILE)
+		if(((n == NORMAL_FILE && modified) || (n == DELETED_FILE && removed)
+		    || (n == NEW_FILE && added) || n == FAILED_FILE || n == PATCHED_FILE)
 		   && ToLower(list[i].a).Find(sFind) >= 0)
 			files.Add(MakeFile(i));
 	}

----------------------- uppsrc/TextDiffCtrl/TextCtrl.cpp -----------------------
index 506eb4e1e..e9330209b 100644
@@ -52,7 +52,7 @@ void TextCompareCtrl::DoSelection(int y, bool shift)
 void TextCompareCtrl::LeftDown(Point pt, dword keyflags)
 {
 	Size sz = GetSize();
-	if(pt.x > sz.cx - gutter_width || HasCapture() && gutter_capture) {
+	if(pt.x > sz.cx - gutter_width || (HasCapture() && gutter_capture)) {
 		if(!HasCapture())
 			SetCapture();
 		int line = (pt.y * lines.GetCount()) / sz.cy;
@@ -213,7 +213,7 @@ bool TextCompareCtrl::LineDiff(bool left, Vector<LineEdit::Highlight>& hln, Colo
 			}
 		}
 	
-	if(matchlen > 1 || matchlen && !IsAlNum(s1[p1])) {
+	if(matchlen > 1 || (matchlen && !IsAlNum(s1[p1]))) {
 		for(int i = 0; i < matchlen; i++)
 			hln[(left ? p1 : p2) + i].paper = eq_color;
 

----------------------- uppsrc/TextDiffCtrl/TextDiff.cpp -----------------------
index 695362e56..785fe44c8 100644
@@ -111,7 +111,7 @@ TextComparator::TextComparator(const Vector<String>& f1, const Vector<String>& f
 
 static bool CompareSection(const TextSection& ta, const TextSection& tb)
 {
-	return ta.start1 < tb.start1 || ta.start1 == tb.start1 && ta.start2 < tb.start2;
+	return ta.start1 < tb.start1 || (ta.start1 == tb.start1 && ta.start2 < tb.start2);
 }
 
 Array<TextSection> TextComparator::GetSections() const

------------------------ uppsrc/TextDiffCtrl/patch.cpp ------------------------
index a422dd8b6..9d4f86ba9 100644
@@ -195,7 +195,7 @@ String Patch::GetPatchedFile(int i) const
 			}
 		}
 		
-		if(pos < 0 || ch_pos.GetCount() && ch_pos.Top() > pos)
+		if(pos < 0 || (ch_pos.GetCount() && ch_pos.Top() > pos))
 			return String::GetVoid();
 		ch_pos.Add(pos);
 	}

---------------------------- uppsrc/ide/Assist.cpp ----------------------------
index e735439f1..1b1514220 100644
@@ -343,9 +343,9 @@ void AssistEditor::SyncAssist()
 			if(!found[i] &&
 			   (typei < 0 || m.typei == typei) &&
 			   (pass ? m.uname.StartsWith(uname) : m.name.StartsWith(name)) &&
-			   (!destructor || m.kind == DESTRUCTOR && m.scope == current_type + "::")) {
+			   (!destructor || (m.kind == DESTRUCTOR && m.scope == current_type + "::"))) {
 					int q = include_assist ? -1 : over.Find(m.qitem);
-					if(q < 0 || over[q] == m.typei && m.scope.GetCount()) {
+					if(q < 0 || (over[q] == m.typei && m.scope.GetCount())) {
 						found[i] = true;
 						assist_item_ndx.Add(i);
 						if(q < 0)
@@ -865,8 +865,8 @@ bool AssistEditor::Key(dword key, int count)
 	else
 	if(auto_assist) {
 		if(InCode()) {
-			if(key == '.' || key == '>' && Ch(GetCursor32() - 2) == '-' ||
-			   key == ':' && Ch(GetCursor32() - 2) == ':')
+			if(key == '.' || (key == '>' && Ch(GetCursor32() - 2) == '-') ||
+			   (key == ':' && Ch(GetCursor32() - 2) == ':'))
 				Assist();
 			else
 			if(key == '(') {

---------------------- uppsrc/ide/Browser/CodeBrowser.cpp ----------------------
index 9e17442d0..1554c760c 100644
@@ -4,7 +4,7 @@ bool MatchCib(const String& s, const String& match)
 {
 	if(IsNull(match)) return true;
 	int q = ToUpper(s).Find(match);
-	return q > 0 && !iscid(s[q - 1]) || q == 0;	
+	return (q > 0 && !iscid(s[q - 1])) || q == 0;	
 }
 
 bool MatchPm(const String& fn, const String& pm)

------------------------ uppsrc/ide/Browser/CodeRef.cpp ------------------------
index f70d1d7b0..c3dd27fb8 100644
@@ -369,7 +369,7 @@ void TopicEditor::GoTo(const String& _topic, const String& link, const String& c
 					for(;;) {
 						int c = editor.GetCursor();
 						RichText::FormatInfo f = editor.GetFormatInfo();
-						if(f.styleid == BeginUuid() || (IsNull(f.label) || f.label == "noref") && pass)
+						if(f.styleid == BeginUuid() || ((IsNull(f.label) || f.label == "noref") && pass))
 							break;
 						editor.NextPara();
 						if(editor.GetCursor() == c)

------------------------- uppsrc/ide/Browser/Item.cpp -------------------------
index 84207acc1..384e8859f 100644
@@ -96,7 +96,7 @@ Vector<ItemTextPart> ParseItemNatural(const String& name,
 		p.pari = pari;
 		int n = 1;
 		if(*s >= '0' && *s <= '9') {
-			while(s[n] >= '0' && s[n] <= '9' || (s[n] == 'x' || s[n] == 'X'))
+			while((s[n] >= '0' && s[n] <= '9') || (s[n] == 'x' || s[n] == 'X'))
 				n++;
 			p.type = ITEM_NUMBER;
 		}

----------------------- uppsrc/ide/Browser/TopicBase.cpp -----------------------
index fe895c318..f4696cdf1 100644
@@ -139,7 +139,7 @@ void SyncTopicFile(const String& link)
 	LLOG("SyncTopicFile " << link << " path: " << path);
 	TopicInfo& ti = topic_info().GetPut(link);
 	Time tm = FileGetTime(path);
-	if(ti.path == ":ide:" || ti.path == path && ti.time == tm)
+	if(ti.path == ":ide:" || (ti.path == path && ti.time == tm))
 		return;
 	String fn = TopicCacheName(path);
 	if(FileGetTime(fn) > tm) {

---------------------- uppsrc/ide/Builders/GccBuilder.cpp ----------------------
index 528a9615f..d81dbe6a6 100644
@@ -93,10 +93,9 @@ bool GccBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V
 				String fn = srcfile[j];
 				String ext = GetSrcType(fn);
 				if(findarg(ext, ".c", ".cpp", ".cc", ".cxx", ".brc", ".s", ".ss") >= 0 ||
-				   objectivec && findarg(ext, ".mm", ".m") >= 0 ||
-				   +
+				   (objectivec && findarg(ext, ".mm", ".m") >= 0) ||
 				   (!release && blitz && ext == ".icpp") ||
-				   ext == ".rc" && HasFlag("WIN32")) {
+				   (ext == ".rc" && HasFlag("WIN32"))) {
 					sfile.Add(fn);
 					soptions.Add(gop);
 				}
@@ -325,7 +324,7 @@ bool GccBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V
 		OnFinish(callback1(DeletePCHFile, pch_file));
 
 	if(!HasFlag("MAIN")) {
-		if(HasFlag("BLITZ") && !HasFlag("SO") || HasFlag("NOLIB") || making_lib) {
+		if((HasFlag("BLITZ") && !HasFlag("SO")) || HasFlag("NOLIB") || making_lib) {
 			linkfile.Append(obj); // Simply link everything as .o files...
 			IdeConsoleEndGroup();
 //			if(ccount)

--------------------- uppsrc/ide/Builders/JavaBuilder.cpp ---------------------
index 9e920d0e8..1921e674f 100644
@@ -97,7 +97,7 @@ bool JavaBuilder::BuildPackage(const String& package, Vector<String>& linkfile,
 				String fn = srcfile[j];
 				String ext = ToLower(GetFileExt(fn));
 				bool ismf = false;
-				if(ext == ".java" || main && ext == ".mf")
+				if(ext == ".java" || (main && ext == ".mf"))
 				{
 					if(ext == ".mf")
 					{

----------------------- uppsrc/ide/Builders/MakeFile.cpp -----------------------
index c39959e10..9d50c1ace 100644
@@ -399,7 +399,7 @@ void MakeBuild::SaveMakeFile(const String& fn, bool exporting)
 	;
 
 	bool sv = ::SaveFile(fn, makefile);
-	if(!exporting) {
+	if(exporting) {
 		if(sv)
 			PutConsole(Format("%s(1): makefile generation complete", fn));
 		else

-------------------------- uppsrc/ide/ContextGoto.cpp --------------------------
index e664547d9..b07870876 100644
@@ -482,7 +482,7 @@ void Ide::GotoFileAndId(const String& path, const String& id)
 			WString ln = editor.GetWLine(i);
 			int q = ln.Find(wid);
 			while(q >= 0) {
-				if(q == 0 || !iscid(ln[q - 1]) && !iscid(ln[q + wid.GetCount()])) {
+				if(q == 0 || (!iscid(ln[q - 1]) && !iscid(ln[q + wid.GetCount()]))) {
 					editor.SetCursor(editor.GetPos64(i, q));
 					editor.CenterCursor();
 					return;

-------------------------- uppsrc/ide/Core/BinObj.cpp --------------------------
index ab5789c78..a58b4e63a 100644
@@ -75,7 +75,7 @@ void BinObjInfo::Parse(CParser& binscript, String base_dir)
 				int f = brow.Find(blk.index);
 				if(f >= 0)
 					binscript.ThrowError(Format("%s[%d] already seen at line %d", blk.ident, blk.index, brow[f].scriptline));
-				if(blk.index < 0 && !brow.IsEmpty() || blk.index >= 0 && !brow.IsEmpty() && brow[0].index < 0)
+				if((blk.index < 0 && !brow.IsEmpty()) || (blk.index >= 0 && !brow.IsEmpty() && brow[0].index < 0))
 					binscript.ThrowError(Format("%s: mixing non-array and array elements", blk.ident));
 				brow.Add(blk.index, blk);
 				if(!(blk.flags & Block::FLG_MASK))

------------------------- uppsrc/ide/Core/Package.cpp -------------------------
index 2b83dc836..70d861e8a 100644
@@ -79,7 +79,7 @@ String ReadWhen(CParser& p) {
 			const char *b = p.GetPtr();
 			int lvl = 0;
 			for(;;) {
-				if(p.IsEof() || lvl == 0 && p.IsChar(')'))
+				if(p.IsEof() || (lvl == 0 && p.IsChar(')')))
 					break;
 				if(p.Char('('))
 					lvl++;

------------------------------ uppsrc/ide/Cpp.cpp ------------------------------
index e23671043..b7fba0396 100644
@@ -123,7 +123,7 @@ void AssistEditor::GatherItems(const String& type, bool only_public, Index<Strin
 			const CppItem& im = n[i];
 			if(im.kind == STRUCT || im.kind == STRUCTTEMPLATE)
 				base << im.qptype << ';';
-			if((im.IsCode() || !thisback && (im.IsData() || im.IsMacro() && IsNull(type)))
+			if((im.IsCode() || (!thisback && (im.IsData() || (im.IsMacro() && IsNull(type)))))
 			   && (!op || im.access == PUBLIC)) {
 				AssistItemAdd(ntp, im, typei);
 			}

-------------------------- uppsrc/ide/Credentials.cpp --------------------------
index 32229a19f..e7d1b6b4a 100644
@@ -94,7 +94,7 @@ struct GetPasskeyDlg : WithGetPasskeyLayout<TopWindow> {
 
 GetPasskeyDlg::GetPasskeyDlg()
 {
-	CtrlLayoutOKCancel(*this, "Passkey");
+	CtrlLayoutOK(*this, "Passkey");
 	
 	show_passkey << [=] { Sync(); };
 	

----------------------- uppsrc/ide/Debuggers/GdbData.cpp -----------------------
index 0b460b0f4..36a5fa0c6 100644
@@ -52,7 +52,7 @@ String DataClean(CParser& p)
 	int lvl = 0;
 	for(;;) {
 		bool sp = p.Spaces();
-		if(lvl == 0 && (p.IsChar('}') || p.IsChar(',')) || p.IsEof())
+		if((lvl == 0 && (p.IsChar('}') || p.IsChar(','))) || p.IsEof())
 			break;
 		if(sp)
 			r << ' ';

---------------------------- uppsrc/ide/Errors.cpp ----------------------------
index fa0734aa5..da5bb6abe 100644
@@ -59,7 +59,7 @@ bool Ide::FindLineError(const String& ln, FindLineErrorCache& cache, ErrorInfo&
 					}
 				}
 				file = FollowCygwinSymlink(file);
-				if(!IsFullPath(file) || !exists && !FileExists(file) || !IsTextFile(file))
+				if(!IsFullPath(file) || (!exists && !FileExists(file)) || !IsTextFile(file))
 					file = Null;
 				cache.file.Add(file0, file);
 			}
@@ -150,7 +150,7 @@ bool Ide::FindLineError(const String& ln, FindLineErrorCache& cache, ErrorInfo&
 				return f.lineno > 0;
 			}
 			else
-			if(*s == ':' || !strchr(s, '/') && !strchr(s, '\\')) // safe to say this is final
+			if(*s == ':' || (!strchr(s, '/') && !strchr(s, '\\'))) // safe to say this is final
 				return false;
 			else
 				f.file.Cat(*s); // File is not complete, e.g.: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Vc\Include\string.h(186)

--------------------------- uppsrc/ide/Navigator.cpp ---------------------------
index 74dc3cd2f..77132018f 100644
@@ -572,10 +572,10 @@ void Navigator::Search()
 					for(int j = 0; j < ci.GetCount(); j++) {
 						const CppItem& m = ci[j];
 						if(local ? m.file == fileii
-						         : m.uname.Find('@') < 0 && (pass < 0 ? m.name == search_name :
+						         : (m.uname.Find('@') < 0 && (pass < 0 ? m.name == search_name :
 						                               pass ? m.uname.Find(usearch_name) >= 0
-						                                    : m.name.StartsWith(search_name))
-						           || both && foundnest) {
+						                                    : m.name.StartsWith(search_name)))
+						           || (both && foundnest)) {
 							String key = nest + '\1' + m.qitem;
 							int q = nest_pass.Find(nest);
 							int p = pass;

-------------------------- uppsrc/ide/OutputMode.cpp --------------------------
index 11c1a3a16..97c9ba0b6 100644
@@ -179,7 +179,7 @@ void OutMode::Save()
 void OutMode::Export(int kind)
 {
 	String ep = ~export_dir;
-	if(IsNull(ep)) {
+		if(IsNull(ep)) {
 		Exclamation("Missing output directory!");
 		return;
 	}

--------------------------- uppsrc/ide/RepoSync.cpp ---------------------------
index b285e4299..d878e9a83 100644
@@ -90,7 +90,7 @@ bool IsConflictFile(String path)
 	String ext = GetFileExt(path);
 	if(*ext == '.') {
 		ext = ext.Mid(1);
-		if(findarg(ext, "mine", "theirs", "working") >= 0 || *ext == 'r' && IsDigit(ext[1])) {
+		if(findarg(ext, "mine", "theirs", "working") >= 0 || (*ext == 'r' && IsDigit(ext[1]))) {
 			for(int i = 0; i < 3; i++) {
 				int q = path.ReverseFind('.');
 				if(q < 0)
@@ -153,7 +153,7 @@ bool RepoSync::ListSvn(const String& path)
 							color = AdjustIfDark(c[action]);
 						}
 					}
-					if(pass == action < 0 && action != DELETEC) {
+					if(pass == action && action != DELETEC) {
 						int ii = list.GetCount();
 						list.Add(action, file, Null,
 						         AttrText(action < 0 ? ln[i] : "  " + file.Mid(path.GetCount() + 1)).Ink(color));
@@ -193,7 +193,7 @@ bool RepoSync::ListGit(const String& path)
 			String file = AppendFileName(path, h.Mid(3));
 			actions = true;
 			int action = String("M.?DR").Find(h[1]);
-			if(action < 0 || h[0] != '?' && h[0] != ' ')
+			if(action < 0 || (h[0] != '?' && h[0] != ' '))
 				action = SVN_IGNORE;
 			String an;
 			Color  color;

----------------------------- uppsrc/ide/Swaps.cpp -----------------------------
index d61002bcd..a94b3f983 100644
@@ -33,7 +33,7 @@ bool Ide::SwapSIf(const char *cref)
 	if(q < 0)
 		return false;
 	const Array<CppItem>& nn = CodeBase()[q];
-	if(cref && MakeCodeRef(p.current_scope, p.current_key) != cref || IsNull(p.current_name))
+	if(cref && (MakeCodeRef(p.current_scope, p.current_key) != cref || IsNull(p.current_name)))
 		return false;
 	Vector<const CppItem *> n;
 	bool destructor = p.current_key.Find('~') >= 0;

--------------------------- uppsrc/ide/Template.cpp ---------------------------
index 5e9c18ede..3978d05fd 100644
@@ -341,7 +341,7 @@ void TemplateDlg::LoadNest(const char *path, bool main, bool recurse)
 		if(ToLower(GetFileExt(ff.GetName())) == ".upt") {
 			try {
 				PackageTemplate t = ReadTemplate(p);
-				if(main && t.main || !main && t.sub)
+				if((main && t.main) || (!main && t.sub))
 					pt.Add() = pick(t);
 			}
 			catch(CParser::Error e) {

---------------------------- uppsrc/ide/idebar.cpp ----------------------------
index df7e6bad9..61def00a1 100644
@@ -554,9 +554,9 @@ void Ide::FilePropertiesMenu(Bar& menu)
 				for(int i = 0; i < n; i++) { // check that we are in git conflict
 					const String& s = editor.GetUtf8Line(i);
 					int ch = *s;
-					a = a || ch == '<' && s.StartsWith("<<<<<<<");
-					b = b || ch == '=' && s.StartsWith("=======");
-					c = c || ch == '>' && s.StartsWith(">>>>>>>");
+					a = a || (ch == '<' && s.StartsWith("<<<<<<<"));
+					b = b || (ch == '=' && s.StartsWith("======="));
+					c = c || (ch == '>' && s.StartsWith(">>>>>>>"));
 				}
 				if(a && b && c) {
 					original = "1";

---------------------------- uppsrc/ide/idefile.cpp ----------------------------
index 70fe94c55..d79c71294 100644
@@ -477,8 +477,8 @@ void Ide::EditFile0(const String& path, byte charset, int spellcheck_comments, c
 	if(!designer && editastext.Find(path) < 0 &&
 	   (findarg(GetFileExt(path), ".log") < 0 &&
 	    findarg(charset, CHARSET_UTF8_BOM, CHARSET_UTF16_LE, CHARSET_UTF16_BE,
-	            CHARSET_UTF16_LE_BOM, CHARSET_UTF16_BE_BOM) < 0 &&
-	    FileIsBinary(path) || editashex.Find(path) >= 0))
+	            CHARSET_UTF16_LE_BOM, ((CHARSET_UTF16_BE_BOM) < 0 &&
+	    FileIsBinary(path)) || (editashex.Find(path) >= 0))))
 		designer.Create<FileHexView>().Open(path);
 	
 	ManageDisplayVisibility();
@@ -549,7 +549,7 @@ void Ide::EditFile0(const String& path, byte charset, int spellcheck_comments, c
 				const int64 max_size = 768*1024*1024;
 			#endif
 				const int view_limit = 256*1024*1024;
-				if(view_file.GetSize() < view_limit || editastext.Find(editfile) >= 0 && view_file.GetSize() < max_size) {
+				if((view_file.GetSize() < view_limit) || (editastext.Find(editfile) >= 0 && view_file.GetSize() < max_size)) {
 					le = editor.Load(view_file, charset);
 					view_file.Close();
 				}

---------------------------- uppsrc/ide/idetool.cpp ----------------------------
index d4da768e6..8e16de7c5 100644
@@ -100,7 +100,7 @@ void Ide::GotoPosition()
 		for(String n : pk.file) {
 			String pf = PosFn(pkg, n);
 			int q = f.GetCount() - pf.GetCount() - 1;
-			if(pf == f || q >= 0 && f.EndsWith(PosFn(pkg, n)) && f[q] == '/') {
+			if(pf == f || (q >= 0 && f.EndsWith(PosFn(pkg, n)) && f[q] == '/')) {
 				GotoPos(SourcePath(pkg, n), line);
 				return;
 			}

------------------------------- uppsrc/ide/t.cpp -------------------------------
index 954530646..fe93b40a0 100644
@@ -166,7 +166,7 @@ String CreateTFile(const VectorMap<String, LngEntry>& map, const Vector<int>& ln
 				int lang = lngset[j];
 				if(rep || lang != LNG_enUS) {
 					int q = e.text.Find(lang);
-					if(!rep || q >= 0 && !IsNull(e.text[q])) {
+					if(!rep || (q >= 0 && !IsNull(e.text[q]))) {
 						int c = (lang >> 15) & 31;
 						if(c) {
 							out.Cat(c + 'a' - 1);

--------------------- uppsrc/plugin/astyle/ASFormatter.cpp ---------------------
index c8c1e60cb..4434d79d7 100644
@@ -680,8 +680,8 @@ WString ASFormatter::nextLine()
 		            && !isPreviousCharPostComment       // Fixes wrongly appended newlines after '}' immediately after comments
 		            && peekNextChar() != ' '
 		            && !IS_A(previousBracketType,  DEFINITION_TYPE)
-		            && !(ASBeautifier::isJavaStyle && currentChar == ')'))
-		        && !IS_A(bracketTypeStack->back(),  DEFINITION_TYPE))
+		            && !(ASBeautifier::isJavaStyle && currentChar == ')')
+		        && !IS_A(bracketTypeStack->back(),  DEFINITION_TYPE)))
 		        && (shouldBreakOneLineBlocks
 		            || !IS_A(bracketTypeStack->back(),  SINGLE_LINE_TYPE)))
 		{

------------------------ uppsrc/plugin/lz4/Compress.cpp ------------------------
index 12c3158f2..a802035f1 100644
@@ -115,7 +115,7 @@ void LZ4CompressStream::_Put(const void *data, dword size)
 	const char *s = reinterpret_cast<const char *>(data);
 
 	while(size > 0) {
-		if(IsError() || out && out->IsError())
+		if(IsError() || (out && out->IsError()))
 			return;
 		dword n = dword(wrlim - ptr);
 		if(size >= n) {

--------------------------- uppsrc/plugin/lz4/lz4.h ---------------------------
index 16649e291..833892113 100644
@@ -95,7 +95,7 @@ private:
 	void          Init();
 	bool          Next();
 	void          Fetch();
-	bool          Ended() const { return IsError() || in->IsError() || ptr == rdlim && ii == count && eof; }
+	bool          Ended() const { return IsError() || in->IsError() || (ptr == rdlim && ii == count && eof); }
 
 public:
 	bool Open(Stream& in);

------------------------- uppsrc/plugin/lzma/lzma.cpp -------------------------
index c1c6ddd1e..f6d1b060d 100644
@@ -100,7 +100,7 @@ static SRes Decode2(CLzmaDec *state, ISeqOutStream *outStream, ISeqInStream *inS
 				return SZ_ERROR_WRITE;
 			
 		outPos = 0;
-		if(res != SZ_OK || thereIsSize && unpackSize == 0)
+		if(res != SZ_OK || (thereIsSize && unpackSize == 0))
 			return res;
 
 		if(inProcessed == 0 && outProcessed == 0) {

----------------------- uppsrc/plugin/zstd/Compress.cpp -----------------------
index 733f54d00..caa3b4003 100644
@@ -98,7 +98,7 @@ void ZstdCompressStream::_Put(const void *data, dword size)
 	const char *s = reinterpret_cast<const char *>(data);
 
 	while(size > 0) {
-		if(IsError() || out && out->IsError())
+		if(IsError() || (out && out->IsError()))
 			return;
 		dword n = dword(wrlim - ptr);
 		if(size >= n) {

-------------------------- uppsrc/plugin/zstd/zstd.h --------------------------
index e7d5ce6d4..7ddd10c26 100644
@@ -86,7 +86,7 @@ private:
 	void          Init();
 	bool          Next();
 	void          Fetch();
-	bool          Ended() const { return IsError() || in->IsError() || ptr == rdlim && ii == count && eof; }
+	bool          Ended() const { return IsError() || in->IsError() || (ptr == rdlim && ii == count && eof); }
 
 public:	
 	bool Open(Stream& in);

2021-01-07-163141_1920x1080_scrot

<!-- gh-comment-id:756192665 --> @mingodad commented on GitHub (Jan 7, 2021): Here is the changes I made to eliminate the compiler warnings (that ended up messing up a bit see the screenshot attached where we can see that the editor comes up with an HEX view of the file): ``` ----------------------- uppsrc/CodeEditor/CHighlight.cpp ----------------------- index ceb2674f5..a353e7055 100644 @@ -182,7 +182,7 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls Grounding(p, e); if(highlight == HIGHLIGHT_CALC) { - if(editor && line == editor->GetLineCount() - 1 || *p == '$') + if((editor && line == editor->GetLineCount() - 1) || *p == '$') hls.SetPaper(0, linelen + 1, hl_style[PAPER_BLOCK1].color); } else @@ -196,7 +196,7 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls while(bid < this->bid.GetCount() - 1 && (i >= linelen || p[i] == ' ' || p[i] == '\t')) { hls.SetPaper(i, 1, BlockColor(bid)); - if(i < linelen && p[i] == '\t' || ++pos >= tabsize) { + if((i < linelen && p[i] == '\t') || ++pos >= tabsize) { pos = 0; bid++; } @@ -242,7 +242,7 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls while(p < e) { int raw_n = 0; dword pair = MAKELONG(p[0], p[1]); - if(pair == MAKELONG('/', '*') && highlight != HIGHLIGHT_JSON || comment) { + if((pair == MAKELONG('/', '*') && highlight != HIGHLIGHT_JSON) || comment) { if(!comment) { hls.Put(2, hl_style[INK_COMMENT]); p += 2; @@ -289,16 +289,16 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls hls.Put(int(p - b), hl_style[INK_RAW_STRING]); } else - if(linecomment && linecont || pair == MAKELONG('/', '/') && - highlight != HIGHLIGHT_CSS && highlight != HIGHLIGHT_JSON || - highlight == HIGHLIGHT_PHP && *p == '#') { + if((linecomment && linecont) || (pair == MAKELONG('/', '/') && + highlight != HIGHLIGHT_CSS && highlight != HIGHLIGHT_JSON) || + (highlight == HIGHLIGHT_PHP && *p == '#')) { while(p < e) p = DoComment(hls, p, e); is_comment = true; break; } else - if((*p == '\"' || *p == '\'') || linecont && string) + if((*p == '\"' || *p == '\'') || (linecont && string)) p = hls.CString(p); else if(*p == '(') { @@ -336,7 +336,7 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls hls.SetPaper(hls.pos, linelen + 1 - hls.pos, BlockColor(--block_level)); Bracket(int(p - ltext) + pos, hls, editor); int& l = *p == ')' ? pl : *p == '}' ? cl : bl; - if(bc && (bc != *p || l <= 0) || bc == 0 && *p != '}') { + if((bc && (bc != *p || l <= 0)) || (bc == 0 && *p != '}')) { hls.Put(p == ltext || ignore_errors ? hl_style[INK_PAR0] : hl_style[INK_ERROR]); brk.Clear(); cl = bl = pl = 0; @@ -379,7 +379,7 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls if(iscib(*p)) { const wchar *q = p; StringBuffer id; - while((iscidl(*q) || highlight == HIGHLIGHT_CSS && *q == '-') && q < e) + while((iscidl(*q) || (highlight == HIGHLIGHT_CSS && *q == '-')) && q < e) id.Cat(*q++); String iid = id; if(highlight == HIGHLIGHT_SQL) ------------------------- uppsrc/CodeEditor/CLogic.cpp ------------------------- index da40f77a0..639d88688 100644 @@ -20,8 +20,8 @@ int CSyntax::GetCommentPos(CodeEditor& e, int l, WString& ch) const sSpaces(cp, ln); One<EditorSyntax> esyntax = e.GetSyntax(e.GetCursorLine()); CSyntax *syntax = dynamic_cast<CSyntax *>(~esyntax); - if(syntax && syntax->comment && ln.Find("*/") < 0 || - cp < ln.GetCount() - 2 && ln[cp] == '/' && ln[cp + 1] == '/') { + if((syntax && syntax->comment && ln.Find("*/") < 0) || + (cp < ln.GetCount() - 2 && ln[cp] == '/' && ln[cp + 1] == '/')) { while(cp < ln.GetLength() && findarg(ln[cp], '/', '*', '!', '<', '>', '%', '#', '@', '|') >= 0) cp++; ch = ln.Mid(0, cp); @@ -75,7 +75,7 @@ void CSyntax::IndentInsert0(CodeEditor& e, int chr, int count, bool reformat) e.InsertChar(*s++, 1); if(!syntax) return; - if(syntax->stmtline == cl || syntax->blk.GetCount() && syntax->blk.Top() == cl // statement (if, while..) || first line of block + if(syntax->stmtline == cl || (syntax->blk.GetCount() && syntax->blk.Top() == cl) // statement (if, while..) || first line of block || *pl.Last() == ':') { // label if(indent_spaces || (s > pl && s[-1] == ' ')) e.InsertChar(' ', indent_amount); @@ -128,7 +128,7 @@ void CSyntax::IndentInsert0(CodeEditor& e, int chr, int count, bool reformat) // {, } inserted on line alone should be moved left sometimes: int cl = e.GetCursorLine(); WString l = e.GetWLine(cl); - if(chr != '{' && chr != '}' || count > 1) { + if((chr != '{' && chr != '}') || count > 1) { e.InsertChar(chr, 1, true); return; } ------------------------ uppsrc/CodeEditor/CSyntax.cpp ------------------------ index 12526f906..47cb3e280 100644 @@ -127,8 +127,8 @@ void CSyntax::ScanSyntax(const wchar *ln, const wchar *e, int line, int tab_size p++; int idlen = int(p - id); if(id[0] == 'i' && id[1] == 'f' - && (idlen == 2 || idlen == 5 && id[2] == 'd' && id[3] == 'e' && id[4] == 'f' - || idlen == 6 && id[2] == 'n' && id[3] == 'd' && id[4] == 'e' && id[5] == 'f')) { + && (idlen == 2 || (idlen == 5 && id[2] == 'd' && id[3] == 'e' && id[4] == 'f') + || (idlen == 6 && id[2] == 'n' && id[3] == 'd' && id[4] == 'e' && id[5] == 'f'))) { IfState& ifstate = ifstack.Add(); ifstate.state = IfState::IF; ifstate.iftext = sReadLn(ln); ----------------------- uppsrc/CodeEditor/CodeEditor.cpp ----------------------- index 8c79116be..023ac14e6 100644 @@ -81,7 +81,7 @@ void CodeEditor::DirtyFrom(int line) { } inline bool IsComment(int a, int b) { - return a == '/' && b == '*' || a == '*' && b == '/' || a == '/' && b == '/'; + return (a == '/' && b == '*') || (a == '*' && b == '/') || (a == '/' && b == '/'); } inline bool RBR(int c) { @@ -193,7 +193,7 @@ bool CodeEditor::IsCursorBracket(int64 pos) const bool CodeEditor::IsMatchingBracket(int64 pos) const { - return pos == highlight_bracket_pos && (hilite_bracket == 1 || hilite_bracket == 2 && bracket_flash); + return pos == highlight_bracket_pos && (hilite_bracket == 1 || (hilite_bracket == 2 && bracket_flash)); } void CodeEditor::CheckBrackets() @@ -1086,7 +1086,7 @@ void CodeEditor::HighlightLine(int line, Vector<LineEdit::Highlight>& hl, int64 break; int n = illuminated.GetCount(); if(n > 1 || !iscid(illuminated[0]) || - (q == 0 || !iscid(l[q - 1])) && (q + n >= l.GetCount() || !iscid(l[q + n]))) + ((q == 0 || !iscid(l[q - 1])) && (q + n >= l.GetCount() || !iscid(l[q + n])))) while(n-- && q < hl.GetCount()) { const HlStyle& st = hl_style[PAPER_SELWORD]; hl[q].paper = st.color; ----------------------- uppsrc/CodeEditor/LogSyntax.cpp ----------------------- index 491a32a92..4b373a814 100644 @@ -53,7 +53,7 @@ void LogSyntax::Highlight(const wchar *s, const wchar *end, HighlightOutput& hls sws << "ok" << "success"; } String w; - while(s < end && IsAlNum(*s) || *s == '_') + while((s < end && IsAlNum(*s)) || *s == '_') w.Cat(ToLower(*s++)); bool hl = rws.Find(w) >= 0; bool st = sws.Find(w) >= 0; ---------------------- uppsrc/CodeEditor/PythonSyntax.cpp ---------------------- index 053866820..c6f1a08bc 100644 @@ -42,7 +42,7 @@ void PythonSyntax::Highlight(const wchar *s, const wchar *end, HighlightOutput& "not", "with", "async", "elif", "if", "or", "yield" }; static Index<String> sws = { "self", "NotImplemented", "Ellipsis", "__debug__", "__file__", "__name__" }; String w; - while(s < end && IsAlNum(*s) || *s == '_') + while((s < end && IsAlNum(*s)) || *s == '_') w.Cat(*s++); hls.Put(w.GetCount(), kws.Find(w) >= 0 ? hl_style[INK_KEYWORD] : sws.Find(w) >= 0 ? hl_style[INK_UPP] : ------------------------- uppsrc/Core/BlockStream.cpp ------------------------- index 025dce011..a6b627ecf 100644 @@ -473,7 +473,7 @@ bool FileStream::Open(const char *name, dword mode, mode_t tmode) { struct stat st[1]; fstat(handle, st); if(!(st->st_mode & S_IFREG) || // not a regular file, e.g. folder - bad things would happen - (mode & NOWRITESHARE) && flock(handle, LOCK_EX|LOCK_NB) < 0) { // lock if not sharing + ((mode & NOWRITESHARE) && flock(handle, LOCK_EX|LOCK_NB) < 0)) { // lock if not sharing close(handle); handle = -1; return false; ---------------------------- uppsrc/Core/CharSet.h ---------------------------- index a389fbb3a..13a7a3305 100644 @@ -185,12 +185,12 @@ inline char ToUpperAscii(wchar c) { return ToUpperAscii((dword) c); } inline char ToLowerAscii(wchar c) { return ToLowerAscii((dword) c); } inline bool IsDigit(int c) { return c >= '0' && c <= '9'; } -inline bool IsAlpha(int c) { return c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z'; } +inline bool IsAlpha(int c) { return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'); } inline bool IsAlNum(int c) { return IsDigit(c) || IsAlpha(c); } inline bool IsLeNum(int c) { return IsDigit(c) || IsLetter(c); } inline bool IsPunct(int c) { return c != ' ' && !IsAlNum(c); } inline bool IsSpace(int c) { return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\v' || c == '\t'; } -inline bool IsXDigit(int c) { return IsDigit(c) || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f'; } +inline bool IsXDigit(int c) { return IsDigit(c) || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'); } bool IsDoubleWidth(int c); @@ -255,7 +255,7 @@ bool SaveFileBOMUtf8(const char *path, const String& data); word UnicodeCombine(word chr, word combine); -inline bool IsCJKIdeograph(int c) { return c >= 0x2e80 && c <= 0xdfaf || c >= 0xf900 && c <= 0xfaff; } +inline bool IsCJKIdeograph(int c) { return (c >= 0x2e80 && c <= 0xdfaf) || (c >= 0xf900 && c <= 0xfaff); } int ToUnicode(int chr, byte charset); int FromUnicode(wchar wchr, byte charset, int defchar = DEFAULTCHAR); ----------------------------- uppsrc/Core/CoAlgo.h ----------------------------- index fdf855dd8..300793528 100644 @@ -128,7 +128,7 @@ int CoFindBest(const Range& r, const Better& better) i++; } CoWork::FinLock(); - if(better(*b, *best) || !better(*best, *b) && b < best) + if(better(*b, *best) || (!better(*best, *b) && b < best)) best = b; } ); ---------------------------- uppsrc/Core/Color.cpp ---------------------------- index 0fea74ed3..9de8ff032 100644 @@ -189,7 +189,7 @@ static int sCharFilterNoDigit(int c) static int sCharFilterHex(int c) { - return c >= 'a' && c <= 'f' || c >= 'A' && c <= 'F' || IsDigit(c) ? c : 0; + return (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F') || IsDigit(c) ? c : 0; } Color ColorFromText(const char *s) --------------------------- uppsrc/Core/Convert.cpp --------------------------- index 4aac022e9..8e8f4f5d1 100644 @@ -125,7 +125,7 @@ double ScanDoubleT(const T *p, const T **endptr, bool accept_comma) *endptr = p; if(*p == '+' || *p == '-') neg = (*p++ == '-'); - if((byte)(*p - '0') >= 10 && !((*p == '.' || accept_comma && *p == ',') && (byte)(p[1] - '0') < 10)) { + if((byte)(*p - '0') >= 10 && !((*p == '.' || (accept_comma && *p == ',')) && (byte)(p[1] - '0') < 10)) { if(endptr) *endptr = begin; return Null; } @@ -140,7 +140,7 @@ double ScanDoubleT(const T *p, const T **endptr, bool accept_comma) else exp++; int raise = exp; - if(*p == '.' || accept_comma && *p == ',') // decimal part + if(*p == '.' || (accept_comma && *p == ',')) // decimal part while((byte)((c = *++p) - '0') < 10) { if(c != '0') { if(raise) { ---------------------------- uppsrc/Core/Format.cpp ---------------------------- index 6ab51bd1c..63bd8bd0b 100644 @@ -46,7 +46,7 @@ String FormatIntBase(int i, int base, int width, char lpad, int sign, bool upper while(x /= base); } bool minus = (sign >= 0 && i < 0 && !IsNull(i)); - bool do_sign = (sign > 0 || sign >= 0 && minus); + bool do_sign = (sign > 0 || (sign >= 0 && minus)); if(do_sign && lpad != '0') *--p = (minus ? '-' : '+'); if(width > e - p) @@ -316,7 +316,7 @@ String FormatDoubleFix(double d, int digits, int flags) if(flags & FD_REL) digits = max(0, digits - Nvl(exp, 0) - 1); String out; - if(flags & FD_SIGN || d < 0 && !IsNull(exp)) + if(flags & FD_SIGN || (d < 0 && !IsNull(exp))) out.Cat(d >= 0 ? '+' : '-'); int pointchar = (flags & FD_COMMA) ? ',' : '.'; if(IsNull(exp) || exp < -digits) { @@ -372,7 +372,7 @@ String FormatDoubleExp(double d, int digits, int flags, int fill_exp) String dig = FormatDoubleDigits(d, digits, flags | FD_REL, exp); exp = Nvl(exp, 0); StringBuffer out; - if(flags & FD_SIGN || d < 0 && !IsNull(exp)) + if(flags & FD_SIGN || (d < 0 && !IsNull(exp))) out.Cat(d >= 0 ? '+' : '-'); out.Cat(dig[0]); if(dig.GetLength() > 1) @@ -621,7 +621,7 @@ String RealFormatter(const Formatting& f) flags |= FD_SIGN; s++; } - if(IsDigit(*s) || *s == '-' && IsDigit(s[1])) { + if(IsDigit(*s) || (*s == '-' && IsDigit(s[1]))) { digits = (int)strtol(s, NULL, 10); while(IsDigit(*++s)) ; ----------------------------- uppsrc/Core/Http.cpp ----------------------------- index b97c4c95f..b0daecb1b 100644 @@ -783,7 +783,7 @@ void HttpRequest::Out(const void *ptr, int size) HttpError("content length exceeded " + AsString(max_content_size)); return; } - if(WhenContent && (status_code >= 200 && status_code < 300 || all_content)) + if(WhenContent && ((status_code >= 200 && status_code < 300) || all_content)) WhenContent(ptr, size); else body.Cat((const char *)ptr, size); @@ -797,7 +797,7 @@ bool HttpRequest::ReadingBody() if(has_content_length && content_length == 0) return false; - String s = TcpSocket::Get(has_content_length && content_length > 0 || chunked_encoding ? + String s = TcpSocket::Get((has_content_length && content_length > 0) || chunked_encoding ? (int)min((int64)chunk, count) : chunk); if(s.GetCount()) { #ifndef ENDZIP ----------------------------- uppsrc/Core/Parser.h ----------------------------- index 084697e5d..38bac6a03 100644 @@ -1,9 +1,9 @@ inline bool iscib(int c) { - return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '_' || c == '$'; + return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_' || c == '$'; } inline bool iscid(int c) { - return iscib(c) || c >= '0' && c <= '9'; + return iscib(c) || ((c >= '0') && (c <= '9')); } class CParser { ----------------------------- uppsrc/Core/Path.cpp ----------------------------- index edfa2afe4..1043f59e5 100644 @@ -525,8 +525,8 @@ bool FindFile::CanMode(dword usr, dword grp, dword oth) const static uid_t uid = getuid(); static gid_t gid = getgid(); return (mode & oth) || - (mode & grp) && gid == s.st_gid || - (mode & usr) && uid == s.st_uid; + ((mode & grp) && gid == s.st_gid) || + ((mode & usr) && uid == s.st_uid); } bool FindFile::IsSymLink() const ---------------------------- uppsrc/Core/Socket.cpp ---------------------------- index 408b571d5..f237b9091 100644 @@ -452,7 +452,7 @@ bool TcpSocket::RawConnect(addrinfo *arp) for(int pass = 0; pass < 2; pass++) { addrinfo *rp = arp; while(rp) { - if(rp->ai_family == AF_INET == !pass && // Try to connect IPv4 in the first pass + if(rp->ai_family == AF_INET && !pass && // Try to connect IPv4 in the first pass Open(rp->ai_family, rp->ai_socktype, rp->ai_protocol)) { if(connect(socket, rp->ai_addr, (int)rp->ai_addrlen) == 0 || GetErrorCode() == SOCKERR(EINPROGRESS) || GetErrorCode() == SOCKERR(EWOULDBLOCK) @@ -645,7 +645,7 @@ bool TcpSocket::RawWait(dword flags, int end_time) #endif return true; } - if(IsGlobalTimeout() || to <= 0 && timeout) { + if(IsGlobalTimeout() || (to <= 0 && timeout)) { is_timeout = true; return false; } @@ -703,7 +703,7 @@ int TcpSocket::Put(const void *s_, int length) return done; peek = false; int count = Send(s + done, length - done); - if(IsError() || timeout == 0 && count == 0 && peek) + if(IsError() || (timeout == 0 && count == 0 && peek)) return done; if(count > 0) done += count; @@ -767,7 +767,7 @@ void TcpSocket::ReadBuffer(int end_time) bool TcpSocket::IsEof() const { - return is_eof && ptr == end || IsAbort() || !IsOpen() || IsError(); + return (is_eof && ptr == end) || IsAbort() || !IsOpen() || IsError(); } int TcpSocket::Get_() ---------------------------- uppsrc/Core/Stream.cpp ---------------------------- index 92e9df196..0b6862c1b 100644 @@ -1373,7 +1373,7 @@ Stream& Pack16(Stream& s, int& i1, int& i2, int& i3, int& i4, int& i5) { int StreamHeading(Stream& stream, int ver, int minver, int maxver, const char* tag) { - if(stream.IsLoading() && stream.IsEof() || stream.IsError()) + if((stream.IsLoading() && stream.IsEof()) || stream.IsError()) return Null; String text = tag; dword len = text.GetLength(); ----------------------------- uppsrc/Core/String.h ----------------------------- index 88c8b7fdc..6ca076104 100644 @@ -290,7 +290,7 @@ public: bool IsEqual(const String0& s) const { uint64 q1 = q[1]; uint64 sq1 = s.q[1]; - return q1 == sq1 && q[0] == s.q[0] || ((q1 | sq1) & MAKE8B(0,0,0,0,0,0,255,0)) && LEq(s); + return (q1 == sq1 && q[0] == s.q[0]) || (((q1 | sq1) & MAKE8B(0,0,0,0,0,0,255,0)) && LEq(s)); } bool IsEqual(const char *s) const; --------------------------- uppsrc/Core/TimeDate.cpp --------------------------- index 3289f2349..c5c360681 100644 @@ -27,7 +27,7 @@ int GetDaysOfMonth(int m, int y) { } bool Date::IsValid() const { - return year == -32768 || month >= 1 && month <= 12 && day >= 1 && day <= GetDaysOfMonth(month, year); + return year == -32768 || (month >= 1 && month <= 12 && day >= 1 && day <= GetDaysOfMonth(month, year)); } String DayName(int i, int lang) @@ -499,7 +499,7 @@ int64 Time::Get() const bool Time::IsValid() const { return year == -32768 || - Date::IsValid() && hour >= 0 && hour < 24 && minute >= 0 && minute < 60 && second >= 0 && second < 60; + (Date::IsValid() && hour >= 0 && hour < 24 && minute >= 0 && minute < 60 && second >= 0 && second < 60); } int64 operator-(Time a, Time b) { ---------------------------- uppsrc/Core/Value.hpp ---------------------------- index f420b8b84..ae4c67607 100644 @@ -11,15 +11,15 @@ Value::Value(const Value& v) template<> inline bool IsPolyEqual(const bool& x, const Value& v) { - return v.Is<double>() && int(x) == double(v) - || v.Is<int64>() && int(x) == int64(v) - || v.Is<int>() && int(x) == int(v); + return (v.Is<double>() && int(x) == double(v)) + || (v.Is<int64>() && int(x) == int64(v)) + || (v.Is<int>() && int(x) == int(v)); } template<> inline bool IsPolyEqual(const int& x, const Value& v) { - return v.Is<double>() && x == double(v) - || v.Is<int64>() && x == int64(v); + return (v.Is<double>() && x == double(v)) + || (v.Is<int64>() && x == int64(v)); } template<> ---------------------------- uppsrc/Core/Vcont.hpp ---------------------------- index 95e0f1905..30b7c850d 100644 @@ -378,7 +378,7 @@ void Vector<T>::Insert(int i, Vector<T>&& v) { template <class T> void Vector<T>::InsertSplit(int i, Vector<T>& v, int from) { - ASSERT(!vector || v.vector != vector && from <= v.GetCount()); + ASSERT(!vector || (v.vector != vector && from <= v.GetCount())); int n = v.GetCount() - from; if(n) { RawInsert(i, n); ----------------------------- uppsrc/Core/XML.cpp ----------------------------- index f90bf8d73..71918e160 100644 @@ -11,7 +11,7 @@ static inline void sDeXmlChar(StringBuffer& result, char chr, byte charset, bool else if(chr == '&') result.Cat("&amp;"); else if(chr == '\'') result.Cat("&apos;"); else if(chr == '\"') result.Cat("&quot;"); - else if((byte)chr < ' ' && (escapelf || chr != '\n' && chr != '\t' && chr != '\r')) + else if((byte)chr < ' ' && (escapelf || (chr != '\n' && chr != '\t' && chr != '\r'))) result.Cat(Format("&#x%02x;", (byte)chr)); else if(!(chr & 0x80) || charset == CHARSET_UTF8) result.Cat(chr); else result.Cat(ToUtf8(ToUnicode(chr, charset))); @@ -962,9 +962,9 @@ XmlNode::XmlNode(const XmlNode& n, int) bool Ignore(XmlParser& p, dword style) { - if((XML_IGNORE_DECLS & style) && p.IsDecl() || - (XML_IGNORE_PIS & style) && p.IsPI() || - (XML_IGNORE_COMMENTS & style) && p.IsComment()) { + if(((XML_IGNORE_DECLS & style) && p.IsDecl()) || + ((XML_IGNORE_PIS & style) && p.IsPI()) || + ((XML_IGNORE_COMMENTS & style) && p.IsComment())) { p.Skip(); return true; } @@ -1086,7 +1086,7 @@ bool ShouldPreserve(const String& s) return true; l = s.End(); for(const char *x = s; x < l; x++) - if(*x == '\t' || *x == '\n' || *x == ' ' && x[1] == ' ') + if(*x == '\t' || *x == '\n' || (*x == ' ' && x[1] == ' ')) return true; return false; } ---------------------------- uppsrc/Core/parser.cpp ---------------------------- index 89fa1353d..66afba18f 100644 @@ -190,7 +190,7 @@ String CParser::ReadIdt() { StringBuffer result; int lvl = 0; while(IsAlNum(*term) || *term == '_' || *term == '<' || *term == '>' || - *term == ':' || (*term == ',' || *term == ' ' ) && lvl > 0 ) { + *term == ':' || ((*term == ',' || *term == ' ' ) && lvl > 0 )) { if(*term == '<') lvl++; if(*term == '>') lvl--; result.Cat(*term++); @@ -410,7 +410,7 @@ String CParser::ReadOneString(int delim, bool chkend) { if(!ReadHex(hex2, 4)) ThrowError("Incomplete universal character"); if(hex2 >= 0xDC00 && hex2 <= 0xDFFF) { - result.Cat(ToUtf8(((hex & 0x3ff) << 10) | (hex2 & 0x3ff) + 0x10000)); + result.Cat(ToUtf8((((hex & 0x3ff) << 10) | (hex2 & 0x3ff)) + 0x10000)); break; } } @@ -683,7 +683,7 @@ String AsCString(const char *s, const char *lim, int linemax, const char *linepf continue; // skip s++ } else { - if(byte(*s) < 32 || (byte)*s >= 0x7f && (flags & ASCSTRING_OCTALHI) || (byte)*s == 0xff || (byte)*s == 0x7f) { + if(byte(*s) < 32 || ((byte)*s >= 0x7f && (flags & ASCSTRING_OCTALHI)) || (byte)*s == 0xff || (byte)*s == 0x7f) { char h[4]; int q = (byte)*s; h[0] = '\\'; ------------------------------ uppsrc/Core/t.cpp ------------------------------ index a41c31651..93f8c9d7a 100644 @@ -19,8 +19,8 @@ static int sIdLen(const char *txt) static bool sIdEq(const char *a, const char *b) { for(;;) { - if((*a == '\0' || *a == '\a' && a[1] != '\a') && - (*b == '\0' || *b == '\a' && b[1] != '\a')) + if((*a == '\0' || (*a == '\a' && a[1] != '\a')) && + (*b == '\0' || (*b == '\a' && b[1] != '\a'))) return true; if(*a != *b) return false; --------------------------- uppsrc/CppBase/Body.cpp --------------------------- index 5699f53bb..1db7cb6b0 100644 @@ -200,7 +200,7 @@ void Parser::Statement() if(lex == t_eof) ThrowError(""); TryLambda(); - if(Key(';') || lex == '{' || lex == '}' || lex >= tk_if && lex <= tk_do) + if(Key(';') || lex == '{' || lex == '}' || (lex >= tk_if && lex <= tk_do)) break; ++lex; } --------------------------- uppsrc/CppBase/CppBase.h --------------------------- index d1efa9efc..86d174aa0 100644 @@ -40,7 +40,7 @@ enum Kind { inline bool IsCppType(int i) { - return i >= STRUCT && i <= TYPEDEF || i == FRIENDCLASS; + return (i >= STRUCT && i <= TYPEDEF) || i == FRIENDCLASS; } inline bool IsCppCode(int i) { @@ -56,7 +56,7 @@ inline bool IsCppMacro(int i) { } inline bool IsCppTemplate(int i) { - return i == STRUCTTEMPLATE || i >= FUNCTIONTEMPLATE && i <= CLASSFUNCTIONTEMPLATE; + return i == STRUCTTEMPLATE || (i >= FUNCTIONTEMPLATE && i <= CLASSFUNCTIONTEMPLATE); } void CleanPP(); -------------------------- uppsrc/CppBase/Parser.cpp -------------------------- index f18a75251..3f12439b1 100644 @@ -79,7 +79,7 @@ String FnItem(const char *s, const char *pname, const char *qname, const String& res.Cat(*s++); plvl--; } - if(iscid(*s) || *s == '~' || *s && lvl) + if(iscid(*s) || *s == '~' || (*s && lvl)) res.Cat(*s++); else break; @@ -128,7 +128,7 @@ String FnItem(const char *s, const char *pname, const char *qname, const String& s++; int l = 0; int tl = 0; - while(*s && !(l == 0 && (*s == ',' && tl == 0 || *s == ')'))) { + while(*s && !(l == 0 && ((*s == ',' && tl == 0) || *s == ')'))) { if(*s == '(' || *s == '[') l++; else @@ -255,7 +255,7 @@ void TpSkip(CParser& p) { int lvl = 0; for(;;) { - if(lvl == 0 && (p.IsChar(',') || p.IsChar('>')) || p.IsEof()) + if((lvl == 0 && (p.IsChar(',') || p.IsChar('>'))) || p.IsEof()) break; if(p.Char('<')) lvl++; @@ -461,7 +461,7 @@ String Parser::ReadOper(bool& castoper) { if(Key('(')) level++; for(;;) { - if(lex == t_eof || level <= 0 && lex == '(') break; + if(lex == t_eof || (level <= 0 && lex == '(')) break; if(Key('(') || Key('[')) level++; else if(Key(')') || Key(']')) level--; @@ -837,7 +837,7 @@ int Parser::RPtr() n++; } else - if(t == t_dblcolon || lex.IsId(n) || t == ',' && tlevel > 0) + if(t == t_dblcolon || lex.IsId(n) || (t == ',' && tlevel > 0)) n++; else return 0; @@ -903,8 +903,8 @@ void Parser::Declarator(Decl& d, const char *p) } } if(Key('(')) { - if(inbody || (lex < 256 || lex == tk_true || lex == tk_false) - && lex != ')' && lex != '[' && lex != t_dblcolon) { + if(inbody || ((lex < 256 || lex == tk_true || lex == tk_false) + && lex != ')' && lex != '[' && lex != t_dblcolon)) { int level = 0; for(;;) { if(lex == t_eof) break; @@ -955,7 +955,7 @@ void Parser::Declarator(Decl& d, const char *p) for(;;) { TryLambda(); if(lex == t_eof || lex == ';' - || level == 0 && ((lex == ',' && tlevel == 0) || lex == ')')) + || (level == 0 && ((lex == ',' && tlevel == 0) || lex == ')'))) break; if(Key('<')) // we ignore < > as operators, always consider them template bracket tlevel++; @@ -1232,7 +1232,7 @@ CppItem& Parser::Item(const String& scope, const String& using_namespace, const void Parser::Resume(int bl) { for(;;) { - if(lex == t_eof || lex.GetBracesLevel() == bl && lex == ';') + if(lex == t_eof || (lex.GetBracesLevel() == bl && lex == ';')) break; ++lex; } @@ -1581,7 +1581,7 @@ void Parser::Do() } else if(Key(tk_template)) { - if(lex.IsId() || lex == tk_class && lex.IsId(1)) { + if(lex.IsId() || (lex == tk_class && lex.IsId(1))) { Key(tk_class); for(;;) { if(lex.IsId()) ---------------------------- uppsrc/CppBase/Pre.cpp ---------------------------- index e78ada2d1..f465440ab 100644 @@ -36,7 +36,7 @@ SrcFile PreProcess(Stream& in, Parser& parser) // This is not really C preproces const char *s = ln; bool islbl = false; bool wassemi = false; - while(*s && iscid(*s) || findarg(*s, '\t', ' ', ':') >= 0) { // check for label, labeled lines are not grounded + while((*s && iscid(*s)) || findarg(*s, '\t', ' ', ':') >= 0) { // check for label, labeled lines are not grounded if(*s == ':' && !wassemi) { islbl = true; wassemi = true; // second ':' cancels label -------------------------- uppsrc/CppBase/ppfile.cpp -------------------------- index fc5e6fd12..eac26e5eb 100644 @@ -92,7 +92,7 @@ PPMacro *FindPPMacro(const String& id, Index<int>& segment_id, int& segmenti) else if(pass == 0 || m.segment_id == 0 || undef.Find(m.undef_segment_id) < 0) { int si = m.segment_id == 0 ? INT_MAX : segment_id.Find(m.segment_id); // defs macros always override - if(si > best || si >= 0 && si == best && m.line > line) { + if(si > best || (si >= 0 && si == best && m.line > line)) { best = si; line = m.line; r = &m; ---------------------------- uppsrc/CtrlCore/Gtk.h ---------------------------- index 281464c20..08ed036be 100644 @@ -9,8 +9,16 @@ #pragma clang diagnostic ignored "-Wdeprecated" #endif +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wparentheses" +#endif #include <gtk/gtk.h> #include <gdk/gdkkeysyms.h> +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + #ifdef __clang__ #pragma clang diagnostic pop -------------------------- uppsrc/CtrlCore/GtkTop.cpp -------------------------- index 9e1c94d5a..d56b6b430 100644 @@ -68,7 +68,7 @@ void TopWindow::CenterRect(Ctrl *owner) { GuiLock __; SetupRect(owner); - if(owner && center == 1 || center == 2) { + if((owner && center == 1) || center == 2) { Size sz = GetRect().Size(); Rect r, wr; wr = Ctrl::GetWorkArea(); ------------------------- uppsrc/CtrlCore/GtkUtil.cpp ------------------------- index 415a6c422..051bd7650 100644 @@ -17,8 +17,8 @@ String ImageClipFromPixbufUnref(GdkPixbuf *pixbuf) Image img; if(pixbuf) { int chn = gdk_pixbuf_get_n_channels(pixbuf); - if((chn == 3 && !gdk_pixbuf_get_has_alpha(pixbuf) || - chn == 4 && gdk_pixbuf_get_has_alpha(pixbuf)) && + if(((chn == 3 && !gdk_pixbuf_get_has_alpha(pixbuf)) || + (chn == 4 && gdk_pixbuf_get_has_alpha(pixbuf))) && gdk_pixbuf_get_colorspace(pixbuf) == GDK_COLORSPACE_RGB && gdk_pixbuf_get_bits_per_sample(pixbuf) == 8) { Size sz(gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height(pixbuf)); ------------------------- uppsrc/CtrlCore/ParseRTF.cpp ------------------------- index c4208bcd6..4a21a4529 100644 @@ -223,7 +223,7 @@ RTFParser::RTFParser(const char *rtf) RichText RTFParser::Run() { - if(!PassGroup() || !PassCmd("rtf") || command_arg != 1 && !IsNull(command_arg)) + if(!PassGroup() || !PassCmd("rtf") || (command_arg != 1 && !IsNull(command_arg))) return pick(output); while(Token() != T_EOF) ReadItem(); @@ -307,7 +307,7 @@ void RTFParser::FlushTable(int level) int& out_wd = (outer_border[b] ? tbl_border : tbl_grid); Color& out_co = (outer_border[b] ? clr_border : clr_grid); if(IsNull(cell.info.format.bordercolor) || border_width[b] <= 0 - || !IsNull(out_co) && out_co != cell.info.format.bordercolor) + || (!IsNull(out_co) && out_co != cell.info.format.bordercolor)) out_wd = 0; else if(IsNull(out_wd) || border_width[b] < out_wd) { out_wd = border_width[b]; @@ -469,7 +469,7 @@ RTFParser::TOKEN RTFParser::Fetch() } default: { - if(IsAlpha(*--rtf) || *rtf == '*' && rtf[1] == '\\' && IsAlpha(rtf[2])) { + if(IsAlpha(*--rtf) || (*rtf == '*' && rtf[1] == '\\' && IsAlpha(rtf[2]))) { if(*rtf == '*') { rtf += 2; state.new_dest = true; @@ -541,7 +541,7 @@ bool RTFParser::PassEndGroup(int level) void RTFParser::Skip() { LLOG("Skip"); - bool is_group = (token == T_GROUP || token == T_COMMAND && state.new_dest); + bool is_group = (token == T_GROUP || (token == T_COMMAND && state.new_dest)); is_full = false; if(is_group) SkipGroup(); ------------------------- uppsrc/CtrlLib/ArrayCtrl.cpp ------------------------- index b58f6a742..bc049e412 100644 @@ -856,7 +856,7 @@ const Display& ArrayCtrl::GetCellInfo(int i, int j, bool f0, bg = array[i].paper; fg = i & 1 ? evenink : oddink; if((st & Display::SELECT) || - !multiselect && (st & Display::CURSOR) && !nocursor || + (!multiselect && (st & Display::CURSOR) && !nocursor) || drop) { fg = hasfocus ? SColorHighlightText : SColorText; bg = hasfocus ? SColorHighlight : Blend(SColorDisabled, SColorPaper); @@ -897,7 +897,7 @@ Size ArrayCtrl::DoPaint(Draw& w, bool sample) { int sy = 0; if(!IsNull(i)) while(i < GetCount()) { - if((!sample || i == cursor || i < array.GetCount() && array[i].select) && IsLineVisible(i)) { + if((!sample || i == cursor || ((i < array.GetCount() && array[i].select) && IsLineVisible(i)))) { r.top = sample ? sy : GetLineY(i) - sb; if(r.top > size.cy) break; @@ -922,7 +922,7 @@ Size ArrayCtrl::DoPaint(Draw& w, bool sample) { if(spanwidecells) SpanWideCell(d, q, cm, cw, r, i, j); - if(cw < 2 * cm || editmode && i == cursor && column[jj].edit) + if(cw < 2 * cm || (editmode && i == cursor && column[jj].edit)) d.PaintBackground(w, r, q, fg, bg, st); else { d.PaintBackground(w, RectC(r.left, r.top, cm, r.Height()), q, fg, bg, st); @@ -2299,7 +2299,7 @@ String ArrayCtrl::RowFormat(const char *s) bool ArrayCtrl::DoRemove() { if(IsReadOnly()) return false; - if(!IsCursor() || askremove && !PromptOKCancel(RowFormat(t_("Do you really want to delete the selected %s ?")))) + if(!IsCursor() || (askremove && !PromptOKCancel(RowFormat(t_("Do you really want to delete the selected %s ?"))))) return false; if(multiselect) { Bits sel; ---------------------------- uppsrc/CtrlLib/Bar.cpp ---------------------------- index 0dda29380..89cff51e9 100644 @@ -680,7 +680,7 @@ void BarCtrl::Layout() { LLOG("BarCtrl::Layout"); if(IsChild()) { - bool dowrap = InFrame() && wrap >= 0 || wrap > 0; + bool dowrap = (InFrame() && wrap >= 0) || wrap > 0; if(GetAlign() == BAR_LEFT || GetAlign() == BAR_RIGHT) pane.Repos(false, dowrap ? GetSize().cy : INT_MAX); else -------------------------- uppsrc/CtrlLib/Button.cpp -------------------------- index df4407d05..a077524df 100644 @@ -396,8 +396,8 @@ bool Button::HotKey(dword key) { } bool up = key & K_KEYUP; key = key & ~K_KEYUP; - if(key == K_ENTER && (type == OK || type == EXIT) || - key == K_ESCAPE && (type == CANCEL || type == EXIT)) { + if((key == K_ENTER && (type == OK || type == EXIT)) || + (key == K_ESCAPE && (type == CANCEL || type == EXIT))) { if(up) { if(IsKeyPush()) return FinishPush(); ------------------------ uppsrc/CtrlLib/ColumnList.cpp ------------------------ index 7ffc43820..e6960b2e0 100644 @@ -370,7 +370,7 @@ void ColumnList::GetItemStyle(int i, Color& fg, Color& bg, dword& st) if(nobg) bg = Null; if((st & Display::SELECT) || - (!multi || !item[i].canselect && selcount == 0) && (st & Display::CURSOR) || + ((!multi || (!item[i].canselect && selcount == 0)) && (st & Display::CURSOR)) || drop) { fg = hasfocus ? SColorHighlightText : SColorText; bg = hasfocus ? SColorHighlight : Blend(SColorDisabled, SColorPaper); @@ -908,7 +908,7 @@ void ColumnList::DragAndDrop(Point p, PasteClip& d) if(DnDInsert(i, p.y, d, 2)) return; } - if(GetCount() == 0 && p.y < 4 || !WhenDrop) { + if((GetCount() == 0 && p.y < 4) || !WhenDrop) { WhenDropInsert(GetCount(), d); if(d.IsAccepted()) { DnD(GetCount(), true); ----------------------- uppsrc/CtrlLib/DateTimeCtrl.cpp ----------------------- index b94f32e45..dca9cd5f0 100644 @@ -902,8 +902,8 @@ void Clock::Paint(Draw& w) int Clock::GetDir(int pp, int cp) { dir = 0; - if(cp >= 1 && cp <= 30 && pp >= 1 && pp <= 30 || - cp > 30 && cp <= 60 && pp > 30 && pp <= 60) + if((cp >= 1 && cp <= 30 && pp >= 1 && pp <= 30) || + (cp > 30 && cp <= 60 && pp > 30 && pp <= 60)) { dir = pp < cp ? 1 : -1; } ----------------------- uppsrc/CtrlLib/DisplayPopup.cpp ----------------------- index f1c65e7a4..9f4fd27ef 100644 @@ -186,7 +186,7 @@ bool DisplayPopup::IsOpen() bool DisplayPopup::HasMouse() { - return Ctrl::HasMouse() || ctrl && ctrl->HasMouse(); + return Ctrl::HasMouse() || (ctrl && ctrl->HasMouse()); } void DisplayPopup::Set(Ctrl *_ctrl, const Rect& _item, -------------------------- uppsrc/CtrlLib/DocEdit.cpp -------------------------- index 13d2fea2a..5edb9b40a 100644 @@ -438,7 +438,7 @@ bool DocEdit::Key(dword key, int cnt) default: if(filter && key >= 32 && key < 65535) key = (*filter)(key); - if(key >= ' ' && key < 65536 || key == '\n' || key == '\t' || key == K_SHIFT_SPACE) { + if((key >= ' ' && key < 65536) || key == '\n' || key == '\t' || key == K_SHIFT_SPACE) { if(key == K_TAB && !processtab) return false; if(key >= 128 && key < 65536 && (charset != CHARSET_UNICODE && charset != CHARSET_UTF8_BOM) ------------------------ uppsrc/CtrlLib/DropChoice.cpp ------------------------ index 9458e3f87..12b22dd15 100644 @@ -36,7 +36,7 @@ void DropChoice::PseudoPush() } void DropChoice::Drop() { - if(!owner || owner->IsReadOnly() && !rodrop || list.GetCount() == 0 && !WhenDrop) return; + if(!owner || (owner->IsReadOnly() && !rodrop) || (list.GetCount() == 0 && !WhenDrop)) return; WhenDrop(); if(dropfocus) owner->SetWantFocus(); @@ -46,12 +46,12 @@ void DropChoice::Drop() { } void DropChoice::Select() { - if(!owner || owner->IsReadOnly() && !rodrop) return; + if(!owner || (owner->IsReadOnly() && !rodrop)) return; WhenSelect(); } Value DropChoice::Get() const { - if(!owner || owner->IsReadOnly() && !rodrop) return Value(); + if(!owner || (owner->IsReadOnly() && !rodrop)) return Value(); int c = list.GetCursor(); if(c < 0) return Value(); return list.Get(c, 0); @@ -59,7 +59,7 @@ Value DropChoice::Get() const { int DropChoice::GetIndex() const { - if(!owner || owner->IsReadOnly() && !rodrop) return -1; + if(!owner || (owner->IsReadOnly() && !rodrop)) return -1; return list.GetCursor(); } ------------------------- uppsrc/CtrlLib/EditField.cpp ------------------------- index a62ac67b5..e68ef15ec 100644 @@ -274,7 +274,7 @@ Color EditField::GetPaper() : style->disabled; if(nobg) paper = Null; - if(enabled && (convert && convert->Scan(text).IsError() || errorbg)) + if(enabled && ((convert && convert->Scan(text).IsError()) || errorbg)) paper = style->invalid; return paper; } @@ -941,7 +941,7 @@ bool EditField::Key(dword key, int rep) } return false; default: - if(key >= ' ' && key < 65536 || key == K_SHIFT_SPACE) { + if((key >= ' ' && key < 65536) || key == K_SHIFT_SPACE) { if(!RemoveSelection()) SaveUndo(); while(rep--) Insert(key == K_SHIFT_SPACE ? ' ' : key); -------------------------- uppsrc/CtrlLib/FileSel.cpp -------------------------- index c1e2b4112..44a968918 100644 @@ -909,7 +909,7 @@ void FileSel::SearchLoad() list.Renaming(true); } if(filesystem->IsPosix()) - if(d == "/" || !IsEmpty(basedir) && String(~dir).IsEmpty()) + if(d == "/" || (!IsEmpty(basedir) && String(~dir).IsEmpty())) dirup.Disable(); if(filesystem->IsWin32()) if(!IsEmpty(basedir) && String(~dir).IsEmpty()) @@ -1282,8 +1282,8 @@ void FileSel::Open() { } if(!IsFullPath(fn)) fn = AppendFileName(~dir, fn); - if(filesystem->IsWin32() && (!fn.IsEmpty() && (*fn.Last() == '\\' || *fn.Last() == '/')) - || filesystem->IsPosix() && (fn != "/" && (*fn.Last() == '\\' || *fn.Last() == '/'))) + if((filesystem->IsWin32() && (!fn.IsEmpty() && (*fn.Last() == '\\' || *fn.Last() == '/'))) + || (filesystem->IsPosix() && (fn != "/" && (*fn.Last() == '\\' || *fn.Last() == '/')))) { fn.Trim(fn.GetLength() - 1); SetDir(TrimDot(fn)); @@ -1625,7 +1625,7 @@ void FileSel::FileUpdate() { } bool b = list.IsCursor() || !String(~file).IsEmpty(); ok.Enable(b); - if(mode != SAVEAS || list.IsCursor() && list[list.GetCursor()].isdir) + if(mode != SAVEAS || (list.IsCursor() && list[list.GetCursor()].isdir)) ok.SetLabel(t_("Open")); else ok.SetLabel(t_("Save")); @@ -1993,8 +1993,8 @@ bool FileSel::Execute(int _mode) { type.Trim(dlc); String d = ~dir; - if(filesystem->IsWin32() && d.GetLength() == 3 && d[1] == ':' || - filesystem->IsPosix() && d == "/" || + if((filesystem->IsWin32() && d.GetLength() == 3 && d[1] == ':') || + (filesystem->IsPosix() && d == "/") || !IsFullPath(d)) d.Clear(); ------------------------- uppsrc/CtrlLib/LabelBase.cpp ------------------------- index 197ccee4d..89b57dd73 100644 @@ -80,7 +80,7 @@ int ExtractAccessKey(const char *s, String& label) String text; bool qtf = *s == '\1'; while(*s) - if((*s == '&' && !qtf || *s == '\b') && s[1] && s[1] != '&') { + if(((*s == '&' && !qtf) || *s == '\b') && s[1] && s[1] != '&') { akey = ToAscii(ToUpper(s[1])); pos = text.GetLength() + 1; s++; ------------------------- uppsrc/CtrlLib/LineEdit.cpp ------------------------- index 3017d7b96..87d1232e5 100644 @@ -411,7 +411,7 @@ void LineEdit::Paint0(Draw& w) { int cursorline = GetLine(cursor); Highlight ih; ih.ink = color[IsShowEnabled() ? INK_NORMAL : INK_DISABLED]; - ih.paper = color[IsReadOnly() && showreadonly || !IsShowEnabled() ? PAPER_READONLY : PAPER_NORMAL]; + ih.paper = color[(IsReadOnly() && showreadonly) || !IsShowEnabled() ? PAPER_READONLY : PAPER_NORMAL]; if(nobg) ih.paper = Null; ih.font = font; @@ -609,7 +609,7 @@ void LineEdit::Paint0(Draw& w) { selh -= len + 1; pos += len + 1; } - w.DrawRect(0, y, sz.cx, sz.cy - y, color[IsReadOnly() && showreadonly || !IsShowEnabled() ? PAPER_READONLY : PAPER_NORMAL]); + w.DrawRect(0, y, sz.cx, sz.cy - y, color[(IsReadOnly() && showreadonly) || !IsShowEnabled() ? PAPER_READONLY : PAPER_NORMAL]); DrawTiles(w, DropCaret(), CtrlImg::checkers()); vlinex = caretpos.x; } @@ -1010,8 +1010,8 @@ bool LineEdit::InsertChar(dword key, int count, bool canow) { return false; if(filter && key >= 32 && key < 65535) key = (*filter)(key); - if(!IsReadOnly() && (key >= 32 && key < 65536 || key == '\t' || key == '\n' || - key == K_ENTER && processenter || key == K_SHIFT_SPACE)) { + if(!IsReadOnly() && ((key >= 32 && key < 65536) || key == '\t' || key == '\n' || + (key == K_ENTER && processenter) || key == K_SHIFT_SPACE)) { if(key >= 128 && key < 65536 && (charset != CHARSET_UNICODE && charset != CHARSET_UTF8_BOM) && FromUnicode((wchar)key, charset) == DEFAULTCHAR) return true; -------------------------- uppsrc/CtrlLib/MenuBar.cpp -------------------------- index f82fc3d4c..efb43ecd8 100644 @@ -368,7 +368,7 @@ bool MenuBar::Key(dword key, int count) if(IterateFocusBackward(pane.GetLastChild(), &pane, false, true)) return true; } else - if(parentmenu && !parentmenu->IsChild() && key == K_LEFT || key == K_ESCAPE) { + if((parentmenu && !parentmenu->IsChild() && key == K_LEFT) || key == K_ESCAPE) { if(HasMouseDeep()) GetMouseCtrl()->Refresh(); if(parentmenu && parentmenu->submenu) @@ -449,7 +449,7 @@ bool MenuBar::HotKey(dword key) s_doaltkey = true; return true; } - if((key == K_F10 || key == (K_ALT_KEY|K_KEYUP) && s_doaltkey) + if((key == K_F10 || (key == (K_ALT_KEY|K_KEYUP) && s_doaltkey)) && !submenu && !HasFocusDeep() && GetTopWindow() && GetTopWindow()->IsForeground()) { LLOG("Open menu by F10 or ALT-UP"); SetupRestoreFocus(); ------------------------- uppsrc/CtrlLib/MenuItem.cpp ------------------------- index b4be0b8d8..bbfdf38bd 100644 @@ -266,7 +266,7 @@ void MenuItem::LostFocus() int MenuItem::GetVisualState() { return HasFocus() ? - (HasMouse() && GetMouseLeft() || GetMouseRight()) ? PUSH : HIGHLIGHT : NORMAL; + ((HasMouse() && GetMouseLeft()) || GetMouseRight()) ? PUSH : HIGHLIGHT : NORMAL; } void MenuItem::SyncState() @@ -395,7 +395,7 @@ void MenuItem::RightUp(Point p, dword w) bool MenuItem::HotKey(dword key) { if(isenabled && (key == accel || CompareAccessKey(accesskey, key) - || key < 256 && IsAlNum((char)key) && CompareAccessKey(accesskey, ToUpper((char)key) + K_DELTA + K_ALT))) { + || (key < 256 && IsAlNum((char)key) && CompareAccessKey(accesskey, ToUpper((char)key) + K_DELTA + K_ALT)))) { LLOG("MenuItem::HotKey(" << key << ") -> SetFocus"); SetFocus(); Sync(); @@ -517,8 +517,8 @@ Size TopSubMenuItem::GetMinSize() const int TopSubMenuItem::GetState() { if(parentmenu && parentmenu->GetActiveSubmenu() == &menu) return PUSH; - if(HasMouse() && GetParent() && !GetParent()->HasFocusDeep() && - (!parentmenu || !parentmenu->GetActiveSubmenu() || parentmenu->GetActiveSubmenu() == &menu) + if((HasMouse() && GetParent() && !GetParent()->HasFocusDeep() && + (!parentmenu || !parentmenu->GetActiveSubmenu() || parentmenu->GetActiveSubmenu() == &menu)) || HasFocus()) return HIGHLIGHT; return NORMAL; @@ -609,7 +609,7 @@ void TopSubMenuItem::SyncState() int TopMenuItem::GetState() { if(!IsEnabled()) return NORMAL; - if(HasMouse() && GetMouseLeft() || GetMouseRight()) return PUSH; + if((HasMouse() && GetMouseLeft()) || GetMouseRight()) return PUSH; if(HasFocus() || HasMouse()) return HIGHLIGHT; return NORMAL; } ------------------------ uppsrc/CtrlLib/MultiButton.cpp ------------------------ index 0bfe7f7dd..2173d0337 100644 @@ -286,13 +286,13 @@ int MultiButton::ChState(int i) if(i == MAIN && frm && style->activeedge) { int q = 0; if(p) - q = !p->IsEnabled() || !IsEnabled() || p->IsReadOnly() || i >= 0 && !button[i].enabled ? CTRL_DISABLED + q = !p->IsEnabled() || !IsEnabled() || p->IsReadOnly() || (i >= 0 && !button[i].enabled) ? CTRL_DISABLED : p->HasFocus() || push ? CTRL_PRESSED : p->HasMouse() || hl >= 0 ? CTRL_HOT : CTRL_NORMAL; return q; } - if(!IsShowEnabled() || IsReadOnly() || frm && p && p->IsReadOnly() || i >= 0 && !button[i].enabled) + if(!IsShowEnabled() || IsReadOnly() || (frm && p && p->IsReadOnly()) || (i >= 0 && !button[i].enabled)) return CTRL_DISABLED; if(IsTrivial() && !frm) i = 0; ----------------------- uppsrc/CtrlLib/RichTextView.cpp ----------------------- index 3b2c0d482..e4d80ac8d 100644 @@ -188,7 +188,7 @@ void RichTextView::RefreshSel() { int l = minmax(min(cursor, anchor), 0, text.GetLength()); int h = minmax(max(cursor, anchor), 0, text.GetLength()); - if(sell == l && selh == h || sell == selh && l == h) + if((sell == l && selh == h) || (sell == selh && l == h)) return; RichPos pl = text.GetRichPos(l); RichPos ph = text.GetRichPos(h); ------------------------ uppsrc/CtrlLib/SuggestCtrl.cpp ------------------------ index fab48acf3..a8047aad9 100644 @@ -89,7 +89,7 @@ bool SuggestCtrl::Key(dword key, int count) if(cc) key = cc; if(EditString::Key(key, count)) { - if(key >= 32 && key < 65536 || key == K_BACKSPACE || key == K_CTRL_SPACE) { + if((key >= 32 && key < 65536) || key == K_BACKSPACE || key == K_CTRL_SPACE) { int h; WString x = CF(ReadLast(h)); list.Clear(); -------------------------- uppsrc/CtrlLib/Switch.cpp -------------------------- index b7e59cdda..e4fa3f9dc 100644 @@ -217,7 +217,7 @@ void Switch::Paint(Draw& w) { DrawSmartText(w, x + isz.cx + DPI(4), y + ty, sz.cx, v.label, font, dv || IsReadOnly() ? SColorDisabled : GetLabelTextColor(this), /////// VisibleAccessKeys() ? v.accesskey : 0); - if(HasFocus() && (pushindex == i || v.value == value && pushindex < 0)) + if(HasFocus() && (pushindex == i || (v.value == value && pushindex < 0))) DrawFocus(w, RectC(x + isz.cx + DPI(2), y + ty - DPI(1), tsz.cx + DPI(3), tsz.cy + DPI(2)) & sz); } v.rect = hr; -------------------------- uppsrc/CtrlLib/ToolTip.cpp -------------------------- index 8c82fc164..00ca2c60b 100644 @@ -93,7 +93,7 @@ void SyncToolTip(Ctrl *ctrl) { if(!GUI_ToolTips()) return; - if(ctrl != tipctrl || ctrl && ctrl->GetTip() != AppToolTip().Get()) { + if(ctrl != tipctrl || (ctrl && ctrl->GetTip() != AppToolTip().Get())) { LLOG("ToolTipHook / ctrl change " << UPP::Name(ctrl) << " -> " << UPP::Name(ctrl)); tipctrl = ctrl; KillTimeCallback((void *)SyncToolTip); ------------------------- uppsrc/CtrlLib/TreeCtrl.cpp ------------------------- index bae192b99..4e38ca752 100644 @@ -803,7 +803,7 @@ bool TreeCtrl::IsSel(int id) const bool TreeCtrl::IsSelDeep(int id) const { - return IsSel(id) || id && IsSelDeep(GetParent(id)); + return IsSel(id) || (id && IsSelDeep(GetParent(id))); } void TreeCtrl::SelectOne0(int id, bool sel, bool cb) @@ -1073,7 +1073,7 @@ const Display *TreeCtrl::GetStyle(int i, Color& fg, Color& bg, dword& st) if(hasfocus) st |= Display::FOCUS; if((st & Display::SELECT) || - !multiselect && (st & Display::CURSOR) && !nocursor || + (!multiselect && (st & Display::CURSOR) && !nocursor) || drop) { fg = hasfocus ? SColorHighlightText : SColorText; bg = hasfocus ? SColorHighlight : Blend(SColorDisabled, SColorPaper); @@ -1156,7 +1156,7 @@ void TreeCtrl::Paint(Draw& w) const Display *d = GetStyle(i, fg, bg, st); int ctx = highlight_ctrl * csz.cx; Rect br = RectC(x, y, vsz.cx + 2 * m.margin + ctx, msz.cy); - if(!IsNull(m.value) || m.ctrl && highlight_ctrl) { + if(!IsNull(m.value) || (m.ctrl && highlight_ctrl)) { w.DrawRect(br, bg); Rect r = RectC(x + ctx + m.margin, y + (msz.cy - vsz.cy) / 2, vsz.cx, vsz.cy); w.Clip(r); @@ -1871,7 +1871,7 @@ void OptionTree::SetOption(int id) } opt = option[id]; if(opt) { - if(t && f || n) { + if((t && f) || n) { opt->Set(Null); } else ----------------------------- uppsrc/Draw/Font.cpp ----------------------------- index 19d91f89d..8cad5d592 100644 @@ -90,7 +90,7 @@ void Font::SetFace(int index, const String& name) int FontFilter(int c) { - return c >= 'a' && c <= 'z' || c >= '0' && c <= '9' ? c : c >= 'A' && c <= 'Z' ? ToLower(c) : 0; + return (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9' ? c : c >= 'A' && c <= 'Z' ? ToLower(c) : 0); } int Font::FindFaceNameIndex(const String& name) { ---------------------------- uppsrc/Draw/Image.cpp ---------------------------- index 63a1f8478..bb44cc61f 100644 @@ -274,12 +274,12 @@ bool Image::operator==(const Image& img) const { static_assert(sizeof(RGBA) == 4, "sizeof(RGBA)"); return IsSame(img) || - GetSize() == img.GetSize() && + (GetSize() == img.GetSize() && GetHotSpot() == img.GetHotSpot() && Get2ndSpot() == img.Get2ndSpot() && GetDots() == img.GetDots() && GetResolution() == img.GetResolution() && - memeq32(~*this, ~img, GetLength()); + memeq32(~*this, ~img, GetLength())); } bool Image::operator!=(const Image& img) const ------------------------------ uppsrc/Esc/Esc.cpp ------------------------------ index 829d5c7aa..d3b08a43a 100644 @@ -169,7 +169,7 @@ EscValue Esc::ExecuteLambda(const String& id, EscValue lambda, SRVal self, Vecto if(!lambda.IsLambda()) ThrowError(Format("'%s' is not a lambda", id)); const EscLambda& l = lambda.GetLambda(); - if(!l.varargs && arg.GetCount() > l.arg.GetCount() + if((!l.varargs && arg.GetCount() > l.arg.GetCount()) || arg.GetCount() < l.arg.GetCount() - l.def.GetCount()) ThrowError("invalid number of arguments in call to '" + id + "'"); Esc sub(global, l.code, op_limit, l.filename, l.line); -------------------------- uppsrc/Painter/OnPath.cpp -------------------------- index b94a2aab8..df3645320 100644 @@ -13,7 +13,7 @@ void BufferPainter::BeginOnPathOp(double q, bool abs) Pointf pos(0, 0); for(int i = 0; i < onpath.GetCount(); i++) { PathLine& l = onpath[i]; - if(l.len > 0 && (l.len > q || q >= 1.0 && i == onpath.GetCount() - 1)) { + if(l.len > 0 && (l.len > q || (q >= 1.0 && i == onpath.GetCount() - 1))) { Pointf v = l.p - pos; Translate(q / l.len * v + pos); Rotate(Bearing(v)); ---------------------- uppsrc/Painter/RadialGradient.cpp ---------------------- index 9a9ed8f1d..5794afa82 100644 @@ -46,7 +46,7 @@ struct PainterRadialSpan : SpanSource { h = h & 2047; else if(style == GRADIENT_REFLECT) - h = (h & 2048) ? (2047 - h & 2047) : (h & 2047); + h = (h & 2048) ? (2047 - (h & 2047)) : (h & 2047); else h = minmax(h, 0, 2047); *span++ = gradient[h]; -------------------------- uppsrc/Painter/Render.cpp -------------------------- index 7205edf9d..8e0872655 100644 @@ -147,7 +147,7 @@ Buffer<ClippingLine> BufferPainter::RenderPath(double width, Event<One<SpanSourc current = Null; - if(width == 0 || !ss && color.a == 0 && width >= FILL) + if(width == 0 || (!ss && color.a == 0 && width >= FILL)) return newclip; if(pathattr.mtx_serial != preclip_mtx_serial) { -------------------------- uppsrc/Painter/Stroker.cpp -------------------------- index 317d67090..f7a654c53 100644 @@ -41,10 +41,10 @@ void Stroker::Round(const Pointf& p, const Pointf& v1, const Pointf& v2, double inline bool Stroker::PreClipped(Pointf p2, Pointf p3) { - return p2.x + tw < preclip.left && p3.x + tw < preclip.left || - p2.x - tw > preclip.right && p3.x - tw > preclip.right || - p2.y + tw < preclip.top && p3.y + tw < preclip.top || - p2.y - tw > preclip.bottom && p3.y - tw > preclip.bottom; + return (p2.x + tw < preclip.left && p3.x + tw < preclip.left) || + (p2.x - tw > preclip.right && p3.x - tw > preclip.right) || + (p2.y + tw < preclip.top && p3.y + tw < preclip.top) || + (p2.y - tw > preclip.bottom && p3.y - tw > preclip.bottom); } void Stroker::Line(const Pointf& p3) ------------------------- uppsrc/Painter/SvgParser.cpp ------------------------- index 61fcbc380..84ba2f614 100644 @@ -449,7 +449,7 @@ void SvgParser::Element(const XmlNode& n, int depth, bool dosymbols) FinishElement(); } else - if(n.IsTag("g") || n.IsTag("symbol") && dosymbols) + if(n.IsTag("g") || (n.IsTag("symbol") && dosymbols)) Items(n, depth); else if(n.IsTag("use")) { --------------------------- uppsrc/RichEdit/Clip.cpp --------------------------- index 5d943aa7e..6da88b655 100644 @@ -38,7 +38,7 @@ bool RichEdit::Accept(PasteClip& d, RichText& clip, String& fmt) if(d.Accept() && GetFileLength(fn) < 17000000) { String data = LoadFile(fn); StringStream ss(data); - if(StreamRaster::OpenAny(ss) || ext == ".svg" && IsSVG(LoadFile(fn))) { + if(StreamRaster::OpenAny(ss) || (ext == ".svg" && IsSVG(LoadFile(fn)))) { RichPara p; p.Cat(CreateRawImageObject(data), formatinfo); clip.Cat(p); -------------------------- uppsrc/RichEdit/Editor.cpp -------------------------- index 30ba8cff4..2e9484b05 100644 @@ -328,7 +328,7 @@ int RichEdit::GetNearestPos(int x, PageY py) String dummy; RichPos p = text.GetRichPos(c); if(c >= text.GetLength() - 1 || c < 0 || p.object || p.field - || p.table && (p.posincell == 0 || p.posincell == p.celllen)) + || (p.table && (p.posincell == 0 || p.posincell == p.celllen))) return c; Rect r1 = text.GetCaret(c, pagesz); Rect r2 = text.GetCaret(c + 1, pagesz); --------------------------- uppsrc/RichEdit/Find.cpp --------------------------- index 739af1971..06c2ceefb 100644 @@ -45,8 +45,8 @@ struct RichFindIterator : RichText::Iterator { q += cursor - pos; while(q <= e) { if(compare3(q, upperw, lowerw, len) && - (!ww || (q + len == e || !IsLetter(q[len])) && - (q == ptext || !IsLetter(q[-1])))) { + (!ww || ((q + len == e || !IsLetter(q[len])) && + (q == ptext || !IsLetter(q[-1]))))) { fpos = int(q - ~ptext + pos); return true; } --------------------------- uppsrc/RichEdit/Kbd.cpp --------------------------- index 5022551fc..af687930a 100644 @@ -184,7 +184,7 @@ bool RichEdit::Key(dword key, int count) } if(key == K_SHIFT_SPACE) key = ' '; - if(key == 9 || key >= 32 && key < 65536) { + if(key == 9 || (key >= 32 && key < 65536)) { RichPara::Format f; if(IsSelection()) { f = text.GetRichPos(min(cursor, anchor)).format; ------------------------- uppsrc/RichEdit/Speller.cpp ------------------------- index b52898ec1..037626ad1 100644 @@ -36,7 +36,7 @@ Bits RichEdit::SpellParagraph(const RichPara& para) while(s < end) { if(IsLetter(*s)) { const wchar *q = s; - while(s < end && IsLetter(*s) || s + 1 < end && *s == '\'' && IsLetter(s[1])) + while((s < end && IsLetter(*s)) || (s + 1 < end && *s == '\'' && IsLetter(s[1]))) s++; if(!SpellWord(q, int(s - q), lang[q - text])) e.SetN(int(q - text), int(s - q)); -------------------------- uppsrc/RichEdit/Table.cpp -------------------------- index 92eeebe3a..d39cf48cc 100644 @@ -323,7 +323,7 @@ void RichEdit::SplitCell() void RichEdit::CellProperties() { - if(!(tablesel || cursorp.table && !IsSelection())) + if(!(tablesel || (cursorp.table && !IsSelection()))) return; WithCellPropertiesLayout<TopWindow> dlg; CtrlLayoutOKCancel(dlg, t_("Cell properties")); --------------------------- uppsrc/RichEdit/Tool.cpp --------------------------- index 458c3507e..d568d235d 100644 @@ -297,7 +297,7 @@ void RichEdit::RedoTool(Bar& bar, dword key) void RichEdit::CutTool(Bar& bar, dword key) { - bar.Add(!IsReadOnly() && IsSelection() || objectpos >= 0, t_("Cut"), CtrlImg::cut(), USERBACK(Cut)) + bar.Add((!IsReadOnly() && IsSelection()) || objectpos >= 0, t_("Cut"), CtrlImg::cut(), USERBACK(Cut)) .Key(K_SHIFT_DELETE) .Key(key); } ------------------------- uppsrc/RichText/ParaType.cpp ------------------------- index 45db631fa..4ccb6bf5f 100644 @@ -317,9 +317,9 @@ RichPara::Lines RichPara::FormatLines(int acx) const t = GetNextTab(cx + format.lm, rcx); space = NULL; } - if(cx + *w > rcx && s > text || - *s == '\t' && (t.align == ALIGN_RIGHT ? t.pos - format.lm > rcx - : t.pos - format.lm >= rcx)) { + if((cx + *w > rcx && s > text) || + (*s == '\t' && (t.align == ALIGN_RIGHT ? t.pos - format.lm > rcx + : t.pos - format.lm >= rcx))) { Line& l = lines.line.Add(); l.withtabs = withtabs; l.pos = (int)(text - lines.text); ------------------------- uppsrc/RichText/ParseQtf.cpp ------------------------- index 866144131..59fe1ae2d 100644 @@ -325,11 +325,11 @@ void RichQtfParser::ReadObject() StringBuffer data; for(;;) { while(*term < 32 && *term > 0) term++; - if((byte)*term >= ' ' && (byte)*term <= 127 || *term == '\0') break; + if(((byte)*term >= ' ' && (byte)*term <= 127) || *term == '\0') break; byte seven = *term++; for(int i = 0; i < 7; i++) { while((byte)*term < 32 && (byte)*term > 0) term++; - if((byte)*term >= ' ' && (byte)*term <= 127 || *term == '\0') break; + if(((byte)*term >= ' ' && (byte)*term <= 127) || *term == '\0') break; data.Cat((*term++ & 0x7f) | ((seven << 7) & 0x80)); seven >>= 1; } ------------------------- uppsrc/RichText/TxtData.cpp ------------------------- index cb5e9bd9a..579c30630 100644 @@ -203,7 +203,7 @@ RichPara RichTxt::Get(int i, const RichStyles& s) const bool RichTxt::IsEmpty() const { - return part.IsEmpty() || part.GetCount() == 1 && ComputeLength() == 0; + return part.IsEmpty() || (part.GetCount() == 1 && ComputeLength() == 0); } int RichTxt::ComputeLength() const ------------------------- uppsrc/RichText/TxtPaint.cpp ------------------------- index 123c6de37..b002d1715 100644 @@ -100,7 +100,7 @@ void RichTxt::Advance(int parti, RichContext& rc, RichContext& begin) const } if(pp.newhdrftr && rc.text == this) rc.HeaderFooter(~pp.header, ~pp.footer); - if(pp.newpage || rc.py.y + cy + nbefore + nline > rc.page.bottom && cy < rc.page.Height()) + if(pp.newpage || (rc.py.y + cy + nbefore + nline > rc.page.bottom && cy < rc.page.Height())) rc.Page(); begin = rc; rc.py.y += pp.before + pp.ruler; --------------------------- uppsrc/TabBar/TabBar.cpp --------------------------- index 0295ae22a..6f9fbe37c 100644 @@ -2279,7 +2279,7 @@ bool TabBar::ProcessMouse(int i, const Point& p) if (stacking && ProcessStackMouse(i, p)) return true; bool iscross = crosses && !IsCancelClose(i) ? tabs[i].HasMouseCross(p) : false; - if(highlight != i || (iscross && cross != i || !iscross && cross == i)) + if(highlight != i || ((iscross && cross != i) || (!iscross && cross == i))) { cross = iscross ? i : -1; SetHighlight(i); ----------------------- uppsrc/TextDiffCtrl/DirDiff.cpp ----------------------- index 5042053a1..7d4f95748 100644 @@ -197,8 +197,8 @@ void DirDiffDlg::ShowResult() for(int i = 0; i < list.GetCount(); i++) { int n = list[i].d; - if((n == NORMAL_FILE && modified || n == DELETED_FILE && removed - || n == NEW_FILE && added || n == FAILED_FILE || n == PATCHED_FILE) + if(((n == NORMAL_FILE && modified) || (n == DELETED_FILE && removed) + || (n == NEW_FILE && added) || n == FAILED_FILE || n == PATCHED_FILE) && ToLower(list[i].a).Find(sFind) >= 0) files.Add(MakeFile(i)); } ----------------------- uppsrc/TextDiffCtrl/TextCtrl.cpp ----------------------- index 506eb4e1e..e9330209b 100644 @@ -52,7 +52,7 @@ void TextCompareCtrl::DoSelection(int y, bool shift) void TextCompareCtrl::LeftDown(Point pt, dword keyflags) { Size sz = GetSize(); - if(pt.x > sz.cx - gutter_width || HasCapture() && gutter_capture) { + if(pt.x > sz.cx - gutter_width || (HasCapture() && gutter_capture)) { if(!HasCapture()) SetCapture(); int line = (pt.y * lines.GetCount()) / sz.cy; @@ -213,7 +213,7 @@ bool TextCompareCtrl::LineDiff(bool left, Vector<LineEdit::Highlight>& hln, Colo } } - if(matchlen > 1 || matchlen && !IsAlNum(s1[p1])) { + if(matchlen > 1 || (matchlen && !IsAlNum(s1[p1]))) { for(int i = 0; i < matchlen; i++) hln[(left ? p1 : p2) + i].paper = eq_color; ----------------------- uppsrc/TextDiffCtrl/TextDiff.cpp ----------------------- index 695362e56..785fe44c8 100644 @@ -111,7 +111,7 @@ TextComparator::TextComparator(const Vector<String>& f1, const Vector<String>& f static bool CompareSection(const TextSection& ta, const TextSection& tb) { - return ta.start1 < tb.start1 || ta.start1 == tb.start1 && ta.start2 < tb.start2; + return ta.start1 < tb.start1 || (ta.start1 == tb.start1 && ta.start2 < tb.start2); } Array<TextSection> TextComparator::GetSections() const ------------------------ uppsrc/TextDiffCtrl/patch.cpp ------------------------ index a422dd8b6..9d4f86ba9 100644 @@ -195,7 +195,7 @@ String Patch::GetPatchedFile(int i) const } } - if(pos < 0 || ch_pos.GetCount() && ch_pos.Top() > pos) + if(pos < 0 || (ch_pos.GetCount() && ch_pos.Top() > pos)) return String::GetVoid(); ch_pos.Add(pos); } ---------------------------- uppsrc/ide/Assist.cpp ---------------------------- index e735439f1..1b1514220 100644 @@ -343,9 +343,9 @@ void AssistEditor::SyncAssist() if(!found[i] && (typei < 0 || m.typei == typei) && (pass ? m.uname.StartsWith(uname) : m.name.StartsWith(name)) && - (!destructor || m.kind == DESTRUCTOR && m.scope == current_type + "::")) { + (!destructor || (m.kind == DESTRUCTOR && m.scope == current_type + "::"))) { int q = include_assist ? -1 : over.Find(m.qitem); - if(q < 0 || over[q] == m.typei && m.scope.GetCount()) { + if(q < 0 || (over[q] == m.typei && m.scope.GetCount())) { found[i] = true; assist_item_ndx.Add(i); if(q < 0) @@ -865,8 +865,8 @@ bool AssistEditor::Key(dword key, int count) else if(auto_assist) { if(InCode()) { - if(key == '.' || key == '>' && Ch(GetCursor32() - 2) == '-' || - key == ':' && Ch(GetCursor32() - 2) == ':') + if(key == '.' || (key == '>' && Ch(GetCursor32() - 2) == '-') || + (key == ':' && Ch(GetCursor32() - 2) == ':')) Assist(); else if(key == '(') { ---------------------- uppsrc/ide/Browser/CodeBrowser.cpp ---------------------- index 9e17442d0..1554c760c 100644 @@ -4,7 +4,7 @@ bool MatchCib(const String& s, const String& match) { if(IsNull(match)) return true; int q = ToUpper(s).Find(match); - return q > 0 && !iscid(s[q - 1]) || q == 0; + return (q > 0 && !iscid(s[q - 1])) || q == 0; } bool MatchPm(const String& fn, const String& pm) ------------------------ uppsrc/ide/Browser/CodeRef.cpp ------------------------ index f70d1d7b0..c3dd27fb8 100644 @@ -369,7 +369,7 @@ void TopicEditor::GoTo(const String& _topic, const String& link, const String& c for(;;) { int c = editor.GetCursor(); RichText::FormatInfo f = editor.GetFormatInfo(); - if(f.styleid == BeginUuid() || (IsNull(f.label) || f.label == "noref") && pass) + if(f.styleid == BeginUuid() || ((IsNull(f.label) || f.label == "noref") && pass)) break; editor.NextPara(); if(editor.GetCursor() == c) ------------------------- uppsrc/ide/Browser/Item.cpp ------------------------- index 84207acc1..384e8859f 100644 @@ -96,7 +96,7 @@ Vector<ItemTextPart> ParseItemNatural(const String& name, p.pari = pari; int n = 1; if(*s >= '0' && *s <= '9') { - while(s[n] >= '0' && s[n] <= '9' || (s[n] == 'x' || s[n] == 'X')) + while((s[n] >= '0' && s[n] <= '9') || (s[n] == 'x' || s[n] == 'X')) n++; p.type = ITEM_NUMBER; } ----------------------- uppsrc/ide/Browser/TopicBase.cpp ----------------------- index fe895c318..f4696cdf1 100644 @@ -139,7 +139,7 @@ void SyncTopicFile(const String& link) LLOG("SyncTopicFile " << link << " path: " << path); TopicInfo& ti = topic_info().GetPut(link); Time tm = FileGetTime(path); - if(ti.path == ":ide:" || ti.path == path && ti.time == tm) + if(ti.path == ":ide:" || (ti.path == path && ti.time == tm)) return; String fn = TopicCacheName(path); if(FileGetTime(fn) > tm) { ---------------------- uppsrc/ide/Builders/GccBuilder.cpp ---------------------- index 528a9615f..d81dbe6a6 100644 @@ -93,10 +93,9 @@ bool GccBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V String fn = srcfile[j]; String ext = GetSrcType(fn); if(findarg(ext, ".c", ".cpp", ".cc", ".cxx", ".brc", ".s", ".ss") >= 0 || - objectivec && findarg(ext, ".mm", ".m") >= 0 || - + + (objectivec && findarg(ext, ".mm", ".m") >= 0) || (!release && blitz && ext == ".icpp") || - ext == ".rc" && HasFlag("WIN32")) { + (ext == ".rc" && HasFlag("WIN32"))) { sfile.Add(fn); soptions.Add(gop); } @@ -325,7 +324,7 @@ bool GccBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V OnFinish(callback1(DeletePCHFile, pch_file)); if(!HasFlag("MAIN")) { - if(HasFlag("BLITZ") && !HasFlag("SO") || HasFlag("NOLIB") || making_lib) { + if((HasFlag("BLITZ") && !HasFlag("SO")) || HasFlag("NOLIB") || making_lib) { linkfile.Append(obj); // Simply link everything as .o files... IdeConsoleEndGroup(); // if(ccount) --------------------- uppsrc/ide/Builders/JavaBuilder.cpp --------------------- index 9e920d0e8..1921e674f 100644 @@ -97,7 +97,7 @@ bool JavaBuilder::BuildPackage(const String& package, Vector<String>& linkfile, String fn = srcfile[j]; String ext = ToLower(GetFileExt(fn)); bool ismf = false; - if(ext == ".java" || main && ext == ".mf") + if(ext == ".java" || (main && ext == ".mf")) { if(ext == ".mf") { ----------------------- uppsrc/ide/Builders/MakeFile.cpp ----------------------- index c39959e10..9d50c1ace 100644 @@ -399,7 +399,7 @@ void MakeBuild::SaveMakeFile(const String& fn, bool exporting) ; bool sv = ::SaveFile(fn, makefile); - if(!exporting) { + if(exporting) { if(sv) PutConsole(Format("%s(1): makefile generation complete", fn)); else -------------------------- uppsrc/ide/ContextGoto.cpp -------------------------- index e664547d9..b07870876 100644 @@ -482,7 +482,7 @@ void Ide::GotoFileAndId(const String& path, const String& id) WString ln = editor.GetWLine(i); int q = ln.Find(wid); while(q >= 0) { - if(q == 0 || !iscid(ln[q - 1]) && !iscid(ln[q + wid.GetCount()])) { + if(q == 0 || (!iscid(ln[q - 1]) && !iscid(ln[q + wid.GetCount()]))) { editor.SetCursor(editor.GetPos64(i, q)); editor.CenterCursor(); return; -------------------------- uppsrc/ide/Core/BinObj.cpp -------------------------- index ab5789c78..a58b4e63a 100644 @@ -75,7 +75,7 @@ void BinObjInfo::Parse(CParser& binscript, String base_dir) int f = brow.Find(blk.index); if(f >= 0) binscript.ThrowError(Format("%s[%d] already seen at line %d", blk.ident, blk.index, brow[f].scriptline)); - if(blk.index < 0 && !brow.IsEmpty() || blk.index >= 0 && !brow.IsEmpty() && brow[0].index < 0) + if((blk.index < 0 && !brow.IsEmpty()) || (blk.index >= 0 && !brow.IsEmpty() && brow[0].index < 0)) binscript.ThrowError(Format("%s: mixing non-array and array elements", blk.ident)); brow.Add(blk.index, blk); if(!(blk.flags & Block::FLG_MASK)) ------------------------- uppsrc/ide/Core/Package.cpp ------------------------- index 2b83dc836..70d861e8a 100644 @@ -79,7 +79,7 @@ String ReadWhen(CParser& p) { const char *b = p.GetPtr(); int lvl = 0; for(;;) { - if(p.IsEof() || lvl == 0 && p.IsChar(')')) + if(p.IsEof() || (lvl == 0 && p.IsChar(')'))) break; if(p.Char('(')) lvl++; ------------------------------ uppsrc/ide/Cpp.cpp ------------------------------ index e23671043..b7fba0396 100644 @@ -123,7 +123,7 @@ void AssistEditor::GatherItems(const String& type, bool only_public, Index<Strin const CppItem& im = n[i]; if(im.kind == STRUCT || im.kind == STRUCTTEMPLATE) base << im.qptype << ';'; - if((im.IsCode() || !thisback && (im.IsData() || im.IsMacro() && IsNull(type))) + if((im.IsCode() || (!thisback && (im.IsData() || (im.IsMacro() && IsNull(type))))) && (!op || im.access == PUBLIC)) { AssistItemAdd(ntp, im, typei); } -------------------------- uppsrc/ide/Credentials.cpp -------------------------- index 32229a19f..e7d1b6b4a 100644 @@ -94,7 +94,7 @@ struct GetPasskeyDlg : WithGetPasskeyLayout<TopWindow> { GetPasskeyDlg::GetPasskeyDlg() { - CtrlLayoutOKCancel(*this, "Passkey"); + CtrlLayoutOK(*this, "Passkey"); show_passkey << [=] { Sync(); }; ----------------------- uppsrc/ide/Debuggers/GdbData.cpp ----------------------- index 0b460b0f4..36a5fa0c6 100644 @@ -52,7 +52,7 @@ String DataClean(CParser& p) int lvl = 0; for(;;) { bool sp = p.Spaces(); - if(lvl == 0 && (p.IsChar('}') || p.IsChar(',')) || p.IsEof()) + if((lvl == 0 && (p.IsChar('}') || p.IsChar(','))) || p.IsEof()) break; if(sp) r << ' '; ---------------------------- uppsrc/ide/Errors.cpp ---------------------------- index fa0734aa5..da5bb6abe 100644 @@ -59,7 +59,7 @@ bool Ide::FindLineError(const String& ln, FindLineErrorCache& cache, ErrorInfo& } } file = FollowCygwinSymlink(file); - if(!IsFullPath(file) || !exists && !FileExists(file) || !IsTextFile(file)) + if(!IsFullPath(file) || (!exists && !FileExists(file)) || !IsTextFile(file)) file = Null; cache.file.Add(file0, file); } @@ -150,7 +150,7 @@ bool Ide::FindLineError(const String& ln, FindLineErrorCache& cache, ErrorInfo& return f.lineno > 0; } else - if(*s == ':' || !strchr(s, '/') && !strchr(s, '\\')) // safe to say this is final + if(*s == ':' || (!strchr(s, '/') && !strchr(s, '\\'))) // safe to say this is final return false; else f.file.Cat(*s); // File is not complete, e.g.: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Vc\Include\string.h(186) --------------------------- uppsrc/ide/Navigator.cpp --------------------------- index 74dc3cd2f..77132018f 100644 @@ -572,10 +572,10 @@ void Navigator::Search() for(int j = 0; j < ci.GetCount(); j++) { const CppItem& m = ci[j]; if(local ? m.file == fileii - : m.uname.Find('@') < 0 && (pass < 0 ? m.name == search_name : + : (m.uname.Find('@') < 0 && (pass < 0 ? m.name == search_name : pass ? m.uname.Find(usearch_name) >= 0 - : m.name.StartsWith(search_name)) - || both && foundnest) { + : m.name.StartsWith(search_name))) + || (both && foundnest)) { String key = nest + '\1' + m.qitem; int q = nest_pass.Find(nest); int p = pass; -------------------------- uppsrc/ide/OutputMode.cpp -------------------------- index 11c1a3a16..97c9ba0b6 100644 @@ -179,7 +179,7 @@ void OutMode::Save() void OutMode::Export(int kind) { String ep = ~export_dir; - if(IsNull(ep)) { + if(IsNull(ep)) { Exclamation("Missing output directory!"); return; } --------------------------- uppsrc/ide/RepoSync.cpp --------------------------- index b285e4299..d878e9a83 100644 @@ -90,7 +90,7 @@ bool IsConflictFile(String path) String ext = GetFileExt(path); if(*ext == '.') { ext = ext.Mid(1); - if(findarg(ext, "mine", "theirs", "working") >= 0 || *ext == 'r' && IsDigit(ext[1])) { + if(findarg(ext, "mine", "theirs", "working") >= 0 || (*ext == 'r' && IsDigit(ext[1]))) { for(int i = 0; i < 3; i++) { int q = path.ReverseFind('.'); if(q < 0) @@ -153,7 +153,7 @@ bool RepoSync::ListSvn(const String& path) color = AdjustIfDark(c[action]); } } - if(pass == action < 0 && action != DELETEC) { + if(pass == action && action != DELETEC) { int ii = list.GetCount(); list.Add(action, file, Null, AttrText(action < 0 ? ln[i] : " " + file.Mid(path.GetCount() + 1)).Ink(color)); @@ -193,7 +193,7 @@ bool RepoSync::ListGit(const String& path) String file = AppendFileName(path, h.Mid(3)); actions = true; int action = String("M.?DR").Find(h[1]); - if(action < 0 || h[0] != '?' && h[0] != ' ') + if(action < 0 || (h[0] != '?' && h[0] != ' ')) action = SVN_IGNORE; String an; Color color; ----------------------------- uppsrc/ide/Swaps.cpp ----------------------------- index d61002bcd..a94b3f983 100644 @@ -33,7 +33,7 @@ bool Ide::SwapSIf(const char *cref) if(q < 0) return false; const Array<CppItem>& nn = CodeBase()[q]; - if(cref && MakeCodeRef(p.current_scope, p.current_key) != cref || IsNull(p.current_name)) + if(cref && (MakeCodeRef(p.current_scope, p.current_key) != cref || IsNull(p.current_name))) return false; Vector<const CppItem *> n; bool destructor = p.current_key.Find('~') >= 0; --------------------------- uppsrc/ide/Template.cpp --------------------------- index 5e9c18ede..3978d05fd 100644 @@ -341,7 +341,7 @@ void TemplateDlg::LoadNest(const char *path, bool main, bool recurse) if(ToLower(GetFileExt(ff.GetName())) == ".upt") { try { PackageTemplate t = ReadTemplate(p); - if(main && t.main || !main && t.sub) + if((main && t.main) || (!main && t.sub)) pt.Add() = pick(t); } catch(CParser::Error e) { ---------------------------- uppsrc/ide/idebar.cpp ---------------------------- index df7e6bad9..61def00a1 100644 @@ -554,9 +554,9 @@ void Ide::FilePropertiesMenu(Bar& menu) for(int i = 0; i < n; i++) { // check that we are in git conflict const String& s = editor.GetUtf8Line(i); int ch = *s; - a = a || ch == '<' && s.StartsWith("<<<<<<<"); - b = b || ch == '=' && s.StartsWith("======="); - c = c || ch == '>' && s.StartsWith(">>>>>>>"); + a = a || (ch == '<' && s.StartsWith("<<<<<<<")); + b = b || (ch == '=' && s.StartsWith("=======")); + c = c || (ch == '>' && s.StartsWith(">>>>>>>")); } if(a && b && c) { original = "1"; ---------------------------- uppsrc/ide/idefile.cpp ---------------------------- index 70fe94c55..d79c71294 100644 @@ -477,8 +477,8 @@ void Ide::EditFile0(const String& path, byte charset, int spellcheck_comments, c if(!designer && editastext.Find(path) < 0 && (findarg(GetFileExt(path), ".log") < 0 && findarg(charset, CHARSET_UTF8_BOM, CHARSET_UTF16_LE, CHARSET_UTF16_BE, - CHARSET_UTF16_LE_BOM, CHARSET_UTF16_BE_BOM) < 0 && - FileIsBinary(path) || editashex.Find(path) >= 0)) + CHARSET_UTF16_LE_BOM, ((CHARSET_UTF16_BE_BOM) < 0 && + FileIsBinary(path)) || (editashex.Find(path) >= 0)))) designer.Create<FileHexView>().Open(path); ManageDisplayVisibility(); @@ -549,7 +549,7 @@ void Ide::EditFile0(const String& path, byte charset, int spellcheck_comments, c const int64 max_size = 768*1024*1024; #endif const int view_limit = 256*1024*1024; - if(view_file.GetSize() < view_limit || editastext.Find(editfile) >= 0 && view_file.GetSize() < max_size) { + if((view_file.GetSize() < view_limit) || (editastext.Find(editfile) >= 0 && view_file.GetSize() < max_size)) { le = editor.Load(view_file, charset); view_file.Close(); } ---------------------------- uppsrc/ide/idetool.cpp ---------------------------- index d4da768e6..8e16de7c5 100644 @@ -100,7 +100,7 @@ void Ide::GotoPosition() for(String n : pk.file) { String pf = PosFn(pkg, n); int q = f.GetCount() - pf.GetCount() - 1; - if(pf == f || q >= 0 && f.EndsWith(PosFn(pkg, n)) && f[q] == '/') { + if(pf == f || (q >= 0 && f.EndsWith(PosFn(pkg, n)) && f[q] == '/')) { GotoPos(SourcePath(pkg, n), line); return; } ------------------------------- uppsrc/ide/t.cpp ------------------------------- index 954530646..fe93b40a0 100644 @@ -166,7 +166,7 @@ String CreateTFile(const VectorMap<String, LngEntry>& map, const Vector<int>& ln int lang = lngset[j]; if(rep || lang != LNG_enUS) { int q = e.text.Find(lang); - if(!rep || q >= 0 && !IsNull(e.text[q])) { + if(!rep || (q >= 0 && !IsNull(e.text[q]))) { int c = (lang >> 15) & 31; if(c) { out.Cat(c + 'a' - 1); --------------------- uppsrc/plugin/astyle/ASFormatter.cpp --------------------- index c8c1e60cb..4434d79d7 100644 @@ -680,8 +680,8 @@ WString ASFormatter::nextLine() && !isPreviousCharPostComment // Fixes wrongly appended newlines after '}' immediately after comments && peekNextChar() != ' ' && !IS_A(previousBracketType, DEFINITION_TYPE) - && !(ASBeautifier::isJavaStyle && currentChar == ')')) - && !IS_A(bracketTypeStack->back(), DEFINITION_TYPE)) + && !(ASBeautifier::isJavaStyle && currentChar == ')') + && !IS_A(bracketTypeStack->back(), DEFINITION_TYPE))) && (shouldBreakOneLineBlocks || !IS_A(bracketTypeStack->back(), SINGLE_LINE_TYPE))) { ------------------------ uppsrc/plugin/lz4/Compress.cpp ------------------------ index 12c3158f2..a802035f1 100644 @@ -115,7 +115,7 @@ void LZ4CompressStream::_Put(const void *data, dword size) const char *s = reinterpret_cast<const char *>(data); while(size > 0) { - if(IsError() || out && out->IsError()) + if(IsError() || (out && out->IsError())) return; dword n = dword(wrlim - ptr); if(size >= n) { --------------------------- uppsrc/plugin/lz4/lz4.h --------------------------- index 16649e291..833892113 100644 @@ -95,7 +95,7 @@ private: void Init(); bool Next(); void Fetch(); - bool Ended() const { return IsError() || in->IsError() || ptr == rdlim && ii == count && eof; } + bool Ended() const { return IsError() || in->IsError() || (ptr == rdlim && ii == count && eof); } public: bool Open(Stream& in); ------------------------- uppsrc/plugin/lzma/lzma.cpp ------------------------- index c1c6ddd1e..f6d1b060d 100644 @@ -100,7 +100,7 @@ static SRes Decode2(CLzmaDec *state, ISeqOutStream *outStream, ISeqInStream *inS return SZ_ERROR_WRITE; outPos = 0; - if(res != SZ_OK || thereIsSize && unpackSize == 0) + if(res != SZ_OK || (thereIsSize && unpackSize == 0)) return res; if(inProcessed == 0 && outProcessed == 0) { ----------------------- uppsrc/plugin/zstd/Compress.cpp ----------------------- index 733f54d00..caa3b4003 100644 @@ -98,7 +98,7 @@ void ZstdCompressStream::_Put(const void *data, dword size) const char *s = reinterpret_cast<const char *>(data); while(size > 0) { - if(IsError() || out && out->IsError()) + if(IsError() || (out && out->IsError())) return; dword n = dword(wrlim - ptr); if(size >= n) { -------------------------- uppsrc/plugin/zstd/zstd.h -------------------------- index e7d5ce6d4..7ddd10c26 100644 @@ -86,7 +86,7 @@ private: void Init(); bool Next(); void Fetch(); - bool Ended() const { return IsError() || in->IsError() || ptr == rdlim && ii == count && eof; } + bool Ended() const { return IsError() || in->IsError() || (ptr == rdlim && ii == count && eof); } public: bool Open(Stream& in); ``` ![2021-01-07-163141_1920x1080_scrot](https://user-images.githubusercontent.com/462618/103911669-96683f00-5106-11eb-989e-b99baf5ab051.png)
Author
Owner

@mingodad commented on GitHub (Jan 7, 2021):

Redoing it with the help of clang11:

clang++ -c -x c++ -D_DEBUG -O0 -ggdb -g2  -std=c++14 -Wall -pipe  `pkg-config --cflags freetype2` `pkg-config --cflags x11` `pkg-config --cflags fontconfig` `pkg-config --cflags xcb` `pkg-config --cflags expat` `pkg-config --cflags xinerama` `pkg-config --cflags xrender` `pkg-config --cflags xft` `pkg-config --cflags xdmcp` `pkg-config --cflags xext` `pkg-config --cflags gtk+-3.0` `pkg-config --cflags libnotify` `pkg-config --cflags libpng` -I./ -I_out/ -DflagGUI -DflagGCC -DflagDEBUG -DflagSHARED -DflagDEBUG_FULL -DflagPOSIX -DflagLINUX -DflagBLITZ  CtrlLib/ColorPopup.cpp -o _out/CtrlLib/GCC-Blitz-Debug-Debug_Full-Gcc-Gui-Linux-Posix-Shared/ColorPopup.o
CtrlLib/ToolTip.cpp:96:29: warning: '&&' within '||' [-Wlogical-op-parentheses]
        if(ctrl != tipctrl || ctrl && ctrl->GetTip() != AppToolTip().Get()) {
                           ~~ ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CtrlLib/ToolTip.cpp:96:29: note: place parentheses around the '&&' expression to silence this warning
        if(ctrl != tipctrl || ctrl && ctrl->GetTip() != AppToolTip().Get()) {
                                   ^
                              (                                           )
<!-- gh-comment-id:756237030 --> @mingodad commented on GitHub (Jan 7, 2021): Redoing it with the help of clang11: ``` clang++ -c -x c++ -D_DEBUG -O0 -ggdb -g2 -std=c++14 -Wall -pipe `pkg-config --cflags freetype2` `pkg-config --cflags x11` `pkg-config --cflags fontconfig` `pkg-config --cflags xcb` `pkg-config --cflags expat` `pkg-config --cflags xinerama` `pkg-config --cflags xrender` `pkg-config --cflags xft` `pkg-config --cflags xdmcp` `pkg-config --cflags xext` `pkg-config --cflags gtk+-3.0` `pkg-config --cflags libnotify` `pkg-config --cflags libpng` -I./ -I_out/ -DflagGUI -DflagGCC -DflagDEBUG -DflagSHARED -DflagDEBUG_FULL -DflagPOSIX -DflagLINUX -DflagBLITZ CtrlLib/ColorPopup.cpp -o _out/CtrlLib/GCC-Blitz-Debug-Debug_Full-Gcc-Gui-Linux-Posix-Shared/ColorPopup.o CtrlLib/ToolTip.cpp:96:29: warning: '&&' within '||' [-Wlogical-op-parentheses] if(ctrl != tipctrl || ctrl && ctrl->GetTip() != AppToolTip().Get()) { ~~ ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CtrlLib/ToolTip.cpp:96:29: note: place parentheses around the '&&' expression to silence this warning if(ctrl != tipctrl || ctrl && ctrl->GetTip() != AppToolTip().Get()) { ^ ( ) ```
Author
Owner

@mingodad commented on GitHub (Jan 7, 2021):

This one also need review:

c++ -c -x c++ -D_DEBUG -O0 -ggdb -g2  -std=c++14 -Wall -pipe  `pkg-config --cflags freetype2` `pkg-config --cflags x11` `pkg-config --cflags fontconfig` `pkg-config --cflags xcb` `pkg-config --cflags expat` `pkg-config --cflags xinerama` `pkg-config --cflags xrender` `pkg-config --cflags xft` `pkg-config --cflags xdmcp` `pkg-config --cflags xext` `pkg-config --cflags gtk+-3.0` `pkg-config --cflags libnotify` `pkg-config --cflags libpng` -I./ -I_out/ -DflagGUI -DflagGCC -DflagDEBUG -DflagSHARED -DflagDEBUG_FULL -DflagPOSIX -DflagLINUX -DflagBLITZ  Core/z.cpp -o _out/Core/GCC-Blitz-Debug-Debug_Full-Gcc-Gui-Linux-Posix-Shared/z.o
Core/parser.cpp: In member function ‘Upp::String Upp::CParser::ReadOneString(int, bool)’:
Core/parser.cpp:413:66: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses]
  413 |         result.Cat(ToUtf8(((hex & 0x3ff) << 10) | (hex2 & 0x3ff) + 0x10000));
      |                                                   ~~~~~~~~~~~~~~~^~~~~~~~~
<!-- gh-comment-id:756267963 --> @mingodad commented on GitHub (Jan 7, 2021): This one also need review: ``` c++ -c -x c++ -D_DEBUG -O0 -ggdb -g2 -std=c++14 -Wall -pipe `pkg-config --cflags freetype2` `pkg-config --cflags x11` `pkg-config --cflags fontconfig` `pkg-config --cflags xcb` `pkg-config --cflags expat` `pkg-config --cflags xinerama` `pkg-config --cflags xrender` `pkg-config --cflags xft` `pkg-config --cflags xdmcp` `pkg-config --cflags xext` `pkg-config --cflags gtk+-3.0` `pkg-config --cflags libnotify` `pkg-config --cflags libpng` -I./ -I_out/ -DflagGUI -DflagGCC -DflagDEBUG -DflagSHARED -DflagDEBUG_FULL -DflagPOSIX -DflagLINUX -DflagBLITZ Core/z.cpp -o _out/Core/GCC-Blitz-Debug-Debug_Full-Gcc-Gui-Linux-Posix-Shared/z.o Core/parser.cpp: In member function ‘Upp::String Upp::CParser::ReadOneString(int, bool)’: Core/parser.cpp:413:66: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses] 413 | result.Cat(ToUtf8(((hex & 0x3ff) << 10) | (hex2 & 0x3ff) + 0x10000)); | ~~~~~~~~~~~~~~~^~~~~~~~~ ```
Author
Owner

@mingodad commented on GitHub (Jan 7, 2021):

This one also need review:

c++ -c -x c++ -D_DEBUG -O0 -ggdb -g2  -std=c++14 -Wall -pipe  `pkg-config --cflags freetype2` `pkg-config --cflags x11` `pkg-config --cflags fontconfig` `pkg-config --cflags xcb` `pkg-config --cflags expat` `pkg-config --cflags xinerama` `pkg-config --cflags xrender` `pkg-config --cflags xft` `pkg-config --cflags xdmcp` `pkg-config --cflags xext` `pkg-config --cflags gtk+-3.0` `pkg-config --cflags libnotify` `pkg-config --cflags libpng` -I./ -I_out/ -DflagGUI -DflagGCC -DflagDEBUG -DflagSHARED -DflagDEBUG_FULL -DflagPOSIX -DflagLINUX -DflagBLITZ  Painter/SvgBounds.cpp -o _out/Painter/GCC-Blitz-Debug-Debug_Full-Gcc-Gui-Linux-Posix-Shared/SvgBounds.o
Painter/RadialGradient.cpp: In member function ‘virtual void Upp::PainterRadialSpan::Get(Upp::RGBA*, int, int, unsigned int)’:
Painter/RadialGradient.cpp:49:28: warning: suggest parentheses around ‘-’ in operand of ‘&’ [-Wparentheses]
   49 |     h = (h & 2048) ? (2047 - h & 2047) : (h & 2047);
      |                       ~~~~~^~~
<!-- gh-comment-id:756268709 --> @mingodad commented on GitHub (Jan 7, 2021): This one also need review: ``` c++ -c -x c++ -D_DEBUG -O0 -ggdb -g2 -std=c++14 -Wall -pipe `pkg-config --cflags freetype2` `pkg-config --cflags x11` `pkg-config --cflags fontconfig` `pkg-config --cflags xcb` `pkg-config --cflags expat` `pkg-config --cflags xinerama` `pkg-config --cflags xrender` `pkg-config --cflags xft` `pkg-config --cflags xdmcp` `pkg-config --cflags xext` `pkg-config --cflags gtk+-3.0` `pkg-config --cflags libnotify` `pkg-config --cflags libpng` -I./ -I_out/ -DflagGUI -DflagGCC -DflagDEBUG -DflagSHARED -DflagDEBUG_FULL -DflagPOSIX -DflagLINUX -DflagBLITZ Painter/SvgBounds.cpp -o _out/Painter/GCC-Blitz-Debug-Debug_Full-Gcc-Gui-Linux-Posix-Shared/SvgBounds.o Painter/RadialGradient.cpp: In member function ‘virtual void Upp::PainterRadialSpan::Get(Upp::RGBA*, int, int, unsigned int)’: Painter/RadialGradient.cpp:49:28: warning: suggest parentheses around ‘-’ in operand of ‘&’ [-Wparentheses] 49 | h = (h & 2048) ? (2047 - h & 2047) : (h & 2047); | ~~~~~^~~ ```
Author
Owner

@mingodad commented on GitHub (Jan 7, 2021):

And here is the second replacement I did again from scratch and now I get the files shown properly in the built IDE:

----------------------- uppsrc/CodeEditor/CHighlight.cpp -----------------------
index ceb2674f5..a353e7055 100644
@@ -182,7 +182,7 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls
 	
 	Grounding(p, e);
 	if(highlight == HIGHLIGHT_CALC) {
-		if(editor && line == editor->GetLineCount() - 1 || *p == '$')
+		if((editor && line == editor->GetLineCount() - 1) || *p == '$')
 			hls.SetPaper(0, linelen + 1, hl_style[PAPER_BLOCK1].color);
 	}
 	else
@@ -196,7 +196,7 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls
 			while(bid < this->bid.GetCount() - 1
 			&& (i >= linelen || p[i] == ' ' || p[i] == '\t')) {
 				hls.SetPaper(i, 1, BlockColor(bid));
-				if(i < linelen && p[i] == '\t' || ++pos >= tabsize) {
+				if((i < linelen && p[i] == '\t') || ++pos >= tabsize) {
 					pos = 0;
 					bid++;
 				}
@@ -242,7 +242,7 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls
 	while(p < e) {
 		int  raw_n = 0;
 		dword pair = MAKELONG(p[0], p[1]);
-		if(pair == MAKELONG('/', '*') && highlight != HIGHLIGHT_JSON || comment) {
+		if((pair == MAKELONG('/', '*') && highlight != HIGHLIGHT_JSON) || comment) {
 			if(!comment) {
 				hls.Put(2, hl_style[INK_COMMENT]);
 				p += 2;
@@ -289,16 +289,16 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls
 				hls.Put(int(p - b), hl_style[INK_RAW_STRING]);
 		}
 		else
-		if(linecomment && linecont || pair == MAKELONG('/', '/') &&
-		   highlight != HIGHLIGHT_CSS && highlight != HIGHLIGHT_JSON ||
-		   highlight == HIGHLIGHT_PHP && *p == '#') {
+		if((linecomment && linecont) || (pair == MAKELONG('/', '/') &&
+		   highlight != HIGHLIGHT_CSS && highlight != HIGHLIGHT_JSON) ||
+		   (highlight == HIGHLIGHT_PHP && *p == '#')) {
 			while(p < e)
 				p = DoComment(hls, p, e);
 			is_comment = true;
 			break;
 		}
 		else
-		if((*p == '\"' || *p == '\'') || linecont && string)
+		if((*p == '\"' || *p == '\'') || (linecont && string))
 			p = hls.CString(p);
 		else
 		if(*p == '(') {
@@ -336,7 +336,7 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls
 				hls.SetPaper(hls.pos, linelen + 1 - hls.pos, BlockColor(--block_level));
 			Bracket(int(p - ltext) + pos, hls, editor);
 			int& l = *p == ')' ? pl : *p == '}' ? cl : bl;
-			if(bc && (bc != *p || l <= 0) || bc == 0 && *p != '}') {
+			if((bc && (bc != *p || l <= 0)) || (bc == 0 && *p != '}')) {
 				hls.Put(p == ltext || ignore_errors ? hl_style[INK_PAR0] : hl_style[INK_ERROR]);
 				brk.Clear();
 				cl = bl = pl = 0;
@@ -379,7 +379,7 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls
 		if(iscib(*p)) {
 			const wchar *q = p;
 			StringBuffer id;
-			while((iscidl(*q) || highlight == HIGHLIGHT_CSS && *q == '-') && q < e)
+			while((iscidl(*q) || (highlight == HIGHLIGHT_CSS && *q == '-')) && q < e)
 				id.Cat(*q++);
 			String iid = id;
 			if(highlight == HIGHLIGHT_SQL)

------------------------- uppsrc/CodeEditor/CLogic.cpp -------------------------
index da40f77a0..639d88688 100644
@@ -20,8 +20,8 @@ int CSyntax::GetCommentPos(CodeEditor& e, int l, WString& ch) const
 	sSpaces(cp, ln);
 	One<EditorSyntax> esyntax = e.GetSyntax(e.GetCursorLine());
 	CSyntax *syntax = dynamic_cast<CSyntax *>(~esyntax);
-	if(syntax && syntax->comment && ln.Find("*/") < 0 ||
-	   cp < ln.GetCount() - 2 && ln[cp] == '/' && ln[cp + 1] == '/') {
+	if((syntax && syntax->comment && ln.Find("*/") < 0) ||
+	   (cp < ln.GetCount() - 2 && ln[cp] == '/' && ln[cp + 1] == '/')) {
 	    while(cp < ln.GetLength() && findarg(ln[cp], '/', '*', '!', '<', '>', '%', '#', '@', '|') >= 0)
 	        cp++;
 	    ch = ln.Mid(0, cp);
@@ -75,7 +75,7 @@ void CSyntax::IndentInsert0(CodeEditor& e, int chr, int count, bool reformat)
 				e.InsertChar(*s++, 1);
 			if(!syntax)
 				return;
-			if(syntax->stmtline == cl || syntax->blk.GetCount() && syntax->blk.Top() == cl // statement (if, while..) || first line of block
+			if(syntax->stmtline == cl || (syntax->blk.GetCount() && syntax->blk.Top() == cl) // statement (if, while..) || first line of block
 			   || *pl.Last() == ':') { // label
 				if(indent_spaces || (s > pl && s[-1] == ' '))
 					e.InsertChar(' ', indent_amount);
@@ -128,7 +128,7 @@ void CSyntax::IndentInsert0(CodeEditor& e, int chr, int count, bool reformat)
 	// {, } inserted on line alone should be moved left sometimes:
 	int cl = e.GetCursorLine();
 	WString l = e.GetWLine(cl);
-	if(chr != '{' && chr != '}' || count > 1) {
+	if((chr != '{' && chr != '}') || count > 1) {
 		e.InsertChar(chr, 1, true);
 		return;
 	}

------------------------ uppsrc/CodeEditor/CSyntax.cpp ------------------------
index 12526f906..47cb3e280 100644
@@ -127,8 +127,8 @@ void CSyntax::ScanSyntax(const wchar *ln, const wchar *e, int line, int tab_size
 			p++;
 		int idlen = int(p - id);
 		if(id[0] == 'i' && id[1] == 'f'
-		&& (idlen == 2 || idlen == 5 && id[2] == 'd' && id[3] == 'e' && id[4] == 'f'
-		|| idlen == 6 && id[2] == 'n' && id[3] == 'd' && id[4] == 'e' && id[5] == 'f')) {
+		&& (idlen == 2 || (idlen == 5 && id[2] == 'd' && id[3] == 'e' && id[4] == 'f')
+		|| (idlen == 6 && id[2] == 'n' && id[3] == 'd' && id[4] == 'e' && id[5] == 'f'))) {
 			IfState& ifstate = ifstack.Add();
 			ifstate.state = IfState::IF;
 			ifstate.iftext = sReadLn(ln);

----------------------- uppsrc/CodeEditor/CodeEditor.cpp -----------------------
index 8c79116be..023ac14e6 100644
@@ -81,7 +81,7 @@ void CodeEditor::DirtyFrom(int line) {
 }
 
 inline bool IsComment(int a, int b) {
-	return a == '/' && b == '*' || a == '*' && b == '/' || a == '/' && b == '/';
+	return (a == '/' && b == '*') || (a == '*' && b == '/') || (a == '/' && b == '/');
 }
 
 inline bool RBR(int c) {
@@ -193,7 +193,7 @@ bool CodeEditor::IsCursorBracket(int64 pos) const
 
 bool CodeEditor::IsMatchingBracket(int64 pos) const
 {
-	return pos == highlight_bracket_pos && (hilite_bracket == 1 || hilite_bracket == 2 && bracket_flash);
+	return pos == highlight_bracket_pos && (hilite_bracket == 1 || (hilite_bracket == 2 && bracket_flash));
 }
 
 void CodeEditor::CheckBrackets()
@@ -1086,7 +1086,7 @@ void CodeEditor::HighlightLine(int line, Vector<LineEdit::Highlight>& hl, int64
 				break;
 			int n = illuminated.GetCount();
 			if(n > 1 || !iscid(illuminated[0]) ||
-			   (q == 0 || !iscid(l[q - 1])) && (q + n >= l.GetCount() || !iscid(l[q + n])))
+			   ((q == 0 || !iscid(l[q - 1])) && (q + n >= l.GetCount() || !iscid(l[q + n]))))
 				while(n-- && q < hl.GetCount()) {
 					const HlStyle& st = hl_style[PAPER_SELWORD];
 					hl[q].paper = st.color;

----------------------- uppsrc/CodeEditor/LogSyntax.cpp -----------------------
index 491a32a92..4b373a814 100644
@@ -53,7 +53,7 @@ void LogSyntax::Highlight(const wchar *s, const wchar *end, HighlightOutput& hls
 				sws << "ok" << "success";
 			}
 			String w;
-			while(s < end && IsAlNum(*s) || *s == '_')
+			while((s < end && IsAlNum(*s)) || *s == '_')
 				w.Cat(ToLower(*s++));
 			bool hl = rws.Find(w) >= 0;
 			bool st = sws.Find(w) >= 0;

---------------------- uppsrc/CodeEditor/PythonSyntax.cpp ----------------------
index 053866820..c6f1a08bc 100644
@@ -42,7 +42,7 @@ void PythonSyntax::Highlight(const wchar *s, const wchar *end, HighlightOutput&
 			                             "not", "with", "async", "elif", "if", "or", "yield" };
 			static Index<String> sws = { "self", "NotImplemented", "Ellipsis", "__debug__", "__file__", "__name__" };
 			String w;
-			while(s < end && IsAlNum(*s) || *s == '_')
+			while((s < end && IsAlNum(*s)) || *s == '_')
 				w.Cat(*s++);
 			hls.Put(w.GetCount(), kws.Find(w) >= 0 ? hl_style[INK_KEYWORD] :
 			                      sws.Find(w) >= 0 ? hl_style[INK_UPP] :

------------------------- uppsrc/Core/BlockStream.cpp -------------------------
index 025dce011..a6b627ecf 100644
@@ -473,7 +473,7 @@ bool FileStream::Open(const char *name, dword mode, mode_t tmode) {
 		struct stat st[1];
 		fstat(handle, st);
 		if(!(st->st_mode & S_IFREG) ||  // not a regular file, e.g. folder - bad things would happen
-		   (mode & NOWRITESHARE) && flock(handle, LOCK_EX|LOCK_NB) < 0) { // lock if not sharing
+		   ((mode & NOWRITESHARE) && flock(handle, LOCK_EX|LOCK_NB) < 0)) { // lock if not sharing
 			close(handle);
 			handle = -1;
 			return false;

---------------------------- uppsrc/Core/CharSet.h ----------------------------
index a389fbb3a..13a7a3305 100644
@@ -185,12 +185,12 @@ inline char  ToUpperAscii(wchar c)  { return ToUpperAscii((dword) c); }
 inline char  ToLowerAscii(wchar c)  { return ToLowerAscii((dword) c); }
 
 inline bool IsDigit(int c)         { return c >= '0' && c <= '9'; }
-inline bool IsAlpha(int c)         { return c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z'; }
+inline bool IsAlpha(int c)         { return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'); }
 inline bool IsAlNum(int c)         { return IsDigit(c) || IsAlpha(c); }
 inline bool IsLeNum(int c)         { return IsDigit(c) || IsLetter(c); }
 inline bool IsPunct(int c)         { return c != ' ' && !IsAlNum(c); }
 inline bool IsSpace(int c)         { return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\v' || c == '\t'; }
-inline bool IsXDigit(int c)        { return IsDigit(c) || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f'; }
+inline bool IsXDigit(int c)        { return IsDigit(c) || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'); }
 
 bool IsDoubleWidth(int c);
 
@@ -255,7 +255,7 @@ bool    SaveFileBOMUtf8(const char *path, const String& data);
 
 word UnicodeCombine(word chr, word combine);
 
-inline bool IsCJKIdeograph(int c)  { return c >= 0x2e80 && c <= 0xdfaf || c >= 0xf900 && c <= 0xfaff; }
+inline bool IsCJKIdeograph(int c)  { return (c >= 0x2e80 && c <= 0xdfaf) || (c >= 0xf900 && c <= 0xfaff); }
 
 int  ToUnicode(int chr, byte charset);
 int  FromUnicode(wchar wchr, byte charset, int defchar = DEFAULTCHAR);

----------------------------- uppsrc/Core/CoAlgo.h -----------------------------
index fdf855dd8..300793528 100644
@@ -128,7 +128,7 @@ int CoFindBest(const Range& r, const Better& better)
 				i++;
 			}
 			CoWork::FinLock();
-			if(better(*b, *best) || !better(*best, *b) && b < best)
+			if(better(*b, *best) || (!better(*best, *b) && b < best))
 				best = b;
 		}
 	);

---------------------------- uppsrc/Core/Color.cpp ----------------------------
index 0fea74ed3..9de8ff032 100644
@@ -189,7 +189,7 @@ static int sCharFilterNoDigit(int c)
 
 static int sCharFilterHex(int c)
 {
-	return c >= 'a' && c <= 'f' || c >= 'A' && c <= 'F' || IsDigit(c) ? c : 0;
+	return (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F') || IsDigit(c) ? c : 0;
 }
 
 Color ColorFromText(const char *s)

--------------------------- uppsrc/Core/Convert.cpp ---------------------------
index 4aac022e9..8e8f4f5d1 100644
@@ -125,7 +125,7 @@ double ScanDoubleT(const T *p, const T **endptr, bool accept_comma)
 		*endptr = p;
 	if(*p == '+' || *p == '-')
 		neg = (*p++ == '-');
-	if((byte)(*p - '0') >= 10 && !((*p == '.' || accept_comma && *p == ',') && (byte)(p[1] - '0') < 10)) {
+	if((byte)(*p - '0') >= 10 && !((*p == '.' || (accept_comma && *p == ',')) && (byte)(p[1] - '0') < 10)) {
 		if(endptr) *endptr = begin;
 		return Null;
 	}
@@ -140,7 +140,7 @@ double ScanDoubleT(const T *p, const T **endptr, bool accept_comma)
 		else
 			exp++;
 	int raise = exp;
-	if(*p == '.' || accept_comma && *p == ',') // decimal part
+	if(*p == '.' || (accept_comma && *p == ',')) // decimal part
 		while((byte)((c = *++p) - '0') < 10) {
 			if(c != '0') {
 				if(raise) {

---------------------------- uppsrc/Core/Format.cpp ----------------------------
index 6ab51bd1c..63bd8bd0b 100644
@@ -46,7 +46,7 @@ String FormatIntBase(int i, int base, int width, char lpad, int sign, bool upper
 		while(x /= base);
 	}
 	bool minus = (sign >= 0 && i < 0 && !IsNull(i));
-	bool do_sign = (sign > 0 || sign >= 0 && minus);
+	bool do_sign = (sign > 0 || (sign >= 0 && minus));
 	if(do_sign && lpad != '0')
 		*--p = (minus ? '-' : '+');
 	if(width > e - p)
@@ -316,7 +316,7 @@ String FormatDoubleFix(double d, int digits, int flags)
 	if(flags & FD_REL)
 		digits = max(0, digits - Nvl(exp, 0) - 1);
 	String out;
-	if(flags & FD_SIGN || d < 0 && !IsNull(exp))
+	if(flags & FD_SIGN || (d < 0 && !IsNull(exp)))
 		out.Cat(d >= 0 ? '+' : '-');
 	int pointchar = (flags & FD_COMMA) ? ',' : '.';
 	if(IsNull(exp) || exp < -digits) {
@@ -372,7 +372,7 @@ String FormatDoubleExp(double d, int digits, int flags, int fill_exp)
 	String dig = FormatDoubleDigits(d, digits, flags | FD_REL, exp);
 	exp = Nvl(exp, 0);
 	StringBuffer out;
-	if(flags & FD_SIGN || d < 0 && !IsNull(exp))
+	if(flags & FD_SIGN || (d < 0 && !IsNull(exp)))
 		out.Cat(d >= 0 ? '+' : '-');
 	out.Cat(dig[0]);
 	if(dig.GetLength() > 1)
@@ -621,7 +621,7 @@ String RealFormatter(const Formatting& f)
 		flags |= FD_SIGN;
 		s++;
 	}
-	if(IsDigit(*s) || *s == '-' && IsDigit(s[1])) {
+	if(IsDigit(*s) || (*s == '-' && IsDigit(s[1]))) {
 		digits = (int)strtol(s, NULL, 10);
 		while(IsDigit(*++s))
 			;

----------------------------- uppsrc/Core/Http.cpp -----------------------------
index b97c4c95f..b0daecb1b 100644
@@ -783,7 +783,7 @@ void HttpRequest::Out(const void *ptr, int size)
 		HttpError("content length exceeded " + AsString(max_content_size));
 		return;
 	}
-	if(WhenContent && (status_code >= 200 && status_code < 300 || all_content))
+	if(WhenContent && ((status_code >= 200 && status_code < 300) || all_content))
 		WhenContent(ptr, size);
 	else
 		body.Cat((const char *)ptr, size);
@@ -797,7 +797,7 @@ bool HttpRequest::ReadingBody()
 	if(has_content_length && content_length == 0)
 		return false;
 
-	String s = TcpSocket::Get(has_content_length && content_length > 0 || chunked_encoding ?
+	String s = TcpSocket::Get((has_content_length && content_length > 0) || chunked_encoding ?
 	                          (int)min((int64)chunk, count) : chunk);
 	if(s.GetCount()) {
 	#ifndef ENDZIP

----------------------------- uppsrc/Core/Parser.h -----------------------------
index 084697e5d..5fe172297 100644
@@ -1,9 +1,9 @@
 inline bool iscib(int c) {
-	return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '_' || c == '$';
+	return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_' || c == '$';
 }
 
 inline bool iscid(int c) {
-	return iscib(c) || c >= '0' && c <= '9';
+	return iscib(c) || (c >= '0' && c <= '9');
 }
 
 class CParser {

----------------------------- uppsrc/Core/Path.cpp -----------------------------
index edfa2afe4..1043f59e5 100644
@@ -525,8 +525,8 @@ bool FindFile::CanMode(dword usr, dword grp, dword oth) const
 	static uid_t uid = getuid();
 	static gid_t gid = getgid();
 	return (mode & oth) ||
-	       (mode & grp) && gid == s.st_gid ||
-	       (mode & usr) && uid == s.st_uid;
+	       ((mode & grp) && gid == s.st_gid) ||
+	       ((mode & usr) && uid == s.st_uid);
 }
 
 bool FindFile::IsSymLink() const

---------------------------- uppsrc/Core/Socket.cpp ----------------------------
index 408b571d5..f237b9091 100644
@@ -452,7 +452,7 @@ bool TcpSocket::RawConnect(addrinfo *arp)
 	for(int pass = 0; pass < 2; pass++) {
 		addrinfo *rp = arp;
 		while(rp) {
-			if(rp->ai_family == AF_INET == !pass && // Try to connect IPv4 in the first pass
+			if(rp->ai_family == AF_INET && !pass && // Try to connect IPv4 in the first pass
 			   Open(rp->ai_family, rp->ai_socktype, rp->ai_protocol)) {
 				if(connect(socket, rp->ai_addr, (int)rp->ai_addrlen) == 0 ||
 				   GetErrorCode() == SOCKERR(EINPROGRESS) || GetErrorCode() == SOCKERR(EWOULDBLOCK)
@@ -645,7 +645,7 @@ bool TcpSocket::RawWait(dword flags, int end_time)
 		#endif
 			return true;
 		}
-		if(IsGlobalTimeout() || to <= 0 && timeout) {
+		if(IsGlobalTimeout() || (to <= 0 && timeout)) {
 			is_timeout = true;
 			return false;
 		}
@@ -703,7 +703,7 @@ int TcpSocket::Put(const void *s_, int length)
 			return done;
 		peek = false;
 		int count = Send(s + done, length - done);
-		if(IsError() || timeout == 0 && count == 0 && peek)
+		if(IsError() || (timeout == 0 && count == 0 && peek))
 			return done;
 		if(count > 0)
 			done += count;
@@ -767,7 +767,7 @@ void TcpSocket::ReadBuffer(int end_time)
 
 bool TcpSocket::IsEof() const
 {
-	return is_eof && ptr == end || IsAbort() || !IsOpen() || IsError();
+	return (is_eof && ptr == end) || IsAbort() || !IsOpen() || IsError();
 }
 
 int TcpSocket::Get_()

---------------------------- uppsrc/Core/Stream.cpp ----------------------------
index 92e9df196..0b6862c1b 100644
@@ -1373,7 +1373,7 @@ Stream& Pack16(Stream& s, int& i1, int& i2, int& i3, int& i4, int& i5) {
 
 int StreamHeading(Stream& stream, int ver, int minver, int maxver, const char* tag)
 {
-	if(stream.IsLoading() && stream.IsEof() || stream.IsError())
+	if((stream.IsLoading() && stream.IsEof()) || stream.IsError())
 		return Null;
 	String text = tag;
 	dword len = text.GetLength();

----------------------------- uppsrc/Core/String.h -----------------------------
index 88c8b7fdc..6ca076104 100644
@@ -290,7 +290,7 @@ public:
 	bool IsEqual(const String0& s) const {
 		uint64 q1 = q[1];
 		uint64 sq1 = s.q[1];
-		return q1 == sq1 && q[0] == s.q[0] || ((q1 | sq1) & MAKE8B(0,0,0,0,0,0,255,0)) && LEq(s);
+		return (q1 == sq1 && q[0] == s.q[0]) || (((q1 | sq1) & MAKE8B(0,0,0,0,0,0,255,0)) && LEq(s));
 	}
 	bool IsEqual(const char *s) const;
 

--------------------------- uppsrc/Core/TimeDate.cpp ---------------------------
index 3289f2349..c5c360681 100644
@@ -27,7 +27,7 @@ int  GetDaysOfMonth(int m, int y) {
 }
 
 bool Date::IsValid() const {
-	return year == -32768 || month >= 1 && month <= 12 && day >= 1 && day <= GetDaysOfMonth(month, year);
+	return year == -32768 || (month >= 1 && month <= 12 && day >= 1 && day <= GetDaysOfMonth(month, year));
 }
 
 String DayName(int i, int lang)
@@ -499,7 +499,7 @@ int64 Time::Get() const
 bool Time::IsValid() const
 {
 	return year == -32768 ||
-	       Date::IsValid() && hour >= 0 && hour < 24 && minute >= 0 && minute < 60 && second >= 0 && second < 60;
+	       (Date::IsValid() && hour >= 0 && hour < 24 && minute >= 0 && minute < 60 && second >= 0 && second < 60);
 }
 
 int64 operator-(Time a, Time b) {

---------------------------- uppsrc/Core/Value.hpp ----------------------------
index f420b8b84..ae4c67607 100644
@@ -11,15 +11,15 @@ Value::Value(const Value& v)
 
 template<>
 inline bool IsPolyEqual(const bool& x, const Value& v) {
-	return v.Is<double>() && int(x) == double(v)
-	    || v.Is<int64>() && int(x) == int64(v)
-	    || v.Is<int>() && int(x) == int(v);
+	return (v.Is<double>() && int(x) == double(v))
+	    || (v.Is<int64>() && int(x) == int64(v))
+	    || (v.Is<int>() && int(x) == int(v));
 }
 
 template<>
 inline bool IsPolyEqual(const int& x, const Value& v) {
-	return v.Is<double>() && x == double(v)
-	    || v.Is<int64>() && x == int64(v);
+	return (v.Is<double>() && x == double(v))
+	    || (v.Is<int64>() && x == int64(v));
 }
 
 template<>

---------------------------- uppsrc/Core/Vcont.hpp ----------------------------
index 95e0f1905..30b7c850d 100644
@@ -378,7 +378,7 @@ void Vector<T>::Insert(int i, Vector<T>&& v) {
 template <class T>
 void Vector<T>::InsertSplit(int i, Vector<T>& v, int from)
 {
-	ASSERT(!vector || v.vector != vector && from <= v.GetCount());
+	ASSERT(!vector || (v.vector != vector && from <= v.GetCount()));
 	int n = v.GetCount() - from;
 	if(n) {
 		RawInsert(i, n);

----------------------------- uppsrc/Core/XML.cpp -----------------------------
index f90bf8d73..71918e160 100644
@@ -11,7 +11,7 @@ static inline void sDeXmlChar(StringBuffer& result, char chr, byte charset, bool
 	else if(chr == '&')  result.Cat("&amp;");
 	else if(chr == '\'') result.Cat("&apos;");
 	else if(chr == '\"') result.Cat("&quot;");
-	else if((byte)chr < ' ' && (escapelf || chr != '\n' && chr != '\t' && chr != '\r'))
+	else if((byte)chr < ' ' && (escapelf || (chr != '\n' && chr != '\t' && chr != '\r')))
 		result.Cat(Format("&#x%02x;", (byte)chr));
 	else if(!(chr & 0x80) || charset == CHARSET_UTF8) result.Cat(chr);
 	else result.Cat(ToUtf8(ToUnicode(chr, charset)));
@@ -962,9 +962,9 @@ XmlNode::XmlNode(const XmlNode& n, int)
 
 bool Ignore(XmlParser& p, dword style)
 {
-	if((XML_IGNORE_DECLS & style) && p.IsDecl() ||
-	   (XML_IGNORE_PIS & style) && p.IsPI() ||
-	   (XML_IGNORE_COMMENTS & style) && p.IsComment()) {
+	if(((XML_IGNORE_DECLS & style) && p.IsDecl()) ||
+	   ((XML_IGNORE_PIS & style) && p.IsPI()) ||
+	   ((XML_IGNORE_COMMENTS & style) && p.IsComment())) {
 		p.Skip();
 		return true;
 	}
@@ -1086,7 +1086,7 @@ bool ShouldPreserve(const String& s)
 		return true;
 	l = s.End();
 	for(const char *x = s; x < l; x++)
-		if(*x == '\t' || *x == '\n' || *x == ' ' && x[1] == ' ')
+		if(*x == '\t' || *x == '\n' || (*x == ' ' && x[1] == ' '))
 			return true;
 	return false;
 }

---------------------------- uppsrc/Core/parser.cpp ----------------------------
index 89fa1353d..91c74f5a5 100644
@@ -190,7 +190,7 @@ String CParser::ReadIdt() {
 	StringBuffer result;
 	int lvl = 0;
 	while(IsAlNum(*term) || *term == '_' || *term == '<' || *term == '>' ||
-	      *term == ':' || (*term == ',' || *term == ' ' ) && lvl > 0 ) {
+	      *term == ':' || ((*term == ',' || *term == ' ' ) && lvl > 0) ) {
 		if(*term == '<') lvl++;
 		if(*term == '>') lvl--;
 		result.Cat(*term++);
@@ -683,7 +683,7 @@ String AsCString(const char *s, const char *lim, int linemax, const char *linepf
 				continue; // skip s++
 			}
 			else {
-				if(byte(*s) < 32 || (byte)*s >= 0x7f && (flags & ASCSTRING_OCTALHI) || (byte)*s == 0xff || (byte)*s == 0x7f) {
+				if(byte(*s) < 32 || ((byte)*s >= 0x7f && (flags & ASCSTRING_OCTALHI)) || (byte)*s == 0xff || (byte)*s == 0x7f) {
 					char h[4];
 					int q = (byte)*s;
 					h[0] = '\\';

------------------------------ uppsrc/Core/t.cpp ------------------------------
index a41c31651..93f8c9d7a 100644
@@ -19,8 +19,8 @@ static int sIdLen(const char *txt)
 static bool sIdEq(const char *a, const char *b)
 {
 	for(;;) {
-		if((*a == '\0' || *a == '\a' && a[1] != '\a') &&
-		   (*b == '\0' || *b == '\a' && b[1] != '\a'))
+		if((*a == '\0' || (*a == '\a' && a[1] != '\a')) &&
+		   (*b == '\0' || (*b == '\a' && b[1] != '\a')))
 			return true;
 		if(*a != *b)
 			return false;

--------------------------- uppsrc/CppBase/Body.cpp ---------------------------
index 5699f53bb..1db7cb6b0 100644
@@ -200,7 +200,7 @@ void Parser::Statement()
 			if(lex == t_eof)
 				ThrowError("");
 			TryLambda();
-			if(Key(';') || lex == '{' || lex == '}' || lex >= tk_if && lex <= tk_do)
+			if(Key(';') || lex == '{' || lex == '}' || (lex >= tk_if && lex <= tk_do))
 				break;
 			++lex;
 		}

--------------------------- uppsrc/CppBase/CppBase.h ---------------------------
index d1efa9efc..86d174aa0 100644
@@ -40,7 +40,7 @@ enum Kind {
 
 inline bool IsCppType(int i)
 {
-	return i >= STRUCT && i <= TYPEDEF || i == FRIENDCLASS;
+	return (i >= STRUCT && i <= TYPEDEF) || i == FRIENDCLASS;
 }
 
 inline bool IsCppCode(int i) {
@@ -56,7 +56,7 @@ inline bool IsCppMacro(int i) {
 }
 
 inline bool IsCppTemplate(int i) {
-	return i == STRUCTTEMPLATE || i >= FUNCTIONTEMPLATE && i <= CLASSFUNCTIONTEMPLATE;
+	return i == STRUCTTEMPLATE || (i >= FUNCTIONTEMPLATE && i <= CLASSFUNCTIONTEMPLATE);
 }
 
 void   CleanPP();

-------------------------- uppsrc/CppBase/Parser.cpp --------------------------
index f18a75251..3f12439b1 100644
@@ -79,7 +79,7 @@ String FnItem(const char *s, const char *pname, const char *qname, const String&
 				res.Cat(*s++);
 				plvl--;
 			}
-			if(iscid(*s) || *s == '~' || *s && lvl)
+			if(iscid(*s) || *s == '~' || (*s && lvl))
 				res.Cat(*s++);
 			else
 				break;
@@ -128,7 +128,7 @@ String FnItem(const char *s, const char *pname, const char *qname, const String&
 			s++;
 			int l = 0;
 			int tl = 0;
-			while(*s && !(l == 0 && (*s == ',' && tl == 0 || *s == ')'))) {
+			while(*s && !(l == 0 && ((*s == ',' && tl == 0) || *s == ')'))) {
 				if(*s == '(' || *s == '[')
 					l++;
 				else
@@ -255,7 +255,7 @@ void TpSkip(CParser& p)
 {
 	int lvl = 0;
 	for(;;) {
-		if(lvl == 0 && (p.IsChar(',') || p.IsChar('>')) || p.IsEof())
+		if((lvl == 0 && (p.IsChar(',') || p.IsChar('>'))) || p.IsEof())
 			break;
 		if(p.Char('<'))
 			lvl++;
@@ -461,7 +461,7 @@ String Parser::ReadOper(bool& castoper) {
 	if(Key('('))
 		level++;
 	for(;;) {
-		if(lex == t_eof || level <= 0 && lex == '(') break;
+		if(lex == t_eof || (level <= 0 && lex == '(')) break;
 		if(Key('(') || Key('[')) level++;
 		else
 		if(Key(')')  || Key(']')) level--;
@@ -837,7 +837,7 @@ int Parser::RPtr()
 			n++;
 		}
 		else
-		if(t == t_dblcolon || lex.IsId(n) || t == ',' && tlevel > 0)
+		if(t == t_dblcolon || lex.IsId(n) || (t == ',' && tlevel > 0))
 			n++;
 		else
 			return 0;
@@ -903,8 +903,8 @@ void Parser::Declarator(Decl& d, const char *p)
 		}
 	}
 	if(Key('(')) {
-		if(inbody || (lex < 256 || lex == tk_true || lex == tk_false)
-		   && lex != ')' && lex != '[' && lex != t_dblcolon) {
+		if(inbody || ((lex < 256 || lex == tk_true || lex == tk_false)
+		   && lex != ')' && lex != '[' && lex != t_dblcolon)) {
 			int level = 0;
 			for(;;) {
 				if(lex == t_eof) break;
@@ -955,7 +955,7 @@ void Parser::Declarator(Decl& d, const char *p)
 		for(;;) {
 			TryLambda();
 			if(lex == t_eof  || lex == ';'
-			   || level == 0 && ((lex == ',' && tlevel == 0) || lex == ')'))
+			   || (level == 0 && ((lex == ',' && tlevel == 0) || lex == ')')))
 				break;
 			if(Key('<')) // we ignore < > as operators, always consider them template bracket
 				tlevel++;
@@ -1232,7 +1232,7 @@ CppItem& Parser::Item(const String& scope, const String& using_namespace, const
 void Parser::Resume(int bl)
 {
 	for(;;) {
-		if(lex == t_eof || lex.GetBracesLevel() == bl && lex == ';')
+		if(lex == t_eof || (lex.GetBracesLevel() == bl && lex == ';'))
 			break;
 		++lex;
 	}
@@ -1581,7 +1581,7 @@ void Parser::Do()
 	}
 	else
 	if(Key(tk_template)) {
-		if(lex.IsId() || lex == tk_class && lex.IsId(1)) {
+		if(lex.IsId() || (lex == tk_class && lex.IsId(1))) {
 			Key(tk_class);
 			for(;;) {
 				if(lex.IsId())

---------------------------- uppsrc/CppBase/Pre.cpp ----------------------------
index e78ada2d1..f465440ab 100644
@@ -36,7 +36,7 @@ SrcFile PreProcess(Stream& in, Parser& parser) // This is not really C preproces
 			const char *s = ln;
 			bool islbl = false;
 			bool wassemi = false;
-			while(*s && iscid(*s) || findarg(*s, '\t', ' ', ':') >= 0) { // check for label, labeled lines are not grounded
+			while((*s && iscid(*s)) || findarg(*s, '\t', ' ', ':') >= 0) { // check for label, labeled lines are not grounded
 				if(*s == ':' && !wassemi) {
 					islbl = true;
 					wassemi = true; // second ':' cancels label

-------------------------- uppsrc/CppBase/ppfile.cpp --------------------------
index fc5e6fd12..eac26e5eb 100644
@@ -92,7 +92,7 @@ PPMacro *FindPPMacro(const String& id, Index<int>& segment_id, int& segmenti)
 			else
 			if(pass == 0 || m.segment_id == 0 || undef.Find(m.undef_segment_id) < 0) {
 				int si = m.segment_id == 0 ? INT_MAX : segment_id.Find(m.segment_id); // defs macros always override
-				if(si > best || si >= 0 && si == best && m.line > line) {
+				if(si > best || (si >= 0 && si == best && m.line > line)) {
 					best = si;
 					line = m.line;
 					r = &m;

---------------------------- uppsrc/CtrlCore/Gtk.h ----------------------------
index 281464c20..f830f391a 100644
@@ -9,8 +9,15 @@
 #pragma clang diagnostic ignored "-Wdeprecated"
 #endif
 
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
+#ifdef __GNUC__
+#pragma GCC diagnostic push 
+#pragma GCC diagnostic ignored "-Wparentheses"
+#endif
+ #include <gtk/gtk.h>
+ #include <gdk/gdkkeysyms.h>
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
 
 #ifdef __clang__
 #pragma clang diagnostic pop

-------------------------- uppsrc/CtrlCore/GtkTop.cpp --------------------------
index 9e1c94d5a..d56b6b430 100644
@@ -68,7 +68,7 @@ void TopWindow::CenterRect(Ctrl *owner)
 {
 	GuiLock __;
 	SetupRect(owner);
-	if(owner && center == 1 || center == 2) {
+	if((owner && center == 1) || center == 2) {
 		Size sz = GetRect().Size();
 		Rect r, wr;
 		wr = Ctrl::GetWorkArea();

------------------------- uppsrc/CtrlCore/GtkUtil.cpp -------------------------
index 415a6c422..051bd7650 100644
@@ -17,8 +17,8 @@ String ImageClipFromPixbufUnref(GdkPixbuf *pixbuf)
 	Image img;
 	if(pixbuf) {
 		int chn = gdk_pixbuf_get_n_channels(pixbuf);
-		if((chn == 3 && !gdk_pixbuf_get_has_alpha(pixbuf) ||
-		    chn == 4 && gdk_pixbuf_get_has_alpha(pixbuf)) &&
+		if(((chn == 3 && !gdk_pixbuf_get_has_alpha(pixbuf)) ||
+		    (chn == 4 && gdk_pixbuf_get_has_alpha(pixbuf))) &&
 		   gdk_pixbuf_get_colorspace(pixbuf) == GDK_COLORSPACE_RGB &&
 		   gdk_pixbuf_get_bits_per_sample(pixbuf) == 8) {
 			Size sz(gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height(pixbuf));

------------------------- uppsrc/CtrlCore/ParseRTF.cpp -------------------------
index c4208bcd6..4a21a4529 100644
@@ -223,7 +223,7 @@ RTFParser::RTFParser(const char *rtf)
 
 RichText RTFParser::Run()
 {
-	if(!PassGroup() || !PassCmd("rtf") || command_arg != 1 && !IsNull(command_arg))
+	if(!PassGroup() || !PassCmd("rtf") || (command_arg != 1 && !IsNull(command_arg)))
 		return pick(output);
 	while(Token() != T_EOF)
 		ReadItem();
@@ -307,7 +307,7 @@ void RTFParser::FlushTable(int level)
 					int& out_wd = (outer_border[b] ? tbl_border : tbl_grid);
 					Color& out_co = (outer_border[b] ? clr_border : clr_grid);
 					if(IsNull(cell.info.format.bordercolor) || border_width[b] <= 0
-					|| !IsNull(out_co) && out_co != cell.info.format.bordercolor)
+					|| (!IsNull(out_co) && out_co != cell.info.format.bordercolor))
 						out_wd = 0;
 					else if(IsNull(out_wd) || border_width[b] < out_wd) {
 						out_wd = border_width[b];
@@ -469,7 +469,7 @@ RTFParser::TOKEN RTFParser::Fetch()
 				}
 
 				default: {
-					if(IsAlpha(*--rtf) || *rtf == '*' && rtf[1] == '\\' && IsAlpha(rtf[2])) {
+					if(IsAlpha(*--rtf) || (*rtf == '*' && rtf[1] == '\\' && IsAlpha(rtf[2]))) {
 						if(*rtf == '*') {
 							rtf += 2;
 							state.new_dest = true;
@@ -541,7 +541,7 @@ bool RTFParser::PassEndGroup(int level)
 void RTFParser::Skip()
 {
 	LLOG("Skip");
-	bool is_group = (token == T_GROUP || token == T_COMMAND && state.new_dest);
+	bool is_group = (token == T_GROUP || (token == T_COMMAND && state.new_dest));
 	is_full = false;
 	if(is_group)
 		SkipGroup();

------------------------- uppsrc/CtrlLib/ArrayCtrl.cpp -------------------------
index b58f6a742..a0e8ef085 100644
@@ -856,7 +856,7 @@ const Display& ArrayCtrl::GetCellInfo(int i, int j, bool f0,
 		bg = array[i].paper;
 	fg = i & 1 ? evenink : oddink;
 	if((st & Display::SELECT) ||
-	    !multiselect && (st & Display::CURSOR) && !nocursor ||
+	    (!multiselect && (st & Display::CURSOR) && !nocursor) ||
 	    drop) {
 		fg = hasfocus ? SColorHighlightText : SColorText;
 		bg = hasfocus ? SColorHighlight : Blend(SColorDisabled, SColorPaper);
@@ -897,7 +897,7 @@ Size  ArrayCtrl::DoPaint(Draw& w, bool sample) {
 	int sy = 0;
 	if(!IsNull(i))
 		while(i < GetCount()) {
-			if((!sample || i == cursor || i < array.GetCount() && array[i].select) && IsLineVisible(i)) {
+			if((!sample || i == cursor || (i < array.GetCount() && array[i].select)) && IsLineVisible(i)) {
 				r.top = sample ? sy : GetLineY(i) - sb;
 				if(r.top > size.cy)
 					break;
@@ -922,7 +922,7 @@ Size  ArrayCtrl::DoPaint(Draw& w, bool sample) {
 							if(spanwidecells)
 								SpanWideCell(d, q, cm, cw, r, i, j);
 							
-							if(cw < 2 * cm || editmode && i == cursor && column[jj].edit)
+							if(cw < 2 * cm || (editmode && i == cursor && column[jj].edit))
 								d.PaintBackground(w, r, q, fg, bg, st);
 							else {
 								d.PaintBackground(w, RectC(r.left, r.top, cm, r.Height()), q, fg, bg, st);
@@ -2299,7 +2299,7 @@ String ArrayCtrl::RowFormat(const char *s)
 bool ArrayCtrl::DoRemove()
 {
 	if(IsReadOnly()) return false;
-	if(!IsCursor() || askremove && !PromptOKCancel(RowFormat(t_("Do you really want to delete the selected %s ?"))))
+	if(!IsCursor() || (askremove && !PromptOKCancel(RowFormat(t_("Do you really want to delete the selected %s ?")))))
 		return false;
 	if(multiselect) {
 		Bits sel;

---------------------------- uppsrc/CtrlLib/Bar.cpp ----------------------------
index 0dda29380..89cff51e9 100644
@@ -680,7 +680,7 @@ void BarCtrl::Layout()
 {
 	LLOG("BarCtrl::Layout");
 	if(IsChild()) {
-		bool dowrap = InFrame() && wrap >= 0 || wrap > 0;
+		bool dowrap = (InFrame() && wrap >= 0) || wrap > 0;
 		if(GetAlign() == BAR_LEFT || GetAlign() == BAR_RIGHT)
 			pane.Repos(false, dowrap ? GetSize().cy : INT_MAX);
 		else

-------------------------- uppsrc/CtrlLib/Button.cpp --------------------------
index df4407d05..a077524df 100644
@@ -396,8 +396,8 @@ bool Button::HotKey(dword key) {
 	}
 	bool up = key & K_KEYUP;
 	key = key & ~K_KEYUP;
-	if(key == K_ENTER && (type == OK || type == EXIT) ||
-	   key == K_ESCAPE && (type == CANCEL || type == EXIT)) {
+	if((key == K_ENTER && (type == OK || type == EXIT)) ||
+	   (key == K_ESCAPE && (type == CANCEL || type == EXIT))) {
 		if(up) {
 			if(IsKeyPush())
 				return FinishPush();

------------------------ uppsrc/CtrlLib/ColumnList.cpp ------------------------
index 7ffc43820..e6960b2e0 100644
@@ -370,7 +370,7 @@ void ColumnList::GetItemStyle(int i, Color& fg, Color& bg, dword& st)
 	if(nobg)
 		bg = Null;
 	if((st & Display::SELECT) ||
-	   (!multi || !item[i].canselect && selcount == 0) && (st & Display::CURSOR) ||
+	   ((!multi || (!item[i].canselect && selcount == 0)) && (st & Display::CURSOR)) ||
 	   drop) {
 		fg = hasfocus ? SColorHighlightText : SColorText;
 		bg = hasfocus ? SColorHighlight : Blend(SColorDisabled, SColorPaper);
@@ -908,7 +908,7 @@ void ColumnList::DragAndDrop(Point p, PasteClip& d)
 		if(DnDInsert(i, p.y, d, 2))
 			return;
 	}
-	if(GetCount() == 0 && p.y < 4 || !WhenDrop) {
+	if((GetCount() == 0 && p.y < 4) || !WhenDrop) {
 		WhenDropInsert(GetCount(), d);
 		if(d.IsAccepted()) {
 			DnD(GetCount(), true);

----------------------- uppsrc/CtrlLib/DateTimeCtrl.cpp -----------------------
index b94f32e45..dca9cd5f0 100644
@@ -902,8 +902,8 @@ void Clock::Paint(Draw& w)
 int Clock::GetDir(int pp, int cp)
 {
 	dir = 0;
-	if(cp >= 1 && cp <= 30 && pp >= 1 && pp <= 30 ||
-	   cp > 30 && cp <= 60 && pp > 30 && pp <= 60)
+	if((cp >= 1 && cp <= 30 && pp >= 1 && pp <= 30) ||
+	   (cp > 30 && cp <= 60 && pp > 30 && pp <= 60))
 	{
 		dir = pp < cp ? 1 : -1;
 	}

----------------------- uppsrc/CtrlLib/DisplayPopup.cpp -----------------------
index f1c65e7a4..9f4fd27ef 100644
@@ -186,7 +186,7 @@ bool DisplayPopup::IsOpen()
 
 bool DisplayPopup::HasMouse()
 {
-	return Ctrl::HasMouse() || ctrl && ctrl->HasMouse();
+	return Ctrl::HasMouse() || (ctrl && ctrl->HasMouse());
 }
 
 void DisplayPopup::Set(Ctrl *_ctrl, const Rect& _item,

-------------------------- uppsrc/CtrlLib/DocEdit.cpp --------------------------
index 13d2fea2a..5edb9b40a 100644
@@ -438,7 +438,7 @@ bool DocEdit::Key(dword key, int cnt)
 		default:
 			if(filter && key >= 32 && key < 65535)
 				key = (*filter)(key);
-			if(key >= ' ' && key < 65536 || key == '\n' || key == '\t' || key == K_SHIFT_SPACE) {
+			if((key >= ' ' && key < 65536) || key == '\n' || key == '\t' || key == K_SHIFT_SPACE) {
 				if(key == K_TAB && !processtab)
 					return false;
 				if(key >= 128 && key < 65536 && (charset != CHARSET_UNICODE && charset != CHARSET_UTF8_BOM)

------------------------ uppsrc/CtrlLib/DropChoice.cpp ------------------------
index 9458e3f87..12b22dd15 100644
@@ -36,7 +36,7 @@ void DropChoice::PseudoPush()
 }
 
 void DropChoice::Drop() {
-	if(!owner || owner->IsReadOnly() && !rodrop || list.GetCount() == 0 && !WhenDrop) return;
+	if(!owner || (owner->IsReadOnly() && !rodrop) || (list.GetCount() == 0 && !WhenDrop)) return;
 	WhenDrop();
 	if(dropfocus)
 		owner->SetWantFocus();
@@ -46,12 +46,12 @@ void DropChoice::Drop() {
 }
 
 void DropChoice::Select() {
-	if(!owner || owner->IsReadOnly() && !rodrop) return;
+	if(!owner || (owner->IsReadOnly() && !rodrop)) return;
 	WhenSelect();
 }
 
 Value DropChoice::Get() const {
-	if(!owner || owner->IsReadOnly() && !rodrop) return Value();
+	if(!owner || (owner->IsReadOnly() && !rodrop)) return Value();
 	int c = list.GetCursor();
 	if(c < 0) return Value();
 	return list.Get(c, 0);
@@ -59,7 +59,7 @@ Value DropChoice::Get() const {
 
 int DropChoice::GetIndex() const
 {
-	if(!owner || owner->IsReadOnly() && !rodrop) return -1;
+	if(!owner || (owner->IsReadOnly() && !rodrop)) return -1;
 	return list.GetCursor();
 }
 

------------------------- uppsrc/CtrlLib/EditField.cpp -------------------------
index a62ac67b5..e68ef15ec 100644
@@ -274,7 +274,7 @@ Color EditField::GetPaper()
 	                                       : style->disabled;
 	if(nobg)
 		paper = Null;
-	if(enabled && (convert && convert->Scan(text).IsError() || errorbg))
+	if(enabled && ((convert && convert->Scan(text).IsError()) || errorbg))
 		paper = style->invalid;
 	return paper;
 }
@@ -941,7 +941,7 @@ bool EditField::Key(dword key, int rep)
 		}
 		return false;
 	default:
-		if(key >= ' ' && key < 65536 || key == K_SHIFT_SPACE) {
+		if((key >= ' ' && key < 65536) || key == K_SHIFT_SPACE) {
 			if(!RemoveSelection()) SaveUndo();
 			while(rep--)
 				Insert(key == K_SHIFT_SPACE ? ' ' : key);

-------------------------- uppsrc/CtrlLib/FileSel.cpp --------------------------
index c1e2b4112..44a968918 100644
@@ -909,7 +909,7 @@ void FileSel::SearchLoad()
 		list.Renaming(true);
 	}
 	if(filesystem->IsPosix())
-		if(d == "/" || !IsEmpty(basedir) && String(~dir).IsEmpty())
+		if(d == "/" || (!IsEmpty(basedir) && String(~dir).IsEmpty()))
 			dirup.Disable();
 	if(filesystem->IsWin32())
 		if(!IsEmpty(basedir) && String(~dir).IsEmpty())
@@ -1282,8 +1282,8 @@ void FileSel::Open() {
 			}
 			if(!IsFullPath(fn))
 				fn = AppendFileName(~dir, fn);
-			if(filesystem->IsWin32() && (!fn.IsEmpty() && (*fn.Last() == '\\' || *fn.Last() == '/'))
-			|| filesystem->IsPosix() && (fn != "/" && (*fn.Last() == '\\' || *fn.Last() == '/')))
+			if((filesystem->IsWin32() && (!fn.IsEmpty() && (*fn.Last() == '\\' || *fn.Last() == '/')))
+			|| (filesystem->IsPosix() && (fn != "/" && (*fn.Last() == '\\' || *fn.Last() == '/'))))
 			{
 				fn.Trim(fn.GetLength() - 1);
 				SetDir(TrimDot(fn));
@@ -1625,7 +1625,7 @@ void FileSel::FileUpdate() {
 	}
 	bool b = list.IsCursor() || !String(~file).IsEmpty();
 	ok.Enable(b);
-	if(mode != SAVEAS || list.IsCursor() && list[list.GetCursor()].isdir)
+	if(mode != SAVEAS || (list.IsCursor() && list[list.GetCursor()].isdir))
 		ok.SetLabel(t_("Open"));
 	else
 		ok.SetLabel(t_("Save"));
@@ -1993,8 +1993,8 @@ bool FileSel::Execute(int _mode) {
 		type.Trim(dlc);
 
 	String d = ~dir;
-	if(filesystem->IsWin32() && d.GetLength() == 3 && d[1] == ':' ||
-	   filesystem->IsPosix() && d == "/" ||
+	if((filesystem->IsWin32() && d.GetLength() == 3 && d[1] == ':') ||
+	   (filesystem->IsPosix() && d == "/") ||
 	   !IsFullPath(d))
 		d.Clear();
 

------------------------- uppsrc/CtrlLib/LabelBase.cpp -------------------------
index 197ccee4d..89b57dd73 100644
@@ -80,7 +80,7 @@ int  ExtractAccessKey(const char *s, String& label)
 	String text;
 	bool qtf = *s == '\1';
 	while(*s)
-		if((*s == '&' && !qtf || *s == '\b') && s[1] && s[1] != '&') {
+		if(((*s == '&' && !qtf) || *s == '\b') && s[1] && s[1] != '&') {
 			akey = ToAscii(ToUpper(s[1]));
 			pos = text.GetLength() + 1; 
 			s++;

------------------------- uppsrc/CtrlLib/LineEdit.cpp -------------------------
index 3017d7b96..87d1232e5 100644
@@ -411,7 +411,7 @@ void   LineEdit::Paint0(Draw& w) {
 	int cursorline = GetLine(cursor);
 	Highlight ih;
 	ih.ink = color[IsShowEnabled() ? INK_NORMAL : INK_DISABLED];
-	ih.paper = color[IsReadOnly() && showreadonly || !IsShowEnabled() ? PAPER_READONLY : PAPER_NORMAL];
+	ih.paper = color[(IsReadOnly() && showreadonly) || !IsShowEnabled() ? PAPER_READONLY : PAPER_NORMAL];
 	if(nobg)
 		ih.paper = Null;
 	ih.font = font;
@@ -609,7 +609,7 @@ void   LineEdit::Paint0(Draw& w) {
 		selh -= len + 1;
 		pos += len + 1;
 	}
-	w.DrawRect(0, y, sz.cx, sz.cy - y, color[IsReadOnly() && showreadonly || !IsShowEnabled() ? PAPER_READONLY : PAPER_NORMAL]);
+	w.DrawRect(0, y, sz.cx, sz.cy - y, color[(IsReadOnly() && showreadonly) || !IsShowEnabled() ? PAPER_READONLY : PAPER_NORMAL]);
 	DrawTiles(w, DropCaret(), CtrlImg::checkers());
 	vlinex = caretpos.x;
 }
@@ -1010,8 +1010,8 @@ bool LineEdit::InsertChar(dword key, int count, bool canow) {
 		return false;
 	if(filter && key >= 32 && key < 65535)
 		key = (*filter)(key);
-	if(!IsReadOnly() && (key >= 32 && key < 65536 || key == '\t' || key == '\n' ||
-	   key == K_ENTER && processenter || key == K_SHIFT_SPACE)) {
+	if(!IsReadOnly() && ((key >= 32 && key < 65536) || key == '\t' || key == '\n' ||
+	   (key == K_ENTER && processenter) || key == K_SHIFT_SPACE)) {
 		if(key >= 128 && key < 65536 && (charset != CHARSET_UNICODE && charset != CHARSET_UTF8_BOM)
 		   && FromUnicode((wchar)key, charset) == DEFAULTCHAR)
 			return true;

-------------------------- uppsrc/CtrlLib/MenuBar.cpp --------------------------
index f82fc3d4c..efb43ecd8 100644
@@ -368,7 +368,7 @@ bool MenuBar::Key(dword key, int count)
 		if(IterateFocusBackward(pane.GetLastChild(), &pane, false, true)) return true;
 	}
 	else
-	if(parentmenu && !parentmenu->IsChild() && key == K_LEFT || key == K_ESCAPE) {
+	if((parentmenu && !parentmenu->IsChild() && key == K_LEFT) || key == K_ESCAPE) {
 		if(HasMouseDeep())
 			GetMouseCtrl()->Refresh();
 		if(parentmenu && parentmenu->submenu)
@@ -449,7 +449,7 @@ bool MenuBar::HotKey(dword key)
 			s_doaltkey = true;
 			return true;
 		}
-		if((key == K_F10 || key == (K_ALT_KEY|K_KEYUP) && s_doaltkey)
+		if((key == K_F10 || (key == (K_ALT_KEY|K_KEYUP) && s_doaltkey))
 		   && !submenu && !HasFocusDeep() && GetTopWindow() && GetTopWindow()->IsForeground()) {
 			LLOG("Open menu by F10 or ALT-UP");
 			SetupRestoreFocus();

------------------------- uppsrc/CtrlLib/MenuItem.cpp -------------------------
index b4be0b8d8..bbfdf38bd 100644
@@ -266,7 +266,7 @@ void MenuItem::LostFocus()
 int MenuItem::GetVisualState()
 {
 	return HasFocus() ?
-	       (HasMouse() && GetMouseLeft() || GetMouseRight()) ? PUSH : HIGHLIGHT : NORMAL;
+	       ((HasMouse() && GetMouseLeft()) || GetMouseRight()) ? PUSH : HIGHLIGHT : NORMAL;
 }
 
 void MenuItem::SyncState()
@@ -395,7 +395,7 @@ void MenuItem::RightUp(Point p, dword w)
 bool MenuItem::HotKey(dword key)
 {
 	if(isenabled && (key == accel || CompareAccessKey(accesskey, key)
-	|| key < 256 && IsAlNum((char)key) && CompareAccessKey(accesskey, ToUpper((char)key) + K_DELTA + K_ALT))) {
+	|| (key < 256 && IsAlNum((char)key) && CompareAccessKey(accesskey, ToUpper((char)key) + K_DELTA + K_ALT)))) {
 		LLOG("MenuItem::HotKey(" << key << ") -> SetFocus");
 		SetFocus();
 		Sync();
@@ -517,8 +517,8 @@ Size TopSubMenuItem::GetMinSize() const
 int  TopSubMenuItem::GetState()
 {
 	if(parentmenu && parentmenu->GetActiveSubmenu() == &menu) return PUSH;
-	if(HasMouse() && GetParent() && !GetParent()->HasFocusDeep() &&
-	                 (!parentmenu || !parentmenu->GetActiveSubmenu() || parentmenu->GetActiveSubmenu() == &menu)
+	if((HasMouse() && GetParent() && !GetParent()->HasFocusDeep() &&
+	                 (!parentmenu || !parentmenu->GetActiveSubmenu() || parentmenu->GetActiveSubmenu() == &menu))
 	   || HasFocus())
 		return HIGHLIGHT;
 	return NORMAL;
@@ -609,7 +609,7 @@ void TopSubMenuItem::SyncState()
 int  TopMenuItem::GetState()
 {
 	if(!IsEnabled()) return NORMAL;
-	if(HasMouse() && GetMouseLeft() || GetMouseRight()) return PUSH;
+	if((HasMouse() && GetMouseLeft()) || GetMouseRight()) return PUSH;
 	if(HasFocus() || HasMouse()) return HIGHLIGHT;
 	return NORMAL;
 }

------------------------ uppsrc/CtrlLib/MultiButton.cpp ------------------------
index 0bfe7f7dd..2173d0337 100644
@@ -286,13 +286,13 @@ int MultiButton::ChState(int i)
 	if(i == MAIN && frm && style->activeedge) {
 		int q = 0;
 		if(p)
-			q = !p->IsEnabled() || !IsEnabled() || p->IsReadOnly() || i >= 0 && !button[i].enabled ? CTRL_DISABLED
+			q = !p->IsEnabled() || !IsEnabled() || p->IsReadOnly() || (i >= 0 && !button[i].enabled) ? CTRL_DISABLED
 			    : p->HasFocus() || push ? CTRL_PRESSED
 			    : p->HasMouse() || hl >= 0 ? CTRL_HOT
 			    : CTRL_NORMAL;
 		return q;
 	}
-	if(!IsShowEnabled() || IsReadOnly() || frm && p && p->IsReadOnly() || i >= 0 && !button[i].enabled)
+	if(!IsShowEnabled() || IsReadOnly() || (frm && p && p->IsReadOnly()) || (i >= 0 && !button[i].enabled))
 		return CTRL_DISABLED;
 	if(IsTrivial() && !frm)
 		i = 0;

----------------------- uppsrc/CtrlLib/RichTextView.cpp -----------------------
index 3b2c0d482..e4d80ac8d 100644
@@ -188,7 +188,7 @@ void  RichTextView::RefreshSel()
 {
 	int l = minmax(min(cursor, anchor), 0, text.GetLength());
 	int h = minmax(max(cursor, anchor), 0, text.GetLength());
-	if(sell == l && selh == h || sell == selh && l == h)
+	if((sell == l && selh == h) || (sell == selh && l == h))
 		return;
 	RichPos pl = text.GetRichPos(l);
 	RichPos ph = text.GetRichPos(h);

------------------------ uppsrc/CtrlLib/SuggestCtrl.cpp ------------------------
index fab48acf3..a8047aad9 100644
@@ -89,7 +89,7 @@ bool SuggestCtrl::Key(dword key, int count)
 	if(cc)
 		key = cc;
 	if(EditString::Key(key, count)) {
-		if(key >= 32 && key < 65536 || key == K_BACKSPACE || key == K_CTRL_SPACE) {
+		if((key >= 32 && key < 65536) || key == K_BACKSPACE || key == K_CTRL_SPACE) {
 			int h;
 			WString x = CF(ReadLast(h));
 			list.Clear();

-------------------------- uppsrc/CtrlLib/Switch.cpp --------------------------
index b7e59cdda..e4fa3f9dc 100644
@@ -217,7 +217,7 @@ void Switch::Paint(Draw& w) {
 				DrawSmartText(w, x + isz.cx + DPI(4), y + ty, sz.cx, v.label, font,
 				              dv || IsReadOnly() ? SColorDisabled : GetLabelTextColor(this), ///////
 				              VisibleAccessKeys() ? v.accesskey : 0);
-				if(HasFocus() && (pushindex == i || v.value == value && pushindex < 0))
+				if(HasFocus() && (pushindex == i || (v.value == value && pushindex < 0)))
 					DrawFocus(w, RectC(x + isz.cx + DPI(2), y + ty - DPI(1), tsz.cx + DPI(3), tsz.cy + DPI(2)) & sz);
 			}
 			v.rect = hr;

-------------------------- uppsrc/CtrlLib/ToolTip.cpp --------------------------
index 8c82fc164..00ca2c60b 100644
@@ -93,7 +93,7 @@ void SyncToolTip(Ctrl *ctrl)
 {
 	if(!GUI_ToolTips())
 		return;
-	if(ctrl != tipctrl || ctrl && ctrl->GetTip() != AppToolTip().Get()) {
+	if(ctrl != tipctrl || (ctrl && ctrl->GetTip() != AppToolTip().Get())) {
 		LLOG("ToolTipHook / ctrl change " << UPP::Name(ctrl) << " -> " << UPP::Name(ctrl));
 		tipctrl = ctrl;
 		KillTimeCallback((void *)SyncToolTip);

------------------------- uppsrc/CtrlLib/TreeCtrl.cpp -------------------------
index bae192b99..4e38ca752 100644
@@ -803,7 +803,7 @@ bool TreeCtrl::IsSel(int id) const
 
 bool TreeCtrl::IsSelDeep(int id) const
 {
-	return IsSel(id) || id && IsSelDeep(GetParent(id));
+	return IsSel(id) || (id && IsSelDeep(GetParent(id)));
 }
 
 void TreeCtrl::SelectOne0(int id, bool sel, bool cb)
@@ -1073,7 +1073,7 @@ const Display *TreeCtrl::GetStyle(int i, Color& fg, Color& bg, dword& st)
 	if(hasfocus)
 		st |= Display::FOCUS;
 	if((st & Display::SELECT) ||
-	    !multiselect && (st & Display::CURSOR) && !nocursor ||
+	    (!multiselect && (st & Display::CURSOR) && !nocursor) ||
 	    drop) {
 		fg = hasfocus ? SColorHighlightText : SColorText;
 		bg = hasfocus ? SColorHighlight : Blend(SColorDisabled, SColorPaper);
@@ -1156,7 +1156,7 @@ void TreeCtrl::Paint(Draw& w)
 				const Display *d = GetStyle(i, fg, bg, st);
 				int ctx = highlight_ctrl * csz.cx;
 				Rect br = RectC(x, y, vsz.cx + 2 * m.margin + ctx, msz.cy);
-				if(!IsNull(m.value) || m.ctrl && highlight_ctrl) {
+				if(!IsNull(m.value) || (m.ctrl && highlight_ctrl)) {
 					w.DrawRect(br, bg);
 					Rect r = RectC(x + ctx + m.margin, y + (msz.cy - vsz.cy) / 2, vsz.cx, vsz.cy);
 					w.Clip(r);
@@ -1871,7 +1871,7 @@ void OptionTree::SetOption(int id)
 		}
 		opt = option[id];
 		if(opt) {
-			if(t && f || n) {
+			if((t && f) || n) {
 				opt->Set(Null);
 			}
 			else

----------------------------- uppsrc/Draw/Font.cpp -----------------------------
index 19d91f89d..eda6ad3bf 100644
@@ -90,7 +90,7 @@ void Font::SetFace(int index, const String& name)
 
 int FontFilter(int c)
 {
-	return c >= 'a' && c <= 'z' || c >= '0' && c <= '9' ? c : c >= 'A' && c <= 'Z' ? ToLower(c) : 0;
+	return (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') ? c : c >= 'A' && c <= 'Z' ? ToLower(c) : 0;
 }
 
 int  Font::FindFaceNameIndex(const String& name) {

---------------------------- uppsrc/Draw/Image.cpp ----------------------------
index 63a1f8478..bb44cc61f 100644
@@ -274,12 +274,12 @@ bool Image::operator==(const Image& img) const
 {
 	static_assert(sizeof(RGBA) == 4, "sizeof(RGBA)");
 	return IsSame(img) ||
-	   GetSize() == img.GetSize() &&
+	   (GetSize() == img.GetSize() &&
 	   GetHotSpot() == img.GetHotSpot() &&
 	   Get2ndSpot() == img.Get2ndSpot() &&
 	   GetDots() == img.GetDots() &&
 	   GetResolution() == img.GetResolution() &&
-	   memeq32(~*this, ~img, GetLength());
+	   memeq32(~*this, ~img, GetLength()));
 }
 
 bool Image::operator!=(const Image& img) const

------------------------------ uppsrc/Esc/Esc.cpp ------------------------------
index 829d5c7aa..d3b08a43a 100644
@@ -169,7 +169,7 @@ EscValue Esc::ExecuteLambda(const String& id, EscValue lambda, SRVal self, Vecto
 	if(!lambda.IsLambda())
 		ThrowError(Format("'%s' is not a lambda", id));
 	const EscLambda& l = lambda.GetLambda();
-	if(!l.varargs && arg.GetCount() > l.arg.GetCount()
+	if((!l.varargs && arg.GetCount() > l.arg.GetCount())
 	   || arg.GetCount() < l.arg.GetCount() - l.def.GetCount())
 		ThrowError("invalid number of arguments in call to '" + id + "'");
 	Esc sub(global, l.code, op_limit, l.filename, l.line);

-------------------------- uppsrc/Painter/OnPath.cpp --------------------------
index b94a2aab8..df3645320 100644
@@ -13,7 +13,7 @@ void BufferPainter::BeginOnPathOp(double q, bool abs)
 		Pointf pos(0, 0);
 		for(int i = 0; i < onpath.GetCount(); i++) {
 			PathLine& l = onpath[i];
-			if(l.len > 0 && (l.len > q || q >= 1.0 && i == onpath.GetCount() - 1)) {
+			if(l.len > 0 && (l.len > q || (q >= 1.0 && i == onpath.GetCount() - 1))) {
 				Pointf v = l.p - pos;
 				Translate(q / l.len * v + pos);
 				Rotate(Bearing(v));

-------------------------- uppsrc/Painter/Render.cpp --------------------------
index 7205edf9d..8e0872655 100644
@@ -147,7 +147,7 @@ Buffer<ClippingLine> BufferPainter::RenderPath(double width, Event<One<SpanSourc
 
 	current = Null;
 
-	if(width == 0 || !ss && color.a == 0 && width >= FILL)
+	if(width == 0 || (!ss && color.a == 0 && width >= FILL))
 		return newclip;
 	
 	if(pathattr.mtx_serial != preclip_mtx_serial) {

-------------------------- uppsrc/Painter/Stroker.cpp --------------------------
index 317d67090..f7a654c53 100644
@@ -41,10 +41,10 @@ void Stroker::Round(const Pointf& p, const Pointf& v1, const Pointf& v2, double
 
 inline bool Stroker::PreClipped(Pointf p2, Pointf p3)
 {
-	return p2.x + tw < preclip.left && p3.x + tw < preclip.left ||
-	       p2.x - tw > preclip.right && p3.x - tw > preclip.right ||
-           p2.y + tw < preclip.top && p3.y + tw < preclip.top ||
-	       p2.y - tw > preclip.bottom && p3.y - tw > preclip.bottom;
+	return (p2.x + tw < preclip.left && p3.x + tw < preclip.left) ||
+	       (p2.x - tw > preclip.right && p3.x - tw > preclip.right) ||
+           (p2.y + tw < preclip.top && p3.y + tw < preclip.top) ||
+	       (p2.y - tw > preclip.bottom && p3.y - tw > preclip.bottom);
 }
 
 void Stroker::Line(const Pointf& p3)

------------------------- uppsrc/Painter/SvgParser.cpp -------------------------
index 61fcbc380..84ba2f614 100644
@@ -449,7 +449,7 @@ void SvgParser::Element(const XmlNode& n, int depth, bool dosymbols)
 		FinishElement();
 	}
 	else
-	if(n.IsTag("g") || n.IsTag("symbol") && dosymbols)
+	if(n.IsTag("g") || (n.IsTag("symbol") && dosymbols))
 		Items(n, depth);
 	else
 	if(n.IsTag("use")) {

--------------------------- uppsrc/RichEdit/Clip.cpp ---------------------------
index 5d943aa7e..6da88b655 100644
@@ -38,7 +38,7 @@ bool RichEdit::Accept(PasteClip& d, RichText& clip, String& fmt)
 				if(d.Accept() && GetFileLength(fn) < 17000000) {
 					String data = LoadFile(fn);
 					StringStream ss(data);
-					if(StreamRaster::OpenAny(ss) || ext == ".svg" && IsSVG(LoadFile(fn))) {
+					if(StreamRaster::OpenAny(ss) || (ext == ".svg" && IsSVG(LoadFile(fn)))) {
 						RichPara p;
 						p.Cat(CreateRawImageObject(data), formatinfo);
 						clip.Cat(p);

-------------------------- uppsrc/RichEdit/Editor.cpp --------------------------
index 30ba8cff4..2e9484b05 100644
@@ -328,7 +328,7 @@ int  RichEdit::GetNearestPos(int x, PageY py)
 	String dummy;
 	RichPos p = text.GetRichPos(c);
 	if(c >= text.GetLength() - 1 || c < 0 || p.object || p.field
-	   || p.table && (p.posincell == 0 || p.posincell == p.celllen))
+	   || (p.table && (p.posincell == 0 || p.posincell == p.celllen)))
 		return c;
 	Rect r1 = text.GetCaret(c, pagesz);
 	Rect r2 = text.GetCaret(c + 1, pagesz);

--------------------------- uppsrc/RichEdit/Find.cpp ---------------------------
index 739af1971..06c2ceefb 100644
@@ -45,8 +45,8 @@ struct RichFindIterator : RichText::Iterator {
 				q += cursor - pos;
 			while(q <= e) {
 				if(compare3(q, upperw, lowerw, len) &&
-				   (!ww || (q + len == e || !IsLetter(q[len])) &&
-				           (q == ptext || !IsLetter(q[-1])))) {
+				   (!ww || ((q + len == e || !IsLetter(q[len])) &&
+				           (q == ptext || !IsLetter(q[-1]))))) {
 					fpos = int(q - ~ptext + pos);
 					return true;
 				}

--------------------------- uppsrc/RichEdit/Kbd.cpp ---------------------------
index 5022551fc..af687930a 100644
@@ -184,7 +184,7 @@ bool RichEdit::Key(dword key, int count)
 		}
 		if(key == K_SHIFT_SPACE)
 			key = ' ';
-		if(key == 9 || key >= 32 && key < 65536) {
+		if(key == 9 || (key >= 32 && key < 65536)) {
 			RichPara::Format f;
 			if(IsSelection()) {
 				f = text.GetRichPos(min(cursor, anchor)).format;

------------------------- uppsrc/RichEdit/Speller.cpp -------------------------
index b52898ec1..037626ad1 100644
@@ -36,7 +36,7 @@ Bits RichEdit::SpellParagraph(const RichPara& para)
 	while(s < end) {
 		if(IsLetter(*s)) {
 			const wchar *q = s;
-			while(s < end && IsLetter(*s) || s + 1 < end && *s == '\'' && IsLetter(s[1]))
+			while((s < end && IsLetter(*s)) || (s + 1 < end && *s == '\'' && IsLetter(s[1])))
 				s++;
 			if(!SpellWord(q, int(s - q), lang[q - text]))
 				e.SetN(int(q - text), int(s - q));

-------------------------- uppsrc/RichEdit/Table.cpp --------------------------
index 92eeebe3a..d39cf48cc 100644
@@ -323,7 +323,7 @@ void RichEdit::SplitCell()
 
 void RichEdit::CellProperties()
 {
-	if(!(tablesel || cursorp.table && !IsSelection()))
+	if(!(tablesel || (cursorp.table && !IsSelection())))
 		return;
 	WithCellPropertiesLayout<TopWindow> dlg;
 	CtrlLayoutOKCancel(dlg, t_("Cell properties"));

--------------------------- uppsrc/RichEdit/Tool.cpp ---------------------------
index 458c3507e..d568d235d 100644
@@ -297,7 +297,7 @@ void RichEdit::RedoTool(Bar& bar, dword key)
 
 void RichEdit::CutTool(Bar& bar, dword key)
 {
-	bar.Add(!IsReadOnly() && IsSelection() || objectpos >= 0, t_("Cut"), CtrlImg::cut(), USERBACK(Cut))
+	bar.Add((!IsReadOnly() && IsSelection()) || objectpos >= 0, t_("Cut"), CtrlImg::cut(), USERBACK(Cut))
 	   .Key(K_SHIFT_DELETE)
 	   .Key(key);
 }

------------------------- uppsrc/RichText/ParaType.cpp -------------------------
index 45db631fa..4ccb6bf5f 100644
@@ -317,9 +317,9 @@ RichPara::Lines RichPara::FormatLines(int acx) const
 				t = GetNextTab(cx + format.lm, rcx);
 				space = NULL;
 			}
-			if(cx + *w > rcx && s > text ||
-			   *s == '\t' && (t.align == ALIGN_RIGHT ? t.pos - format.lm > rcx
-			                                         : t.pos - format.lm >= rcx)) {
+			if((cx + *w > rcx && s > text) ||
+			   (*s == '\t' && (t.align == ALIGN_RIGHT ? t.pos - format.lm > rcx
+			                                         : t.pos - format.lm >= rcx))) {
 				Line& l = lines.line.Add();
 				l.withtabs = withtabs;
 				l.pos = (int)(text - lines.text);

------------------------- uppsrc/RichText/ParseQtf.cpp -------------------------
index 866144131..59fe1ae2d 100644
@@ -325,11 +325,11 @@ void RichQtfParser::ReadObject()
 			StringBuffer data;
 			for(;;) {
 				while(*term < 32 && *term > 0) term++;
-				if((byte)*term >= ' ' && (byte)*term <= 127 || *term == '\0') break;
+				if(((byte)*term >= ' ' && (byte)*term <= 127) || *term == '\0') break;
 				byte seven = *term++;
 				for(int i = 0; i < 7; i++) {
 					while((byte)*term < 32 && (byte)*term > 0) term++;
-					if((byte)*term >= ' ' && (byte)*term <= 127 || *term == '\0') break;
+					if(((byte)*term >= ' ' && (byte)*term <= 127) || *term == '\0') break;
 					data.Cat((*term++ & 0x7f) | ((seven << 7) & 0x80));
 					seven >>= 1;
 				}

------------------------- uppsrc/RichText/TxtData.cpp -------------------------
index cb5e9bd9a..579c30630 100644
@@ -203,7 +203,7 @@ RichPara RichTxt::Get(int i, const RichStyles& s) const
 
 bool RichTxt::IsEmpty() const
 {
-	return part.IsEmpty() || part.GetCount() == 1 && ComputeLength() == 0;
+	return part.IsEmpty() || (part.GetCount() == 1 && ComputeLength() == 0);
 }
 
 int RichTxt::ComputeLength() const

------------------------- uppsrc/RichText/TxtPaint.cpp -------------------------
index 123c6de37..b002d1715 100644
@@ -100,7 +100,7 @@ void RichTxt::Advance(int parti, RichContext& rc, RichContext& begin) const
 			}
 			if(pp.newhdrftr && rc.text == this)
 				rc.HeaderFooter(~pp.header, ~pp.footer);
-			if(pp.newpage || rc.py.y + cy + nbefore + nline > rc.page.bottom && cy < rc.page.Height())
+			if(pp.newpage || (rc.py.y + cy + nbefore + nline > rc.page.bottom && cy < rc.page.Height()))
 				rc.Page();
 			begin = rc;
 			rc.py.y += pp.before + pp.ruler;

--------------------------- uppsrc/TabBar/TabBar.cpp ---------------------------
index 0295ae22a..6f9fbe37c 100644
@@ -2279,7 +2279,7 @@ bool TabBar::ProcessMouse(int i, const Point& p)
 		if (stacking && ProcessStackMouse(i, p))
 			return true;
 		bool iscross = crosses && !IsCancelClose(i) ? tabs[i].HasMouseCross(p) : false;
-		if(highlight != i || (iscross && cross != i || !iscross && cross == i))
+		if(highlight != i || ((iscross && cross != i) || (!iscross && cross == i)))
 		{
 			cross = iscross ? i : -1;
 			SetHighlight(i);

----------------------- uppsrc/TextDiffCtrl/DirDiff.cpp -----------------------
index 5042053a1..7d4f95748 100644
@@ -197,8 +197,8 @@ void DirDiffDlg::ShowResult()
 	for(int i = 0; i < list.GetCount(); i++)
 	{
 		int n = list[i].d;
-		if((n == NORMAL_FILE && modified || n == DELETED_FILE && removed
-		    || n == NEW_FILE && added || n == FAILED_FILE || n == PATCHED_FILE)
+		if(((n == NORMAL_FILE && modified) || (n == DELETED_FILE && removed)
+		    || (n == NEW_FILE && added) || n == FAILED_FILE || n == PATCHED_FILE)
 		   && ToLower(list[i].a).Find(sFind) >= 0)
 			files.Add(MakeFile(i));
 	}

----------------------- uppsrc/TextDiffCtrl/TextCtrl.cpp -----------------------
index 506eb4e1e..e9330209b 100644
@@ -52,7 +52,7 @@ void TextCompareCtrl::DoSelection(int y, bool shift)
 void TextCompareCtrl::LeftDown(Point pt, dword keyflags)
 {
 	Size sz = GetSize();
-	if(pt.x > sz.cx - gutter_width || HasCapture() && gutter_capture) {
+	if(pt.x > sz.cx - gutter_width || (HasCapture() && gutter_capture)) {
 		if(!HasCapture())
 			SetCapture();
 		int line = (pt.y * lines.GetCount()) / sz.cy;
@@ -213,7 +213,7 @@ bool TextCompareCtrl::LineDiff(bool left, Vector<LineEdit::Highlight>& hln, Colo
 			}
 		}
 	
-	if(matchlen > 1 || matchlen && !IsAlNum(s1[p1])) {
+	if(matchlen > 1 || (matchlen && !IsAlNum(s1[p1]))) {
 		for(int i = 0; i < matchlen; i++)
 			hln[(left ? p1 : p2) + i].paper = eq_color;
 

----------------------- uppsrc/TextDiffCtrl/TextDiff.cpp -----------------------
index 695362e56..785fe44c8 100644
@@ -111,7 +111,7 @@ TextComparator::TextComparator(const Vector<String>& f1, const Vector<String>& f
 
 static bool CompareSection(const TextSection& ta, const TextSection& tb)
 {
-	return ta.start1 < tb.start1 || ta.start1 == tb.start1 && ta.start2 < tb.start2;
+	return ta.start1 < tb.start1 || (ta.start1 == tb.start1 && ta.start2 < tb.start2);
 }
 
 Array<TextSection> TextComparator::GetSections() const

------------------------ uppsrc/TextDiffCtrl/patch.cpp ------------------------
index a422dd8b6..9d4f86ba9 100644
@@ -195,7 +195,7 @@ String Patch::GetPatchedFile(int i) const
 			}
 		}
 		
-		if(pos < 0 || ch_pos.GetCount() && ch_pos.Top() > pos)
+		if(pos < 0 || (ch_pos.GetCount() && ch_pos.Top() > pos))
 			return String::GetVoid();
 		ch_pos.Add(pos);
 	}

---------------------------- uppsrc/ide/Assist.cpp ----------------------------
index e735439f1..1b1514220 100644
@@ -343,9 +343,9 @@ void AssistEditor::SyncAssist()
 			if(!found[i] &&
 			   (typei < 0 || m.typei == typei) &&
 			   (pass ? m.uname.StartsWith(uname) : m.name.StartsWith(name)) &&
-			   (!destructor || m.kind == DESTRUCTOR && m.scope == current_type + "::")) {
+			   (!destructor || (m.kind == DESTRUCTOR && m.scope == current_type + "::"))) {
 					int q = include_assist ? -1 : over.Find(m.qitem);
-					if(q < 0 || over[q] == m.typei && m.scope.GetCount()) {
+					if(q < 0 || (over[q] == m.typei && m.scope.GetCount())) {
 						found[i] = true;
 						assist_item_ndx.Add(i);
 						if(q < 0)
@@ -865,8 +865,8 @@ bool AssistEditor::Key(dword key, int count)
 	else
 	if(auto_assist) {
 		if(InCode()) {
-			if(key == '.' || key == '>' && Ch(GetCursor32() - 2) == '-' ||
-			   key == ':' && Ch(GetCursor32() - 2) == ':')
+			if(key == '.' || (key == '>' && Ch(GetCursor32() - 2) == '-') ||
+			   (key == ':' && Ch(GetCursor32() - 2) == ':'))
 				Assist();
 			else
 			if(key == '(') {

---------------------- uppsrc/ide/Browser/CodeBrowser.cpp ----------------------
index 9e17442d0..1554c760c 100644
@@ -4,7 +4,7 @@ bool MatchCib(const String& s, const String& match)
 {
 	if(IsNull(match)) return true;
 	int q = ToUpper(s).Find(match);
-	return q > 0 && !iscid(s[q - 1]) || q == 0;	
+	return (q > 0 && !iscid(s[q - 1])) || q == 0;	
 }
 
 bool MatchPm(const String& fn, const String& pm)

------------------------ uppsrc/ide/Browser/CodeRef.cpp ------------------------
index f70d1d7b0..c3dd27fb8 100644
@@ -369,7 +369,7 @@ void TopicEditor::GoTo(const String& _topic, const String& link, const String& c
 					for(;;) {
 						int c = editor.GetCursor();
 						RichText::FormatInfo f = editor.GetFormatInfo();
-						if(f.styleid == BeginUuid() || (IsNull(f.label) || f.label == "noref") && pass)
+						if(f.styleid == BeginUuid() || ((IsNull(f.label) || f.label == "noref") && pass))
 							break;
 						editor.NextPara();
 						if(editor.GetCursor() == c)

------------------------- uppsrc/ide/Browser/Item.cpp -------------------------
index 84207acc1..384e8859f 100644
@@ -96,7 +96,7 @@ Vector<ItemTextPart> ParseItemNatural(const String& name,
 		p.pari = pari;
 		int n = 1;
 		if(*s >= '0' && *s <= '9') {
-			while(s[n] >= '0' && s[n] <= '9' || (s[n] == 'x' || s[n] == 'X'))
+			while((s[n] >= '0' && s[n] <= '9') || (s[n] == 'x' || s[n] == 'X'))
 				n++;
 			p.type = ITEM_NUMBER;
 		}

----------------------- uppsrc/ide/Browser/TopicBase.cpp -----------------------
index fe895c318..f4696cdf1 100644
@@ -139,7 +139,7 @@ void SyncTopicFile(const String& link)
 	LLOG("SyncTopicFile " << link << " path: " << path);
 	TopicInfo& ti = topic_info().GetPut(link);
 	Time tm = FileGetTime(path);
-	if(ti.path == ":ide:" || ti.path == path && ti.time == tm)
+	if(ti.path == ":ide:" || (ti.path == path && ti.time == tm))
 		return;
 	String fn = TopicCacheName(path);
 	if(FileGetTime(fn) > tm) {

---------------------- uppsrc/ide/Builders/GccBuilder.cpp ----------------------
index 528a9615f..d81dbe6a6 100644
@@ -93,10 +93,9 @@ bool GccBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V
 				String fn = srcfile[j];
 				String ext = GetSrcType(fn);
 				if(findarg(ext, ".c", ".cpp", ".cc", ".cxx", ".brc", ".s", ".ss") >= 0 ||
-				   objectivec && findarg(ext, ".mm", ".m") >= 0 ||
-				   +
+				   (objectivec && findarg(ext, ".mm", ".m") >= 0) ||
 				   (!release && blitz && ext == ".icpp") ||
-				   ext == ".rc" && HasFlag("WIN32")) {
+				   (ext == ".rc" && HasFlag("WIN32"))) {
 					sfile.Add(fn);
 					soptions.Add(gop);
 				}
@@ -325,7 +324,7 @@ bool GccBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V
 		OnFinish(callback1(DeletePCHFile, pch_file));
 
 	if(!HasFlag("MAIN")) {
-		if(HasFlag("BLITZ") && !HasFlag("SO") || HasFlag("NOLIB") || making_lib) {
+		if((HasFlag("BLITZ") && !HasFlag("SO")) || HasFlag("NOLIB") || making_lib) {
 			linkfile.Append(obj); // Simply link everything as .o files...
 			IdeConsoleEndGroup();
 //			if(ccount)

--------------------- uppsrc/ide/Builders/JavaBuilder.cpp ---------------------
index 9e920d0e8..1921e674f 100644
@@ -97,7 +97,7 @@ bool JavaBuilder::BuildPackage(const String& package, Vector<String>& linkfile,
 				String fn = srcfile[j];
 				String ext = ToLower(GetFileExt(fn));
 				bool ismf = false;
-				if(ext == ".java" || main && ext == ".mf")
+				if(ext == ".java" || (main && ext == ".mf"))
 				{
 					if(ext == ".mf")
 					{

-------------------------- uppsrc/ide/ContextGoto.cpp --------------------------
index e664547d9..b07870876 100644
@@ -482,7 +482,7 @@ void Ide::GotoFileAndId(const String& path, const String& id)
 			WString ln = editor.GetWLine(i);
 			int q = ln.Find(wid);
 			while(q >= 0) {
-				if(q == 0 || !iscid(ln[q - 1]) && !iscid(ln[q + wid.GetCount()])) {
+				if(q == 0 || (!iscid(ln[q - 1]) && !iscid(ln[q + wid.GetCount()]))) {
 					editor.SetCursor(editor.GetPos64(i, q));
 					editor.CenterCursor();
 					return;

-------------------------- uppsrc/ide/Core/BinObj.cpp --------------------------
index ab5789c78..a58b4e63a 100644
@@ -75,7 +75,7 @@ void BinObjInfo::Parse(CParser& binscript, String base_dir)
 				int f = brow.Find(blk.index);
 				if(f >= 0)
 					binscript.ThrowError(Format("%s[%d] already seen at line %d", blk.ident, blk.index, brow[f].scriptline));
-				if(blk.index < 0 && !brow.IsEmpty() || blk.index >= 0 && !brow.IsEmpty() && brow[0].index < 0)
+				if((blk.index < 0 && !brow.IsEmpty()) || (blk.index >= 0 && !brow.IsEmpty() && brow[0].index < 0))
 					binscript.ThrowError(Format("%s: mixing non-array and array elements", blk.ident));
 				brow.Add(blk.index, blk);
 				if(!(blk.flags & Block::FLG_MASK))

------------------------- uppsrc/ide/Core/Package.cpp -------------------------
index 2b83dc836..70d861e8a 100644
@@ -79,7 +79,7 @@ String ReadWhen(CParser& p) {
 			const char *b = p.GetPtr();
 			int lvl = 0;
 			for(;;) {
-				if(p.IsEof() || lvl == 0 && p.IsChar(')'))
+				if(p.IsEof() || (lvl == 0 && p.IsChar(')')))
 					break;
 				if(p.Char('('))
 					lvl++;

------------------------------ uppsrc/ide/Cpp.cpp ------------------------------
index e23671043..b7fba0396 100644
@@ -123,7 +123,7 @@ void AssistEditor::GatherItems(const String& type, bool only_public, Index<Strin
 			const CppItem& im = n[i];
 			if(im.kind == STRUCT || im.kind == STRUCTTEMPLATE)
 				base << im.qptype << ';';
-			if((im.IsCode() || !thisback && (im.IsData() || im.IsMacro() && IsNull(type)))
+			if((im.IsCode() || (!thisback && (im.IsData() || (im.IsMacro() && IsNull(type)))))
 			   && (!op || im.access == PUBLIC)) {
 				AssistItemAdd(ntp, im, typei);
 			}

----------------------- uppsrc/ide/Debuggers/GdbData.cpp -----------------------
index 0b460b0f4..36a5fa0c6 100644
@@ -52,7 +52,7 @@ String DataClean(CParser& p)
 	int lvl = 0;
 	for(;;) {
 		bool sp = p.Spaces();
-		if(lvl == 0 && (p.IsChar('}') || p.IsChar(',')) || p.IsEof())
+		if((lvl == 0 && (p.IsChar('}') || p.IsChar(','))) || p.IsEof())
 			break;
 		if(sp)
 			r << ' ';

---------------------------- uppsrc/ide/Errors.cpp ----------------------------
index fa0734aa5..da5bb6abe 100644
@@ -59,7 +59,7 @@ bool Ide::FindLineError(const String& ln, FindLineErrorCache& cache, ErrorInfo&
 					}
 				}
 				file = FollowCygwinSymlink(file);
-				if(!IsFullPath(file) || !exists && !FileExists(file) || !IsTextFile(file))
+				if(!IsFullPath(file) || (!exists && !FileExists(file)) || !IsTextFile(file))
 					file = Null;
 				cache.file.Add(file0, file);
 			}
@@ -150,7 +150,7 @@ bool Ide::FindLineError(const String& ln, FindLineErrorCache& cache, ErrorInfo&
 				return f.lineno > 0;
 			}
 			else
-			if(*s == ':' || !strchr(s, '/') && !strchr(s, '\\')) // safe to say this is final
+			if(*s == ':' || (!strchr(s, '/') && !strchr(s, '\\'))) // safe to say this is final
 				return false;
 			else
 				f.file.Cat(*s); // File is not complete, e.g.: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Vc\Include\string.h(186)

--------------------------- uppsrc/ide/Navigator.cpp ---------------------------
index 74dc3cd2f..77132018f 100644
@@ -572,10 +572,10 @@ void Navigator::Search()
 					for(int j = 0; j < ci.GetCount(); j++) {
 						const CppItem& m = ci[j];
 						if(local ? m.file == fileii
-						         : m.uname.Find('@') < 0 && (pass < 0 ? m.name == search_name :
+						         : (m.uname.Find('@') < 0 && (pass < 0 ? m.name == search_name :
 						                               pass ? m.uname.Find(usearch_name) >= 0
-						                                    : m.name.StartsWith(search_name))
-						           || both && foundnest) {
+						                                    : m.name.StartsWith(search_name)))
+						           || (both && foundnest)) {
 							String key = nest + '\1' + m.qitem;
 							int q = nest_pass.Find(nest);
 							int p = pass;

--------------------------- uppsrc/ide/RepoSync.cpp ---------------------------
index b285e4299..d878e9a83 100644
@@ -90,7 +90,7 @@ bool IsConflictFile(String path)
 	String ext = GetFileExt(path);
 	if(*ext == '.') {
 		ext = ext.Mid(1);
-		if(findarg(ext, "mine", "theirs", "working") >= 0 || *ext == 'r' && IsDigit(ext[1])) {
+		if(findarg(ext, "mine", "theirs", "working") >= 0 || (*ext == 'r' && IsDigit(ext[1]))) {
 			for(int i = 0; i < 3; i++) {
 				int q = path.ReverseFind('.');
 				if(q < 0)
@@ -153,7 +153,7 @@ bool RepoSync::ListSvn(const String& path)
 							color = AdjustIfDark(c[action]);
 						}
 					}
-					if(pass == action < 0 && action != DELETEC) {
+					if(pass == action && action != DELETEC) {
 						int ii = list.GetCount();
 						list.Add(action, file, Null,
 						         AttrText(action < 0 ? ln[i] : "  " + file.Mid(path.GetCount() + 1)).Ink(color));
@@ -193,7 +193,7 @@ bool RepoSync::ListGit(const String& path)
 			String file = AppendFileName(path, h.Mid(3));
 			actions = true;
 			int action = String("M.?DR").Find(h[1]);
-			if(action < 0 || h[0] != '?' && h[0] != ' ')
+			if(action < 0 || (h[0] != '?' && h[0] != ' '))
 				action = SVN_IGNORE;
 			String an;
 			Color  color;

----------------------------- uppsrc/ide/Swaps.cpp -----------------------------
index d61002bcd..d54cdbba0 100644
@@ -33,7 +33,7 @@ bool Ide::SwapSIf(const char *cref)
 	if(q < 0)
 		return false;
 	const Array<CppItem>& nn = CodeBase()[q];
-	if(cref && MakeCodeRef(p.current_scope, p.current_key) != cref || IsNull(p.current_name))
+	if((cref && MakeCodeRef(p.current_scope, p.current_key) != cref) || IsNull(p.current_name))
 		return false;
 	Vector<const CppItem *> n;
 	bool destructor = p.current_key.Find('~') >= 0;

--------------------------- uppsrc/ide/Template.cpp ---------------------------
index 5e9c18ede..3978d05fd 100644
@@ -341,7 +341,7 @@ void TemplateDlg::LoadNest(const char *path, bool main, bool recurse)
 		if(ToLower(GetFileExt(ff.GetName())) == ".upt") {
 			try {
 				PackageTemplate t = ReadTemplate(p);
-				if(main && t.main || !main && t.sub)
+				if((main && t.main) || (!main && t.sub))
 					pt.Add() = pick(t);
 			}
 			catch(CParser::Error e) {

---------------------------- uppsrc/ide/idebar.cpp ----------------------------
index df7e6bad9..61def00a1 100644
@@ -554,9 +554,9 @@ void Ide::FilePropertiesMenu(Bar& menu)
 				for(int i = 0; i < n; i++) { // check that we are in git conflict
 					const String& s = editor.GetUtf8Line(i);
 					int ch = *s;
-					a = a || ch == '<' && s.StartsWith("<<<<<<<");
-					b = b || ch == '=' && s.StartsWith("=======");
-					c = c || ch == '>' && s.StartsWith(">>>>>>>");
+					a = a || (ch == '<' && s.StartsWith("<<<<<<<"));
+					b = b || (ch == '=' && s.StartsWith("======="));
+					c = c || (ch == '>' && s.StartsWith(">>>>>>>"));
 				}
 				if(a && b && c) {
 					original = "1";

---------------------------- uppsrc/ide/idefile.cpp ----------------------------
index 70fe94c55..e5cc0c76e 100644
@@ -475,10 +475,10 @@ void Ide::EditFile0(const String& path, byte charset, int spellcheck_comments, c
 	}
 
 	if(!designer && editastext.Find(path) < 0 &&
-	   (findarg(GetFileExt(path), ".log") < 0 &&
+	   ((findarg(GetFileExt(path), ".log") < 0 &&
 	    findarg(charset, CHARSET_UTF8_BOM, CHARSET_UTF16_LE, CHARSET_UTF16_BE,
 	            CHARSET_UTF16_LE_BOM, CHARSET_UTF16_BE_BOM) < 0 &&
-	    FileIsBinary(path) || editashex.Find(path) >= 0))
+	    FileIsBinary(path)) || editashex.Find(path) >= 0))
 		designer.Create<FileHexView>().Open(path);
 	
 	ManageDisplayVisibility();
@@ -549,7 +549,7 @@ void Ide::EditFile0(const String& path, byte charset, int spellcheck_comments, c
 				const int64 max_size = 768*1024*1024;
 			#endif
 				const int view_limit = 256*1024*1024;
-				if(view_file.GetSize() < view_limit || editastext.Find(editfile) >= 0 && view_file.GetSize() < max_size) {
+				if(view_file.GetSize() < view_limit || (editastext.Find(editfile) >= 0 && view_file.GetSize() < max_size)) {
 					le = editor.Load(view_file, charset);
 					view_file.Close();
 				}

---------------------------- uppsrc/ide/idetool.cpp ----------------------------
index d4da768e6..8e16de7c5 100644
@@ -100,7 +100,7 @@ void Ide::GotoPosition()
 		for(String n : pk.file) {
 			String pf = PosFn(pkg, n);
 			int q = f.GetCount() - pf.GetCount() - 1;
-			if(pf == f || q >= 0 && f.EndsWith(PosFn(pkg, n)) && f[q] == '/') {
+			if(pf == f || (q >= 0 && f.EndsWith(PosFn(pkg, n)) && f[q] == '/')) {
 				GotoPos(SourcePath(pkg, n), line);
 				return;
 			}

------------------------------- uppsrc/ide/t.cpp -------------------------------
index 954530646..fe93b40a0 100644
@@ -166,7 +166,7 @@ String CreateTFile(const VectorMap<String, LngEntry>& map, const Vector<int>& ln
 				int lang = lngset[j];
 				if(rep || lang != LNG_enUS) {
 					int q = e.text.Find(lang);
-					if(!rep || q >= 0 && !IsNull(e.text[q])) {
+					if(!rep || (q >= 0 && !IsNull(e.text[q]))) {
 						int c = (lang >> 15) & 31;
 						if(c) {
 							out.Cat(c + 'a' - 1);

--------------------- uppsrc/plugin/astyle/ASFormatter.cpp ---------------------
index c8c1e60cb..4434d79d7 100644
@@ -680,8 +680,8 @@ WString ASFormatter::nextLine()
 		            && !isPreviousCharPostComment       // Fixes wrongly appended newlines after '}' immediately after comments
 		            && peekNextChar() != ' '
 		            && !IS_A(previousBracketType,  DEFINITION_TYPE)
-		            && !(ASBeautifier::isJavaStyle && currentChar == ')'))
-		        && !IS_A(bracketTypeStack->back(),  DEFINITION_TYPE))
+		            && !(ASBeautifier::isJavaStyle && currentChar == ')')
+		        && !IS_A(bracketTypeStack->back(),  DEFINITION_TYPE)))
 		        && (shouldBreakOneLineBlocks
 		            || !IS_A(bracketTypeStack->back(),  SINGLE_LINE_TYPE)))
 		{

------------------------ uppsrc/plugin/lz4/Compress.cpp ------------------------
index 12c3158f2..a802035f1 100644
@@ -115,7 +115,7 @@ void LZ4CompressStream::_Put(const void *data, dword size)
 	const char *s = reinterpret_cast<const char *>(data);
 
 	while(size > 0) {
-		if(IsError() || out && out->IsError())
+		if(IsError() || (out && out->IsError()))
 			return;
 		dword n = dword(wrlim - ptr);
 		if(size >= n) {

--------------------------- uppsrc/plugin/lz4/lz4.h ---------------------------
index 16649e291..833892113 100644
@@ -95,7 +95,7 @@ private:
 	void          Init();
 	bool          Next();
 	void          Fetch();
-	bool          Ended() const { return IsError() || in->IsError() || ptr == rdlim && ii == count && eof; }
+	bool          Ended() const { return IsError() || in->IsError() || (ptr == rdlim && ii == count && eof); }
 
 public:
 	bool Open(Stream& in);

------------------------- uppsrc/plugin/lzma/lzma.cpp -------------------------
index c1c6ddd1e..f6d1b060d 100644
@@ -100,7 +100,7 @@ static SRes Decode2(CLzmaDec *state, ISeqOutStream *outStream, ISeqInStream *inS
 				return SZ_ERROR_WRITE;
 			
 		outPos = 0;
-		if(res != SZ_OK || thereIsSize && unpackSize == 0)
+		if(res != SZ_OK || (thereIsSize && unpackSize == 0))
 			return res;
 
 		if(inProcessed == 0 && outProcessed == 0) {

----------------------- uppsrc/plugin/zstd/Compress.cpp -----------------------
index 733f54d00..caa3b4003 100644
@@ -98,7 +98,7 @@ void ZstdCompressStream::_Put(const void *data, dword size)
 	const char *s = reinterpret_cast<const char *>(data);
 
 	while(size > 0) {
-		if(IsError() || out && out->IsError())
+		if(IsError() || (out && out->IsError()))
 			return;
 		dword n = dword(wrlim - ptr);
 		if(size >= n) {

-------------------------- uppsrc/plugin/zstd/zstd.h --------------------------
index e7d5ce6d4..7ddd10c26 100644
@@ -86,7 +86,7 @@ private:
 	void          Init();
 	bool          Next();
 	void          Fetch();
-	bool          Ended() const { return IsError() || in->IsError() || ptr == rdlim && ii == count && eof; }
+	bool          Ended() const { return IsError() || in->IsError() || (ptr == rdlim && ii == count && eof); }
 
 public:	
 	bool Open(Stream& in);
<!-- gh-comment-id:756271425 --> @mingodad commented on GitHub (Jan 7, 2021): And here is the second replacement I did again from scratch and now I get the files shown properly in the built IDE: ``` ----------------------- uppsrc/CodeEditor/CHighlight.cpp ----------------------- index ceb2674f5..a353e7055 100644 @@ -182,7 +182,7 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls Grounding(p, e); if(highlight == HIGHLIGHT_CALC) { - if(editor && line == editor->GetLineCount() - 1 || *p == '$') + if((editor && line == editor->GetLineCount() - 1) || *p == '$') hls.SetPaper(0, linelen + 1, hl_style[PAPER_BLOCK1].color); } else @@ -196,7 +196,7 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls while(bid < this->bid.GetCount() - 1 && (i >= linelen || p[i] == ' ' || p[i] == '\t')) { hls.SetPaper(i, 1, BlockColor(bid)); - if(i < linelen && p[i] == '\t' || ++pos >= tabsize) { + if((i < linelen && p[i] == '\t') || ++pos >= tabsize) { pos = 0; bid++; } @@ -242,7 +242,7 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls while(p < e) { int raw_n = 0; dword pair = MAKELONG(p[0], p[1]); - if(pair == MAKELONG('/', '*') && highlight != HIGHLIGHT_JSON || comment) { + if((pair == MAKELONG('/', '*') && highlight != HIGHLIGHT_JSON) || comment) { if(!comment) { hls.Put(2, hl_style[INK_COMMENT]); p += 2; @@ -289,16 +289,16 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls hls.Put(int(p - b), hl_style[INK_RAW_STRING]); } else - if(linecomment && linecont || pair == MAKELONG('/', '/') && - highlight != HIGHLIGHT_CSS && highlight != HIGHLIGHT_JSON || - highlight == HIGHLIGHT_PHP && *p == '#') { + if((linecomment && linecont) || (pair == MAKELONG('/', '/') && + highlight != HIGHLIGHT_CSS && highlight != HIGHLIGHT_JSON) || + (highlight == HIGHLIGHT_PHP && *p == '#')) { while(p < e) p = DoComment(hls, p, e); is_comment = true; break; } else - if((*p == '\"' || *p == '\'') || linecont && string) + if((*p == '\"' || *p == '\'') || (linecont && string)) p = hls.CString(p); else if(*p == '(') { @@ -336,7 +336,7 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls hls.SetPaper(hls.pos, linelen + 1 - hls.pos, BlockColor(--block_level)); Bracket(int(p - ltext) + pos, hls, editor); int& l = *p == ')' ? pl : *p == '}' ? cl : bl; - if(bc && (bc != *p || l <= 0) || bc == 0 && *p != '}') { + if((bc && (bc != *p || l <= 0)) || (bc == 0 && *p != '}')) { hls.Put(p == ltext || ignore_errors ? hl_style[INK_PAR0] : hl_style[INK_ERROR]); brk.Clear(); cl = bl = pl = 0; @@ -379,7 +379,7 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls if(iscib(*p)) { const wchar *q = p; StringBuffer id; - while((iscidl(*q) || highlight == HIGHLIGHT_CSS && *q == '-') && q < e) + while((iscidl(*q) || (highlight == HIGHLIGHT_CSS && *q == '-')) && q < e) id.Cat(*q++); String iid = id; if(highlight == HIGHLIGHT_SQL) ------------------------- uppsrc/CodeEditor/CLogic.cpp ------------------------- index da40f77a0..639d88688 100644 @@ -20,8 +20,8 @@ int CSyntax::GetCommentPos(CodeEditor& e, int l, WString& ch) const sSpaces(cp, ln); One<EditorSyntax> esyntax = e.GetSyntax(e.GetCursorLine()); CSyntax *syntax = dynamic_cast<CSyntax *>(~esyntax); - if(syntax && syntax->comment && ln.Find("*/") < 0 || - cp < ln.GetCount() - 2 && ln[cp] == '/' && ln[cp + 1] == '/') { + if((syntax && syntax->comment && ln.Find("*/") < 0) || + (cp < ln.GetCount() - 2 && ln[cp] == '/' && ln[cp + 1] == '/')) { while(cp < ln.GetLength() && findarg(ln[cp], '/', '*', '!', '<', '>', '%', '#', '@', '|') >= 0) cp++; ch = ln.Mid(0, cp); @@ -75,7 +75,7 @@ void CSyntax::IndentInsert0(CodeEditor& e, int chr, int count, bool reformat) e.InsertChar(*s++, 1); if(!syntax) return; - if(syntax->stmtline == cl || syntax->blk.GetCount() && syntax->blk.Top() == cl // statement (if, while..) || first line of block + if(syntax->stmtline == cl || (syntax->blk.GetCount() && syntax->blk.Top() == cl) // statement (if, while..) || first line of block || *pl.Last() == ':') { // label if(indent_spaces || (s > pl && s[-1] == ' ')) e.InsertChar(' ', indent_amount); @@ -128,7 +128,7 @@ void CSyntax::IndentInsert0(CodeEditor& e, int chr, int count, bool reformat) // {, } inserted on line alone should be moved left sometimes: int cl = e.GetCursorLine(); WString l = e.GetWLine(cl); - if(chr != '{' && chr != '}' || count > 1) { + if((chr != '{' && chr != '}') || count > 1) { e.InsertChar(chr, 1, true); return; } ------------------------ uppsrc/CodeEditor/CSyntax.cpp ------------------------ index 12526f906..47cb3e280 100644 @@ -127,8 +127,8 @@ void CSyntax::ScanSyntax(const wchar *ln, const wchar *e, int line, int tab_size p++; int idlen = int(p - id); if(id[0] == 'i' && id[1] == 'f' - && (idlen == 2 || idlen == 5 && id[2] == 'd' && id[3] == 'e' && id[4] == 'f' - || idlen == 6 && id[2] == 'n' && id[3] == 'd' && id[4] == 'e' && id[5] == 'f')) { + && (idlen == 2 || (idlen == 5 && id[2] == 'd' && id[3] == 'e' && id[4] == 'f') + || (idlen == 6 && id[2] == 'n' && id[3] == 'd' && id[4] == 'e' && id[5] == 'f'))) { IfState& ifstate = ifstack.Add(); ifstate.state = IfState::IF; ifstate.iftext = sReadLn(ln); ----------------------- uppsrc/CodeEditor/CodeEditor.cpp ----------------------- index 8c79116be..023ac14e6 100644 @@ -81,7 +81,7 @@ void CodeEditor::DirtyFrom(int line) { } inline bool IsComment(int a, int b) { - return a == '/' && b == '*' || a == '*' && b == '/' || a == '/' && b == '/'; + return (a == '/' && b == '*') || (a == '*' && b == '/') || (a == '/' && b == '/'); } inline bool RBR(int c) { @@ -193,7 +193,7 @@ bool CodeEditor::IsCursorBracket(int64 pos) const bool CodeEditor::IsMatchingBracket(int64 pos) const { - return pos == highlight_bracket_pos && (hilite_bracket == 1 || hilite_bracket == 2 && bracket_flash); + return pos == highlight_bracket_pos && (hilite_bracket == 1 || (hilite_bracket == 2 && bracket_flash)); } void CodeEditor::CheckBrackets() @@ -1086,7 +1086,7 @@ void CodeEditor::HighlightLine(int line, Vector<LineEdit::Highlight>& hl, int64 break; int n = illuminated.GetCount(); if(n > 1 || !iscid(illuminated[0]) || - (q == 0 || !iscid(l[q - 1])) && (q + n >= l.GetCount() || !iscid(l[q + n]))) + ((q == 0 || !iscid(l[q - 1])) && (q + n >= l.GetCount() || !iscid(l[q + n])))) while(n-- && q < hl.GetCount()) { const HlStyle& st = hl_style[PAPER_SELWORD]; hl[q].paper = st.color; ----------------------- uppsrc/CodeEditor/LogSyntax.cpp ----------------------- index 491a32a92..4b373a814 100644 @@ -53,7 +53,7 @@ void LogSyntax::Highlight(const wchar *s, const wchar *end, HighlightOutput& hls sws << "ok" << "success"; } String w; - while(s < end && IsAlNum(*s) || *s == '_') + while((s < end && IsAlNum(*s)) || *s == '_') w.Cat(ToLower(*s++)); bool hl = rws.Find(w) >= 0; bool st = sws.Find(w) >= 0; ---------------------- uppsrc/CodeEditor/PythonSyntax.cpp ---------------------- index 053866820..c6f1a08bc 100644 @@ -42,7 +42,7 @@ void PythonSyntax::Highlight(const wchar *s, const wchar *end, HighlightOutput& "not", "with", "async", "elif", "if", "or", "yield" }; static Index<String> sws = { "self", "NotImplemented", "Ellipsis", "__debug__", "__file__", "__name__" }; String w; - while(s < end && IsAlNum(*s) || *s == '_') + while((s < end && IsAlNum(*s)) || *s == '_') w.Cat(*s++); hls.Put(w.GetCount(), kws.Find(w) >= 0 ? hl_style[INK_KEYWORD] : sws.Find(w) >= 0 ? hl_style[INK_UPP] : ------------------------- uppsrc/Core/BlockStream.cpp ------------------------- index 025dce011..a6b627ecf 100644 @@ -473,7 +473,7 @@ bool FileStream::Open(const char *name, dword mode, mode_t tmode) { struct stat st[1]; fstat(handle, st); if(!(st->st_mode & S_IFREG) || // not a regular file, e.g. folder - bad things would happen - (mode & NOWRITESHARE) && flock(handle, LOCK_EX|LOCK_NB) < 0) { // lock if not sharing + ((mode & NOWRITESHARE) && flock(handle, LOCK_EX|LOCK_NB) < 0)) { // lock if not sharing close(handle); handle = -1; return false; ---------------------------- uppsrc/Core/CharSet.h ---------------------------- index a389fbb3a..13a7a3305 100644 @@ -185,12 +185,12 @@ inline char ToUpperAscii(wchar c) { return ToUpperAscii((dword) c); } inline char ToLowerAscii(wchar c) { return ToLowerAscii((dword) c); } inline bool IsDigit(int c) { return c >= '0' && c <= '9'; } -inline bool IsAlpha(int c) { return c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z'; } +inline bool IsAlpha(int c) { return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'); } inline bool IsAlNum(int c) { return IsDigit(c) || IsAlpha(c); } inline bool IsLeNum(int c) { return IsDigit(c) || IsLetter(c); } inline bool IsPunct(int c) { return c != ' ' && !IsAlNum(c); } inline bool IsSpace(int c) { return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\v' || c == '\t'; } -inline bool IsXDigit(int c) { return IsDigit(c) || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f'; } +inline bool IsXDigit(int c) { return IsDigit(c) || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'); } bool IsDoubleWidth(int c); @@ -255,7 +255,7 @@ bool SaveFileBOMUtf8(const char *path, const String& data); word UnicodeCombine(word chr, word combine); -inline bool IsCJKIdeograph(int c) { return c >= 0x2e80 && c <= 0xdfaf || c >= 0xf900 && c <= 0xfaff; } +inline bool IsCJKIdeograph(int c) { return (c >= 0x2e80 && c <= 0xdfaf) || (c >= 0xf900 && c <= 0xfaff); } int ToUnicode(int chr, byte charset); int FromUnicode(wchar wchr, byte charset, int defchar = DEFAULTCHAR); ----------------------------- uppsrc/Core/CoAlgo.h ----------------------------- index fdf855dd8..300793528 100644 @@ -128,7 +128,7 @@ int CoFindBest(const Range& r, const Better& better) i++; } CoWork::FinLock(); - if(better(*b, *best) || !better(*best, *b) && b < best) + if(better(*b, *best) || (!better(*best, *b) && b < best)) best = b; } ); ---------------------------- uppsrc/Core/Color.cpp ---------------------------- index 0fea74ed3..9de8ff032 100644 @@ -189,7 +189,7 @@ static int sCharFilterNoDigit(int c) static int sCharFilterHex(int c) { - return c >= 'a' && c <= 'f' || c >= 'A' && c <= 'F' || IsDigit(c) ? c : 0; + return (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F') || IsDigit(c) ? c : 0; } Color ColorFromText(const char *s) --------------------------- uppsrc/Core/Convert.cpp --------------------------- index 4aac022e9..8e8f4f5d1 100644 @@ -125,7 +125,7 @@ double ScanDoubleT(const T *p, const T **endptr, bool accept_comma) *endptr = p; if(*p == '+' || *p == '-') neg = (*p++ == '-'); - if((byte)(*p - '0') >= 10 && !((*p == '.' || accept_comma && *p == ',') && (byte)(p[1] - '0') < 10)) { + if((byte)(*p - '0') >= 10 && !((*p == '.' || (accept_comma && *p == ',')) && (byte)(p[1] - '0') < 10)) { if(endptr) *endptr = begin; return Null; } @@ -140,7 +140,7 @@ double ScanDoubleT(const T *p, const T **endptr, bool accept_comma) else exp++; int raise = exp; - if(*p == '.' || accept_comma && *p == ',') // decimal part + if(*p == '.' || (accept_comma && *p == ',')) // decimal part while((byte)((c = *++p) - '0') < 10) { if(c != '0') { if(raise) { ---------------------------- uppsrc/Core/Format.cpp ---------------------------- index 6ab51bd1c..63bd8bd0b 100644 @@ -46,7 +46,7 @@ String FormatIntBase(int i, int base, int width, char lpad, int sign, bool upper while(x /= base); } bool minus = (sign >= 0 && i < 0 && !IsNull(i)); - bool do_sign = (sign > 0 || sign >= 0 && minus); + bool do_sign = (sign > 0 || (sign >= 0 && minus)); if(do_sign && lpad != '0') *--p = (minus ? '-' : '+'); if(width > e - p) @@ -316,7 +316,7 @@ String FormatDoubleFix(double d, int digits, int flags) if(flags & FD_REL) digits = max(0, digits - Nvl(exp, 0) - 1); String out; - if(flags & FD_SIGN || d < 0 && !IsNull(exp)) + if(flags & FD_SIGN || (d < 0 && !IsNull(exp))) out.Cat(d >= 0 ? '+' : '-'); int pointchar = (flags & FD_COMMA) ? ',' : '.'; if(IsNull(exp) || exp < -digits) { @@ -372,7 +372,7 @@ String FormatDoubleExp(double d, int digits, int flags, int fill_exp) String dig = FormatDoubleDigits(d, digits, flags | FD_REL, exp); exp = Nvl(exp, 0); StringBuffer out; - if(flags & FD_SIGN || d < 0 && !IsNull(exp)) + if(flags & FD_SIGN || (d < 0 && !IsNull(exp))) out.Cat(d >= 0 ? '+' : '-'); out.Cat(dig[0]); if(dig.GetLength() > 1) @@ -621,7 +621,7 @@ String RealFormatter(const Formatting& f) flags |= FD_SIGN; s++; } - if(IsDigit(*s) || *s == '-' && IsDigit(s[1])) { + if(IsDigit(*s) || (*s == '-' && IsDigit(s[1]))) { digits = (int)strtol(s, NULL, 10); while(IsDigit(*++s)) ; ----------------------------- uppsrc/Core/Http.cpp ----------------------------- index b97c4c95f..b0daecb1b 100644 @@ -783,7 +783,7 @@ void HttpRequest::Out(const void *ptr, int size) HttpError("content length exceeded " + AsString(max_content_size)); return; } - if(WhenContent && (status_code >= 200 && status_code < 300 || all_content)) + if(WhenContent && ((status_code >= 200 && status_code < 300) || all_content)) WhenContent(ptr, size); else body.Cat((const char *)ptr, size); @@ -797,7 +797,7 @@ bool HttpRequest::ReadingBody() if(has_content_length && content_length == 0) return false; - String s = TcpSocket::Get(has_content_length && content_length > 0 || chunked_encoding ? + String s = TcpSocket::Get((has_content_length && content_length > 0) || chunked_encoding ? (int)min((int64)chunk, count) : chunk); if(s.GetCount()) { #ifndef ENDZIP ----------------------------- uppsrc/Core/Parser.h ----------------------------- index 084697e5d..5fe172297 100644 @@ -1,9 +1,9 @@ inline bool iscib(int c) { - return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '_' || c == '$'; + return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_' || c == '$'; } inline bool iscid(int c) { - return iscib(c) || c >= '0' && c <= '9'; + return iscib(c) || (c >= '0' && c <= '9'); } class CParser { ----------------------------- uppsrc/Core/Path.cpp ----------------------------- index edfa2afe4..1043f59e5 100644 @@ -525,8 +525,8 @@ bool FindFile::CanMode(dword usr, dword grp, dword oth) const static uid_t uid = getuid(); static gid_t gid = getgid(); return (mode & oth) || - (mode & grp) && gid == s.st_gid || - (mode & usr) && uid == s.st_uid; + ((mode & grp) && gid == s.st_gid) || + ((mode & usr) && uid == s.st_uid); } bool FindFile::IsSymLink() const ---------------------------- uppsrc/Core/Socket.cpp ---------------------------- index 408b571d5..f237b9091 100644 @@ -452,7 +452,7 @@ bool TcpSocket::RawConnect(addrinfo *arp) for(int pass = 0; pass < 2; pass++) { addrinfo *rp = arp; while(rp) { - if(rp->ai_family == AF_INET == !pass && // Try to connect IPv4 in the first pass + if(rp->ai_family == AF_INET && !pass && // Try to connect IPv4 in the first pass Open(rp->ai_family, rp->ai_socktype, rp->ai_protocol)) { if(connect(socket, rp->ai_addr, (int)rp->ai_addrlen) == 0 || GetErrorCode() == SOCKERR(EINPROGRESS) || GetErrorCode() == SOCKERR(EWOULDBLOCK) @@ -645,7 +645,7 @@ bool TcpSocket::RawWait(dword flags, int end_time) #endif return true; } - if(IsGlobalTimeout() || to <= 0 && timeout) { + if(IsGlobalTimeout() || (to <= 0 && timeout)) { is_timeout = true; return false; } @@ -703,7 +703,7 @@ int TcpSocket::Put(const void *s_, int length) return done; peek = false; int count = Send(s + done, length - done); - if(IsError() || timeout == 0 && count == 0 && peek) + if(IsError() || (timeout == 0 && count == 0 && peek)) return done; if(count > 0) done += count; @@ -767,7 +767,7 @@ void TcpSocket::ReadBuffer(int end_time) bool TcpSocket::IsEof() const { - return is_eof && ptr == end || IsAbort() || !IsOpen() || IsError(); + return (is_eof && ptr == end) || IsAbort() || !IsOpen() || IsError(); } int TcpSocket::Get_() ---------------------------- uppsrc/Core/Stream.cpp ---------------------------- index 92e9df196..0b6862c1b 100644 @@ -1373,7 +1373,7 @@ Stream& Pack16(Stream& s, int& i1, int& i2, int& i3, int& i4, int& i5) { int StreamHeading(Stream& stream, int ver, int minver, int maxver, const char* tag) { - if(stream.IsLoading() && stream.IsEof() || stream.IsError()) + if((stream.IsLoading() && stream.IsEof()) || stream.IsError()) return Null; String text = tag; dword len = text.GetLength(); ----------------------------- uppsrc/Core/String.h ----------------------------- index 88c8b7fdc..6ca076104 100644 @@ -290,7 +290,7 @@ public: bool IsEqual(const String0& s) const { uint64 q1 = q[1]; uint64 sq1 = s.q[1]; - return q1 == sq1 && q[0] == s.q[0] || ((q1 | sq1) & MAKE8B(0,0,0,0,0,0,255,0)) && LEq(s); + return (q1 == sq1 && q[0] == s.q[0]) || (((q1 | sq1) & MAKE8B(0,0,0,0,0,0,255,0)) && LEq(s)); } bool IsEqual(const char *s) const; --------------------------- uppsrc/Core/TimeDate.cpp --------------------------- index 3289f2349..c5c360681 100644 @@ -27,7 +27,7 @@ int GetDaysOfMonth(int m, int y) { } bool Date::IsValid() const { - return year == -32768 || month >= 1 && month <= 12 && day >= 1 && day <= GetDaysOfMonth(month, year); + return year == -32768 || (month >= 1 && month <= 12 && day >= 1 && day <= GetDaysOfMonth(month, year)); } String DayName(int i, int lang) @@ -499,7 +499,7 @@ int64 Time::Get() const bool Time::IsValid() const { return year == -32768 || - Date::IsValid() && hour >= 0 && hour < 24 && minute >= 0 && minute < 60 && second >= 0 && second < 60; + (Date::IsValid() && hour >= 0 && hour < 24 && minute >= 0 && minute < 60 && second >= 0 && second < 60); } int64 operator-(Time a, Time b) { ---------------------------- uppsrc/Core/Value.hpp ---------------------------- index f420b8b84..ae4c67607 100644 @@ -11,15 +11,15 @@ Value::Value(const Value& v) template<> inline bool IsPolyEqual(const bool& x, const Value& v) { - return v.Is<double>() && int(x) == double(v) - || v.Is<int64>() && int(x) == int64(v) - || v.Is<int>() && int(x) == int(v); + return (v.Is<double>() && int(x) == double(v)) + || (v.Is<int64>() && int(x) == int64(v)) + || (v.Is<int>() && int(x) == int(v)); } template<> inline bool IsPolyEqual(const int& x, const Value& v) { - return v.Is<double>() && x == double(v) - || v.Is<int64>() && x == int64(v); + return (v.Is<double>() && x == double(v)) + || (v.Is<int64>() && x == int64(v)); } template<> ---------------------------- uppsrc/Core/Vcont.hpp ---------------------------- index 95e0f1905..30b7c850d 100644 @@ -378,7 +378,7 @@ void Vector<T>::Insert(int i, Vector<T>&& v) { template <class T> void Vector<T>::InsertSplit(int i, Vector<T>& v, int from) { - ASSERT(!vector || v.vector != vector && from <= v.GetCount()); + ASSERT(!vector || (v.vector != vector && from <= v.GetCount())); int n = v.GetCount() - from; if(n) { RawInsert(i, n); ----------------------------- uppsrc/Core/XML.cpp ----------------------------- index f90bf8d73..71918e160 100644 @@ -11,7 +11,7 @@ static inline void sDeXmlChar(StringBuffer& result, char chr, byte charset, bool else if(chr == '&') result.Cat("&amp;"); else if(chr == '\'') result.Cat("&apos;"); else if(chr == '\"') result.Cat("&quot;"); - else if((byte)chr < ' ' && (escapelf || chr != '\n' && chr != '\t' && chr != '\r')) + else if((byte)chr < ' ' && (escapelf || (chr != '\n' && chr != '\t' && chr != '\r'))) result.Cat(Format("&#x%02x;", (byte)chr)); else if(!(chr & 0x80) || charset == CHARSET_UTF8) result.Cat(chr); else result.Cat(ToUtf8(ToUnicode(chr, charset))); @@ -962,9 +962,9 @@ XmlNode::XmlNode(const XmlNode& n, int) bool Ignore(XmlParser& p, dword style) { - if((XML_IGNORE_DECLS & style) && p.IsDecl() || - (XML_IGNORE_PIS & style) && p.IsPI() || - (XML_IGNORE_COMMENTS & style) && p.IsComment()) { + if(((XML_IGNORE_DECLS & style) && p.IsDecl()) || + ((XML_IGNORE_PIS & style) && p.IsPI()) || + ((XML_IGNORE_COMMENTS & style) && p.IsComment())) { p.Skip(); return true; } @@ -1086,7 +1086,7 @@ bool ShouldPreserve(const String& s) return true; l = s.End(); for(const char *x = s; x < l; x++) - if(*x == '\t' || *x == '\n' || *x == ' ' && x[1] == ' ') + if(*x == '\t' || *x == '\n' || (*x == ' ' && x[1] == ' ')) return true; return false; } ---------------------------- uppsrc/Core/parser.cpp ---------------------------- index 89fa1353d..91c74f5a5 100644 @@ -190,7 +190,7 @@ String CParser::ReadIdt() { StringBuffer result; int lvl = 0; while(IsAlNum(*term) || *term == '_' || *term == '<' || *term == '>' || - *term == ':' || (*term == ',' || *term == ' ' ) && lvl > 0 ) { + *term == ':' || ((*term == ',' || *term == ' ' ) && lvl > 0) ) { if(*term == '<') lvl++; if(*term == '>') lvl--; result.Cat(*term++); @@ -683,7 +683,7 @@ String AsCString(const char *s, const char *lim, int linemax, const char *linepf continue; // skip s++ } else { - if(byte(*s) < 32 || (byte)*s >= 0x7f && (flags & ASCSTRING_OCTALHI) || (byte)*s == 0xff || (byte)*s == 0x7f) { + if(byte(*s) < 32 || ((byte)*s >= 0x7f && (flags & ASCSTRING_OCTALHI)) || (byte)*s == 0xff || (byte)*s == 0x7f) { char h[4]; int q = (byte)*s; h[0] = '\\'; ------------------------------ uppsrc/Core/t.cpp ------------------------------ index a41c31651..93f8c9d7a 100644 @@ -19,8 +19,8 @@ static int sIdLen(const char *txt) static bool sIdEq(const char *a, const char *b) { for(;;) { - if((*a == '\0' || *a == '\a' && a[1] != '\a') && - (*b == '\0' || *b == '\a' && b[1] != '\a')) + if((*a == '\0' || (*a == '\a' && a[1] != '\a')) && + (*b == '\0' || (*b == '\a' && b[1] != '\a'))) return true; if(*a != *b) return false; --------------------------- uppsrc/CppBase/Body.cpp --------------------------- index 5699f53bb..1db7cb6b0 100644 @@ -200,7 +200,7 @@ void Parser::Statement() if(lex == t_eof) ThrowError(""); TryLambda(); - if(Key(';') || lex == '{' || lex == '}' || lex >= tk_if && lex <= tk_do) + if(Key(';') || lex == '{' || lex == '}' || (lex >= tk_if && lex <= tk_do)) break; ++lex; } --------------------------- uppsrc/CppBase/CppBase.h --------------------------- index d1efa9efc..86d174aa0 100644 @@ -40,7 +40,7 @@ enum Kind { inline bool IsCppType(int i) { - return i >= STRUCT && i <= TYPEDEF || i == FRIENDCLASS; + return (i >= STRUCT && i <= TYPEDEF) || i == FRIENDCLASS; } inline bool IsCppCode(int i) { @@ -56,7 +56,7 @@ inline bool IsCppMacro(int i) { } inline bool IsCppTemplate(int i) { - return i == STRUCTTEMPLATE || i >= FUNCTIONTEMPLATE && i <= CLASSFUNCTIONTEMPLATE; + return i == STRUCTTEMPLATE || (i >= FUNCTIONTEMPLATE && i <= CLASSFUNCTIONTEMPLATE); } void CleanPP(); -------------------------- uppsrc/CppBase/Parser.cpp -------------------------- index f18a75251..3f12439b1 100644 @@ -79,7 +79,7 @@ String FnItem(const char *s, const char *pname, const char *qname, const String& res.Cat(*s++); plvl--; } - if(iscid(*s) || *s == '~' || *s && lvl) + if(iscid(*s) || *s == '~' || (*s && lvl)) res.Cat(*s++); else break; @@ -128,7 +128,7 @@ String FnItem(const char *s, const char *pname, const char *qname, const String& s++; int l = 0; int tl = 0; - while(*s && !(l == 0 && (*s == ',' && tl == 0 || *s == ')'))) { + while(*s && !(l == 0 && ((*s == ',' && tl == 0) || *s == ')'))) { if(*s == '(' || *s == '[') l++; else @@ -255,7 +255,7 @@ void TpSkip(CParser& p) { int lvl = 0; for(;;) { - if(lvl == 0 && (p.IsChar(',') || p.IsChar('>')) || p.IsEof()) + if((lvl == 0 && (p.IsChar(',') || p.IsChar('>'))) || p.IsEof()) break; if(p.Char('<')) lvl++; @@ -461,7 +461,7 @@ String Parser::ReadOper(bool& castoper) { if(Key('(')) level++; for(;;) { - if(lex == t_eof || level <= 0 && lex == '(') break; + if(lex == t_eof || (level <= 0 && lex == '(')) break; if(Key('(') || Key('[')) level++; else if(Key(')') || Key(']')) level--; @@ -837,7 +837,7 @@ int Parser::RPtr() n++; } else - if(t == t_dblcolon || lex.IsId(n) || t == ',' && tlevel > 0) + if(t == t_dblcolon || lex.IsId(n) || (t == ',' && tlevel > 0)) n++; else return 0; @@ -903,8 +903,8 @@ void Parser::Declarator(Decl& d, const char *p) } } if(Key('(')) { - if(inbody || (lex < 256 || lex == tk_true || lex == tk_false) - && lex != ')' && lex != '[' && lex != t_dblcolon) { + if(inbody || ((lex < 256 || lex == tk_true || lex == tk_false) + && lex != ')' && lex != '[' && lex != t_dblcolon)) { int level = 0; for(;;) { if(lex == t_eof) break; @@ -955,7 +955,7 @@ void Parser::Declarator(Decl& d, const char *p) for(;;) { TryLambda(); if(lex == t_eof || lex == ';' - || level == 0 && ((lex == ',' && tlevel == 0) || lex == ')')) + || (level == 0 && ((lex == ',' && tlevel == 0) || lex == ')'))) break; if(Key('<')) // we ignore < > as operators, always consider them template bracket tlevel++; @@ -1232,7 +1232,7 @@ CppItem& Parser::Item(const String& scope, const String& using_namespace, const void Parser::Resume(int bl) { for(;;) { - if(lex == t_eof || lex.GetBracesLevel() == bl && lex == ';') + if(lex == t_eof || (lex.GetBracesLevel() == bl && lex == ';')) break; ++lex; } @@ -1581,7 +1581,7 @@ void Parser::Do() } else if(Key(tk_template)) { - if(lex.IsId() || lex == tk_class && lex.IsId(1)) { + if(lex.IsId() || (lex == tk_class && lex.IsId(1))) { Key(tk_class); for(;;) { if(lex.IsId()) ---------------------------- uppsrc/CppBase/Pre.cpp ---------------------------- index e78ada2d1..f465440ab 100644 @@ -36,7 +36,7 @@ SrcFile PreProcess(Stream& in, Parser& parser) // This is not really C preproces const char *s = ln; bool islbl = false; bool wassemi = false; - while(*s && iscid(*s) || findarg(*s, '\t', ' ', ':') >= 0) { // check for label, labeled lines are not grounded + while((*s && iscid(*s)) || findarg(*s, '\t', ' ', ':') >= 0) { // check for label, labeled lines are not grounded if(*s == ':' && !wassemi) { islbl = true; wassemi = true; // second ':' cancels label -------------------------- uppsrc/CppBase/ppfile.cpp -------------------------- index fc5e6fd12..eac26e5eb 100644 @@ -92,7 +92,7 @@ PPMacro *FindPPMacro(const String& id, Index<int>& segment_id, int& segmenti) else if(pass == 0 || m.segment_id == 0 || undef.Find(m.undef_segment_id) < 0) { int si = m.segment_id == 0 ? INT_MAX : segment_id.Find(m.segment_id); // defs macros always override - if(si > best || si >= 0 && si == best && m.line > line) { + if(si > best || (si >= 0 && si == best && m.line > line)) { best = si; line = m.line; r = &m; ---------------------------- uppsrc/CtrlCore/Gtk.h ---------------------------- index 281464c20..f830f391a 100644 @@ -9,8 +9,15 @@ #pragma clang diagnostic ignored "-Wdeprecated" #endif -#include <gtk/gtk.h> -#include <gdk/gdkkeysyms.h> +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wparentheses" +#endif + #include <gtk/gtk.h> + #include <gdk/gdkkeysyms.h> +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif #ifdef __clang__ #pragma clang diagnostic pop -------------------------- uppsrc/CtrlCore/GtkTop.cpp -------------------------- index 9e1c94d5a..d56b6b430 100644 @@ -68,7 +68,7 @@ void TopWindow::CenterRect(Ctrl *owner) { GuiLock __; SetupRect(owner); - if(owner && center == 1 || center == 2) { + if((owner && center == 1) || center == 2) { Size sz = GetRect().Size(); Rect r, wr; wr = Ctrl::GetWorkArea(); ------------------------- uppsrc/CtrlCore/GtkUtil.cpp ------------------------- index 415a6c422..051bd7650 100644 @@ -17,8 +17,8 @@ String ImageClipFromPixbufUnref(GdkPixbuf *pixbuf) Image img; if(pixbuf) { int chn = gdk_pixbuf_get_n_channels(pixbuf); - if((chn == 3 && !gdk_pixbuf_get_has_alpha(pixbuf) || - chn == 4 && gdk_pixbuf_get_has_alpha(pixbuf)) && + if(((chn == 3 && !gdk_pixbuf_get_has_alpha(pixbuf)) || + (chn == 4 && gdk_pixbuf_get_has_alpha(pixbuf))) && gdk_pixbuf_get_colorspace(pixbuf) == GDK_COLORSPACE_RGB && gdk_pixbuf_get_bits_per_sample(pixbuf) == 8) { Size sz(gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height(pixbuf)); ------------------------- uppsrc/CtrlCore/ParseRTF.cpp ------------------------- index c4208bcd6..4a21a4529 100644 @@ -223,7 +223,7 @@ RTFParser::RTFParser(const char *rtf) RichText RTFParser::Run() { - if(!PassGroup() || !PassCmd("rtf") || command_arg != 1 && !IsNull(command_arg)) + if(!PassGroup() || !PassCmd("rtf") || (command_arg != 1 && !IsNull(command_arg))) return pick(output); while(Token() != T_EOF) ReadItem(); @@ -307,7 +307,7 @@ void RTFParser::FlushTable(int level) int& out_wd = (outer_border[b] ? tbl_border : tbl_grid); Color& out_co = (outer_border[b] ? clr_border : clr_grid); if(IsNull(cell.info.format.bordercolor) || border_width[b] <= 0 - || !IsNull(out_co) && out_co != cell.info.format.bordercolor) + || (!IsNull(out_co) && out_co != cell.info.format.bordercolor)) out_wd = 0; else if(IsNull(out_wd) || border_width[b] < out_wd) { out_wd = border_width[b]; @@ -469,7 +469,7 @@ RTFParser::TOKEN RTFParser::Fetch() } default: { - if(IsAlpha(*--rtf) || *rtf == '*' && rtf[1] == '\\' && IsAlpha(rtf[2])) { + if(IsAlpha(*--rtf) || (*rtf == '*' && rtf[1] == '\\' && IsAlpha(rtf[2]))) { if(*rtf == '*') { rtf += 2; state.new_dest = true; @@ -541,7 +541,7 @@ bool RTFParser::PassEndGroup(int level) void RTFParser::Skip() { LLOG("Skip"); - bool is_group = (token == T_GROUP || token == T_COMMAND && state.new_dest); + bool is_group = (token == T_GROUP || (token == T_COMMAND && state.new_dest)); is_full = false; if(is_group) SkipGroup(); ------------------------- uppsrc/CtrlLib/ArrayCtrl.cpp ------------------------- index b58f6a742..a0e8ef085 100644 @@ -856,7 +856,7 @@ const Display& ArrayCtrl::GetCellInfo(int i, int j, bool f0, bg = array[i].paper; fg = i & 1 ? evenink : oddink; if((st & Display::SELECT) || - !multiselect && (st & Display::CURSOR) && !nocursor || + (!multiselect && (st & Display::CURSOR) && !nocursor) || drop) { fg = hasfocus ? SColorHighlightText : SColorText; bg = hasfocus ? SColorHighlight : Blend(SColorDisabled, SColorPaper); @@ -897,7 +897,7 @@ Size ArrayCtrl::DoPaint(Draw& w, bool sample) { int sy = 0; if(!IsNull(i)) while(i < GetCount()) { - if((!sample || i == cursor || i < array.GetCount() && array[i].select) && IsLineVisible(i)) { + if((!sample || i == cursor || (i < array.GetCount() && array[i].select)) && IsLineVisible(i)) { r.top = sample ? sy : GetLineY(i) - sb; if(r.top > size.cy) break; @@ -922,7 +922,7 @@ Size ArrayCtrl::DoPaint(Draw& w, bool sample) { if(spanwidecells) SpanWideCell(d, q, cm, cw, r, i, j); - if(cw < 2 * cm || editmode && i == cursor && column[jj].edit) + if(cw < 2 * cm || (editmode && i == cursor && column[jj].edit)) d.PaintBackground(w, r, q, fg, bg, st); else { d.PaintBackground(w, RectC(r.left, r.top, cm, r.Height()), q, fg, bg, st); @@ -2299,7 +2299,7 @@ String ArrayCtrl::RowFormat(const char *s) bool ArrayCtrl::DoRemove() { if(IsReadOnly()) return false; - if(!IsCursor() || askremove && !PromptOKCancel(RowFormat(t_("Do you really want to delete the selected %s ?")))) + if(!IsCursor() || (askremove && !PromptOKCancel(RowFormat(t_("Do you really want to delete the selected %s ?"))))) return false; if(multiselect) { Bits sel; ---------------------------- uppsrc/CtrlLib/Bar.cpp ---------------------------- index 0dda29380..89cff51e9 100644 @@ -680,7 +680,7 @@ void BarCtrl::Layout() { LLOG("BarCtrl::Layout"); if(IsChild()) { - bool dowrap = InFrame() && wrap >= 0 || wrap > 0; + bool dowrap = (InFrame() && wrap >= 0) || wrap > 0; if(GetAlign() == BAR_LEFT || GetAlign() == BAR_RIGHT) pane.Repos(false, dowrap ? GetSize().cy : INT_MAX); else -------------------------- uppsrc/CtrlLib/Button.cpp -------------------------- index df4407d05..a077524df 100644 @@ -396,8 +396,8 @@ bool Button::HotKey(dword key) { } bool up = key & K_KEYUP; key = key & ~K_KEYUP; - if(key == K_ENTER && (type == OK || type == EXIT) || - key == K_ESCAPE && (type == CANCEL || type == EXIT)) { + if((key == K_ENTER && (type == OK || type == EXIT)) || + (key == K_ESCAPE && (type == CANCEL || type == EXIT))) { if(up) { if(IsKeyPush()) return FinishPush(); ------------------------ uppsrc/CtrlLib/ColumnList.cpp ------------------------ index 7ffc43820..e6960b2e0 100644 @@ -370,7 +370,7 @@ void ColumnList::GetItemStyle(int i, Color& fg, Color& bg, dword& st) if(nobg) bg = Null; if((st & Display::SELECT) || - (!multi || !item[i].canselect && selcount == 0) && (st & Display::CURSOR) || + ((!multi || (!item[i].canselect && selcount == 0)) && (st & Display::CURSOR)) || drop) { fg = hasfocus ? SColorHighlightText : SColorText; bg = hasfocus ? SColorHighlight : Blend(SColorDisabled, SColorPaper); @@ -908,7 +908,7 @@ void ColumnList::DragAndDrop(Point p, PasteClip& d) if(DnDInsert(i, p.y, d, 2)) return; } - if(GetCount() == 0 && p.y < 4 || !WhenDrop) { + if((GetCount() == 0 && p.y < 4) || !WhenDrop) { WhenDropInsert(GetCount(), d); if(d.IsAccepted()) { DnD(GetCount(), true); ----------------------- uppsrc/CtrlLib/DateTimeCtrl.cpp ----------------------- index b94f32e45..dca9cd5f0 100644 @@ -902,8 +902,8 @@ void Clock::Paint(Draw& w) int Clock::GetDir(int pp, int cp) { dir = 0; - if(cp >= 1 && cp <= 30 && pp >= 1 && pp <= 30 || - cp > 30 && cp <= 60 && pp > 30 && pp <= 60) + if((cp >= 1 && cp <= 30 && pp >= 1 && pp <= 30) || + (cp > 30 && cp <= 60 && pp > 30 && pp <= 60)) { dir = pp < cp ? 1 : -1; } ----------------------- uppsrc/CtrlLib/DisplayPopup.cpp ----------------------- index f1c65e7a4..9f4fd27ef 100644 @@ -186,7 +186,7 @@ bool DisplayPopup::IsOpen() bool DisplayPopup::HasMouse() { - return Ctrl::HasMouse() || ctrl && ctrl->HasMouse(); + return Ctrl::HasMouse() || (ctrl && ctrl->HasMouse()); } void DisplayPopup::Set(Ctrl *_ctrl, const Rect& _item, -------------------------- uppsrc/CtrlLib/DocEdit.cpp -------------------------- index 13d2fea2a..5edb9b40a 100644 @@ -438,7 +438,7 @@ bool DocEdit::Key(dword key, int cnt) default: if(filter && key >= 32 && key < 65535) key = (*filter)(key); - if(key >= ' ' && key < 65536 || key == '\n' || key == '\t' || key == K_SHIFT_SPACE) { + if((key >= ' ' && key < 65536) || key == '\n' || key == '\t' || key == K_SHIFT_SPACE) { if(key == K_TAB && !processtab) return false; if(key >= 128 && key < 65536 && (charset != CHARSET_UNICODE && charset != CHARSET_UTF8_BOM) ------------------------ uppsrc/CtrlLib/DropChoice.cpp ------------------------ index 9458e3f87..12b22dd15 100644 @@ -36,7 +36,7 @@ void DropChoice::PseudoPush() } void DropChoice::Drop() { - if(!owner || owner->IsReadOnly() && !rodrop || list.GetCount() == 0 && !WhenDrop) return; + if(!owner || (owner->IsReadOnly() && !rodrop) || (list.GetCount() == 0 && !WhenDrop)) return; WhenDrop(); if(dropfocus) owner->SetWantFocus(); @@ -46,12 +46,12 @@ void DropChoice::Drop() { } void DropChoice::Select() { - if(!owner || owner->IsReadOnly() && !rodrop) return; + if(!owner || (owner->IsReadOnly() && !rodrop)) return; WhenSelect(); } Value DropChoice::Get() const { - if(!owner || owner->IsReadOnly() && !rodrop) return Value(); + if(!owner || (owner->IsReadOnly() && !rodrop)) return Value(); int c = list.GetCursor(); if(c < 0) return Value(); return list.Get(c, 0); @@ -59,7 +59,7 @@ Value DropChoice::Get() const { int DropChoice::GetIndex() const { - if(!owner || owner->IsReadOnly() && !rodrop) return -1; + if(!owner || (owner->IsReadOnly() && !rodrop)) return -1; return list.GetCursor(); } ------------------------- uppsrc/CtrlLib/EditField.cpp ------------------------- index a62ac67b5..e68ef15ec 100644 @@ -274,7 +274,7 @@ Color EditField::GetPaper() : style->disabled; if(nobg) paper = Null; - if(enabled && (convert && convert->Scan(text).IsError() || errorbg)) + if(enabled && ((convert && convert->Scan(text).IsError()) || errorbg)) paper = style->invalid; return paper; } @@ -941,7 +941,7 @@ bool EditField::Key(dword key, int rep) } return false; default: - if(key >= ' ' && key < 65536 || key == K_SHIFT_SPACE) { + if((key >= ' ' && key < 65536) || key == K_SHIFT_SPACE) { if(!RemoveSelection()) SaveUndo(); while(rep--) Insert(key == K_SHIFT_SPACE ? ' ' : key); -------------------------- uppsrc/CtrlLib/FileSel.cpp -------------------------- index c1e2b4112..44a968918 100644 @@ -909,7 +909,7 @@ void FileSel::SearchLoad() list.Renaming(true); } if(filesystem->IsPosix()) - if(d == "/" || !IsEmpty(basedir) && String(~dir).IsEmpty()) + if(d == "/" || (!IsEmpty(basedir) && String(~dir).IsEmpty())) dirup.Disable(); if(filesystem->IsWin32()) if(!IsEmpty(basedir) && String(~dir).IsEmpty()) @@ -1282,8 +1282,8 @@ void FileSel::Open() { } if(!IsFullPath(fn)) fn = AppendFileName(~dir, fn); - if(filesystem->IsWin32() && (!fn.IsEmpty() && (*fn.Last() == '\\' || *fn.Last() == '/')) - || filesystem->IsPosix() && (fn != "/" && (*fn.Last() == '\\' || *fn.Last() == '/'))) + if((filesystem->IsWin32() && (!fn.IsEmpty() && (*fn.Last() == '\\' || *fn.Last() == '/'))) + || (filesystem->IsPosix() && (fn != "/" && (*fn.Last() == '\\' || *fn.Last() == '/')))) { fn.Trim(fn.GetLength() - 1); SetDir(TrimDot(fn)); @@ -1625,7 +1625,7 @@ void FileSel::FileUpdate() { } bool b = list.IsCursor() || !String(~file).IsEmpty(); ok.Enable(b); - if(mode != SAVEAS || list.IsCursor() && list[list.GetCursor()].isdir) + if(mode != SAVEAS || (list.IsCursor() && list[list.GetCursor()].isdir)) ok.SetLabel(t_("Open")); else ok.SetLabel(t_("Save")); @@ -1993,8 +1993,8 @@ bool FileSel::Execute(int _mode) { type.Trim(dlc); String d = ~dir; - if(filesystem->IsWin32() && d.GetLength() == 3 && d[1] == ':' || - filesystem->IsPosix() && d == "/" || + if((filesystem->IsWin32() && d.GetLength() == 3 && d[1] == ':') || + (filesystem->IsPosix() && d == "/") || !IsFullPath(d)) d.Clear(); ------------------------- uppsrc/CtrlLib/LabelBase.cpp ------------------------- index 197ccee4d..89b57dd73 100644 @@ -80,7 +80,7 @@ int ExtractAccessKey(const char *s, String& label) String text; bool qtf = *s == '\1'; while(*s) - if((*s == '&' && !qtf || *s == '\b') && s[1] && s[1] != '&') { + if(((*s == '&' && !qtf) || *s == '\b') && s[1] && s[1] != '&') { akey = ToAscii(ToUpper(s[1])); pos = text.GetLength() + 1; s++; ------------------------- uppsrc/CtrlLib/LineEdit.cpp ------------------------- index 3017d7b96..87d1232e5 100644 @@ -411,7 +411,7 @@ void LineEdit::Paint0(Draw& w) { int cursorline = GetLine(cursor); Highlight ih; ih.ink = color[IsShowEnabled() ? INK_NORMAL : INK_DISABLED]; - ih.paper = color[IsReadOnly() && showreadonly || !IsShowEnabled() ? PAPER_READONLY : PAPER_NORMAL]; + ih.paper = color[(IsReadOnly() && showreadonly) || !IsShowEnabled() ? PAPER_READONLY : PAPER_NORMAL]; if(nobg) ih.paper = Null; ih.font = font; @@ -609,7 +609,7 @@ void LineEdit::Paint0(Draw& w) { selh -= len + 1; pos += len + 1; } - w.DrawRect(0, y, sz.cx, sz.cy - y, color[IsReadOnly() && showreadonly || !IsShowEnabled() ? PAPER_READONLY : PAPER_NORMAL]); + w.DrawRect(0, y, sz.cx, sz.cy - y, color[(IsReadOnly() && showreadonly) || !IsShowEnabled() ? PAPER_READONLY : PAPER_NORMAL]); DrawTiles(w, DropCaret(), CtrlImg::checkers()); vlinex = caretpos.x; } @@ -1010,8 +1010,8 @@ bool LineEdit::InsertChar(dword key, int count, bool canow) { return false; if(filter && key >= 32 && key < 65535) key = (*filter)(key); - if(!IsReadOnly() && (key >= 32 && key < 65536 || key == '\t' || key == '\n' || - key == K_ENTER && processenter || key == K_SHIFT_SPACE)) { + if(!IsReadOnly() && ((key >= 32 && key < 65536) || key == '\t' || key == '\n' || + (key == K_ENTER && processenter) || key == K_SHIFT_SPACE)) { if(key >= 128 && key < 65536 && (charset != CHARSET_UNICODE && charset != CHARSET_UTF8_BOM) && FromUnicode((wchar)key, charset) == DEFAULTCHAR) return true; -------------------------- uppsrc/CtrlLib/MenuBar.cpp -------------------------- index f82fc3d4c..efb43ecd8 100644 @@ -368,7 +368,7 @@ bool MenuBar::Key(dword key, int count) if(IterateFocusBackward(pane.GetLastChild(), &pane, false, true)) return true; } else - if(parentmenu && !parentmenu->IsChild() && key == K_LEFT || key == K_ESCAPE) { + if((parentmenu && !parentmenu->IsChild() && key == K_LEFT) || key == K_ESCAPE) { if(HasMouseDeep()) GetMouseCtrl()->Refresh(); if(parentmenu && parentmenu->submenu) @@ -449,7 +449,7 @@ bool MenuBar::HotKey(dword key) s_doaltkey = true; return true; } - if((key == K_F10 || key == (K_ALT_KEY|K_KEYUP) && s_doaltkey) + if((key == K_F10 || (key == (K_ALT_KEY|K_KEYUP) && s_doaltkey)) && !submenu && !HasFocusDeep() && GetTopWindow() && GetTopWindow()->IsForeground()) { LLOG("Open menu by F10 or ALT-UP"); SetupRestoreFocus(); ------------------------- uppsrc/CtrlLib/MenuItem.cpp ------------------------- index b4be0b8d8..bbfdf38bd 100644 @@ -266,7 +266,7 @@ void MenuItem::LostFocus() int MenuItem::GetVisualState() { return HasFocus() ? - (HasMouse() && GetMouseLeft() || GetMouseRight()) ? PUSH : HIGHLIGHT : NORMAL; + ((HasMouse() && GetMouseLeft()) || GetMouseRight()) ? PUSH : HIGHLIGHT : NORMAL; } void MenuItem::SyncState() @@ -395,7 +395,7 @@ void MenuItem::RightUp(Point p, dword w) bool MenuItem::HotKey(dword key) { if(isenabled && (key == accel || CompareAccessKey(accesskey, key) - || key < 256 && IsAlNum((char)key) && CompareAccessKey(accesskey, ToUpper((char)key) + K_DELTA + K_ALT))) { + || (key < 256 && IsAlNum((char)key) && CompareAccessKey(accesskey, ToUpper((char)key) + K_DELTA + K_ALT)))) { LLOG("MenuItem::HotKey(" << key << ") -> SetFocus"); SetFocus(); Sync(); @@ -517,8 +517,8 @@ Size TopSubMenuItem::GetMinSize() const int TopSubMenuItem::GetState() { if(parentmenu && parentmenu->GetActiveSubmenu() == &menu) return PUSH; - if(HasMouse() && GetParent() && !GetParent()->HasFocusDeep() && - (!parentmenu || !parentmenu->GetActiveSubmenu() || parentmenu->GetActiveSubmenu() == &menu) + if((HasMouse() && GetParent() && !GetParent()->HasFocusDeep() && + (!parentmenu || !parentmenu->GetActiveSubmenu() || parentmenu->GetActiveSubmenu() == &menu)) || HasFocus()) return HIGHLIGHT; return NORMAL; @@ -609,7 +609,7 @@ void TopSubMenuItem::SyncState() int TopMenuItem::GetState() { if(!IsEnabled()) return NORMAL; - if(HasMouse() && GetMouseLeft() || GetMouseRight()) return PUSH; + if((HasMouse() && GetMouseLeft()) || GetMouseRight()) return PUSH; if(HasFocus() || HasMouse()) return HIGHLIGHT; return NORMAL; } ------------------------ uppsrc/CtrlLib/MultiButton.cpp ------------------------ index 0bfe7f7dd..2173d0337 100644 @@ -286,13 +286,13 @@ int MultiButton::ChState(int i) if(i == MAIN && frm && style->activeedge) { int q = 0; if(p) - q = !p->IsEnabled() || !IsEnabled() || p->IsReadOnly() || i >= 0 && !button[i].enabled ? CTRL_DISABLED + q = !p->IsEnabled() || !IsEnabled() || p->IsReadOnly() || (i >= 0 && !button[i].enabled) ? CTRL_DISABLED : p->HasFocus() || push ? CTRL_PRESSED : p->HasMouse() || hl >= 0 ? CTRL_HOT : CTRL_NORMAL; return q; } - if(!IsShowEnabled() || IsReadOnly() || frm && p && p->IsReadOnly() || i >= 0 && !button[i].enabled) + if(!IsShowEnabled() || IsReadOnly() || (frm && p && p->IsReadOnly()) || (i >= 0 && !button[i].enabled)) return CTRL_DISABLED; if(IsTrivial() && !frm) i = 0; ----------------------- uppsrc/CtrlLib/RichTextView.cpp ----------------------- index 3b2c0d482..e4d80ac8d 100644 @@ -188,7 +188,7 @@ void RichTextView::RefreshSel() { int l = minmax(min(cursor, anchor), 0, text.GetLength()); int h = minmax(max(cursor, anchor), 0, text.GetLength()); - if(sell == l && selh == h || sell == selh && l == h) + if((sell == l && selh == h) || (sell == selh && l == h)) return; RichPos pl = text.GetRichPos(l); RichPos ph = text.GetRichPos(h); ------------------------ uppsrc/CtrlLib/SuggestCtrl.cpp ------------------------ index fab48acf3..a8047aad9 100644 @@ -89,7 +89,7 @@ bool SuggestCtrl::Key(dword key, int count) if(cc) key = cc; if(EditString::Key(key, count)) { - if(key >= 32 && key < 65536 || key == K_BACKSPACE || key == K_CTRL_SPACE) { + if((key >= 32 && key < 65536) || key == K_BACKSPACE || key == K_CTRL_SPACE) { int h; WString x = CF(ReadLast(h)); list.Clear(); -------------------------- uppsrc/CtrlLib/Switch.cpp -------------------------- index b7e59cdda..e4fa3f9dc 100644 @@ -217,7 +217,7 @@ void Switch::Paint(Draw& w) { DrawSmartText(w, x + isz.cx + DPI(4), y + ty, sz.cx, v.label, font, dv || IsReadOnly() ? SColorDisabled : GetLabelTextColor(this), /////// VisibleAccessKeys() ? v.accesskey : 0); - if(HasFocus() && (pushindex == i || v.value == value && pushindex < 0)) + if(HasFocus() && (pushindex == i || (v.value == value && pushindex < 0))) DrawFocus(w, RectC(x + isz.cx + DPI(2), y + ty - DPI(1), tsz.cx + DPI(3), tsz.cy + DPI(2)) & sz); } v.rect = hr; -------------------------- uppsrc/CtrlLib/ToolTip.cpp -------------------------- index 8c82fc164..00ca2c60b 100644 @@ -93,7 +93,7 @@ void SyncToolTip(Ctrl *ctrl) { if(!GUI_ToolTips()) return; - if(ctrl != tipctrl || ctrl && ctrl->GetTip() != AppToolTip().Get()) { + if(ctrl != tipctrl || (ctrl && ctrl->GetTip() != AppToolTip().Get())) { LLOG("ToolTipHook / ctrl change " << UPP::Name(ctrl) << " -> " << UPP::Name(ctrl)); tipctrl = ctrl; KillTimeCallback((void *)SyncToolTip); ------------------------- uppsrc/CtrlLib/TreeCtrl.cpp ------------------------- index bae192b99..4e38ca752 100644 @@ -803,7 +803,7 @@ bool TreeCtrl::IsSel(int id) const bool TreeCtrl::IsSelDeep(int id) const { - return IsSel(id) || id && IsSelDeep(GetParent(id)); + return IsSel(id) || (id && IsSelDeep(GetParent(id))); } void TreeCtrl::SelectOne0(int id, bool sel, bool cb) @@ -1073,7 +1073,7 @@ const Display *TreeCtrl::GetStyle(int i, Color& fg, Color& bg, dword& st) if(hasfocus) st |= Display::FOCUS; if((st & Display::SELECT) || - !multiselect && (st & Display::CURSOR) && !nocursor || + (!multiselect && (st & Display::CURSOR) && !nocursor) || drop) { fg = hasfocus ? SColorHighlightText : SColorText; bg = hasfocus ? SColorHighlight : Blend(SColorDisabled, SColorPaper); @@ -1156,7 +1156,7 @@ void TreeCtrl::Paint(Draw& w) const Display *d = GetStyle(i, fg, bg, st); int ctx = highlight_ctrl * csz.cx; Rect br = RectC(x, y, vsz.cx + 2 * m.margin + ctx, msz.cy); - if(!IsNull(m.value) || m.ctrl && highlight_ctrl) { + if(!IsNull(m.value) || (m.ctrl && highlight_ctrl)) { w.DrawRect(br, bg); Rect r = RectC(x + ctx + m.margin, y + (msz.cy - vsz.cy) / 2, vsz.cx, vsz.cy); w.Clip(r); @@ -1871,7 +1871,7 @@ void OptionTree::SetOption(int id) } opt = option[id]; if(opt) { - if(t && f || n) { + if((t && f) || n) { opt->Set(Null); } else ----------------------------- uppsrc/Draw/Font.cpp ----------------------------- index 19d91f89d..eda6ad3bf 100644 @@ -90,7 +90,7 @@ void Font::SetFace(int index, const String& name) int FontFilter(int c) { - return c >= 'a' && c <= 'z' || c >= '0' && c <= '9' ? c : c >= 'A' && c <= 'Z' ? ToLower(c) : 0; + return (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') ? c : c >= 'A' && c <= 'Z' ? ToLower(c) : 0; } int Font::FindFaceNameIndex(const String& name) { ---------------------------- uppsrc/Draw/Image.cpp ---------------------------- index 63a1f8478..bb44cc61f 100644 @@ -274,12 +274,12 @@ bool Image::operator==(const Image& img) const { static_assert(sizeof(RGBA) == 4, "sizeof(RGBA)"); return IsSame(img) || - GetSize() == img.GetSize() && + (GetSize() == img.GetSize() && GetHotSpot() == img.GetHotSpot() && Get2ndSpot() == img.Get2ndSpot() && GetDots() == img.GetDots() && GetResolution() == img.GetResolution() && - memeq32(~*this, ~img, GetLength()); + memeq32(~*this, ~img, GetLength())); } bool Image::operator!=(const Image& img) const ------------------------------ uppsrc/Esc/Esc.cpp ------------------------------ index 829d5c7aa..d3b08a43a 100644 @@ -169,7 +169,7 @@ EscValue Esc::ExecuteLambda(const String& id, EscValue lambda, SRVal self, Vecto if(!lambda.IsLambda()) ThrowError(Format("'%s' is not a lambda", id)); const EscLambda& l = lambda.GetLambda(); - if(!l.varargs && arg.GetCount() > l.arg.GetCount() + if((!l.varargs && arg.GetCount() > l.arg.GetCount()) || arg.GetCount() < l.arg.GetCount() - l.def.GetCount()) ThrowError("invalid number of arguments in call to '" + id + "'"); Esc sub(global, l.code, op_limit, l.filename, l.line); -------------------------- uppsrc/Painter/OnPath.cpp -------------------------- index b94a2aab8..df3645320 100644 @@ -13,7 +13,7 @@ void BufferPainter::BeginOnPathOp(double q, bool abs) Pointf pos(0, 0); for(int i = 0; i < onpath.GetCount(); i++) { PathLine& l = onpath[i]; - if(l.len > 0 && (l.len > q || q >= 1.0 && i == onpath.GetCount() - 1)) { + if(l.len > 0 && (l.len > q || (q >= 1.0 && i == onpath.GetCount() - 1))) { Pointf v = l.p - pos; Translate(q / l.len * v + pos); Rotate(Bearing(v)); -------------------------- uppsrc/Painter/Render.cpp -------------------------- index 7205edf9d..8e0872655 100644 @@ -147,7 +147,7 @@ Buffer<ClippingLine> BufferPainter::RenderPath(double width, Event<One<SpanSourc current = Null; - if(width == 0 || !ss && color.a == 0 && width >= FILL) + if(width == 0 || (!ss && color.a == 0 && width >= FILL)) return newclip; if(pathattr.mtx_serial != preclip_mtx_serial) { -------------------------- uppsrc/Painter/Stroker.cpp -------------------------- index 317d67090..f7a654c53 100644 @@ -41,10 +41,10 @@ void Stroker::Round(const Pointf& p, const Pointf& v1, const Pointf& v2, double inline bool Stroker::PreClipped(Pointf p2, Pointf p3) { - return p2.x + tw < preclip.left && p3.x + tw < preclip.left || - p2.x - tw > preclip.right && p3.x - tw > preclip.right || - p2.y + tw < preclip.top && p3.y + tw < preclip.top || - p2.y - tw > preclip.bottom && p3.y - tw > preclip.bottom; + return (p2.x + tw < preclip.left && p3.x + tw < preclip.left) || + (p2.x - tw > preclip.right && p3.x - tw > preclip.right) || + (p2.y + tw < preclip.top && p3.y + tw < preclip.top) || + (p2.y - tw > preclip.bottom && p3.y - tw > preclip.bottom); } void Stroker::Line(const Pointf& p3) ------------------------- uppsrc/Painter/SvgParser.cpp ------------------------- index 61fcbc380..84ba2f614 100644 @@ -449,7 +449,7 @@ void SvgParser::Element(const XmlNode& n, int depth, bool dosymbols) FinishElement(); } else - if(n.IsTag("g") || n.IsTag("symbol") && dosymbols) + if(n.IsTag("g") || (n.IsTag("symbol") && dosymbols)) Items(n, depth); else if(n.IsTag("use")) { --------------------------- uppsrc/RichEdit/Clip.cpp --------------------------- index 5d943aa7e..6da88b655 100644 @@ -38,7 +38,7 @@ bool RichEdit::Accept(PasteClip& d, RichText& clip, String& fmt) if(d.Accept() && GetFileLength(fn) < 17000000) { String data = LoadFile(fn); StringStream ss(data); - if(StreamRaster::OpenAny(ss) || ext == ".svg" && IsSVG(LoadFile(fn))) { + if(StreamRaster::OpenAny(ss) || (ext == ".svg" && IsSVG(LoadFile(fn)))) { RichPara p; p.Cat(CreateRawImageObject(data), formatinfo); clip.Cat(p); -------------------------- uppsrc/RichEdit/Editor.cpp -------------------------- index 30ba8cff4..2e9484b05 100644 @@ -328,7 +328,7 @@ int RichEdit::GetNearestPos(int x, PageY py) String dummy; RichPos p = text.GetRichPos(c); if(c >= text.GetLength() - 1 || c < 0 || p.object || p.field - || p.table && (p.posincell == 0 || p.posincell == p.celllen)) + || (p.table && (p.posincell == 0 || p.posincell == p.celllen))) return c; Rect r1 = text.GetCaret(c, pagesz); Rect r2 = text.GetCaret(c + 1, pagesz); --------------------------- uppsrc/RichEdit/Find.cpp --------------------------- index 739af1971..06c2ceefb 100644 @@ -45,8 +45,8 @@ struct RichFindIterator : RichText::Iterator { q += cursor - pos; while(q <= e) { if(compare3(q, upperw, lowerw, len) && - (!ww || (q + len == e || !IsLetter(q[len])) && - (q == ptext || !IsLetter(q[-1])))) { + (!ww || ((q + len == e || !IsLetter(q[len])) && + (q == ptext || !IsLetter(q[-1]))))) { fpos = int(q - ~ptext + pos); return true; } --------------------------- uppsrc/RichEdit/Kbd.cpp --------------------------- index 5022551fc..af687930a 100644 @@ -184,7 +184,7 @@ bool RichEdit::Key(dword key, int count) } if(key == K_SHIFT_SPACE) key = ' '; - if(key == 9 || key >= 32 && key < 65536) { + if(key == 9 || (key >= 32 && key < 65536)) { RichPara::Format f; if(IsSelection()) { f = text.GetRichPos(min(cursor, anchor)).format; ------------------------- uppsrc/RichEdit/Speller.cpp ------------------------- index b52898ec1..037626ad1 100644 @@ -36,7 +36,7 @@ Bits RichEdit::SpellParagraph(const RichPara& para) while(s < end) { if(IsLetter(*s)) { const wchar *q = s; - while(s < end && IsLetter(*s) || s + 1 < end && *s == '\'' && IsLetter(s[1])) + while((s < end && IsLetter(*s)) || (s + 1 < end && *s == '\'' && IsLetter(s[1]))) s++; if(!SpellWord(q, int(s - q), lang[q - text])) e.SetN(int(q - text), int(s - q)); -------------------------- uppsrc/RichEdit/Table.cpp -------------------------- index 92eeebe3a..d39cf48cc 100644 @@ -323,7 +323,7 @@ void RichEdit::SplitCell() void RichEdit::CellProperties() { - if(!(tablesel || cursorp.table && !IsSelection())) + if(!(tablesel || (cursorp.table && !IsSelection()))) return; WithCellPropertiesLayout<TopWindow> dlg; CtrlLayoutOKCancel(dlg, t_("Cell properties")); --------------------------- uppsrc/RichEdit/Tool.cpp --------------------------- index 458c3507e..d568d235d 100644 @@ -297,7 +297,7 @@ void RichEdit::RedoTool(Bar& bar, dword key) void RichEdit::CutTool(Bar& bar, dword key) { - bar.Add(!IsReadOnly() && IsSelection() || objectpos >= 0, t_("Cut"), CtrlImg::cut(), USERBACK(Cut)) + bar.Add((!IsReadOnly() && IsSelection()) || objectpos >= 0, t_("Cut"), CtrlImg::cut(), USERBACK(Cut)) .Key(K_SHIFT_DELETE) .Key(key); } ------------------------- uppsrc/RichText/ParaType.cpp ------------------------- index 45db631fa..4ccb6bf5f 100644 @@ -317,9 +317,9 @@ RichPara::Lines RichPara::FormatLines(int acx) const t = GetNextTab(cx + format.lm, rcx); space = NULL; } - if(cx + *w > rcx && s > text || - *s == '\t' && (t.align == ALIGN_RIGHT ? t.pos - format.lm > rcx - : t.pos - format.lm >= rcx)) { + if((cx + *w > rcx && s > text) || + (*s == '\t' && (t.align == ALIGN_RIGHT ? t.pos - format.lm > rcx + : t.pos - format.lm >= rcx))) { Line& l = lines.line.Add(); l.withtabs = withtabs; l.pos = (int)(text - lines.text); ------------------------- uppsrc/RichText/ParseQtf.cpp ------------------------- index 866144131..59fe1ae2d 100644 @@ -325,11 +325,11 @@ void RichQtfParser::ReadObject() StringBuffer data; for(;;) { while(*term < 32 && *term > 0) term++; - if((byte)*term >= ' ' && (byte)*term <= 127 || *term == '\0') break; + if(((byte)*term >= ' ' && (byte)*term <= 127) || *term == '\0') break; byte seven = *term++; for(int i = 0; i < 7; i++) { while((byte)*term < 32 && (byte)*term > 0) term++; - if((byte)*term >= ' ' && (byte)*term <= 127 || *term == '\0') break; + if(((byte)*term >= ' ' && (byte)*term <= 127) || *term == '\0') break; data.Cat((*term++ & 0x7f) | ((seven << 7) & 0x80)); seven >>= 1; } ------------------------- uppsrc/RichText/TxtData.cpp ------------------------- index cb5e9bd9a..579c30630 100644 @@ -203,7 +203,7 @@ RichPara RichTxt::Get(int i, const RichStyles& s) const bool RichTxt::IsEmpty() const { - return part.IsEmpty() || part.GetCount() == 1 && ComputeLength() == 0; + return part.IsEmpty() || (part.GetCount() == 1 && ComputeLength() == 0); } int RichTxt::ComputeLength() const ------------------------- uppsrc/RichText/TxtPaint.cpp ------------------------- index 123c6de37..b002d1715 100644 @@ -100,7 +100,7 @@ void RichTxt::Advance(int parti, RichContext& rc, RichContext& begin) const } if(pp.newhdrftr && rc.text == this) rc.HeaderFooter(~pp.header, ~pp.footer); - if(pp.newpage || rc.py.y + cy + nbefore + nline > rc.page.bottom && cy < rc.page.Height()) + if(pp.newpage || (rc.py.y + cy + nbefore + nline > rc.page.bottom && cy < rc.page.Height())) rc.Page(); begin = rc; rc.py.y += pp.before + pp.ruler; --------------------------- uppsrc/TabBar/TabBar.cpp --------------------------- index 0295ae22a..6f9fbe37c 100644 @@ -2279,7 +2279,7 @@ bool TabBar::ProcessMouse(int i, const Point& p) if (stacking && ProcessStackMouse(i, p)) return true; bool iscross = crosses && !IsCancelClose(i) ? tabs[i].HasMouseCross(p) : false; - if(highlight != i || (iscross && cross != i || !iscross && cross == i)) + if(highlight != i || ((iscross && cross != i) || (!iscross && cross == i))) { cross = iscross ? i : -1; SetHighlight(i); ----------------------- uppsrc/TextDiffCtrl/DirDiff.cpp ----------------------- index 5042053a1..7d4f95748 100644 @@ -197,8 +197,8 @@ void DirDiffDlg::ShowResult() for(int i = 0; i < list.GetCount(); i++) { int n = list[i].d; - if((n == NORMAL_FILE && modified || n == DELETED_FILE && removed - || n == NEW_FILE && added || n == FAILED_FILE || n == PATCHED_FILE) + if(((n == NORMAL_FILE && modified) || (n == DELETED_FILE && removed) + || (n == NEW_FILE && added) || n == FAILED_FILE || n == PATCHED_FILE) && ToLower(list[i].a).Find(sFind) >= 0) files.Add(MakeFile(i)); } ----------------------- uppsrc/TextDiffCtrl/TextCtrl.cpp ----------------------- index 506eb4e1e..e9330209b 100644 @@ -52,7 +52,7 @@ void TextCompareCtrl::DoSelection(int y, bool shift) void TextCompareCtrl::LeftDown(Point pt, dword keyflags) { Size sz = GetSize(); - if(pt.x > sz.cx - gutter_width || HasCapture() && gutter_capture) { + if(pt.x > sz.cx - gutter_width || (HasCapture() && gutter_capture)) { if(!HasCapture()) SetCapture(); int line = (pt.y * lines.GetCount()) / sz.cy; @@ -213,7 +213,7 @@ bool TextCompareCtrl::LineDiff(bool left, Vector<LineEdit::Highlight>& hln, Colo } } - if(matchlen > 1 || matchlen && !IsAlNum(s1[p1])) { + if(matchlen > 1 || (matchlen && !IsAlNum(s1[p1]))) { for(int i = 0; i < matchlen; i++) hln[(left ? p1 : p2) + i].paper = eq_color; ----------------------- uppsrc/TextDiffCtrl/TextDiff.cpp ----------------------- index 695362e56..785fe44c8 100644 @@ -111,7 +111,7 @@ TextComparator::TextComparator(const Vector<String>& f1, const Vector<String>& f static bool CompareSection(const TextSection& ta, const TextSection& tb) { - return ta.start1 < tb.start1 || ta.start1 == tb.start1 && ta.start2 < tb.start2; + return ta.start1 < tb.start1 || (ta.start1 == tb.start1 && ta.start2 < tb.start2); } Array<TextSection> TextComparator::GetSections() const ------------------------ uppsrc/TextDiffCtrl/patch.cpp ------------------------ index a422dd8b6..9d4f86ba9 100644 @@ -195,7 +195,7 @@ String Patch::GetPatchedFile(int i) const } } - if(pos < 0 || ch_pos.GetCount() && ch_pos.Top() > pos) + if(pos < 0 || (ch_pos.GetCount() && ch_pos.Top() > pos)) return String::GetVoid(); ch_pos.Add(pos); } ---------------------------- uppsrc/ide/Assist.cpp ---------------------------- index e735439f1..1b1514220 100644 @@ -343,9 +343,9 @@ void AssistEditor::SyncAssist() if(!found[i] && (typei < 0 || m.typei == typei) && (pass ? m.uname.StartsWith(uname) : m.name.StartsWith(name)) && - (!destructor || m.kind == DESTRUCTOR && m.scope == current_type + "::")) { + (!destructor || (m.kind == DESTRUCTOR && m.scope == current_type + "::"))) { int q = include_assist ? -1 : over.Find(m.qitem); - if(q < 0 || over[q] == m.typei && m.scope.GetCount()) { + if(q < 0 || (over[q] == m.typei && m.scope.GetCount())) { found[i] = true; assist_item_ndx.Add(i); if(q < 0) @@ -865,8 +865,8 @@ bool AssistEditor::Key(dword key, int count) else if(auto_assist) { if(InCode()) { - if(key == '.' || key == '>' && Ch(GetCursor32() - 2) == '-' || - key == ':' && Ch(GetCursor32() - 2) == ':') + if(key == '.' || (key == '>' && Ch(GetCursor32() - 2) == '-') || + (key == ':' && Ch(GetCursor32() - 2) == ':')) Assist(); else if(key == '(') { ---------------------- uppsrc/ide/Browser/CodeBrowser.cpp ---------------------- index 9e17442d0..1554c760c 100644 @@ -4,7 +4,7 @@ bool MatchCib(const String& s, const String& match) { if(IsNull(match)) return true; int q = ToUpper(s).Find(match); - return q > 0 && !iscid(s[q - 1]) || q == 0; + return (q > 0 && !iscid(s[q - 1])) || q == 0; } bool MatchPm(const String& fn, const String& pm) ------------------------ uppsrc/ide/Browser/CodeRef.cpp ------------------------ index f70d1d7b0..c3dd27fb8 100644 @@ -369,7 +369,7 @@ void TopicEditor::GoTo(const String& _topic, const String& link, const String& c for(;;) { int c = editor.GetCursor(); RichText::FormatInfo f = editor.GetFormatInfo(); - if(f.styleid == BeginUuid() || (IsNull(f.label) || f.label == "noref") && pass) + if(f.styleid == BeginUuid() || ((IsNull(f.label) || f.label == "noref") && pass)) break; editor.NextPara(); if(editor.GetCursor() == c) ------------------------- uppsrc/ide/Browser/Item.cpp ------------------------- index 84207acc1..384e8859f 100644 @@ -96,7 +96,7 @@ Vector<ItemTextPart> ParseItemNatural(const String& name, p.pari = pari; int n = 1; if(*s >= '0' && *s <= '9') { - while(s[n] >= '0' && s[n] <= '9' || (s[n] == 'x' || s[n] == 'X')) + while((s[n] >= '0' && s[n] <= '9') || (s[n] == 'x' || s[n] == 'X')) n++; p.type = ITEM_NUMBER; } ----------------------- uppsrc/ide/Browser/TopicBase.cpp ----------------------- index fe895c318..f4696cdf1 100644 @@ -139,7 +139,7 @@ void SyncTopicFile(const String& link) LLOG("SyncTopicFile " << link << " path: " << path); TopicInfo& ti = topic_info().GetPut(link); Time tm = FileGetTime(path); - if(ti.path == ":ide:" || ti.path == path && ti.time == tm) + if(ti.path == ":ide:" || (ti.path == path && ti.time == tm)) return; String fn = TopicCacheName(path); if(FileGetTime(fn) > tm) { ---------------------- uppsrc/ide/Builders/GccBuilder.cpp ---------------------- index 528a9615f..d81dbe6a6 100644 @@ -93,10 +93,9 @@ bool GccBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V String fn = srcfile[j]; String ext = GetSrcType(fn); if(findarg(ext, ".c", ".cpp", ".cc", ".cxx", ".brc", ".s", ".ss") >= 0 || - objectivec && findarg(ext, ".mm", ".m") >= 0 || - + + (objectivec && findarg(ext, ".mm", ".m") >= 0) || (!release && blitz && ext == ".icpp") || - ext == ".rc" && HasFlag("WIN32")) { + (ext == ".rc" && HasFlag("WIN32"))) { sfile.Add(fn); soptions.Add(gop); } @@ -325,7 +324,7 @@ bool GccBuilder::BuildPackage(const String& package, Vector<String>& linkfile, V OnFinish(callback1(DeletePCHFile, pch_file)); if(!HasFlag("MAIN")) { - if(HasFlag("BLITZ") && !HasFlag("SO") || HasFlag("NOLIB") || making_lib) { + if((HasFlag("BLITZ") && !HasFlag("SO")) || HasFlag("NOLIB") || making_lib) { linkfile.Append(obj); // Simply link everything as .o files... IdeConsoleEndGroup(); // if(ccount) --------------------- uppsrc/ide/Builders/JavaBuilder.cpp --------------------- index 9e920d0e8..1921e674f 100644 @@ -97,7 +97,7 @@ bool JavaBuilder::BuildPackage(const String& package, Vector<String>& linkfile, String fn = srcfile[j]; String ext = ToLower(GetFileExt(fn)); bool ismf = false; - if(ext == ".java" || main && ext == ".mf") + if(ext == ".java" || (main && ext == ".mf")) { if(ext == ".mf") { -------------------------- uppsrc/ide/ContextGoto.cpp -------------------------- index e664547d9..b07870876 100644 @@ -482,7 +482,7 @@ void Ide::GotoFileAndId(const String& path, const String& id) WString ln = editor.GetWLine(i); int q = ln.Find(wid); while(q >= 0) { - if(q == 0 || !iscid(ln[q - 1]) && !iscid(ln[q + wid.GetCount()])) { + if(q == 0 || (!iscid(ln[q - 1]) && !iscid(ln[q + wid.GetCount()]))) { editor.SetCursor(editor.GetPos64(i, q)); editor.CenterCursor(); return; -------------------------- uppsrc/ide/Core/BinObj.cpp -------------------------- index ab5789c78..a58b4e63a 100644 @@ -75,7 +75,7 @@ void BinObjInfo::Parse(CParser& binscript, String base_dir) int f = brow.Find(blk.index); if(f >= 0) binscript.ThrowError(Format("%s[%d] already seen at line %d", blk.ident, blk.index, brow[f].scriptline)); - if(blk.index < 0 && !brow.IsEmpty() || blk.index >= 0 && !brow.IsEmpty() && brow[0].index < 0) + if((blk.index < 0 && !brow.IsEmpty()) || (blk.index >= 0 && !brow.IsEmpty() && brow[0].index < 0)) binscript.ThrowError(Format("%s: mixing non-array and array elements", blk.ident)); brow.Add(blk.index, blk); if(!(blk.flags & Block::FLG_MASK)) ------------------------- uppsrc/ide/Core/Package.cpp ------------------------- index 2b83dc836..70d861e8a 100644 @@ -79,7 +79,7 @@ String ReadWhen(CParser& p) { const char *b = p.GetPtr(); int lvl = 0; for(;;) { - if(p.IsEof() || lvl == 0 && p.IsChar(')')) + if(p.IsEof() || (lvl == 0 && p.IsChar(')'))) break; if(p.Char('(')) lvl++; ------------------------------ uppsrc/ide/Cpp.cpp ------------------------------ index e23671043..b7fba0396 100644 @@ -123,7 +123,7 @@ void AssistEditor::GatherItems(const String& type, bool only_public, Index<Strin const CppItem& im = n[i]; if(im.kind == STRUCT || im.kind == STRUCTTEMPLATE) base << im.qptype << ';'; - if((im.IsCode() || !thisback && (im.IsData() || im.IsMacro() && IsNull(type))) + if((im.IsCode() || (!thisback && (im.IsData() || (im.IsMacro() && IsNull(type))))) && (!op || im.access == PUBLIC)) { AssistItemAdd(ntp, im, typei); } ----------------------- uppsrc/ide/Debuggers/GdbData.cpp ----------------------- index 0b460b0f4..36a5fa0c6 100644 @@ -52,7 +52,7 @@ String DataClean(CParser& p) int lvl = 0; for(;;) { bool sp = p.Spaces(); - if(lvl == 0 && (p.IsChar('}') || p.IsChar(',')) || p.IsEof()) + if((lvl == 0 && (p.IsChar('}') || p.IsChar(','))) || p.IsEof()) break; if(sp) r << ' '; ---------------------------- uppsrc/ide/Errors.cpp ---------------------------- index fa0734aa5..da5bb6abe 100644 @@ -59,7 +59,7 @@ bool Ide::FindLineError(const String& ln, FindLineErrorCache& cache, ErrorInfo& } } file = FollowCygwinSymlink(file); - if(!IsFullPath(file) || !exists && !FileExists(file) || !IsTextFile(file)) + if(!IsFullPath(file) || (!exists && !FileExists(file)) || !IsTextFile(file)) file = Null; cache.file.Add(file0, file); } @@ -150,7 +150,7 @@ bool Ide::FindLineError(const String& ln, FindLineErrorCache& cache, ErrorInfo& return f.lineno > 0; } else - if(*s == ':' || !strchr(s, '/') && !strchr(s, '\\')) // safe to say this is final + if(*s == ':' || (!strchr(s, '/') && !strchr(s, '\\'))) // safe to say this is final return false; else f.file.Cat(*s); // File is not complete, e.g.: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Vc\Include\string.h(186) --------------------------- uppsrc/ide/Navigator.cpp --------------------------- index 74dc3cd2f..77132018f 100644 @@ -572,10 +572,10 @@ void Navigator::Search() for(int j = 0; j < ci.GetCount(); j++) { const CppItem& m = ci[j]; if(local ? m.file == fileii - : m.uname.Find('@') < 0 && (pass < 0 ? m.name == search_name : + : (m.uname.Find('@') < 0 && (pass < 0 ? m.name == search_name : pass ? m.uname.Find(usearch_name) >= 0 - : m.name.StartsWith(search_name)) - || both && foundnest) { + : m.name.StartsWith(search_name))) + || (both && foundnest)) { String key = nest + '\1' + m.qitem; int q = nest_pass.Find(nest); int p = pass; --------------------------- uppsrc/ide/RepoSync.cpp --------------------------- index b285e4299..d878e9a83 100644 @@ -90,7 +90,7 @@ bool IsConflictFile(String path) String ext = GetFileExt(path); if(*ext == '.') { ext = ext.Mid(1); - if(findarg(ext, "mine", "theirs", "working") >= 0 || *ext == 'r' && IsDigit(ext[1])) { + if(findarg(ext, "mine", "theirs", "working") >= 0 || (*ext == 'r' && IsDigit(ext[1]))) { for(int i = 0; i < 3; i++) { int q = path.ReverseFind('.'); if(q < 0) @@ -153,7 +153,7 @@ bool RepoSync::ListSvn(const String& path) color = AdjustIfDark(c[action]); } } - if(pass == action < 0 && action != DELETEC) { + if(pass == action && action != DELETEC) { int ii = list.GetCount(); list.Add(action, file, Null, AttrText(action < 0 ? ln[i] : " " + file.Mid(path.GetCount() + 1)).Ink(color)); @@ -193,7 +193,7 @@ bool RepoSync::ListGit(const String& path) String file = AppendFileName(path, h.Mid(3)); actions = true; int action = String("M.?DR").Find(h[1]); - if(action < 0 || h[0] != '?' && h[0] != ' ') + if(action < 0 || (h[0] != '?' && h[0] != ' ')) action = SVN_IGNORE; String an; Color color; ----------------------------- uppsrc/ide/Swaps.cpp ----------------------------- index d61002bcd..d54cdbba0 100644 @@ -33,7 +33,7 @@ bool Ide::SwapSIf(const char *cref) if(q < 0) return false; const Array<CppItem>& nn = CodeBase()[q]; - if(cref && MakeCodeRef(p.current_scope, p.current_key) != cref || IsNull(p.current_name)) + if((cref && MakeCodeRef(p.current_scope, p.current_key) != cref) || IsNull(p.current_name)) return false; Vector<const CppItem *> n; bool destructor = p.current_key.Find('~') >= 0; --------------------------- uppsrc/ide/Template.cpp --------------------------- index 5e9c18ede..3978d05fd 100644 @@ -341,7 +341,7 @@ void TemplateDlg::LoadNest(const char *path, bool main, bool recurse) if(ToLower(GetFileExt(ff.GetName())) == ".upt") { try { PackageTemplate t = ReadTemplate(p); - if(main && t.main || !main && t.sub) + if((main && t.main) || (!main && t.sub)) pt.Add() = pick(t); } catch(CParser::Error e) { ---------------------------- uppsrc/ide/idebar.cpp ---------------------------- index df7e6bad9..61def00a1 100644 @@ -554,9 +554,9 @@ void Ide::FilePropertiesMenu(Bar& menu) for(int i = 0; i < n; i++) { // check that we are in git conflict const String& s = editor.GetUtf8Line(i); int ch = *s; - a = a || ch == '<' && s.StartsWith("<<<<<<<"); - b = b || ch == '=' && s.StartsWith("======="); - c = c || ch == '>' && s.StartsWith(">>>>>>>"); + a = a || (ch == '<' && s.StartsWith("<<<<<<<")); + b = b || (ch == '=' && s.StartsWith("=======")); + c = c || (ch == '>' && s.StartsWith(">>>>>>>")); } if(a && b && c) { original = "1"; ---------------------------- uppsrc/ide/idefile.cpp ---------------------------- index 70fe94c55..e5cc0c76e 100644 @@ -475,10 +475,10 @@ void Ide::EditFile0(const String& path, byte charset, int spellcheck_comments, c } if(!designer && editastext.Find(path) < 0 && - (findarg(GetFileExt(path), ".log") < 0 && + ((findarg(GetFileExt(path), ".log") < 0 && findarg(charset, CHARSET_UTF8_BOM, CHARSET_UTF16_LE, CHARSET_UTF16_BE, CHARSET_UTF16_LE_BOM, CHARSET_UTF16_BE_BOM) < 0 && - FileIsBinary(path) || editashex.Find(path) >= 0)) + FileIsBinary(path)) || editashex.Find(path) >= 0)) designer.Create<FileHexView>().Open(path); ManageDisplayVisibility(); @@ -549,7 +549,7 @@ void Ide::EditFile0(const String& path, byte charset, int spellcheck_comments, c const int64 max_size = 768*1024*1024; #endif const int view_limit = 256*1024*1024; - if(view_file.GetSize() < view_limit || editastext.Find(editfile) >= 0 && view_file.GetSize() < max_size) { + if(view_file.GetSize() < view_limit || (editastext.Find(editfile) >= 0 && view_file.GetSize() < max_size)) { le = editor.Load(view_file, charset); view_file.Close(); } ---------------------------- uppsrc/ide/idetool.cpp ---------------------------- index d4da768e6..8e16de7c5 100644 @@ -100,7 +100,7 @@ void Ide::GotoPosition() for(String n : pk.file) { String pf = PosFn(pkg, n); int q = f.GetCount() - pf.GetCount() - 1; - if(pf == f || q >= 0 && f.EndsWith(PosFn(pkg, n)) && f[q] == '/') { + if(pf == f || (q >= 0 && f.EndsWith(PosFn(pkg, n)) && f[q] == '/')) { GotoPos(SourcePath(pkg, n), line); return; } ------------------------------- uppsrc/ide/t.cpp ------------------------------- index 954530646..fe93b40a0 100644 @@ -166,7 +166,7 @@ String CreateTFile(const VectorMap<String, LngEntry>& map, const Vector<int>& ln int lang = lngset[j]; if(rep || lang != LNG_enUS) { int q = e.text.Find(lang); - if(!rep || q >= 0 && !IsNull(e.text[q])) { + if(!rep || (q >= 0 && !IsNull(e.text[q]))) { int c = (lang >> 15) & 31; if(c) { out.Cat(c + 'a' - 1); --------------------- uppsrc/plugin/astyle/ASFormatter.cpp --------------------- index c8c1e60cb..4434d79d7 100644 @@ -680,8 +680,8 @@ WString ASFormatter::nextLine() && !isPreviousCharPostComment // Fixes wrongly appended newlines after '}' immediately after comments && peekNextChar() != ' ' && !IS_A(previousBracketType, DEFINITION_TYPE) - && !(ASBeautifier::isJavaStyle && currentChar == ')')) - && !IS_A(bracketTypeStack->back(), DEFINITION_TYPE)) + && !(ASBeautifier::isJavaStyle && currentChar == ')') + && !IS_A(bracketTypeStack->back(), DEFINITION_TYPE))) && (shouldBreakOneLineBlocks || !IS_A(bracketTypeStack->back(), SINGLE_LINE_TYPE))) { ------------------------ uppsrc/plugin/lz4/Compress.cpp ------------------------ index 12c3158f2..a802035f1 100644 @@ -115,7 +115,7 @@ void LZ4CompressStream::_Put(const void *data, dword size) const char *s = reinterpret_cast<const char *>(data); while(size > 0) { - if(IsError() || out && out->IsError()) + if(IsError() || (out && out->IsError())) return; dword n = dword(wrlim - ptr); if(size >= n) { --------------------------- uppsrc/plugin/lz4/lz4.h --------------------------- index 16649e291..833892113 100644 @@ -95,7 +95,7 @@ private: void Init(); bool Next(); void Fetch(); - bool Ended() const { return IsError() || in->IsError() || ptr == rdlim && ii == count && eof; } + bool Ended() const { return IsError() || in->IsError() || (ptr == rdlim && ii == count && eof); } public: bool Open(Stream& in); ------------------------- uppsrc/plugin/lzma/lzma.cpp ------------------------- index c1c6ddd1e..f6d1b060d 100644 @@ -100,7 +100,7 @@ static SRes Decode2(CLzmaDec *state, ISeqOutStream *outStream, ISeqInStream *inS return SZ_ERROR_WRITE; outPos = 0; - if(res != SZ_OK || thereIsSize && unpackSize == 0) + if(res != SZ_OK || (thereIsSize && unpackSize == 0)) return res; if(inProcessed == 0 && outProcessed == 0) { ----------------------- uppsrc/plugin/zstd/Compress.cpp ----------------------- index 733f54d00..caa3b4003 100644 @@ -98,7 +98,7 @@ void ZstdCompressStream::_Put(const void *data, dword size) const char *s = reinterpret_cast<const char *>(data); while(size > 0) { - if(IsError() || out && out->IsError()) + if(IsError() || (out && out->IsError())) return; dword n = dword(wrlim - ptr); if(size >= n) { -------------------------- uppsrc/plugin/zstd/zstd.h -------------------------- index e7d5ce6d4..7ddd10c26 100644 @@ -86,7 +86,7 @@ private: void Init(); bool Next(); void Fetch(); - bool Ended() const { return IsError() || in->IsError() || ptr == rdlim && ii == count && eof; } + bool Ended() const { return IsError() || in->IsError() || (ptr == rdlim && ii == count && eof); } public: bool Open(Stream& in); ```
Author
Owner

@klugier commented on GitHub (Jan 7, 2021):

@mingodad The reason why it is still there is that Mirek doesn't' like it, so we always use "-Wno-logical-op-parentheses" in context of clang (because there was a time that it was enable by default, they hopefully changed that in the current releases). Anyway, please do not post patches with that fixes. We could accept other fixes related to -Wall, but not this particular one.

When you exporting makefile I highly suggest to use "Wno-logical-op-parentheses", so you should be free from these warnings.

<!-- gh-comment-id:756273206 --> @klugier commented on GitHub (Jan 7, 2021): @mingodad The reason why it is still there is that Mirek doesn't' like it, so we always use "-Wno-logical-op-parentheses" in context of clang (because there was a time that it was enable by default, they hopefully changed that in the current releases). Anyway, please do not post patches with that fixes. We could accept other fixes related to -Wall, but not this particular one. When you exporting makefile I highly suggest to use "Wno-logical-op-parentheses", so you should be free from these warnings.
Author
Owner

@mingodad commented on GitHub (Jan 7, 2021):

And here is a diff between the first and the second chages:

--- <unnamed>
+++ <unnamed>
@@ -312,7 +312,7 @@
  	#ifndef ENDZIP
 
 ----------------------------- uppsrc/Core/Parser.h -----------------------------
-index 084697e5d..38bac6a03 100644
+index 084697e5d..5fe172297 100644
 @@ -1,9 +1,9 @@
  inline bool iscib(int c) {
 -	return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '_' || c == '$';
@@ -321,7 +321,7 @@
  
  inline bool iscid(int c) {
 -	return iscib(c) || c >= '0' && c <= '9';
-+	return iscib(c) || ((c >= '0') && (c <= '9'));
++	return iscib(c) || (c >= '0' && c <= '9');
  }
  
  class CParser {
@@ -495,25 +495,16 @@
  }
 
 ---------------------------- uppsrc/Core/parser.cpp ----------------------------
-index 89fa1353d..66afba18f 100644
+index 89fa1353d..91c74f5a5 100644
 @@ -190,7 +190,7 @@ String CParser::ReadIdt() {
  	StringBuffer result;
  	int lvl = 0;
  	while(IsAlNum(*term) || *term == '_' || *term == '<' || *term == '>' ||
 -	      *term == ':' || (*term == ',' || *term == ' ' ) && lvl > 0 ) {
-+	      *term == ':' || ((*term == ',' || *term == ' ' ) && lvl > 0 )) {
++	      *term == ':' || ((*term == ',' || *term == ' ' ) && lvl > 0) ) {
  		if(*term == '<') lvl++;
  		if(*term == '>') lvl--;
  		result.Cat(*term++);
-@@ -410,7 +410,7 @@ String CParser::ReadOneString(int delim, bool chkend) {
- 							if(!ReadHex(hex2, 4))
- 								ThrowError("Incomplete universal character");
- 							if(hex2 >= 0xDC00 && hex2 <= 0xDFFF) {
--								result.Cat(ToUtf8(((hex & 0x3ff) << 10) | (hex2 & 0x3ff) + 0x10000));
-+								result.Cat(ToUtf8((((hex & 0x3ff) << 10) | (hex2 & 0x3ff)) + 0x10000));
- 								break;
- 							}
- 						}
 @@ -683,7 +683,7 @@ String AsCString(const char *s, const char *lim, int linemax, const char *linepf
  				continue; // skip s++
  			}
@@ -682,21 +673,22 @@
  					r = &m;
 
 ---------------------------- uppsrc/CtrlCore/Gtk.h ----------------------------
-index 281464c20..08ed036be 100644
-@@ -9,8 +9,16 @@
+index 281464c20..f830f391a 100644
+@@ -9,8 +9,15 @@
  #pragma clang diagnostic ignored "-Wdeprecated"
  #endif
  
+-#include <gtk/gtk.h>
+-#include <gdk/gdkkeysyms.h>
 +#ifdef __GNUC__
 +#pragma GCC diagnostic push 
 +#pragma GCC diagnostic ignored "-Wparentheses"
 +#endif
- #include <gtk/gtk.h>
- #include <gdk/gdkkeysyms.h>
++ #include <gtk/gtk.h>
++ #include <gdk/gdkkeysyms.h>
 +#ifdef __GNUC__
 +#pragma GCC diagnostic pop
 +#endif
-+
  
  #ifdef __clang__
  #pragma clang diagnostic pop
@@ -767,7 +759,7 @@
  		SkipGroup();
 
 ------------------------- uppsrc/CtrlLib/ArrayCtrl.cpp -------------------------
-index b58f6a742..bc049e412 100644
+index b58f6a742..a0e8ef085 100644
 @@ -856,7 +856,7 @@ const Display& ArrayCtrl::GetCellInfo(int i, int j, bool f0,
  		bg = array[i].paper;
  	fg = i & 1 ? evenink : oddink;
@@ -782,7 +774,7 @@
  	if(!IsNull(i))
  		while(i < GetCount()) {
 -			if((!sample || i == cursor || i < array.GetCount() && array[i].select) && IsLineVisible(i)) {
-+			if((!sample || i == cursor || ((i < array.GetCount() && array[i].select) && IsLineVisible(i)))) {
++			if((!sample || i == cursor || (i < array.GetCount() && array[i].select)) && IsLineVisible(i)) {
  				r.top = sample ? sy : GetLineY(i) - sb;
  				if(r.top > size.cy)
  					break;
@@ -1203,13 +1195,13 @@
  			else
 
 ----------------------------- uppsrc/Draw/Font.cpp -----------------------------
-index 19d91f89d..8cad5d592 100644
+index 19d91f89d..eda6ad3bf 100644
 @@ -90,7 +90,7 @@ void Font::SetFace(int index, const String& name)
  
  int FontFilter(int c)
  {
 -	return c >= 'a' && c <= 'z' || c >= '0' && c <= '9' ? c : c >= 'A' && c <= 'Z' ? ToLower(c) : 0;
-+	return (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9' ? c : c >= 'A' && c <= 'Z' ? ToLower(c) : 0);
++	return (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') ? c : c >= 'A' && c <= 'Z' ? ToLower(c) : 0;
  }
  
  int  Font::FindFaceNameIndex(const String& name) {
@@ -1255,18 +1247,6 @@
  				Pointf v = l.p - pos;
  				Translate(q / l.len * v + pos);
  				Rotate(Bearing(v));
-
----------------------- uppsrc/Painter/RadialGradient.cpp ----------------------
-index 9a9ed8f1d..5794afa82 100644
-@@ -46,7 +46,7 @@ struct PainterRadialSpan : SpanSource {
- 				h = h & 2047;
- 			else
- 			if(style == GRADIENT_REFLECT)
--				h = (h & 2048) ? (2047 - h & 2047) : (h & 2047);
-+				h = (h & 2048) ? (2047 - (h & 2047)) : (h & 2047);
- 			else
- 				h = minmax(h, 0, 2047);
- 			*span++ = gradient[h];
 
 -------------------------- uppsrc/Painter/Render.cpp --------------------------
 index 7205edf9d..8e0872655 100644
@@ -1732,18 +1712,6 @@
  							String key = nest + '\1' + m.qitem;
  							int q = nest_pass.Find(nest);
  							int p = pass;
-
--------------------------- uppsrc/ide/OutputMode.cpp --------------------------
-index 11c1a3a16..97c9ba0b6 100644
-@@ -179,7 +179,7 @@ void OutMode::Save()
- void OutMode::Export(int kind)
- {
- 	String ep = ~export_dir;
--	if(IsNull(ep)) {
-+		if(IsNull(ep)) {
- 		Exclamation("Missing output directory!");
- 		return;
- 	}
 
 --------------------------- uppsrc/ide/RepoSync.cpp ---------------------------
 index b285e4299..d878e9a83 100644
@@ -1776,13 +1744,13 @@
  			Color  color;
 
 ----------------------------- uppsrc/ide/Swaps.cpp -----------------------------
-index d61002bcd..a94b3f983 100644
+index d61002bcd..d54cdbba0 100644
 @@ -33,7 +33,7 @@ bool Ide::SwapSIf(const char *cref)
  	if(q < 0)
  		return false;
  	const Array<CppItem>& nn = CodeBase()[q];
 -	if(cref && MakeCodeRef(p.current_scope, p.current_key) != cref || IsNull(p.current_name))
-+	if(cref && (MakeCodeRef(p.current_scope, p.current_key) != cref || IsNull(p.current_name)))
++	if((cref && MakeCodeRef(p.current_scope, p.current_key) != cref) || IsNull(p.current_name))
  		return false;
  	Vector<const CppItem *> n;
  	bool destructor = p.current_key.Find('~') >= 0;
@@ -1816,15 +1784,17 @@
  					original = "1";
 
 ---------------------------- uppsrc/ide/idefile.cpp ----------------------------
-index 70fe94c55..d79c71294 100644
-@@ -477,8 +477,8 @@ void Ide::EditFile0(const String& path, byte charset, int spellcheck_comments, c
+index 70fe94c55..e5cc0c76e 100644
+@@ -475,10 +475,10 @@ void Ide::EditFile0(const String& path, byte charset, int spellcheck_comments, c
+ 	}
+ 
  	if(!designer && editastext.Find(path) < 0 &&
- 	   (findarg(GetFileExt(path), ".log") < 0 &&
+-	   (findarg(GetFileExt(path), ".log") < 0 &&
++	   ((findarg(GetFileExt(path), ".log") < 0 &&
  	    findarg(charset, CHARSET_UTF8_BOM, CHARSET_UTF16_LE, CHARSET_UTF16_BE,
--	            CHARSET_UTF16_LE_BOM, CHARSET_UTF16_BE_BOM) < 0 &&
+ 	            CHARSET_UTF16_LE_BOM, CHARSET_UTF16_BE_BOM) < 0 &&
 -	    FileIsBinary(path) || editashex.Find(path) >= 0))
-+	            CHARSET_UTF16_LE_BOM, ((CHARSET_UTF16_BE_BOM) < 0 &&
-+	    FileIsBinary(path)) || (editashex.Find(path) >= 0))))
++	    FileIsBinary(path)) || editashex.Find(path) >= 0))
  		designer.Create<FileHexView>().Open(path);
  	
  	ManageDisplayVisibility();
@@ -1833,7 +1803,7 @@
  			#endif
  				const int view_limit = 256*1024*1024;
 -				if(view_file.GetSize() < view_limit || editastext.Find(editfile) >= 0 && view_file.GetSize() < max_size) {
-+				if((view_file.GetSize() < view_limit) || (editastext.Find(editfile) >= 0 && view_file.GetSize() < max_size)) {
++				if(view_file.GetSize() < view_limit || (editastext.Find(editfile) >= 0 && view_file.GetSize() < max_size)) {
  					le = editor.Load(view_file, charset);
  					view_file.Close();
  				}
<!-- gh-comment-id:756273858 --> @mingodad commented on GitHub (Jan 7, 2021): And here is a diff between the first and the second chages: ``` --- <unnamed> +++ <unnamed> @@ -312,7 +312,7 @@ #ifndef ENDZIP ----------------------------- uppsrc/Core/Parser.h ----------------------------- -index 084697e5d..38bac6a03 100644 +index 084697e5d..5fe172297 100644 @@ -1,9 +1,9 @@ inline bool iscib(int c) { - return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '_' || c == '$'; @@ -321,7 +321,7 @@ inline bool iscid(int c) { - return iscib(c) || c >= '0' && c <= '9'; -+ return iscib(c) || ((c >= '0') && (c <= '9')); ++ return iscib(c) || (c >= '0' && c <= '9'); } class CParser { @@ -495,25 +495,16 @@ } ---------------------------- uppsrc/Core/parser.cpp ---------------------------- -index 89fa1353d..66afba18f 100644 +index 89fa1353d..91c74f5a5 100644 @@ -190,7 +190,7 @@ String CParser::ReadIdt() { StringBuffer result; int lvl = 0; while(IsAlNum(*term) || *term == '_' || *term == '<' || *term == '>' || - *term == ':' || (*term == ',' || *term == ' ' ) && lvl > 0 ) { -+ *term == ':' || ((*term == ',' || *term == ' ' ) && lvl > 0 )) { ++ *term == ':' || ((*term == ',' || *term == ' ' ) && lvl > 0) ) { if(*term == '<') lvl++; if(*term == '>') lvl--; result.Cat(*term++); -@@ -410,7 +410,7 @@ String CParser::ReadOneString(int delim, bool chkend) { - if(!ReadHex(hex2, 4)) - ThrowError("Incomplete universal character"); - if(hex2 >= 0xDC00 && hex2 <= 0xDFFF) { -- result.Cat(ToUtf8(((hex & 0x3ff) << 10) | (hex2 & 0x3ff) + 0x10000)); -+ result.Cat(ToUtf8((((hex & 0x3ff) << 10) | (hex2 & 0x3ff)) + 0x10000)); - break; - } - } @@ -683,7 +683,7 @@ String AsCString(const char *s, const char *lim, int linemax, const char *linepf continue; // skip s++ } @@ -682,21 +673,22 @@ r = &m; ---------------------------- uppsrc/CtrlCore/Gtk.h ---------------------------- -index 281464c20..08ed036be 100644 -@@ -9,8 +9,16 @@ +index 281464c20..f830f391a 100644 +@@ -9,8 +9,15 @@ #pragma clang diagnostic ignored "-Wdeprecated" #endif +-#include <gtk/gtk.h> +-#include <gdk/gdkkeysyms.h> +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wparentheses" +#endif - #include <gtk/gtk.h> - #include <gdk/gdkkeysyms.h> ++ #include <gtk/gtk.h> ++ #include <gdk/gdkkeysyms.h> +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif -+ #ifdef __clang__ #pragma clang diagnostic pop @@ -767,7 +759,7 @@ SkipGroup(); ------------------------- uppsrc/CtrlLib/ArrayCtrl.cpp ------------------------- -index b58f6a742..bc049e412 100644 +index b58f6a742..a0e8ef085 100644 @@ -856,7 +856,7 @@ const Display& ArrayCtrl::GetCellInfo(int i, int j, bool f0, bg = array[i].paper; fg = i & 1 ? evenink : oddink; @@ -782,7 +774,7 @@ if(!IsNull(i)) while(i < GetCount()) { - if((!sample || i == cursor || i < array.GetCount() && array[i].select) && IsLineVisible(i)) { -+ if((!sample || i == cursor || ((i < array.GetCount() && array[i].select) && IsLineVisible(i)))) { ++ if((!sample || i == cursor || (i < array.GetCount() && array[i].select)) && IsLineVisible(i)) { r.top = sample ? sy : GetLineY(i) - sb; if(r.top > size.cy) break; @@ -1203,13 +1195,13 @@ else ----------------------------- uppsrc/Draw/Font.cpp ----------------------------- -index 19d91f89d..8cad5d592 100644 +index 19d91f89d..eda6ad3bf 100644 @@ -90,7 +90,7 @@ void Font::SetFace(int index, const String& name) int FontFilter(int c) { - return c >= 'a' && c <= 'z' || c >= '0' && c <= '9' ? c : c >= 'A' && c <= 'Z' ? ToLower(c) : 0; -+ return (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9' ? c : c >= 'A' && c <= 'Z' ? ToLower(c) : 0); ++ return (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') ? c : c >= 'A' && c <= 'Z' ? ToLower(c) : 0; } int Font::FindFaceNameIndex(const String& name) { @@ -1255,18 +1247,6 @@ Pointf v = l.p - pos; Translate(q / l.len * v + pos); Rotate(Bearing(v)); - ----------------------- uppsrc/Painter/RadialGradient.cpp ---------------------- -index 9a9ed8f1d..5794afa82 100644 -@@ -46,7 +46,7 @@ struct PainterRadialSpan : SpanSource { - h = h & 2047; - else - if(style == GRADIENT_REFLECT) -- h = (h & 2048) ? (2047 - h & 2047) : (h & 2047); -+ h = (h & 2048) ? (2047 - (h & 2047)) : (h & 2047); - else - h = minmax(h, 0, 2047); - *span++ = gradient[h]; -------------------------- uppsrc/Painter/Render.cpp -------------------------- index 7205edf9d..8e0872655 100644 @@ -1732,18 +1712,6 @@ String key = nest + '\1' + m.qitem; int q = nest_pass.Find(nest); int p = pass; - --------------------------- uppsrc/ide/OutputMode.cpp -------------------------- -index 11c1a3a16..97c9ba0b6 100644 -@@ -179,7 +179,7 @@ void OutMode::Save() - void OutMode::Export(int kind) - { - String ep = ~export_dir; -- if(IsNull(ep)) { -+ if(IsNull(ep)) { - Exclamation("Missing output directory!"); - return; - } --------------------------- uppsrc/ide/RepoSync.cpp --------------------------- index b285e4299..d878e9a83 100644 @@ -1776,13 +1744,13 @@ Color color; ----------------------------- uppsrc/ide/Swaps.cpp ----------------------------- -index d61002bcd..a94b3f983 100644 +index d61002bcd..d54cdbba0 100644 @@ -33,7 +33,7 @@ bool Ide::SwapSIf(const char *cref) if(q < 0) return false; const Array<CppItem>& nn = CodeBase()[q]; - if(cref && MakeCodeRef(p.current_scope, p.current_key) != cref || IsNull(p.current_name)) -+ if(cref && (MakeCodeRef(p.current_scope, p.current_key) != cref || IsNull(p.current_name))) ++ if((cref && MakeCodeRef(p.current_scope, p.current_key) != cref) || IsNull(p.current_name)) return false; Vector<const CppItem *> n; bool destructor = p.current_key.Find('~') >= 0; @@ -1816,15 +1784,17 @@ original = "1"; ---------------------------- uppsrc/ide/idefile.cpp ---------------------------- -index 70fe94c55..d79c71294 100644 -@@ -477,8 +477,8 @@ void Ide::EditFile0(const String& path, byte charset, int spellcheck_comments, c +index 70fe94c55..e5cc0c76e 100644 +@@ -475,10 +475,10 @@ void Ide::EditFile0(const String& path, byte charset, int spellcheck_comments, c + } + if(!designer && editastext.Find(path) < 0 && - (findarg(GetFileExt(path), ".log") < 0 && +- (findarg(GetFileExt(path), ".log") < 0 && ++ ((findarg(GetFileExt(path), ".log") < 0 && findarg(charset, CHARSET_UTF8_BOM, CHARSET_UTF16_LE, CHARSET_UTF16_BE, -- CHARSET_UTF16_LE_BOM, CHARSET_UTF16_BE_BOM) < 0 && + CHARSET_UTF16_LE_BOM, CHARSET_UTF16_BE_BOM) < 0 && - FileIsBinary(path) || editashex.Find(path) >= 0)) -+ CHARSET_UTF16_LE_BOM, ((CHARSET_UTF16_BE_BOM) < 0 && -+ FileIsBinary(path)) || (editashex.Find(path) >= 0)))) ++ FileIsBinary(path)) || editashex.Find(path) >= 0)) designer.Create<FileHexView>().Open(path); ManageDisplayVisibility(); @@ -1833,7 +1803,7 @@ #endif const int view_limit = 256*1024*1024; - if(view_file.GetSize() < view_limit || editastext.Find(editfile) >= 0 && view_file.GetSize() < max_size) { -+ if((view_file.GetSize() < view_limit) || (editastext.Find(editfile) >= 0 && view_file.GetSize() < max_size)) { ++ if(view_file.GetSize() < view_limit || (editastext.Find(editfile) >= 0 && view_file.GetSize() < max_size)) { le = editor.Load(view_file, charset); view_file.Close(); } ```
Author
Owner

@mingodad commented on GitHub (Jan 7, 2021):

@mingodad The reason why it is still there is that Mirek doesn't' like it, so we always use "-Wno-logical-op-parentheses" in context of clang (because there was a time that it was enable by default, they hopefully changed that in the current releases). Anyway, please do not post patches with that fixes. We could accept other fixes related to -Wall, but not this particular one.

When you exporting makefile I highly suggest to use "Wno-logical-op-parentheses", so you should be free from this warnings.

As you could see doing so we end up with silly bugs that the compiler could point to us.

With this second attempt there is no warnings with clang and a few ones with g++ (related to signed/uunsigned and few operations with bitwise).

I hope the decision pointed out by Mirek get reconsidered !

<!-- gh-comment-id:756276763 --> @mingodad commented on GitHub (Jan 7, 2021): > @mingodad The reason why it is still there is that Mirek doesn't' like it, so we always use "-Wno-logical-op-parentheses" in context of clang (because there was a time that it was enable by default, they hopefully changed that in the current releases). Anyway, please do not post patches with that fixes. We could accept other fixes related to -Wall, but not this particular one. > > When you exporting makefile I highly suggest to use "Wno-logical-op-parentheses", so you should be free from this warnings. As you could see doing so we end up with silly bugs that the compiler could point to us. With this second attempt there is no warnings with clang and a few ones with g++ (related to signed/uunsigned and few operations with bitwise). **I hope the decision pointed out by Mirek get reconsidered !**
Author
Owner

@mingodad commented on GitHub (Jan 7, 2021):

Also for readability and maintainability as put in the title it'll make life easier for future generations (of new developers and ourselves).

And my first attempt is a testimony of it, I've got several of my interpretation of the warnings wrong, the second time following the good warning messages of clang11 I'm more confident that the second attempt is a lot more correct (what doesn't endorse that all of then are correct based on the intention of the original writer (that probably got confused in several of then)).

<!-- gh-comment-id:756284057 --> @mingodad commented on GitHub (Jan 7, 2021): Also for readability and maintainability as put in the title `it'll make life easier for future generations` (of new developers and ourselves). And my first attempt is a testimony of it, I've got several of my interpretation of the warnings wrong, the second time following the good warning messages of clang11 I'm more confident that the second attempt is a lot more correct (what doesn't endorse that all of then are correct based on the intention of the original writer (that probably got confused in several of then)).
Author
Owner

@klugier commented on GitHub (Jan 7, 2021):

I do not thing it happened - please notice that potential fix might cause regression and it is very likely to happen. There are dozens of places that will need to change. How, to test them all? We have automation, but it is not enough. We will need army of Quality Engineers to complete the whole process. So, I do not see any benefits of doing it right now. It will cause more problems, that it will gain.

You can always silence it by ""Wno-logical-op-parentheses". Anyway you can still enable it for your code by passing "-Wall" per package or enabling it globaly and passing "Wlogical-op-parentheses".

I am closing this thread - you could post the diff for others "-Wall" warning, but the parenthesis will stay like it is right now. I will write to Mirek about it, so if he deiced that want's to do something with it he will reopen.

Of course, if you do not agree, you could always create fork free of this issue :)

<!-- gh-comment-id:756286582 --> @klugier commented on GitHub (Jan 7, 2021): I do not thing it happened - please notice that potential fix might cause regression and it is very likely to happen. There are dozens of places that will need to change. How, to test them all? We have automation, but it is not enough. We will need army of Quality Engineers to complete the whole process. So, I do not see any benefits of doing it right now. It will cause more problems, that it will gain. You can always silence it by ""Wno-logical-op-parentheses". Anyway you can still enable it for your code by passing "-Wall" per package or enabling it globaly and passing "Wlogical-op-parentheses". I am closing this thread - you could post the diff for others "-Wall" warning, but the parenthesis will stay like it is right now. I will write to Mirek about it, so if he deiced that want's to do something with it he will reopen. Of course, if you do not agree, you could always create fork free of this issue :)
Author
Owner

@mingodad commented on GitHub (Jan 7, 2021):

There is ways to gain new contributors and ways to gain/retain technical debt !

<!-- gh-comment-id:756308490 --> @mingodad commented on GitHub (Jan 7, 2021): There is ways to gain new contributors and ways to gain/retain technical debt !
Author
Owner

@klugier commented on GitHub (Jan 7, 2021):

I totally agree that fixing all warnings under (-Wall flag or equivalent in other compilers) is the good practice and professional projects should follow them. This is also one of the most important security practice https://wiki.sei.cmu.edu/confluence/display/seccode/Top+10+Secure+Coding+Practices. Also, -Wall is not sufficient to detect all issues in given code. Previously I used tools such as flawfinder for finding security and believe me upp has a lot of warnings. The main problem here is that upp is the leader base project - it means that the key decision are made by single person - Mirek. And, if he has strong opinion about something then it will be very hard to change it on the main/master branch. On the other hand upp is open source, so if you do not agree you can create fork and make any changes you want. However, this will cost you - you will need to spend additional time on back-propagating issues, conflict resolution etc. The effort is not worth it. So, during the years in this project I learned that some things are unchangeable like this warning with parenthesis. I had several discussion with Mirek about this and to this day nothing changed. So, I live with it. I have nice easy to use GUI framework. Much easier and in many places better than these available on the market, which I can fork any time I want...

Anyway, I like that you raised so many issues. Most of them are valuable and should be fixed. I hope we will manage to fix other warnings too. So, if you post the fix to other warnings I would be grateful.

Thanks for the valuable discussion and yes I am the enemy of the tech debt. It ruined not one project.

<!-- gh-comment-id:756439441 --> @klugier commented on GitHub (Jan 7, 2021): I totally agree that fixing all warnings under (-Wall flag or equivalent in other compilers) is the good practice and professional projects should follow them. This is also one of the most important security practice https://wiki.sei.cmu.edu/confluence/display/seccode/Top+10+Secure+Coding+Practices. Also, -Wall is not sufficient to detect all issues in given code. Previously I used tools such as flawfinder for finding security and believe me upp has a lot of warnings. The main problem here is that upp is the leader base project - it means that the key decision are made by single person - Mirek. And, if he has strong opinion about something then it will be very hard to change it on the main/master branch. On the other hand upp is open source, so if you do not agree you can create fork and make any changes you want. However, this will cost you - you will need to spend additional time on back-propagating issues, conflict resolution etc. The effort is not worth it. So, during the years in this project I learned that some things are unchangeable like this warning with parenthesis. I had several discussion with Mirek about this and to this day nothing changed. So, I live with it. I have nice easy to use GUI framework. Much easier and in many places better than these available on the market, which I can fork any time I want... Anyway, I like that you raised so many issues. Most of them are valuable and should be fixed. I hope we will manage to fix other warnings too. So, if you post the fix to other warnings I would be grateful. Thanks for the valuable discussion and yes I am the enemy of the tech debt. It ruined not one project.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/ultimatepp#18
No description provided.