in64 related bug.
This commit is contained in:
parent
ecb28ba21e
commit
4bcf96c3ea
|
@ -97,6 +97,7 @@ void MFile::ReadBuffer(void *data, unsigned int sz) {
|
|||
data = ((char *)data) + n;
|
||||
sz -= n;
|
||||
curr_fp++;
|
||||
assert(curr_fp < files.size());
|
||||
curr_pos = 0;
|
||||
files[curr_fp]->SetPosition(curr_pos);
|
||||
}
|
||||
|
@ -111,6 +112,7 @@ void MFile::WriteBuffer(void *data, unsigned int sz) {
|
|||
data = ((char *)data) + n;
|
||||
sz -= n;
|
||||
curr_fp++;
|
||||
assert(curr_fp < files.size());
|
||||
curr_pos = 0;
|
||||
files[curr_fp]->SetPosition(curr_pos);
|
||||
}
|
||||
|
@ -144,9 +146,9 @@ void MFile::WriteBuffer(void *data, unsigned int sz) {
|
|||
void MFile::RedimLast(unsigned int sz) {
|
||||
assert(sz <= max_size);
|
||||
File &file = *files.back();
|
||||
unsigned int last_size = file.Length();
|
||||
unsigned int last_size = (int64)file.Length();
|
||||
file.Redim(sz);
|
||||
size += sz - last_size;
|
||||
size += sz - (int64)last_size;
|
||||
}
|
||||
|
||||
std::string MFile::Name(unsigned int n) {
|
||||
|
|
|
@ -116,7 +116,7 @@ Patch &PatchServer::GetPatch(unsigned int idx,
|
|||
if(entry.patch_start != 0xffffffff) { //was allocated.
|
||||
assert(entry.disk_size != 0xffff);
|
||||
|
||||
SetPosition(entry.patch_start * chunk_size);
|
||||
SetPosition((int64)entry.patch_start * (int64)chunk_size);
|
||||
|
||||
if((signature & NXS_COMPRESSED) == 0) { //not compressed
|
||||
ReadBuffer(ram, entry.disk_size * chunk_size);
|
||||
|
@ -254,7 +254,7 @@ void PatchServer::Flush(PTime &ptime) {
|
|||
cerr << "OOOOPSPPPS not supported!" << endl;
|
||||
exit(-1);
|
||||
}
|
||||
SetPosition(entry.patch_start * chunk_size);
|
||||
SetPosition((int64)entry.patch_start * (int64)chunk_size);
|
||||
WriteBuffer(compressed, entry.disk_size * chunk_size);
|
||||
delete []compressed;
|
||||
} else {
|
||||
|
@ -263,7 +263,7 @@ void PatchServer::Flush(PTime &ptime) {
|
|||
entry.patch_start = (unsigned int)(Length()/chunk_size);
|
||||
Redim(Length() + entry.disk_size * chunk_size);
|
||||
}
|
||||
SetPosition(entry.patch_start * chunk_size);
|
||||
SetPosition((int64)entry.patch_start * (int64)chunk_size);
|
||||
WriteBuffer(ptime.patch->start, entry.disk_size * chunk_size);
|
||||
}
|
||||
/* FILE *fo = fopen("tmp", "wb+");
|
||||
|
|
Loading…
Reference in New Issue