From ae84186d3ad30c42fd930e59fce44286054090a4 Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Wed, 11 Mar 2026 16:49:12 -0500 Subject: [PATCH] chore: remove `#pragma warning` directives These are only recognized by MSVC and will throw *additional* warnings on other compilers. --- Minecraft.Client/Platform/Common/UI/UIScene.h | 2 +- .../Platform/Durango/4JLibs/inc/4J_Storage.h | 2 +- .../Durango/DurangoExtras/xcompress.h | 6 ++-- .../PS3/PS3Extras/DirectX/DirectXCollision.h | 12 +++---- .../PS3/PS3Extras/DirectX/DirectXMath.h | 24 +++++++------- .../PS3Extras/DirectX/DirectXMathConvert.inl | 6 ++-- .../PS3Extras/DirectX/DirectXPackedVector.h | 12 +++---- .../SenClientCultureBackCompat_SenBoxArt.h | 4 +-- .../Xbox/Sentient/Include/SenClientUGCTypes.h | 4 +-- .../Level/Storage/SparseDataStorage.cpp | 28 ++++++++-------- .../Level/Storage/SparseLightStorage.cpp | 32 +++++++++---------- 11 files changed, 66 insertions(+), 66 deletions(-) diff --git a/Minecraft.Client/Platform/Common/UI/UIScene.h b/Minecraft.Client/Platform/Common/UI/UIScene.h index 315229390..54b2675fc 100644 --- a/Minecraft.Client/Platform/Common/UI/UIScene.h +++ b/Minecraft.Client/Platform/Common/UI/UIScene.h @@ -1,6 +1,6 @@ #pragma once // 4J-PB - remove the inherits via dominance warnings -#pragma warning( disable : 4250 ) + //using namespace std; // A scene map directly to an Iggy movie (or more accurately a collection of different sized movies) diff --git a/Minecraft.Client/Platform/Durango/4JLibs/inc/4J_Storage.h b/Minecraft.Client/Platform/Durango/4JLibs/inc/4J_Storage.h index 4d97a6eac..e0b94bf45 100644 --- a/Minecraft.Client/Platform/Durango/4JLibs/inc/4J_Storage.h +++ b/Minecraft.Client/Platform/Durango/4JLibs/inc/4J_Storage.h @@ -460,7 +460,7 @@ public: bool Suspended(); ///////////////////////////////////////////////////////////////////////////// Unimplemented stubs ///////////////////////////////////////////////////////////////////////////////// -#pragma warning(disable: 4100) + void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected) {} bool GetSaveDeviceSelected(unsigned int iPad) { return true; } void ClearDLCOffers(); diff --git a/Minecraft.Client/Platform/Durango/DurangoExtras/xcompress.h b/Minecraft.Client/Platform/Durango/DurangoExtras/xcompress.h index c577ad02b..c8d8d08f3 100644 --- a/Minecraft.Client/Platform/Durango/DurangoExtras/xcompress.h +++ b/Minecraft.Client/Platform/Durango/DurangoExtras/xcompress.h @@ -27,8 +27,8 @@ extern "C" { #endif -#pragma warning(push) -#pragma warning(disable: 4200) // zero-sized array + + typedef enum _XMEMCODEC_TYPE { @@ -244,7 +244,7 @@ typedef struct _XCOMPRESS_BLOCK_HEADER_LZXNATIVE BYTE pCompressedData[0]; } XCOMPRESS_BLOCK_HEADER_LZXNATIVE; -#pragma warning(pop) + #ifdef __cplusplus } diff --git a/Minecraft.Client/Platform/PS3/PS3Extras/DirectX/DirectXCollision.h b/Minecraft.Client/Platform/PS3/PS3Extras/DirectX/DirectXCollision.h index d411432a6..54e959047 100644 --- a/Minecraft.Client/Platform/PS3/PS3Extras/DirectX/DirectXCollision.h +++ b/Minecraft.Client/Platform/PS3/PS3Extras/DirectX/DirectXCollision.h @@ -36,8 +36,8 @@ struct BoundingBox; struct BoundingOrientedBox; struct BoundingFrustum; -#pragma warning(push) -#pragma warning(disable:4324 4820) + + //------------------------------------------------------------------------------------- // Bounding sphere @@ -316,7 +316,7 @@ namespace TriangleTests // Test a triangle against six planes at once (see BoundingFrustum::GetPlanes) }; -#pragma warning(pop) + /**************************************************************************** * @@ -324,8 +324,8 @@ namespace TriangleTests * ****************************************************************************/ -#pragma warning(push) -#pragma warning(disable : 4068 4616 6001) + + #pragma prefast(push) #pragma prefast(disable : 25000, "FXMVECTOR is 16 bytes") @@ -333,7 +333,7 @@ namespace TriangleTests #include "DirectXCollision.inl" #pragma prefast(pop) -#pragma warning(pop) + }; // namespace DirectX diff --git a/Minecraft.Client/Platform/PS3/PS3Extras/DirectX/DirectXMath.h b/Minecraft.Client/Platform/PS3/PS3Extras/DirectX/DirectXMath.h index c79ef233c..2121b7bdc 100644 --- a/Minecraft.Client/Platform/PS3/PS3Extras/DirectX/DirectXMath.h +++ b/Minecraft.Client/Platform/PS3/PS3Extras/DirectX/DirectXMath.h @@ -49,12 +49,12 @@ #endif #endif // !_XM_ARM_NEON_INTRINSICS_ && !_XM_SSE_INTRINSICS_ && !_XM_VMX128_INTRINSICS_ && !_XM_NO_INTRINSICS_ -#pragma warning(push) -#pragma warning(disable:4514 4820 4985) + + #include #include // MGH - #include -#pragma warning(pop) + #if defined(_XM_SSE_INTRINSICS_) @@ -76,10 +76,10 @@ #include -#pragma warning(push) -#pragma warning(disable : 4005 4668) + + #include -#pragma warning(pop) + namespace DirectX @@ -184,8 +184,8 @@ inline bool XMComparisonAnyOutOfBounds(uint32_t CR) { return (((CR) & XM_CRMASK_ * ****************************************************************************/ -#pragma warning(push) -#pragma warning(disable:4068 4201 4365 4324 4820) + + #pragma prefast(push) #pragma prefast(disable : 25000, "FXMVECTOR is 16 bytes") @@ -703,7 +703,7 @@ __declspec(align(16)) struct XMFLOAT4X4A : public XMFLOAT4X4 #endif #pragma prefast(pop) -#pragma warning(pop) + /**************************************************************************** * @@ -1746,8 +1746,8 @@ XMGLOBALCONST XMVECTORF32 g_XMsrgbA1 = { 1.055f, 1.055f, 1.055f, 1.0f * ****************************************************************************/ -#pragma warning(push) -#pragma warning(disable:4068 4214 4204 4365 4616 4640 6001) + + #pragma prefast(push) #pragma prefast(disable : 25000, "FXMVECTOR is 16 bytes") @@ -1855,7 +1855,7 @@ inline XMVECTOR XMVectorSplatConstantInt(int32_t IntConstant) #pragma prefast(pop) -#pragma warning(pop) + }; // namespace DirectX diff --git a/Minecraft.Client/Platform/PS3/PS3Extras/DirectX/DirectXMathConvert.inl b/Minecraft.Client/Platform/PS3/PS3Extras/DirectX/DirectXMathConvert.inl index c8e39352a..a01b94f3b 100644 --- a/Minecraft.Client/Platform/PS3/PS3Extras/DirectX/DirectXMathConvert.inl +++ b/Minecraft.Client/Platform/PS3/PS3Extras/DirectX/DirectXMathConvert.inl @@ -24,8 +24,8 @@ #if defined(_XM_NO_INTRINSICS_) || defined(_XM_SSE_INTRINSICS_) || defined(_XM_ARM_NEON_INTRINSICS_) // For VMX128, these routines are all defines in the main header -#pragma warning(push) -#pragma warning(disable:4701) // Prevent warnings about 'Result' potentially being used without having been initialized + + inline XMVECTOR XMConvertVectorIntToFloat ( @@ -220,7 +220,7 @@ inline XMVECTOR XMConvertVectorFloatToUInt #endif } -#pragma warning(pop) + #endif // _XM_NO_INTRINSICS_ || _XM_SSE_INTRINSICS_ || _XM_ARM_NEON_INTRINSICS_ diff --git a/Minecraft.Client/Platform/PS3/PS3Extras/DirectX/DirectXPackedVector.h b/Minecraft.Client/Platform/PS3/PS3Extras/DirectX/DirectXPackedVector.h index 66df02fd8..5f3a68231 100644 --- a/Minecraft.Client/Platform/PS3/PS3Extras/DirectX/DirectXPackedVector.h +++ b/Minecraft.Client/Platform/PS3/PS3Extras/DirectX/DirectXPackedVector.h @@ -26,8 +26,8 @@ namespace PackedVector #pragma bitfield_order(lsb_to_msb) #endif -#pragma warning(push) -#pragma warning(disable:4201 4365 4324) + + //------------------------------------------------------------------------------ // ARGB Color; 8-8-8-8 bit unsigned normalized integer components packed into @@ -865,7 +865,7 @@ struct XMU555 }; -#pragma warning(pop) + #ifdef _XM_BIGENDIAN_ #pragma bitfield_order(pop) @@ -977,8 +977,8 @@ void XMStoreU555(_Out_ XMU555* pDestination, _In_ FXMVECTOR V); * ****************************************************************************/ -#pragma warning(push) -#pragma warning(disable:4068 4214 4204 4365 4616 6001) + + #pragma prefast(push) #pragma prefast(disable : 25000, "FXMVECTOR is 16 bytes") @@ -986,7 +986,7 @@ void XMStoreU555(_Out_ XMU555* pDestination, _In_ FXMVECTOR V); #include "DirectXPackedVector.inl" #pragma prefast(pop) -#pragma warning(pop) + }; // namespace PackedVector diff --git a/Minecraft.Client/Platform/Xbox/Sentient/Include/SenClientCultureBackCompat_SenBoxArt.h b/Minecraft.Client/Platform/Xbox/Sentient/Include/SenClientCultureBackCompat_SenBoxArt.h index 050d86bf3..98f0f1060 100644 --- a/Minecraft.Client/Platform/Xbox/Sentient/Include/SenClientCultureBackCompat_SenBoxArt.h +++ b/Minecraft.Client/Platform/Xbox/Sentient/Include/SenClientCultureBackCompat_SenBoxArt.h @@ -5,7 +5,7 @@ namespace Sentient { -#pragma warning(disable:4996) + __declspec(deprecated("This function is deprecated. See the function body for an example of using the new API.")) __inline HRESULT SenBoxArtDownloadExtraInfo( @@ -40,5 +40,5 @@ namespace Sentient return SenBoxArtXMLGetDescription(senXML, bufferLengthMax, out_bufferLength, out_buffer); } -#pragma warning(default:4996) + } \ No newline at end of file diff --git a/Minecraft.Client/Platform/Xbox/Sentient/Include/SenClientUGCTypes.h b/Minecraft.Client/Platform/Xbox/Sentient/Include/SenClientUGCTypes.h index 6d1056ff3..7c0e40aa7 100644 --- a/Minecraft.Client/Platform/Xbox/Sentient/Include/SenClientUGCTypes.h +++ b/Minecraft.Client/Platform/Xbox/Sentient/Include/SenClientUGCTypes.h @@ -63,9 +63,9 @@ namespace Sentient { SenUGCMetaData() { -#pragma warning ( disable : 4996 ) // @TODO - Removed once Int16 Descriptors are deprecated + memset(descriptors, 0, sizeof(SenUGCDescriptor) * NrUgcDescriptors); -#pragma warning ( default : 4996 ) + memset(descriptors2, 0, sizeof(__int64) * NrUgcDescriptors); } diff --git a/Minecraft.World/Level/Storage/SparseDataStorage.cpp b/Minecraft.World/Level/Storage/SparseDataStorage.cpp index 0f43dae47..9ef256100 100644 --- a/Minecraft.World/Level/Storage/SparseDataStorage.cpp +++ b/Minecraft.World/Level/Storage/SparseDataStorage.cpp @@ -39,9 +39,9 @@ SparseDataStorage::SparseDataStorage() XMemSet(data, 0, 128 * 127); // Data and count packs together the pointer to our data and the count of planes allocated - 127 planes allocated in this case -#pragma warning ( disable : 4826 ) + dataAndCount = 0x007F000000000000L | (( (__int64) planeIndices ) & 0x0000ffffffffffffL); -#pragma warning ( default : 4826 ) + #ifdef DATA_COMPRESSION_STATS count = 128; #endif @@ -58,9 +58,9 @@ SparseDataStorage::SparseDataStorage(bool isUpper) } // Data and count packs together the pointer to our data and the count of planes allocated - 127 planes allocated in this case -#pragma warning ( disable : 4826 ) + dataAndCount = 0x0000000000000000L | (( (__int64) planeIndices ) & 0x0000ffffffffffffL); -#pragma warning ( default : 4826 ) + #ifdef DATA_COMPRESSION_STATS count = 128; #endif @@ -96,9 +96,9 @@ SparseDataStorage::SparseDataStorage(SparseDataStorage *copyFrom) // AP - I've moved this to be before the memcpy because of a very strange bug on vita. Sometimes dataAndCount wasn't valid in time when ::get was called. // This should never happen and this isn't a proper solution but fixes it for now. -#pragma warning ( disable : 4826 ) + dataAndCount = ( sourceDataAndCount & 0xffff000000000000L ) | ( ((__int64) destIndicesAndData ) & 0x0000ffffffffffffL ); -#pragma warning ( default : 4826 ) + XMemCpy( destIndicesAndData, sourceIndicesAndData, sourceCount * 128 + 128 ); @@ -175,9 +175,9 @@ void SparseDataStorage::setData(byteArray dataIn, unsigned int inOffset) } // Get new data and count packed info -#pragma warning ( disable : 4826 ) + __int64 newDataAndCount = ((__int64) planeIndices) & 0x0000ffffffffffffL; -#pragma warning ( default : 4826 ) + newDataAndCount |= ((__int64)allocatedPlaneCount) << 48; updateDataAndCount( newDataAndCount ); @@ -400,9 +400,9 @@ void SparseDataStorage::addNewPlane(int y) dataPointer[y] = lastLinesUsed; // Get new data and count packed info -#pragma warning ( disable : 4826 ) + __int64 newDataAndCount = ((__int64) dataPointer) & 0x0000ffffffffffffL; -#pragma warning ( default : 4826 ) + newDataAndCount |= ((__int64)linesUsed) << 48; // Attempt to update the data & count atomically. This command will Only succeed if the data stored at @@ -557,9 +557,9 @@ int SparseDataStorage::compress() } // Get new data and count packed info -#pragma warning ( disable : 4826 ) + __int64 newDataAndCount = ((__int64) newIndicesAndData) & 0x0000ffffffffffffL; -#pragma warning ( default : 4826 ) + newDataAndCount |= ((__int64)planesToAlloc) << 48; // Attempt to update the data & count atomically. This command will Only succeed if the data stored at @@ -616,9 +616,9 @@ void SparseDataStorage::read(DataInputStream *dis) byteArray wrapper(dataPointer, count * 128 + 128); dis->readFully(wrapper); -#pragma warning ( disable : 4826 ) + __int64 newDataAndCount = ((__int64) dataPointer) & 0x0000ffffffffffffL; -#pragma warning ( default : 4826 ) + newDataAndCount |= ((__int64)count) << 48; updateDataAndCount(newDataAndCount); diff --git a/Minecraft.World/Level/Storage/SparseLightStorage.cpp b/Minecraft.World/Level/Storage/SparseLightStorage.cpp index 348643ca5..faf245515 100644 --- a/Minecraft.World/Level/Storage/SparseLightStorage.cpp +++ b/Minecraft.World/Level/Storage/SparseLightStorage.cpp @@ -39,9 +39,9 @@ SparseLightStorage::SparseLightStorage(bool sky) XMemSet(data, 0, 128 * 127); // Data and count packs together the pointer to our data and the count of planes allocated - 127 planes allocated in this case -#pragma warning ( disable : 4826 ) + dataAndCount = 0x007F000000000000L | (( (__int64) planeIndices ) & 0x0000ffffffffffffL); -#pragma warning ( default : 4826 ) + #ifdef LIGHT_COMPRESSION_STATS count = 127; #endif @@ -58,9 +58,9 @@ SparseLightStorage::SparseLightStorage(bool sky, bool isUpper) } // Data and count packs together the pointer to our data and the count of planes allocated - 0 planes allocated in this case -#pragma warning ( disable : 4826 ) + dataAndCount = 0x0000000000000000L | (( (__int64) planeIndices ) & 0x0000ffffffffffffL); -#pragma warning ( default : 4826 ) + #ifdef LIGHT_COMPRESSION_STATS count = 0; #endif @@ -96,9 +96,9 @@ SparseLightStorage::SparseLightStorage(SparseLightStorage *copyFrom) // AP - I've moved this to be before the memcpy because of a very strange bug on vita. Sometimes dataAndCount wasn't valid in time when ::get was called. // This should never happen and this isn't a proper solution but fixes it for now. -#pragma warning ( disable : 4826 ) + dataAndCount = ( sourceDataAndCount & 0xffff000000000000L ) | ( ((__int64) destIndicesAndData ) & 0x0000ffffffffffffL ); -#pragma warning ( default : 4826 ) + XMemCpy( destIndicesAndData, sourceIndicesAndData, sourceCount * 128 + 128 ); @@ -179,9 +179,9 @@ void SparseLightStorage::setData(byteArray dataIn, unsigned int inOffset) } // Get new data and count packed info -#pragma warning ( disable : 4826 ) + __int64 newDataAndCount = ((__int64) planeIndices) & 0x0000ffffffffffffL; -#pragma warning ( default : 4826 ) + newDataAndCount |= ((__int64)allocatedPlaneCount) << 48; updateDataAndCount( newDataAndCount ); @@ -311,9 +311,9 @@ void SparseLightStorage::setAllBright() planeIndices[i] = ALL_15_INDEX; } // Data and count packs together the pointer to our data and the count of planes allocated, which is currently zero -#pragma warning ( disable : 4826 ) + __int64 newDataAndCount = ( (__int64) planeIndices ) & 0x0000ffffffffffffL; -#pragma warning ( default : 4826 ) + updateDataAndCount( newDataAndCount ); } @@ -406,9 +406,9 @@ void SparseLightStorage::addNewPlane(int y) dataPointer[y] = lastLinesUsed; // Get new data and count packed info -#pragma warning ( disable : 4826 ) + __int64 newDataAndCount = ((__int64) dataPointer) & 0x0000ffffffffffffL; -#pragma warning ( default : 4826 ) + newDataAndCount |= ((__int64)linesUsed) << 48; // Attempt to update the data & count atomically. This command will Only succeed if the data stored at @@ -574,9 +574,9 @@ int SparseLightStorage::compress() } // Get new data and count packed info -#pragma warning ( disable : 4826 ) + __int64 newDataAndCount = ((__int64) newIndicesAndData) & 0x0000ffffffffffffL; -#pragma warning ( default : 4826 ) + newDataAndCount |= ((__int64)planesToAlloc) << 48; // Attempt to update the data & count atomically. This command will Only succeed if the data stored at @@ -633,9 +633,9 @@ void SparseLightStorage::read(DataInputStream *dis) byteArray wrapper(dataPointer, count * 128 + 128); dis->readFully(wrapper); -#pragma warning ( disable : 4826 ) + __int64 newDataAndCount = ((__int64) dataPointer) & 0x0000ffffffffffffL; -#pragma warning ( default : 4826 ) + newDataAndCount |= ((__int64)count) << 48; updateDataAndCount( newDataAndCount );