address review

This commit is contained in:
toxieainc 2022-07-17 20:29:25 +02:00
parent 24173a2140
commit dda48d7606
3 changed files with 4 additions and 7 deletions

View file

@ -135,7 +135,7 @@ bool GameLoader::MissingAttrib(const GameLoader &loader, const Util::Config::Nod
GameLoader::File::ptr_t GameLoader::File::Create(const GameLoader &loader, const Util::Config::Node &file_node)
{
if (GameLoader::MissingAttrib(loader, file_node, "name") || GameLoader::MissingAttrib(loader, file_node, "offset"))
if (GameLoader::MissingAttrib(loader, file_node, "name") | GameLoader::MissingAttrib(loader, file_node, "offset")) // no || to easier detect errors
return ptr_t();
ptr_t file = std::make_shared<File>();
file->offset = file_node["offset"].ValueAs<uint32_t>();
@ -159,7 +159,7 @@ bool GameLoader::File::operator==(const File &rhs) const
GameLoader::Region::ptr_t GameLoader::Region::Create(const GameLoader &loader, const Util::Config::Node &region_node)
{
if (GameLoader::MissingAttrib(loader, region_node, "name") || MissingAttrib(loader, region_node, "stride") | GameLoader::MissingAttrib(loader, region_node, "chunk_size"))
if (GameLoader::MissingAttrib(loader, region_node, "name") | MissingAttrib(loader, region_node, "stride") | GameLoader::MissingAttrib(loader, region_node, "chunk_size")) // no || to easier detect errors
return ptr_t();
ptr_t region = std::make_shared<Region>();
region->region_name = region_node["name"].Value<std::string>();

View file

@ -332,8 +332,7 @@ void CInputs::PrintHeader(const char *fmt, ...)
va_end(vl);
puts(header);
const size_t hs = strlen(header);
for (size_t i = 0; i < hs; i++)
for (size_t i = 0; i < strlen(header); i++)
putchar('-');
printf("\n\n");
}

View file

@ -60,9 +60,7 @@ bool TCPSend::Send(const void * data, int length)
DPRINTF("Sending %i bytes\n", length);
int sent;
sent = SDLNet_TCP_Send(m_socket, &length, sizeof(int)); // pack the length at the start of transmission.
int sent = SDLNet_TCP_Send(m_socket, &length, sizeof(int)); // pack the length at the start of transmission.
if (!length)
return true; // 0 sized packet will blow our connex