aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/mb12xx
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/mb12xx')
-rw-r--r--src/drivers/mb12xx/mb12xx.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/drivers/mb12xx/mb12xx.cpp b/src/drivers/mb12xx/mb12xx.cpp
index c5f49fb36..f83416993 100644
--- a/src/drivers/mb12xx/mb12xx.cpp
+++ b/src/drivers/mb12xx/mb12xx.cpp
@@ -184,7 +184,7 @@ private:
};
/* helper macro for handling report buffer indices */
-#define INCREMENT(_x, _lim) do { _x++; if (_x >= _lim) _x = 0; } while(0)
+#define INCREMENT(_x, _lim) do { __typeof__(_x) _tmp = _x+1; if (_tmp >= _lim) _tmp = 0; _x = _tmp; } while(0)
/*
* Driver 'main' command.