Skip to content

Commit

Permalink
Add int casts in generated code to placate clang/gcc.
Browse files Browse the repository at this point in the history
  • Loading branch information
kring committed Nov 17, 2024
1 parent ecf002b commit 1f09276
Show file tree
Hide file tree
Showing 94 changed files with 555 additions and 495 deletions.
8 changes: 4 additions & 4 deletions Cesium3DTiles/generated/include/Cesium3DTiles/Asset.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ struct CESIUM3DTILES_API Asset final : public CesiumUtility::ExtensibleObject {
*/
int64_t getSizeBytes() const {
int64_t accum = 0;
accum += sizeof(Asset);
accum += int64_t(sizeof(Asset));
accum += CesiumUtility::ExtensibleObject::getSizeBytes() -
sizeof(CesiumUtility::ExtensibleObject);
accum += this->version.capacity() * sizeof(char);
int64_t(sizeof(CesiumUtility::ExtensibleObject));
accum += int64_t(this->version.capacity() * sizeof(char));
if (this->tilesetVersion) {
accum += this->tilesetVersion->capacity() * sizeof(char);
accum += int64_t(this->tilesetVersion->capacity() * sizeof(char));
}
return accum;
}
Expand Down
4 changes: 2 additions & 2 deletions Cesium3DTiles/generated/include/Cesium3DTiles/Availability.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ struct CESIUM3DTILES_API Availability final
*/
int64_t getSizeBytes() const {
int64_t accum = 0;
accum += sizeof(Availability);
accum += int64_t(sizeof(Availability));
accum += CesiumUtility::ExtensibleObject::getSizeBytes() -
sizeof(CesiumUtility::ExtensibleObject);
int64_t(sizeof(CesiumUtility::ExtensibleObject));

return accum;
}
Expand Down
10 changes: 5 additions & 5 deletions Cesium3DTiles/generated/include/Cesium3DTiles/BoundingVolume.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ struct CESIUM3DTILES_API BoundingVolume final
*/
int64_t getSizeBytes() const {
int64_t accum = 0;
accum += sizeof(BoundingVolume);
accum += int64_t(sizeof(BoundingVolume));
accum += CesiumUtility::ExtensibleObject::getSizeBytes() -
sizeof(CesiumUtility::ExtensibleObject);
accum += sizeof(double) * this->box.capacity();
accum += sizeof(double) * this->region.capacity();
accum += sizeof(double) * this->sphere.capacity();
int64_t(sizeof(CesiumUtility::ExtensibleObject));
accum += int64_t(sizeof(double) * this->box.capacity());
accum += int64_t(sizeof(double) * this->region.capacity());
accum += int64_t(sizeof(double) * this->sphere.capacity());
return accum;
}
};
Expand Down
8 changes: 4 additions & 4 deletions Cesium3DTiles/generated/include/Cesium3DTiles/BufferSpec.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ struct CESIUM3DTILES_API BufferSpec : public CesiumUtility::ExtensibleObject {
*/
int64_t getSizeBytes() const {
int64_t accum = 0;
accum += sizeof(BufferSpec);
accum += int64_t(sizeof(BufferSpec));
accum += CesiumUtility::ExtensibleObject::getSizeBytes() -
sizeof(CesiumUtility::ExtensibleObject);
int64_t(sizeof(CesiumUtility::ExtensibleObject));
if (this->uri) {
accum += this->uri->capacity() * sizeof(char);
accum += int64_t(this->uri->capacity() * sizeof(char));
}
if (this->name) {
accum += this->name->capacity() * sizeof(char);
accum += int64_t(this->name->capacity() * sizeof(char));
}
return accum;
}
Expand Down
6 changes: 3 additions & 3 deletions Cesium3DTiles/generated/include/Cesium3DTiles/BufferView.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ struct CESIUM3DTILES_API BufferView final
*/
int64_t getSizeBytes() const {
int64_t accum = 0;
accum += sizeof(BufferView);
accum += int64_t(sizeof(BufferView));
accum += CesiumUtility::ExtensibleObject::getSizeBytes() -
sizeof(CesiumUtility::ExtensibleObject);
int64_t(sizeof(CesiumUtility::ExtensibleObject));
if (this->name) {
accum += this->name->capacity() * sizeof(char);
accum += int64_t(this->name->capacity() * sizeof(char));
}
return accum;
}
Expand Down
17 changes: 9 additions & 8 deletions Cesium3DTiles/generated/include/Cesium3DTiles/Class.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,21 @@ struct CESIUM3DTILES_API Class final : public CesiumUtility::ExtensibleObject {
*/
int64_t getSizeBytes() const {
int64_t accum = 0;
accum += sizeof(Class);
accum += int64_t(sizeof(Class));
accum += CesiumUtility::ExtensibleObject::getSizeBytes() -
sizeof(CesiumUtility::ExtensibleObject);
int64_t(sizeof(CesiumUtility::ExtensibleObject));
if (this->name) {
accum += this->name->capacity() * sizeof(char);
accum += int64_t(this->name->capacity() * sizeof(char));
}
if (this->description) {
accum += this->description->capacity() * sizeof(char);
accum += int64_t(this->description->capacity() * sizeof(char));
}
accum += this->properties.bucket_count() *
(sizeof(std::string) + sizeof(Cesium3DTiles::ClassProperty));
accum += int64_t(
this->properties.bucket_count() *
(sizeof(std::string) + sizeof(Cesium3DTiles::ClassProperty)));
for (const auto& [k, v] : this->properties) {
accum += k.capacity() * sizeof(char) - sizeof(std::string);
accum += v.getSizeBytes() - sizeof(Cesium3DTiles::ClassProperty);
accum += int64_t(k.capacity() * sizeof(char) - sizeof(std::string));
accum += v.getSizeBytes() - int64_t(sizeof(Cesium3DTiles::ClassProperty));
}
return accum;
}
Expand Down
12 changes: 6 additions & 6 deletions Cesium3DTiles/generated/include/Cesium3DTiles/ClassProperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,20 +198,20 @@ struct CESIUM3DTILES_API ClassProperty final
*/
int64_t getSizeBytes() const {
int64_t accum = 0;
accum += sizeof(ClassProperty);
accum += int64_t(sizeof(ClassProperty));
accum += CesiumUtility::ExtensibleObject::getSizeBytes() -
sizeof(CesiumUtility::ExtensibleObject);
int64_t(sizeof(CesiumUtility::ExtensibleObject));
if (this->name) {
accum += this->name->capacity() * sizeof(char);
accum += int64_t(this->name->capacity() * sizeof(char));
}
if (this->description) {
accum += this->description->capacity() * sizeof(char);
accum += int64_t(this->description->capacity() * sizeof(char));
}
if (this->enumType) {
accum += this->enumType->capacity() * sizeof(char);
accum += int64_t(this->enumType->capacity() * sizeof(char));
}
if (this->semantic) {
accum += this->semantic->capacity() * sizeof(char);
accum += int64_t(this->semantic->capacity() * sizeof(char));
}
return accum;
}
Expand Down
14 changes: 8 additions & 6 deletions Cesium3DTiles/generated/include/Cesium3DTiles/ClassStatistics.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@ struct CESIUM3DTILES_API ClassStatistics final
*/
int64_t getSizeBytes() const {
int64_t accum = 0;
accum += sizeof(ClassStatistics);
accum += int64_t(sizeof(ClassStatistics));
accum += CesiumUtility::ExtensibleObject::getSizeBytes() -
sizeof(CesiumUtility::ExtensibleObject);
accum += this->properties.bucket_count() *
(sizeof(std::string) + sizeof(Cesium3DTiles::PropertyStatistics));
int64_t(sizeof(CesiumUtility::ExtensibleObject));
accum += int64_t(
this->properties.bucket_count() *
(sizeof(std::string) + sizeof(Cesium3DTiles::PropertyStatistics)));
for (const auto& [k, v] : this->properties) {
accum += k.capacity() * sizeof(char) - sizeof(std::string);
accum += v.getSizeBytes() - sizeof(Cesium3DTiles::PropertyStatistics);
accum += int64_t(k.capacity() * sizeof(char) - sizeof(std::string));
accum +=
v.getSizeBytes() - int64_t(sizeof(Cesium3DTiles::PropertyStatistics));
}
return accum;
}
Expand Down
10 changes: 5 additions & 5 deletions Cesium3DTiles/generated/include/Cesium3DTiles/Content.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ struct CESIUM3DTILES_API Content final
*/
int64_t getSizeBytes() const {
int64_t accum = 0;
accum += sizeof(Content);
accum += int64_t(sizeof(Content));
accum += CesiumUtility::ExtensibleObject::getSizeBytes() -
sizeof(CesiumUtility::ExtensibleObject);
int64_t(sizeof(CesiumUtility::ExtensibleObject));
if (this->boundingVolume) {
accum += this->boundingVolume->getSizeBytes() -
sizeof(Cesium3DTiles::BoundingVolume);
int64_t(sizeof(Cesium3DTiles::BoundingVolume));
}
accum += this->uri.capacity() * sizeof(char);
accum += int64_t(this->uri.capacity() * sizeof(char));
if (this->metadata) {
accum += this->metadata->getSizeBytes() -
sizeof(Cesium3DTiles::MetadataEntity);
int64_t(sizeof(Cesium3DTiles::MetadataEntity));
}
return accum;
}
Expand Down
13 changes: 7 additions & 6 deletions Cesium3DTiles/generated/include/Cesium3DTiles/Enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,19 @@ struct CESIUM3DTILES_API Enum final : public CesiumUtility::ExtensibleObject {
*/
int64_t getSizeBytes() const {
int64_t accum = 0;
accum += sizeof(Enum);
accum += int64_t(sizeof(Enum));
accum += CesiumUtility::ExtensibleObject::getSizeBytes() -
sizeof(CesiumUtility::ExtensibleObject);
int64_t(sizeof(CesiumUtility::ExtensibleObject));
if (this->name) {
accum += this->name->capacity() * sizeof(char);
accum += int64_t(this->name->capacity() * sizeof(char));
}
if (this->description) {
accum += this->description->capacity() * sizeof(char);
accum += int64_t(this->description->capacity() * sizeof(char));
}
accum += sizeof(Cesium3DTiles::EnumValue) * this->values.capacity();
accum +=
int64_t(sizeof(Cesium3DTiles::EnumValue) * this->values.capacity());
for (const Cesium3DTiles::EnumValue& value : this->values) {
accum += value.getSizeBytes() - sizeof(Cesium3DTiles::EnumValue);
accum += value.getSizeBytes() - int64_t(sizeof(Cesium3DTiles::EnumValue));
}
return accum;
}
Expand Down
8 changes: 4 additions & 4 deletions Cesium3DTiles/generated/include/Cesium3DTiles/EnumValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ struct CESIUM3DTILES_API EnumValue final
*/
int64_t getSizeBytes() const {
int64_t accum = 0;
accum += sizeof(EnumValue);
accum += int64_t(sizeof(EnumValue));
accum += CesiumUtility::ExtensibleObject::getSizeBytes() -
sizeof(CesiumUtility::ExtensibleObject);
accum += this->name.capacity() * sizeof(char);
int64_t(sizeof(CesiumUtility::ExtensibleObject));
accum += int64_t(this->name.capacity() * sizeof(char));
if (this->description) {
accum += this->description->capacity() * sizeof(char);
accum += int64_t(this->description->capacity() * sizeof(char));
}
return accum;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ struct CESIUM3DTILES_API Extension3dTilesBoundingVolumeS2 final
*/
int64_t getSizeBytes() const {
int64_t accum = 0;
accum += sizeof(Extension3dTilesBoundingVolumeS2);
accum += int64_t(sizeof(Extension3dTilesBoundingVolumeS2));
accum += CesiumUtility::ExtensibleObject::getSizeBytes() -
sizeof(CesiumUtility::ExtensibleObject);
accum += this->token.capacity() * sizeof(char);
int64_t(sizeof(CesiumUtility::ExtensibleObject));
accum += int64_t(this->token.capacity() * sizeof(char));
return accum;
}
};
Expand Down
4 changes: 2 additions & 2 deletions Cesium3DTiles/generated/include/Cesium3DTiles/GroupMetadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ struct CESIUM3DTILES_API GroupMetadata final : public MetadataEntity {
*/
int64_t getSizeBytes() const {
int64_t accum = 0;
accum += sizeof(GroupMetadata);
accum += MetadataEntity::getSizeBytes() - sizeof(MetadataEntity);
accum += int64_t(sizeof(GroupMetadata));
accum += MetadataEntity::getSizeBytes() - int64_t(sizeof(MetadataEntity));

return accum;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ struct CESIUM3DTILES_API ImplicitTiling final
*/
int64_t getSizeBytes() const {
int64_t accum = 0;
accum += sizeof(ImplicitTiling);
accum += int64_t(sizeof(ImplicitTiling));
accum += CesiumUtility::ExtensibleObject::getSizeBytes() -
sizeof(CesiumUtility::ExtensibleObject);
accum += this->subtrees.getSizeBytes() - sizeof(Cesium3DTiles::Subtrees);
int64_t(sizeof(CesiumUtility::ExtensibleObject));
accum += this->subtrees.getSizeBytes() -
int64_t(sizeof(Cesium3DTiles::Subtrees));
return accum;
}
};
Expand Down
15 changes: 8 additions & 7 deletions Cesium3DTiles/generated/include/Cesium3DTiles/MetadataEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,16 @@ struct CESIUM3DTILES_API MetadataEntity
*/
int64_t getSizeBytes() const {
int64_t accum = 0;
accum += sizeof(MetadataEntity);
accum += int64_t(sizeof(MetadataEntity));
accum += CesiumUtility::ExtensibleObject::getSizeBytes() -
sizeof(CesiumUtility::ExtensibleObject);
accum += this->classProperty.capacity() * sizeof(char);
accum += this->properties.bucket_count() *
(sizeof(std::string) + sizeof(CesiumUtility::JsonValue));
int64_t(sizeof(CesiumUtility::ExtensibleObject));
accum += int64_t(this->classProperty.capacity() * sizeof(char));
accum += int64_t(
this->properties.bucket_count() *
(sizeof(std::string) + sizeof(CesiumUtility::JsonValue)));
for (const auto& [k, v] : this->properties) {
accum += k.capacity() * sizeof(char) - sizeof(std::string);
accum += sizeof(CesiumUtility::JsonValue);
accum += int64_t(k.capacity() * sizeof(char) - sizeof(std::string));
accum += int64_t(sizeof(CesiumUtility::JsonValue));
}
return accum;
}
Expand Down
4 changes: 2 additions & 2 deletions Cesium3DTiles/generated/include/Cesium3DTiles/Properties.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ struct CESIUM3DTILES_API Properties final
*/
int64_t getSizeBytes() const {
int64_t accum = 0;
accum += sizeof(Properties);
accum += int64_t(sizeof(Properties));
accum += CesiumUtility::ExtensibleObject::getSizeBytes() -
sizeof(CesiumUtility::ExtensibleObject);
int64_t(sizeof(CesiumUtility::ExtensibleObject));

return accum;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,15 @@ struct CESIUM3DTILES_API PropertyStatistics final
*/
int64_t getSizeBytes() const {
int64_t accum = 0;
accum += sizeof(PropertyStatistics);
accum += int64_t(sizeof(PropertyStatistics));
accum += CesiumUtility::ExtensibleObject::getSizeBytes() -
sizeof(CesiumUtility::ExtensibleObject);
accum += this->occurrences.bucket_count() *
(sizeof(std::string) + sizeof(CesiumUtility::JsonValue));
int64_t(sizeof(CesiumUtility::ExtensibleObject));
accum += int64_t(
this->occurrences.bucket_count() *
(sizeof(std::string) + sizeof(CesiumUtility::JsonValue)));
for (const auto& [k, v] : this->occurrences) {
accum += k.capacity() * sizeof(char) - sizeof(std::string);
accum += sizeof(CesiumUtility::JsonValue);
accum += int64_t(k.capacity() * sizeof(char) - sizeof(std::string));
accum += int64_t(sizeof(CesiumUtility::JsonValue));
}
return accum;
}
Expand Down
17 changes: 9 additions & 8 deletions Cesium3DTiles/generated/include/Cesium3DTiles/PropertyTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,20 @@ struct CESIUM3DTILES_API PropertyTable final
*/
int64_t getSizeBytes() const {
int64_t accum = 0;
accum += sizeof(PropertyTable);
accum += int64_t(sizeof(PropertyTable));
accum += CesiumUtility::ExtensibleObject::getSizeBytes() -
sizeof(CesiumUtility::ExtensibleObject);
int64_t(sizeof(CesiumUtility::ExtensibleObject));
if (this->name) {
accum += this->name->capacity() * sizeof(char);
accum += int64_t(this->name->capacity() * sizeof(char));
}
accum += this->classProperty.capacity() * sizeof(char);
accum +=
accum += int64_t(this->classProperty.capacity() * sizeof(char));
accum += int64_t(
this->properties.bucket_count() *
(sizeof(std::string) + sizeof(Cesium3DTiles::PropertyTableProperty));
(sizeof(std::string) + sizeof(Cesium3DTiles::PropertyTableProperty)));
for (const auto& [k, v] : this->properties) {
accum += k.capacity() * sizeof(char) - sizeof(std::string);
accum += v.getSizeBytes() - sizeof(Cesium3DTiles::PropertyTableProperty);
accum += int64_t(k.capacity() * sizeof(char) - sizeof(std::string));
accum += v.getSizeBytes() -
int64_t(sizeof(Cesium3DTiles::PropertyTableProperty));
}
return accum;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ struct CESIUM3DTILES_API PropertyTableProperty final
*/
int64_t getSizeBytes() const {
int64_t accum = 0;
accum += sizeof(PropertyTableProperty);
accum += int64_t(sizeof(PropertyTableProperty));
accum += CesiumUtility::ExtensibleObject::getSizeBytes() -
sizeof(CesiumUtility::ExtensibleObject);
int64_t(sizeof(CesiumUtility::ExtensibleObject));

return accum;
}
Expand Down
Loading

0 comments on commit 1f09276

Please sign in to comment.