From cbbd3edc396f06d3bad16f4c7e72577e7476d4d9 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 4 Nov 2025 22:06:17 +0100 Subject: [PATCH] pandatool: Make WindowsGuid class trivially copyable Squelches compiler warning --- pandatool/src/xfile/windowsGuid.I | 24 ------------------------ pandatool/src/xfile/windowsGuid.h | 12 +++++------- 2 files changed, 5 insertions(+), 31 deletions(-) diff --git a/pandatool/src/xfile/windowsGuid.I b/pandatool/src/xfile/windowsGuid.I index 5d0ce22046..434182d70a 100644 --- a/pandatool/src/xfile/windowsGuid.I +++ b/pandatool/src/xfile/windowsGuid.I @@ -11,14 +11,6 @@ * @date 2004-10-03 */ -/** - * - */ -INLINE WindowsGuid:: -WindowsGuid() { - memset(this, 0, sizeof(WindowsGuid)); -} - /** * */ @@ -42,22 +34,6 @@ WindowsGuid(unsigned long data1, { } -/** - * - */ -INLINE WindowsGuid:: -WindowsGuid(const WindowsGuid ©) { - (*this) = copy; -} - -/** - * - */ -INLINE void WindowsGuid:: -operator = (const WindowsGuid ©) { - memcpy(this, ©, sizeof(WindowsGuid)); -} - /** * */ diff --git a/pandatool/src/xfile/windowsGuid.h b/pandatool/src/xfile/windowsGuid.h index ea79d0be5a..8c0e306993 100644 --- a/pandatool/src/xfile/windowsGuid.h +++ b/pandatool/src/xfile/windowsGuid.h @@ -25,14 +25,12 @@ */ class WindowsGuid { public: - INLINE WindowsGuid(); + constexpr WindowsGuid() = default; INLINE WindowsGuid(unsigned long data1, unsigned short data2, unsigned short data3, unsigned char b1, unsigned char b2, unsigned char b3, unsigned char b4, unsigned char b5, unsigned char b6, unsigned char b7, unsigned char b8); - INLINE WindowsGuid(const WindowsGuid ©); - INLINE void operator = (const WindowsGuid ©); INLINE bool operator == (const WindowsGuid &other) const; INLINE bool operator != (const WindowsGuid &other) const; @@ -45,10 +43,10 @@ public: void output(std::ostream &out) const; private: - unsigned long _data1; - unsigned short _data2; - unsigned short _data3; - unsigned char _b1, _b2, _b3, _b4, _b5, _b6, _b7, _b8; + unsigned long _data1 = 0; + unsigned short _data2 = 0; + unsigned short _data3 = 0; + unsigned char _b1 = 0, _b2 = 0, _b3 = 0, _b4 = 0, _b5 = 0, _b6 = 0, _b7 = 0, _b8 = 0; }; INLINE std::ostream &operator << (std::ostream &out, const WindowsGuid &guid);