summaryrefslogtreecommitdiff
path: root/src/displayapp/screens
diff options
context:
space:
mode:
authorReinhold Gschweicher <pyro4hell@gmail.com>2022-03-13 22:03:29 +0100
committerReinhold Gschweicher <pyro4hell@gmail.com>2022-03-13 22:05:25 +0100
commit51716898aa00ea2d38dfe38d28a33b4ffbdf22ff (patch)
treed8189a2c54f2fce48bd86181b14973d01039cf65 /src/displayapp/screens
parent21da5869c5e48df666ea9d9c7698f7f69528645e (diff)
Twos: fix warning about extra paranthesis
We have a comparison like `if (( a == b ))`, which is a parenthesis too much, which generates the following warning ``` InfiniTime/src/displayapp/screens/Twos.cpp:133:35: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if ((grid[newRow][newCol].value == grid[oldRow][oldCol].value)) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ InfiniTime/src/displayapp/screens/Twos.cpp:133:35: note: remove extraneous parentheses around the comparison to silence this warning if ((grid[newRow][newCol].value == grid[oldRow][oldCol].value)) { ~ ^ ~ ```
Diffstat (limited to 'src/displayapp/screens')
-rw-r--r--src/displayapp/screens/Twos.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/displayapp/screens/Twos.cpp b/src/displayapp/screens/Twos.cpp
index b15332f1..6d675859 100644
--- a/src/displayapp/screens/Twos.cpp
+++ b/src/displayapp/screens/Twos.cpp
@@ -130,7 +130,7 @@ bool Twos::placeNewTile() {
}
bool Twos::tryMerge(TwosTile grid[][4], int& newRow, int& newCol, int oldRow, int oldCol) {
- if ((grid[newRow][newCol].value == grid[oldRow][oldCol].value)) {
+ if (grid[newRow][newCol].value == grid[oldRow][oldCol].value) {
if ((newCol != oldCol) || (newRow != oldRow)) {
if (!grid[newRow][newCol].merged) {
unsigned int newVal = grid[oldRow][oldCol].value *= 2;