From b6f699d513f8e2848d22c789af974f65eb3517b8 Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Tue, 23 Sep 2025 00:14:53 +0100 Subject: [PATCH] First batch of GCC/Ubuntu 24.04 warnings --- components/debug/debugdraw.cpp | 4 +-- components/misc/utf8stream.hpp | 48 +++++++++++++++---------------- components/sceneutil/keyframe.hpp | 5 ++-- 3 files changed, 29 insertions(+), 28 deletions(-) diff --git a/components/debug/debugdraw.cpp b/components/debug/debugdraw.cpp index f1a38bde57..f085b9407f 100644 --- a/components/debug/debugdraw.cpp +++ b/components/debug/debugdraw.cpp @@ -92,12 +92,12 @@ static void generateCube(osg::Geometry& geom, float dim) normals->push_back(normale); } GLushort startVertex(iFace * 4); - GLushort newFace1[] = { startVertex, startVertex + 1u, startVertex + 2u }; + GLushort newFace1[] = { startVertex, static_cast(startVertex + 1u), static_cast(startVertex + 2u) }; for (int i = 0; i < 3; i++) { indices->push_back(newFace1[i]); } - GLushort newFace2[] = { startVertex + 2u, startVertex + 1u, startVertex + 3u }; + GLushort newFace2[] = { static_cast(startVertex + 2u), static_cast(startVertex + 1u), static_cast(startVertex + 3u) }; for (int i = 0; i < 3; i++) { indices->push_back(newFace2[i]); diff --git a/components/misc/utf8stream.hpp b/components/misc/utf8stream.hpp index 5eb5f99b84..d705ddb3a7 100644 --- a/components/misc/utf8stream.hpp +++ b/components/misc/utf8stream.hpp @@ -17,26 +17,26 @@ public: static UnicodeChar sBadChar() { return UnicodeChar(0xFFFFFFFF); } Utf8Stream(Point begin, Point end) - : cur(begin) - , nxt(begin) - , end(end) - , val(Utf8Stream::sBadChar()) + : mCur(begin) + , mNxt(begin) + , mEnd(end) + , mVal(Utf8Stream::sBadChar()) { } Utf8Stream(const char* str) - : cur(reinterpret_cast(str)) - , nxt(reinterpret_cast(str)) - , end(reinterpret_cast(str) + strlen(str)) - , val(Utf8Stream::sBadChar()) + : mCur(reinterpret_cast(str)) + , mNxt(reinterpret_cast(str)) + , mEnd(reinterpret_cast(str) + strlen(str)) + , mVal(Utf8Stream::sBadChar()) { } Utf8Stream(std::pair range) - : cur(range.first) - , nxt(range.first) - , end(range.second) - , val(Utf8Stream::sBadChar()) + : mCur(range.first) + , mNxt(range.first) + , mEnd(range.second) + , mVal(Utf8Stream::sBadChar()) { } @@ -45,23 +45,23 @@ public: { } - bool eof() const { return cur == end; } + bool eof() const { return mCur == mEnd; } - Point current() const { return cur; } + Point current() const { return mCur; } UnicodeChar peek() { - if (cur == nxt) + if (mCur == mNxt) next(); - return val; + return mVal; } UnicodeChar consume() { - if (cur == nxt) + if (mCur == mNxt) next(); - cur = nxt; - return val; + mCur = mNxt; + return mVal; } static bool isAscii(unsigned char value) { return (value & 0x80) == 0; } @@ -189,12 +189,12 @@ public: } private: - void next() { std::tie(val, nxt) = decode(nxt, end); } + void next() { std::tie(mVal, mNxt) = decode(mNxt, mEnd); } - Point cur; - Point nxt; - Point end; - UnicodeChar val; + Point mCur; + Point mNxt; + Point mEnd; + UnicodeChar mVal; }; #endif diff --git a/components/sceneutil/keyframe.hpp b/components/sceneutil/keyframe.hpp index 391a3aafc4..16ca400aaf 100644 --- a/components/sceneutil/keyframe.hpp +++ b/components/sceneutil/keyframe.hpp @@ -17,8 +17,9 @@ namespace SceneUtil public: KeyframeController() {} - KeyframeController(const KeyframeController& copy) - : SceneUtil::Controller(copy) + KeyframeController(const KeyframeController& copy, const osg::CopyOp& copyop) + : osg::Object(copy, copyop) + , SceneUtil::Controller(copy) { }