aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/DataInputStream.cpp
diff options
context:
space:
mode:
authorLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
committerLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
commit087b7e7abfe81dd7f0fdcdea36ac9f245950df1a (patch)
tree69454763e73ca764af4e682d3573080b13138a0e /Minecraft.World/DataInputStream.cpp
parenta9be52c41a02d207233199e98898fe7483d7e817 (diff)
Revert "Project modernization (#630)"
This code was not tested and breaks in Release builds, reverting to restore functionality of the nightly. All in-game menus do not work and generating a world crashes. This reverts commit a9be52c41a02d207233199e98898fe7483d7e817.
Diffstat (limited to 'Minecraft.World/DataInputStream.cpp')
-rw-r--r--Minecraft.World/DataInputStream.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/Minecraft.World/DataInputStream.cpp b/Minecraft.World/DataInputStream.cpp
index 4e4f5cd1..18deed39 100644
--- a/Minecraft.World/DataInputStream.cpp
+++ b/Minecraft.World/DataInputStream.cpp
@@ -92,12 +92,12 @@ bool DataInputStream::readBoolean()
//the 8-bit value read.
byte DataInputStream::readByte()
{
- return static_cast<byte>(stream->read());
+ return (byte) stream->read();
}
unsigned char DataInputStream::readUnsignedByte()
{
- return static_cast<unsigned char>(stream->read());
+ return (unsigned char) stream->read();
}
//Reads two input bytes and returns a char value. Let a be the first byte read and b be the second byte. The value returned is:
@@ -110,7 +110,7 @@ wchar_t DataInputStream::readChar()
{
int a = stream->read();
int b = stream->read();
- return static_cast<wchar_t>((a << 8) | (b & 0xff));
+ return (wchar_t)((a << 8) | (b & 0xff));
}
//Reads some bytes from an input stream and stores them into the buffer array b. The number of bytes read is equal to the length of b.
@@ -254,14 +254,14 @@ short DataInputStream::readShort()
{
int a = stream->read();
int b = stream->read();
- return static_cast<short>((a << 8) | (b & 0xff));
+ return (short)((a << 8) | (b & 0xff));
}
unsigned short DataInputStream::readUnsignedShort()
{
int a = stream->read();
int b = stream->read();
- return static_cast<unsigned short>((a << 8) | (b & 0xff));
+ return (unsigned short)((a << 8) | (b & 0xff));
}
//Reads in a string that has been encoded using a modified UTF-8 format. The general contract of readUTF is that it reads a representation
@@ -301,7 +301,7 @@ wstring DataInputStream::readUTF()
wstring outputString;
int a = stream->read();
int b = stream->read();
- unsigned short UTFLength = static_cast<unsigned short>(((a & 0xff) << 8) | (b & 0xff));
+ unsigned short UTFLength = (unsigned short) (((a & 0xff) << 8) | (b & 0xff));
//// 4J Stu - I decided while writing DataOutputStream that we didn't need to bother using the UTF8 format
//// used in the java libs, and just write in/out as wchar_t all the time
@@ -343,7 +343,7 @@ wstring DataInputStream::readUTF()
else if( (firstByte & 0x80) == 0x00 )
{
// One byte UTF
- wchar_t readChar = static_cast<wchar_t>(firstByte);
+ wchar_t readChar = (wchar_t)firstByte;
outputString.push_back( readChar );
continue;
}
@@ -374,7 +374,7 @@ wstring DataInputStream::readUTF()
break;
}
- wchar_t readChar = static_cast<wchar_t>(((firstByte & 0x1F) << 6) | (secondByte & 0x3F));
+ wchar_t readChar = (wchar_t)( ((firstByte& 0x1F) << 6) | (secondByte & 0x3F) );
outputString.push_back( readChar );
continue;
}
@@ -422,7 +422,7 @@ wstring DataInputStream::readUTF()
break;
}
- wchar_t readChar = static_cast<wchar_t>(((firstByte & 0x0F) << 12) | ((secondByte & 0x3F) << 6) | (thirdByte & 0x3F));
+ wchar_t readChar = (wchar_t)(((firstByte & 0x0F) << 12) | ((secondByte & 0x3F) << 6) | (thirdByte & 0x3F));
outputString.push_back( readChar );
continue;
}