From 3856537503845b7f22675090c9a198aed5f86a92 Mon Sep 17 00:00:00 2001 From: Joseph Birkner Date: Thu, 22 Feb 2024 07:57:33 +0100 Subject: [PATCH] Cast rapidjson errors to int for logging. --- Cesium3DTilesContent/src/B3dmToGltfConverter.cpp | 4 ++-- Cesium3DTilesContent/src/PntsToGltfConverter.cpp | 4 ++-- Cesium3DTilesContent/src/QuantizedMeshLoader.cpp | 2 +- Cesium3DTilesSelection/src/CesiumIonTilesetLoader.cpp | 4 ++-- Cesium3DTilesSelection/src/LayerJsonTerrainLoader.cpp | 4 ++-- Cesium3DTilesSelection/src/TilesetContentManager.cpp | 2 +- Cesium3DTilesSelection/src/TilesetJsonLoader.cpp | 4 ++-- CesiumRasterOverlays/src/BingMapsRasterOverlay.cpp | 2 +- CesiumRasterOverlays/src/IonRasterOverlay.cpp | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Cesium3DTilesContent/src/B3dmToGltfConverter.cpp b/Cesium3DTilesContent/src/B3dmToGltfConverter.cpp index ebc678883..6160193dc 100644 --- a/Cesium3DTilesContent/src/B3dmToGltfConverter.cpp +++ b/Cesium3DTilesContent/src/B3dmToGltfConverter.cpp @@ -153,7 +153,7 @@ rapidjson::Document parseFeatureTableJsonData( result.errors.emplaceError(fmt::format( "Error when parsing feature table JSON, error code {} at byte offset " "{}", - (int)document.GetParseError(), + static_cast(document.GetParseError()), document.GetErrorOffset())); return document; } @@ -213,7 +213,7 @@ void convertB3dmMetadataToGltfStructuralMetadata( "Error when parsing batch table JSON, error code {} at byte " "offset " "{}. Skip parsing metadata", - batchTableJson.GetParseError(), + static_cast(batchTableJson.GetParseError()), batchTableJson.GetErrorOffset())); return; } diff --git a/Cesium3DTilesContent/src/PntsToGltfConverter.cpp b/Cesium3DTilesContent/src/PntsToGltfConverter.cpp index 3b2e50868..8c28ae7a5 100644 --- a/Cesium3DTilesContent/src/PntsToGltfConverter.cpp +++ b/Cesium3DTilesContent/src/PntsToGltfConverter.cpp @@ -617,7 +617,7 @@ rapidjson::Document parseFeatureTableJson( parsedContent.errors.emplaceError(fmt::format( "Error when parsing feature table JSON, error code {} at byte offset " "{}", - document.GetParseError(), + static_cast(document.GetParseError()), document.GetErrorOffset())); return document; } @@ -783,7 +783,7 @@ rapidjson::Document parseBatchTableJson( "Error when parsing batch table JSON, error code {} at byte " "offset " "{}. Skip parsing metadata", - document.GetParseError(), + static_cast(document.GetParseError()), document.GetErrorOffset())); return document; } diff --git a/Cesium3DTilesContent/src/QuantizedMeshLoader.cpp b/Cesium3DTilesContent/src/QuantizedMeshLoader.cpp index b3c43a92c..e2c2b8800 100644 --- a/Cesium3DTilesContent/src/QuantizedMeshLoader.cpp +++ b/Cesium3DTilesContent/src/QuantizedMeshLoader.cpp @@ -1178,7 +1178,7 @@ static QuantizedMeshMetadataResult processMetadata( if (metadata.HasParseError()) { result.errors.emplaceError(fmt::format( "Error when parsing metadata, error code {} at byte offset {}", - metadata.GetParseError(), + static_cast(metadata.GetParseError()), metadata.GetErrorOffset())); return result; } diff --git a/Cesium3DTilesSelection/src/CesiumIonTilesetLoader.cpp b/Cesium3DTilesSelection/src/CesiumIonTilesetLoader.cpp index 5ea6e2bae..bdd3ca95d 100644 --- a/Cesium3DTilesSelection/src/CesiumIonTilesetLoader.cpp +++ b/Cesium3DTilesSelection/src/CesiumIonTilesetLoader.cpp @@ -58,7 +58,7 @@ std::optional getNewAccessToken( pLogger, "Error when parsing Cesium ion response, error code {} at byte offset " "{}", - ionResponse.GetParseError(), + static_cast(ionResponse.GetParseError()), ionResponse.GetErrorOffset()); return std::nullopt; } @@ -244,7 +244,7 @@ mainThreadHandleEndpointResponse( result.errors.emplaceError(fmt::format( "Error when parsing Cesium ion response JSON, error code {} at byte " "offset {}", - ionResponse.GetParseError(), + static_cast(ionResponse.GetParseError()), ionResponse.GetErrorOffset())); return externals.asyncSystem.createResolvedFuture(std::move(result)); } diff --git a/Cesium3DTilesSelection/src/LayerJsonTerrainLoader.cpp b/Cesium3DTilesSelection/src/LayerJsonTerrainLoader.cpp index cec84813b..0bd7557f8 100644 --- a/Cesium3DTilesSelection/src/LayerJsonTerrainLoader.cpp +++ b/Cesium3DTilesSelection/src/LayerJsonTerrainLoader.cpp @@ -386,7 +386,7 @@ Future loadLayersRecursive( loadLayersResult.errors.emplaceWarning(fmt::format( "Error when parsing layer.json, error code {} at byte " "offset {}", - layerJson.GetParseError(), + static_cast(layerJson.GetParseError()), layerJson.GetErrorOffset())); return asyncSystem.createResolvedFuture( std::move(loadLayersResult)); @@ -490,7 +490,7 @@ Future loadLayerJson( LoadLayersResult result; result.errors.emplaceError(fmt::format( "Error when parsing layer.json, error code {} at byte offset {}", - layerJson.GetParseError(), + static_cast(layerJson.GetParseError()), layerJson.GetErrorOffset())); return asyncSystem.createResolvedFuture(std::move(result)); } diff --git a/Cesium3DTilesSelection/src/TilesetContentManager.cpp b/Cesium3DTilesSelection/src/TilesetContentManager.cpp index b12a112cb..1a954c79a 100644 --- a/Cesium3DTilesSelection/src/TilesetContentManager.cpp +++ b/Cesium3DTilesSelection/src/TilesetContentManager.cpp @@ -689,7 +689,7 @@ TilesetContentManager::TilesetContentManager( result.errors.emplaceError(fmt::format( "Error when parsing tileset JSON, error code {} at byte " "offset {}", - tilesetJson.GetParseError(), + static_cast(tilesetJson.GetParseError()), tilesetJson.GetErrorOffset())); return asyncSystem.createResolvedFuture(std::move(result)); } diff --git a/Cesium3DTilesSelection/src/TilesetJsonLoader.cpp b/Cesium3DTilesSelection/src/TilesetJsonLoader.cpp index 70e0a028b..5bae8c4ab 100644 --- a/Cesium3DTilesSelection/src/TilesetJsonLoader.cpp +++ b/Cesium3DTilesSelection/src/TilesetJsonLoader.cpp @@ -685,7 +685,7 @@ TileLoadResult parseExternalTilesetInWorkerThread( SPDLOG_LOGGER_ERROR( pLogger, "Error when parsing tileset JSON, error code {} at byte offset {}", - tilesetJson.GetParseError(), + static_cast(tilesetJson.GetParseError()), tilesetJson.GetErrorOffset()); return TileLoadResult::createFailedResult(std::move(pCompletedRequest)); } @@ -782,7 +782,7 @@ TilesetJsonLoader::createLoader( result.errors.emplaceError(fmt::format( "Error when parsing tileset JSON, error code {} at byte offset " "{}", - tilesetJson.GetParseError(), + static_cast(tilesetJson.GetParseError()), tilesetJson.GetErrorOffset())); return result; } diff --git a/CesiumRasterOverlays/src/BingMapsRasterOverlay.cpp b/CesiumRasterOverlays/src/BingMapsRasterOverlay.cpp index fca88d623..c5480d7ab 100644 --- a/CesiumRasterOverlays/src/BingMapsRasterOverlay.cpp +++ b/CesiumRasterOverlays/src/BingMapsRasterOverlay.cpp @@ -371,7 +371,7 @@ BingMapsRasterOverlay::createTileProvider( fmt::format( "Error while parsing Bing Maps imagery metadata, error code " "{} at byte offset {}", - response.GetParseError(), + static_cast(response.GetParseError()), response.GetErrorOffset())}); } diff --git a/CesiumRasterOverlays/src/IonRasterOverlay.cpp b/CesiumRasterOverlays/src/IonRasterOverlay.cpp index 196ab96d9..6d1e3109b 100644 --- a/CesiumRasterOverlays/src/IonRasterOverlay.cpp +++ b/CesiumRasterOverlays/src/IonRasterOverlay.cpp @@ -127,7 +127,7 @@ IonRasterOverlay::createTileProvider( fmt::format( "Error while parsing Cesium ion raster overlay response, " "error code {} at byte offset {}", - response.GetParseError(), + static_cast(response.GetParseError()), response.GetErrorOffset())}); }