[ox] Address CLion warnings
This commit is contained in:
parent
44f4d67c80
commit
70168286ab
2
deps/ox/src/ox/fs/test/tests.cpp
vendored
2
deps/ox/src/ox/fs/test/tests.cpp
vendored
@ -9,12 +9,10 @@
|
||||
// make sure asserts are enabled for the test file
|
||||
#undef NDEBUG
|
||||
|
||||
#include <iostream>
|
||||
#include <assert.h>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <ox/fs/fs.hpp>
|
||||
#include <ox/std/std.hpp>
|
||||
#include <ox/fs/filestore/filestoretemplate.hpp>
|
||||
#include <ox/fs/filesystem/filesystem.hpp>
|
||||
|
7
deps/ox/src/ox/mc/presenceindicator.cpp
vendored
7
deps/ox/src/ox/mc/presenceindicator.cpp
vendored
@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
#include <ox/std/byteswap.hpp>
|
||||
#include <ox/std/memops.hpp>
|
||||
#include "err.hpp"
|
||||
#include "presenceindicator.hpp"
|
||||
|
||||
@ -44,11 +43,7 @@ void FieldPresenceIndicator::setFields(int fields) noexcept {
|
||||
m_maskLen = (fields / 8 + 1) - (fields % 8 == 0);
|
||||
}
|
||||
|
||||
int FieldPresenceIndicator::getFields() const noexcept {
|
||||
return m_fields;
|
||||
}
|
||||
|
||||
void FieldPresenceIndicator::setMaxLen(int maxLen) noexcept {
|
||||
void FieldPresenceIndicator::setMaxLen(int maxLen) noexcept {
|
||||
m_maskLen = maxLen;
|
||||
}
|
||||
|
||||
|
4
deps/ox/src/ox/mc/presenceindicator.hpp
vendored
4
deps/ox/src/ox/mc/presenceindicator.hpp
vendored
@ -28,9 +28,7 @@ class FieldPresenceIndicator {
|
||||
|
||||
void setFields(int) noexcept;
|
||||
|
||||
int getFields() const noexcept;
|
||||
|
||||
void setMaxLen(int) noexcept;
|
||||
void setMaxLen(int) noexcept;
|
||||
|
||||
int getMaxLen() const noexcept;
|
||||
|
||||
|
1
deps/ox/src/ox/mc/test/tests.cpp
vendored
1
deps/ox/src/ox/mc/test/tests.cpp
vendored
@ -13,7 +13,6 @@
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <ox/mc/mc.hpp>
|
||||
#include <ox/model/model.hpp>
|
||||
|
1
deps/ox/src/ox/mc/write.hpp
vendored
1
deps/ox/src/ox/mc/write.hpp
vendored
@ -216,7 +216,6 @@ Error MetalClawWriter::appendInteger(I val) noexcept {
|
||||
oxReturnError(m_fieldPresence.set(m_field, fieldSet));
|
||||
m_field++;
|
||||
return OxError(0);
|
||||
;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
1
deps/ox/src/ox/oc/test/tests.cpp
vendored
1
deps/ox/src/ox/oc/test/tests.cpp
vendored
@ -10,7 +10,6 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include <ox/model/model.hpp>
|
||||
#include <ox/oc/oc.hpp>
|
||||
|
13
deps/ox/src/ox/ptrarith/nodebuffer.hpp
vendored
13
deps/ox/src/ox/ptrarith/nodebuffer.hpp
vendored
@ -126,8 +126,6 @@ class OX_PACKED NodeBuffer {
|
||||
|
||||
[[nodiscard]] ItemPtr ptr(size_t offset);
|
||||
|
||||
[[nodiscard]] ItemPtr ptr(void *item);
|
||||
|
||||
[[nodiscard]] ItemPtr malloc(size_t size);
|
||||
|
||||
Error free(ItemPtr item);
|
||||
@ -159,9 +157,7 @@ class OX_PACKED NodeBuffer {
|
||||
template<typename F>
|
||||
Error compact(F cb = [](uint64_t, ItemPtr) {});
|
||||
|
||||
void truncate();
|
||||
|
||||
private:
|
||||
private:
|
||||
uint8_t *data();
|
||||
|
||||
};
|
||||
@ -268,7 +264,7 @@ typename NodeBuffer<size_t, Item>::ItemPtr NodeBuffer<size_t, Item>::malloc(size
|
||||
size_t fullSize = size + sizeof(Item);
|
||||
if (m_header.size - m_header.bytesUsed >= fullSize) {
|
||||
auto last = lastItem();
|
||||
size_t addr = 0;
|
||||
size_t addr;
|
||||
if (last.valid()) {
|
||||
addr = last.offset() + last.size();
|
||||
} else {
|
||||
@ -422,11 +418,6 @@ Error NodeBuffer<size_t, Item>::compact(F cb) {
|
||||
return OxError(0);
|
||||
}
|
||||
|
||||
template<typename size_t, typename Item>
|
||||
void NodeBuffer<size_t, Item>::truncate() {
|
||||
m_header.size = m_header.bytesUsed;
|
||||
}
|
||||
|
||||
template<typename size_t, typename Item>
|
||||
uint8_t *NodeBuffer<size_t, Item>::data() {
|
||||
return reinterpret_cast<uint8_t*>(ptr(sizeof(*this)).get());
|
||||
|
5
deps/ox/src/ox/ptrarith/test/tests.cpp
vendored
5
deps/ox/src/ox/ptrarith/test/tests.cpp
vendored
@ -9,18 +9,13 @@
|
||||
// make sure asserts are enabled for the test file
|
||||
#undef NDEBUG
|
||||
|
||||
#include <iostream>
|
||||
#include <assert.h>
|
||||
#include <array>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <ox/ptrarith/nodebuffer.hpp>
|
||||
#include <ox/fs/fs.hpp>
|
||||
#include <ox/std/std.hpp>
|
||||
#include <ox/fs/filestore/filestoretemplate.hpp>
|
||||
#include <ox/fs/filesystem/filesystem.hpp>
|
||||
|
||||
|
||||
using namespace std;
|
||||
using namespace ox;
|
||||
|
2
deps/ox/src/ox/std/assert.cpp
vendored
2
deps/ox/src/ox/std/assert.cpp
vendored
@ -7,11 +7,9 @@
|
||||
*/
|
||||
|
||||
#if defined(OX_USE_STDLIB)
|
||||
#include <bitset>
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
#include "defines.hpp"
|
||||
#include "stacktrace.hpp"
|
||||
#include "trace.hpp"
|
||||
|
||||
|
2
deps/ox/src/ox/std/random.hpp
vendored
2
deps/ox/src/ox/std/random.hpp
vendored
@ -22,7 +22,7 @@ class OX_PACKED Random {
|
||||
public:
|
||||
Random();
|
||||
|
||||
Random(RandomSeed seed);
|
||||
explicit Random(RandomSeed seed);
|
||||
|
||||
uint64_t gen();
|
||||
};
|
||||
|
2
deps/ox/src/ox/std/string.cpp
vendored
2
deps/ox/src/ox/std/string.cpp
vendored
@ -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
|
||||
}
|
||||
|
8
deps/ox/src/ox/std/test/tests.cpp
vendored
8
deps/ox/src/ox/std/test/tests.cpp
vendored
@ -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;
|
||||
}
|
||||
},
|
||||
{
|
||||
|
1
deps/ox/src/ox/std/trace.cpp
vendored
1
deps/ox/src/ox/std/trace.cpp
vendored
@ -9,7 +9,6 @@
|
||||
#if defined(OX_USE_STDLIB)
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#include "trace.hpp"
|
||||
|
Loading…
x
Reference in New Issue
Block a user