[ox] Address CLion warnings

This commit is contained in:
2021-02-27 02:38:18 -06:00
parent 44f4d67c80
commit 70168286ab
13 changed files with 10 additions and 39 deletions

View File

@@ -7,11 +7,9 @@
*/
#if defined(OX_USE_STDLIB)
#include <bitset>
#include <iostream>
#endif
#include "defines.hpp"
#include "stacktrace.hpp"
#include "trace.hpp"

View File

@@ -22,7 +22,7 @@ class OX_PACKED Random {
public:
Random();
Random(RandomSeed seed);
explicit Random(RandomSeed seed);
uint64_t gen();
};

View File

@@ -177,7 +177,7 @@ std::size_t String::len() const noexcept {
}
std::size_t String::bytes() const noexcept {
std::size_t i = 0;
std::size_t i;
for (i = 0; i < m_buff.size() && m_buff[i]; i++);
return i + 1; // add one for null terminator
}

View File

@@ -25,25 +25,25 @@ std::map<std::string, std::function<int()>> tests = {
{
"ABCDEFG != HIJKLMN",
[]() {
return !(ox_memcmp("ABCDEFG", "HIJKLMN", 7) < 0);
return ox_memcmp("ABCDEFG", "HIJKLMN", 7) >= 0;
}
},
{
"HIJKLMN != ABCDEFG",
[]() {
return !(ox_memcmp("HIJKLMN", "ABCDEFG", 7) > 0);
return ox_memcmp("HIJKLMN", "ABCDEFG", 7) <= 0;
}
},
{
"ABCDEFG == ABCDEFG",
[]() {
return !(ox_memcmp("ABCDEFG", "ABCDEFG", 7) == 0);
return ox_memcmp("ABCDEFG", "ABCDEFG", 7) != 0;
}
},
{
"ABCDEFGHI == ABCDEFG",
[]() {
return !(ox_memcmp("ABCDEFGHI", "ABCDEFG", 7) == 0);
return ox_memcmp("ABCDEFGHI", "ABCDEFG", 7) != 0;
}
},
{

View File

@@ -9,7 +9,6 @@
#if defined(OX_USE_STDLIB)
#include <iomanip>
#include <iostream>
#include <stdio.h>
#endif
#include "trace.hpp"