fix minor bugs

This commit is contained in:
2021-11-23 14:38:08 -05:00
parent b5a66a6000
commit c75ba3b3a8
5 changed files with 10 additions and 12 deletions

View File

@@ -164,7 +164,7 @@ UniqueChannel DrivenEngine::new_incoming_channel() {
} else {
UniqueChannel result = std::move(accepted_channels_.back());
accepted_channels_.pop_back();
return std::move(result);
return result;
}
}

View File

@@ -122,6 +122,7 @@ static void tabify(Inspector &insp, int level) {
}
static void pprint_r(Inspector &insp, int level, LuaSlot root) {
lua_checkstack(insp.L, 20);
LuaVar idv, pairs, key, val;
LuaStack LS(insp.L, idv, pairs, key, val);

View File

@@ -309,9 +309,8 @@ double StreamBuffer::read_double() {
}
void StreamBuffer::write_hashvalue(const util::HashValue &hv) {
make_space(16);
memcpy(write_cursor_, &hv, 16);
write_cursor_ += 16;
write_uint64(hv.first);
write_uint64(hv.second);
}
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() {
check_available(16);
util::HashValue hv;
memcpy(&hv, read_cursor_, 16);
read_cursor_ += 16;
return hv;
uint64_t f = read_uint64();
uint64_t s = read_uint64();
return util::HashValue(f,s);
}
std::string StreamBuffer::read_string() {
@@ -546,7 +543,7 @@ LuaDefine(unittests_streambuffer, "c") {
try {
sb11.read_bytes(1);
LuaAssert(L, false && "This should have thrown an exception");
} catch (StreamEof) {}
} catch (const StreamEof &) {}
LuaAssert(L, sb11.layout_is(6, 0, 5));
// Write some more bytes into the stream, forcing a shift-left

View File

@@ -279,7 +279,7 @@ LuaSourcePtr read_lua_source(const std::string &dir) {
std::string data = get_file_contents(dir + "/" + file);
result->emplace_back(file, data);
}
return std::move(result);
return result;
}
std::string XYZ::debug_string() const {

View File

@@ -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 result = std::move(redirects_);
redirects_.clear();
return std::move(result);
return result;
}
int64_t World::create_login_actor() {