From: Martin Taibr <taibr.martin@gmail.com>
Date: Tue, 15 Jan 2019 01:56:03 +0000 (+0100)
Subject: warn about bit ops
X-Git-Tag: xonotic-v0.8.5~1639^2
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fmerge-requests%2F630%2Fhead;p=xonotic%2Fxonotic-data.pk3dir.git

warn about bit ops
---

diff --git a/qcsrc/lib/bits.qh b/qcsrc/lib/bits.qh
index c158ea032d..de11eef412 100644
--- a/qcsrc/lib/bits.qh
+++ b/qcsrc/lib/bits.qh
@@ -2,6 +2,9 @@
 
 #include "log.qh"
 
+/// Only ever assign into the first 24 bits in QC (so max is BIT(23)).
+/// QC converts the float to int, performs the bit operation, then converts it back.
+/// Assigning to the highest bits means some of the low ones might get lost due to float precision.
 #define BIT(n) (1 << (n))
 #define BITS(n) (BIT(n) - 1)
 #ifndef BRANCHLESS_BITSET