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
@@ -100,7 +100,7 @@ Size type used to represent buffer sizes.
|
||||
|
||||
.. code-block:: C
|
||||
|
||||
typedef uint64_t mjtSize;
|
||||
typedef int64_t mjtSize;
|
||||
|
||||
|
||||
.. _tyEnums:
|
||||
|
||||
+5
-1
@@ -29,7 +29,11 @@ General
|
||||
- ``sidesite -> MjsSite|None``
|
||||
- ``coef -> real``
|
||||
- ``divisor -> real``
|
||||
- Non-breaking API change: :ref:`mj_sizeModel` now returns an :ref:`mjtSize` rather than an ``int``.
|
||||
|
||||
- Non-breaking ABI changes:
|
||||
|
||||
- :ref:`mjtSize` is now defined as ``int64_t`` rather than ``uint64_t`` to avoid future type-promotion bugs.
|
||||
- :ref:`mj_sizeModel` now returns an :ref:`mjtSize` rather than an ``int``.
|
||||
|
||||
MJX
|
||||
^^^
|
||||
|
||||
Reference in New Issue
Block a user