Change mj_encode return type to 64-bit (mjtSize)
This supports encoding files larger than 2GB. PiperOrigin-RevId: 939828697 Change-Id: If60d36c61475ced20b4eb58408ffb37e25bf3db7
This commit is contained in:
committed by
Copybara-Service
parent
1e04c568e8
commit
d83ef0b6b9
@@ -34,8 +34,8 @@ struct FakeEncoderOutput {
|
||||
char resource_name[512];
|
||||
};
|
||||
|
||||
int FakeEncode(const mjSpec* s, const mjModel* m, const mjVFS* vfs,
|
||||
mjResource* resource) {
|
||||
mjtSize FakeEncode(const mjSpec* s, const mjModel* m, const mjVFS* vfs,
|
||||
mjResource* resource) {
|
||||
auto* output = new FakeEncoderOutput;
|
||||
output->nbody = m->nbody;
|
||||
output->ngeom = m->ngeom;
|
||||
@@ -43,7 +43,7 @@ int FakeEncode(const mjSpec* s, const mjModel* m, const mjVFS* vfs,
|
||||
std::snprintf(output->resource_name, sizeof(output->resource_name), "%s",
|
||||
resource->name);
|
||||
resource->data = output;
|
||||
return sizeof(FakeEncoderOutput);
|
||||
return static_cast<mjtSize>(sizeof(FakeEncoderOutput));
|
||||
}
|
||||
|
||||
void CloseResource(mjResource* resource) {
|
||||
|
||||
Reference in New Issue
Block a user