mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-09-23 11:42:27 +00:00
udjfjdkd
This commit is contained in:
@@ -463,7 +463,7 @@ void ConsoleSaveFileSplit::_init(const wstring &fileName, LPVOID pvSaveData, DWO
|
||||
unsigned char *regionDataCompressed;
|
||||
unsigned int regionSizeCompressed;
|
||||
|
||||
StorageManager.GetSubfileDetails(i, ®ionIndex, ®ionDataCompressed, ®ionSizeCompressed);
|
||||
StorageManager.GetSubfileDetails(i, (int*)®ionIndex, (void**)®ionDataCompressed, ®ionSizeCompressed);
|
||||
|
||||
RegionFileReference *regionFileRef = new RegionFileReference(i, regionIndex, regionSizeCompressed, regionDataCompressed);
|
||||
if( regionSizeCompressed > 0 )
|
||||
|
||||
@@ -43,14 +43,12 @@ private:
|
||||
//File(vector<wstring> *path);
|
||||
};
|
||||
|
||||
typedef struct
|
||||
struct FileKeyHash
|
||||
{
|
||||
int operator() (const File &k) const { return File::hash_fnct(k); }
|
||||
};
|
||||
|
||||
} FileKeyHash;
|
||||
|
||||
typedef struct
|
||||
struct FileKeyEq
|
||||
{
|
||||
bool operator() (const File &x, const File &y) const {return File::eq_test(x,y); }
|
||||
|
||||
} FileKeyEq;
|
||||
bool operator() (const File &x, const File &y) const { return File::eq_test(x, y); }
|
||||
};
|
||||
@@ -34,7 +34,7 @@ FileInputStream::FileInputStream(const File &file)
|
||||
NULL // Unsupported
|
||||
);
|
||||
#elif defined(__linux__)
|
||||
m_fileHandle = open(pchFilename, O_RDONLY);
|
||||
m_fileHandle = (HANDLE)(intptr_t)open(pchFilename, O_RDONLY);
|
||||
#else
|
||||
m_fileHandle = CreateFile(
|
||||
pchFilename, // file name
|
||||
@@ -61,7 +61,7 @@ FileInputStream::~FileInputStream()
|
||||
#ifndef __linux__
|
||||
CloseHandle( m_fileHandle );
|
||||
#else
|
||||
::close( m_fileHandle );
|
||||
::close( (int)(intptr_t)m_fileHandle );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ void FileInputStream::close()
|
||||
return;
|
||||
}
|
||||
|
||||
BOOL result = ::close( m_fileHandle );
|
||||
int result = ::close( (int)(intptr_t)m_fileHandle );
|
||||
|
||||
if( result == 0 )
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ FileOutputStream::FileOutputStream(const File &file) : m_fileHandle( INVALID_HAN
|
||||
char* convertedPath = new char[path.size() + 1];
|
||||
std::wcstombs(convertedPath, path.c_str(), path.size() + 1);
|
||||
|
||||
m_fileHandle = open(convertedPath, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR);
|
||||
m_fileHandle = (HANDLE)(intptr_t)open(convertedPath, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR);
|
||||
delete[] convertedPath;
|
||||
#else
|
||||
m_fileHandle = CreateFile(
|
||||
@@ -66,7 +66,7 @@ FileOutputStream::FileOutputStream(const File &file) : m_fileHandle( INVALID_HAN
|
||||
FileOutputStream::~FileOutputStream()
|
||||
{
|
||||
if( m_fileHandle != INVALID_HANDLE_VALUE )
|
||||
::close( m_fileHandle );
|
||||
::close( (int)(intptr_t)m_fileHandle );
|
||||
}
|
||||
|
||||
//Writes the specified byte to this file output stream. Implements the write method of OutputStream.
|
||||
@@ -85,7 +85,7 @@ void FileOutputStream::write(unsigned int b)
|
||||
NULL // overlapped buffer
|
||||
);
|
||||
#else // LINUX
|
||||
int fileDescriptor = reinterpret_cast<int>(m_fileHandle);
|
||||
int fileDescriptor = (int)(intptr_t)(m_fileHandle);
|
||||
ssize_t numberOfBytesWritten = ::write(fileDescriptor, NULL, 1);
|
||||
int result = static_cast<int>(numberOfBytesWritten);
|
||||
#endif // _WIN32
|
||||
@@ -114,7 +114,7 @@ void FileOutputStream::write(byteArray b)
|
||||
NULL // overlapped buffer
|
||||
);
|
||||
#else // Linux
|
||||
int fileDescriptor = reinterpret_cast<int>(m_fileHandle);
|
||||
int fileDescriptor = (int)(intptr_t)(m_fileHandle);
|
||||
ssize_t numberOfBytesWritten = ::write(fileDescriptor, NULL, 1);
|
||||
int result = static_cast<int>(numberOfBytesWritten);
|
||||
#endif // _WIN32
|
||||
@@ -150,7 +150,7 @@ void FileOutputStream::write(byteArray b, unsigned int offset, unsigned int leng
|
||||
NULL // overlapped buffer
|
||||
);
|
||||
#else
|
||||
int fileDescriptor = reinterpret_cast<int>(m_fileHandle);
|
||||
int fileDescriptor = (int)(intptr_t)(m_fileHandle);
|
||||
ssize_t numberOfBytesWritten = ::write(fileDescriptor, static_cast<const void*>(&b[offset]), length);
|
||||
int result = static_cast<int>(numberOfBytesWritten);
|
||||
#endif // _WIN32
|
||||
@@ -173,7 +173,7 @@ void FileOutputStream::close()
|
||||
#ifdef _WIN32
|
||||
BOOL result = CloseHandle( m_fileHandle );
|
||||
#else // __linux__
|
||||
int result = ::close( m_fileHandle );
|
||||
int result = ::close( (int)(intptr_t)m_fileHandle );
|
||||
#endif // _WIN32
|
||||
if( result == 0 )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user