Commit e147da02 authored by Chen Bill's avatar Chen Bill

remove ReadInt8, ReadInt16

parent 965e0564
...@@ -217,12 +217,6 @@ bool Replay::ReadData(void* data, size_t length) { ...@@ -217,12 +217,6 @@ bool Replay::ReadData(void* data, size_t length) {
int Replay::ReadInt32() { int Replay::ReadInt32() {
return ReadValue<int32_t>(); return ReadValue<int32_t>();
} }
short Replay::ReadInt16() {
return ReadValue<int16_t>();
}
char Replay::ReadInt8() {
return ReadValue<char>();
}
void Replay::Rewind() { void Replay::Rewind() {
data_position = 0; data_position = 0;
} }
......
...@@ -60,8 +60,6 @@ public: ...@@ -60,8 +60,6 @@ public:
return ret; return ret;
} }
int ReadInt32(); int ReadInt32();
short ReadInt16();
char ReadInt8();
void Rewind(); void Rewind();
FILE* fp{ nullptr }; FILE* fp{ nullptr };
......
...@@ -228,8 +228,8 @@ bool ReplayMode::StartDuel() { ...@@ -228,8 +228,8 @@ bool ReplayMode::StartDuel() {
} }
} else { } else {
char filename[256]; char filename[256];
int slen = cur_replay.ReadInt16(); auto slen = cur_replay.Read<uint16_t>();
if (slen < 0 || slen > 255) { if (slen > sizeof(filename) - 1) {
return false; return false;
} }
cur_replay.ReadData(filename, slen); cur_replay.ReadData(filename, slen);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment