Jelajahi Sumber

Update streams to reflect underscore_notation switch

taylor001 13 tahun lalu
induk
melakukan
5f91f8f9e7

+ 2 - 2
src/core/streams/File.cpp

@@ -69,8 +69,8 @@ File* File::Open(const char* path, FileOpenMode mode)
 				(TestFlag(mode, FOM_CREATENEW) ? "wb+" : "rb+") : "rb") : (TestFlag(mode, FOM_WRITE) ? "wb" : "rb"));
 	*/
 
-	Math::TestBitmask(mode, FOM_READ) ?
-		(Math::TestBitmask(mode, FOM_WRITE) ? "rb+" : "rb") : (Math::TestBitmask(mode, FOM_WRITE) ? "wb" : "rb")); 
+	math::test_bitmask(mode, FOM_READ) ?
+		(math::test_bitmask(mode, FOM_WRITE) ? "rb+" : "rb") : (math::test_bitmask(mode, FOM_WRITE) ? "wb" : "rb")); 
 
 	if (f->mFileHandle == 0)
 	{

+ 3 - 3
src/core/streams/FileStream.cpp

@@ -38,9 +38,9 @@ FileStream::FileStream(StreamOpenMode openMode, const Str& filename) :
 	//Takes ownership
 	FileOpenMode fileOpenMode = (FileOpenMode)0;
 
-	if (Math::TestBitmask(openMode, SOM_READ))
+	if (math::test_bitmask(openMode, SOM_READ))
 		fileOpenMode = (FileOpenMode)(fileOpenMode | FOM_READ);
-	if (Math::TestBitmask(openMode, SOM_WRITE))
+	if (math::test_bitmask(openMode, SOM_WRITE))
 		fileOpenMode = (FileOpenMode)(fileOpenMode | FOM_WRITE);
 
 	mFile = File::Open(filename.c_str(), fileOpenMode);
@@ -108,7 +108,7 @@ bool FileStream::CopyTo(Stream* stream, size_t size)
 	while (totReadBytes < size)
 	{
 		int readBytes;
-		int expectedReadBytes = Math::Min(size - totReadBytes, chunksize);
+		int expectedReadBytes = math::min(size - totReadBytes, chunksize);
 		readBytes = fread(buff, 1, expectedReadBytes, mFile->GetHandle());
 
 		if (readBytes < expectedReadBytes)

+ 1 - 1
src/core/streams/MemoryStream.cpp

@@ -171,7 +171,7 @@ void MemoryStream::ReadDataBlock(void* buffer, size_t size)
 bool MemoryStream::CopyTo(Stream* stream, size_t size)
 {
 	CheckValid();
-	stream->WriteDataBlock(&(mMem->GetData()[mMemOffset]), Math::Min(mMem->GetSize()-mMemOffset, size));
+	stream->WriteDataBlock(&(mMem->GetData()[mMemOffset]), math::min(mMem->GetSize()-mMemOffset, size));
 	return true;
 }
 

+ 2 - 2
src/core/streams/Stream.cpp

@@ -50,7 +50,7 @@ bool Stream::ZipTo(Stream* stream, size_t size, size_t& zippedSize)
 	size_t bytes_read = 0;
 	do
 	{
-		size_t this_step_bytes = Math::Min(CHUNK_SIZE, size - bytes_read);
+		size_t this_step_bytes = math::min(CHUNK_SIZE, size - bytes_read);
 		ReadDataBlock(in, this_step_bytes);
 
 		strm.avail_in = this_step_bytes;
@@ -109,7 +109,7 @@ bool Stream::UnzipTo(Stream* stream, size_t& /*unzippedSize*/)
 	/* decompress until deflate stream ends or end of file */
 	do
 	{
-		size_t this_step_bytes = Math::Min(CHUNK_SIZE, size - bytes_read);
+		size_t this_step_bytes = math::min(CHUNK_SIZE, size - bytes_read);
 		ReadDataBlock(in, this_step_bytes);
 
 		strm.avail_in = this_step_bytes;

+ 2 - 2
src/core/streams/Stream.h

@@ -175,13 +175,13 @@ public:
 						@return
 							True if readable, false otherwise
 						*/
-	virtual inline bool	CanRead() const { return Math::TestBitmask(mOpenMode, SOM_READ); }
+	virtual inline bool	CanRead() const { return math::test_bitmask(mOpenMode, SOM_READ); }
 						/**
 							Returns whether the stream can be wrote.
 						@return
 							True if writeable, false otherwise
 						*/
-	virtual inline bool	CanWrite() const { return Math::TestBitmask(mOpenMode, SOM_WRITE); }
+	virtual inline bool	CanWrite() const { return math::test_bitmask(mOpenMode, SOM_WRITE); }
 						/**
 							Returns whether the stream can be sought.
 						@returns