pixelmatix / aurora

Aurora runs on SmartMatrix, a beautiful music visualizer, dynamic art display, video game art display.
http://kck.st/1RUlTfb
Other
161 stars 44 forks source link

2 compiler warnings that are likely bugs #41

Open marcmerlin opened 5 years ago

marcmerlin commented 5 years ago

Also in https://github.com/marcmerlin/FastLED_NeoMatrix_SmartMatrix_LEDMatrix_GFX_Demos/commit/2723660c176b089e41e09a051ee7689b7413de80 The first one seems like an obvious bug. Second one, seems like a likely bug, but it's not fully clear. @jasoncoon can you have a quick look?

--- a/GFX/Aurora/Effects.h
+++ b/GFX/Aurora/Effects.h
@@ -701,7 +701,7 @@ public:
   }

   CRGB ColorFromCurrentPalette(uint8_t index = 0, uint8_t brightness = 255, TBlendType blendType = LINEARBLEND) {
-    return ColorFromPalette(currentPalette, index, brightness, currentBlendType);
+    return ColorFromPalette(currentPalette, index, brightness, blendType);
   }

   CRGB HsvToRgb(uint8_t h, uint8_t s, uint8_t v) {
diff --git a/GFX/Aurora/Vector.h b/GFX/Aurora/Vector.h
index 8acbadc..0911313 100644
--- a/GFX/Aurora/Vector.h
+++ b/GFX/Aurora/Vector.h
@@ -45,8 +45,10 @@ public:
     bool operator==(Vector2& v) {
         return x == v.x && y == v.y;
     }
-
     bool operator!=(Vector2& v) {
+       // squelch compiler warning for likely buggy code below
+       v.x = v.x;
+       // this looks buggy
         return !(x == y);
     }