diff options
author | Eric W. Brown <[email protected]> | 2014-08-01 17:51:22 -0400 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-03-17 12:09:04 +0100 |
commit | 68f0e6a22767ee9342c91025b179551c9196b871 (patch) | |
tree | cee655e354a72a4fcab38f85c04165ae303499ab | |
parent | ee308a668e09db08906831f36bcddfbdf2814b23 (diff) |
Suffixed constants to enable clean builds in architectures with differently sized longs (like 32 bit Intel Macs).
-rw-r--r-- | LibOVR/Src/OVR_Sensor2Impl.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/LibOVR/Src/OVR_Sensor2Impl.cpp b/LibOVR/Src/OVR_Sensor2Impl.cpp index 95d486c..f397f22 100644 --- a/LibOVR/Src/OVR_Sensor2Impl.cpp +++ b/LibOVR/Src/OVR_Sensor2Impl.cpp @@ -975,21 +975,21 @@ void UpdateDK2Timestamps(SensorTimeFilter& tf, if (rawValues[i] < lowMks) { LogText("Timestamp %d rollover, was: %u, now: %u\n", i, lowMks, rawValues[i]); - timestamps[i]->TimestampMks += 0x100000000; + timestamps[i]->TimestampMks += 0x100000000LL; } // Update the low bits - timestamps[i]->TimestampMks = (timestamps[i]->TimestampMks & 0xFFFFFFFF00000000) | rawValues[i]; + timestamps[i]->TimestampMks = (timestamps[i]->TimestampMks & 0xFFFFFFFF00000000LL) | rawValues[i]; } else { // Take the high bits from the main timestamp first (not a typo in the first argument!) timestamps[i]->TimestampMks = - (timestamps[0]->TimestampMks & 0xFFFFFFFF00000000) | rawValues[i]; + (timestamps[0]->TimestampMks & 0xFFFFFFFF00000000LL) | rawValues[i]; // Now force it into the reasonable range around the expanded main timestamp if (timestamps[i]->TimestampMks > timestamps[0]->TimestampMks + 0x1000000) - timestamps[i]->TimestampMks -= 0x100000000; - else if (timestamps[i]->TimestampMks + 0x100000000 < timestamps[0]->TimestampMks + 0x1000000) - timestamps[i]->TimestampMks += 0x100000000; + timestamps[i]->TimestampMks -= 0x100000000LL; + else if (timestamps[i]->TimestampMks + 0x100000000LL < timestamps[0]->TimestampMks + 0x1000000LL) + timestamps[i]->TimestampMks += 0x100000000LL; } updateIndices[updateCount] = i; |