fix compiler warnings (GCC + Clang)

This commit is contained in:
MihailRis
2025-03-20 22:04:29 +03:00
parent 6c3d2d0907
commit 3d22de761f
50 changed files with 80 additions and 103 deletions
+2 -2
View File
@@ -6,7 +6,7 @@
#include "util/stringutil.hpp"
namespace {
int is_box(int c) {
inline int is_box(int c) {
switch (c) {
case 'B':
case 'b':
@@ -21,7 +21,7 @@ namespace {
return 10;
}
double power(double base, int64_t power) {
inline double power(double base, int64_t power) {
double result = 1.0;
for (int64_t i = 0; i < power; i++) {
result *= base;
-1
View File
@@ -30,7 +30,6 @@ class TomlReader : BasicParser<char> {
// todo: extract common part
std::string parseMultilineString() {
pos += 2;
char next = peek();
std::stringstream ss;
while (hasNext()) {
+2 -2
View File
@@ -68,7 +68,7 @@ static model::Mesh build_mesh(
const glm::vec2* uvs = nullptr;
const glm::vec3* normals = nullptr;
int coordsIndex, uvsIndex, normalsIndex;
int coordsIndex = 0, uvsIndex = 0, normalsIndex = 0;
for (int i = 0; i < attrs.size(); i++) {
const auto& attr = attrs[i];
@@ -204,7 +204,7 @@ File vec3::load(
// Header
reader.checkMagic("\0\0VEC3\0\0", 8);
int version = reader.getInt16();
int reserved = reader.getInt16();
[[maybe_unused]] int reserved = reader.getInt16();
if (version > VERSION) {
throw std::runtime_error("unsupported VEC3 version");
}