Change mjtSize from uint64_t to int64_t.
This change makes `mjtSize` a signed, rather than unsigned 64-bit integer. While sizes are non-negative, the type promotion rules for unsigned integers can lead to unituitive downstream bugs, and 8 billion terabytes are enough bytes. PiperOrigin-RevId: 834292964 Change-Id: Iea9c47c2a5d80fde63851a543d59ed0549db0f01
This commit is contained in:
committed by
Copybara-Service
parent
49394d57d9
commit
86a77ff8eb
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
//---------------------------------- floating-point definition -------------------------------------
|
||||
|
||||
// floating point data type and minval
|
||||
@@ -30,15 +31,15 @@
|
||||
|
||||
|
||||
|
||||
//-------------------------------------- byte definition -------------------------------------------
|
||||
//---------------------------------- byte definition -----------------------------------------------
|
||||
|
||||
typedef unsigned char mjtByte; // used for true/false
|
||||
|
||||
|
||||
|
||||
//-------------------------------------- size definition -------------------------------------------
|
||||
//---------------------------------- size definition -----------------------------------------------
|
||||
|
||||
typedef uint64_t mjtSize; // used for buffer sizes
|
||||
typedef int64_t mjtSize; // used for buffer sizes
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user