summaryrefslogtreecommitdiffstats
path: root/source/Globals.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/Globals.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/Globals.h b/source/Globals.h
index e536559dd..958c6d6ae 100644
--- a/source/Globals.h
+++ b/source/Globals.h
@@ -189,9 +189,10 @@ typedef unsigned short UInt16;
/// Allows arithmetic expressions like "32 KiB" (but consider using parenthesis around it, "(32 KiB)" )
#define KiB * 1024
+#define MiB * 1024 * 1024
/// Faster than (int)floorf((float)x / (float)div)
-#define FAST_FLOOR_DIV( x, div ) ( (x) < 0 ? (((int)x / div) - 1) : ((int)x / div) )
+#define FAST_FLOOR_DIV( x, div ) (((x) - (((x) < 0) ? ((div) - 1) : 0)) / (div))
// Own version of assert() that writes failed assertions to the log for review
#ifdef _DEBUG