From d8b30d42f579acfaa352402154111eb39160fea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 26 Sep 2018 16:35:32 +0200 Subject: Fix warnings for operator precedence disambiguation [-Wparentheses] Fixes the following GCC 5 warnings: ``` core/io/resource_format_binary.cpp:1721:29: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] core/typedefs.h:108:24: warning: suggest parentheses around comparison in operand of '!=' [-Wparentheses] editor/plugins/spatial_editor_plugin.cpp:2202:58: warning: suggest parentheses around comparison in operand of '!=' [-Wparentheses] editor/plugins/spatial_editor_plugin.cpp:5002:12: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] main/input_default.cpp:346:59: warning: suggest parentheses around '-' inside '<<' [-Wparentheses] main/input_default.cpp:348:60: warning: suggest parentheses around '-' inside '<<' [-Wparentheses] main/input_default.cpp:579:57: warning: suggest parentheses around '-' inside '<<' [-Wparentheses] modules/gridmap/grid_map_editor_plugin.cpp:613:14: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] modules/theora/video_stream_theora.cpp:335:34: warning: suggest parentheses around '+' in operand of '&' [-Wparentheses] modules/theora/video_stream_theora.cpp:336:35: warning: suggest parentheses around '+' in operand of '&' [-Wparentheses] modules/visual_script/visual_script_property_selector.cpp:215:38: warning: suggest parentheses around '&&' within '||' [-Wparentheses] scene/gui/rich_text_label.cpp:424:84: warning: suggest parentheses around '&&' within '||' [-Wparentheses] scene/gui/rich_text_label.cpp:512:80: warning: suggest parentheses around '&&' within '||' [-Wparentheses] scene/gui/scroll_container.cpp:173:36: warning: suggest parentheses around '&&' within '||' [-Wparentheses] scene/gui/scroll_container.cpp:173:86: warning: suggest parentheses around '&&' within '||' [-Wparentheses] scene/gui/tree.cpp:1419:98: warning: suggest parentheses around '&&' within '||' [-Wparentheses] ``` --- core/io/resource_format_binary.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/io') diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index 02c2c6ce1a..e5741014a4 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -1718,7 +1718,7 @@ void ResourceFormatSaverBinaryInstance::save_unicode_string(FileAccess *f, const CharString utf8 = p_string.utf8(); if (p_bit_on_len) { - f->store_32(utf8.length() + 1 | 0x80000000); + f->store_32((utf8.length() + 1) | 0x80000000); } else { f->store_32(utf8.length() + 1); } -- cgit v1.2.3