fix minor bugs
This commit is contained in:
@@ -164,7 +164,7 @@ UniqueChannel DrivenEngine::new_incoming_channel() {
|
|||||||
} else {
|
} else {
|
||||||
UniqueChannel result = std::move(accepted_channels_.back());
|
UniqueChannel result = std::move(accepted_channels_.back());
|
||||||
accepted_channels_.pop_back();
|
accepted_channels_.pop_back();
|
||||||
return std::move(result);
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ static void tabify(Inspector &insp, int level) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void pprint_r(Inspector &insp, int level, LuaSlot root) {
|
static void pprint_r(Inspector &insp, int level, LuaSlot root) {
|
||||||
|
lua_checkstack(insp.L, 20);
|
||||||
LuaVar idv, pairs, key, val;
|
LuaVar idv, pairs, key, val;
|
||||||
LuaStack LS(insp.L, idv, pairs, key, val);
|
LuaStack LS(insp.L, idv, pairs, key, val);
|
||||||
|
|
||||||
|
|||||||
@@ -309,9 +309,8 @@ double StreamBuffer::read_double() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void StreamBuffer::write_hashvalue(const util::HashValue &hv) {
|
void StreamBuffer::write_hashvalue(const util::HashValue &hv) {
|
||||||
make_space(16);
|
write_uint64(hv.first);
|
||||||
memcpy(write_cursor_, &hv, 16);
|
write_uint64(hv.second);
|
||||||
write_cursor_ += 16;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StreamBuffer::write_string(const std::string &s) {
|
void StreamBuffer::write_string(const std::string &s) {
|
||||||
@@ -326,11 +325,9 @@ void StreamBuffer::write_string(const std::string &s) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
util::HashValue StreamBuffer::read_hashvalue() {
|
util::HashValue StreamBuffer::read_hashvalue() {
|
||||||
check_available(16);
|
uint64_t f = read_uint64();
|
||||||
util::HashValue hv;
|
uint64_t s = read_uint64();
|
||||||
memcpy(&hv, read_cursor_, 16);
|
return util::HashValue(f,s);
|
||||||
read_cursor_ += 16;
|
|
||||||
return hv;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string StreamBuffer::read_string() {
|
std::string StreamBuffer::read_string() {
|
||||||
@@ -546,7 +543,7 @@ LuaDefine(unittests_streambuffer, "c") {
|
|||||||
try {
|
try {
|
||||||
sb11.read_bytes(1);
|
sb11.read_bytes(1);
|
||||||
LuaAssert(L, false && "This should have thrown an exception");
|
LuaAssert(L, false && "This should have thrown an exception");
|
||||||
} catch (StreamEof) {}
|
} catch (const StreamEof &) {}
|
||||||
LuaAssert(L, sb11.layout_is(6, 0, 5));
|
LuaAssert(L, sb11.layout_is(6, 0, 5));
|
||||||
|
|
||||||
// Write some more bytes into the stream, forcing a shift-left
|
// Write some more bytes into the stream, forcing a shift-left
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ LuaSourcePtr read_lua_source(const std::string &dir) {
|
|||||||
std::string data = get_file_contents(dir + "/" + file);
|
std::string data = get_file_contents(dir + "/" + file);
|
||||||
result->emplace_back(file, data);
|
result->emplace_back(file, data);
|
||||||
}
|
}
|
||||||
return std::move(result);
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string XYZ::debug_string() const {
|
std::string XYZ::debug_string() const {
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ util::IdVector World::get_near(int64_t player_id, float radius, bool exclude_now
|
|||||||
World::Redirects World::fetch_redirects() {
|
World::Redirects World::fetch_redirects() {
|
||||||
World::Redirects result = std::move(redirects_);
|
World::Redirects result = std::move(redirects_);
|
||||||
redirects_.clear();
|
redirects_.clear();
|
||||||
return std::move(result);
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t World::create_login_actor() {
|
int64_t World::create_login_actor() {
|
||||||
|
|||||||
Reference in New Issue
Block a user