From e4f18add748de01b88e9be4b8289133b2a99f524 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 17 Nov 2021 18:45:58 -0500 Subject: [PATCH] Game & Print Kits: Fix GCC 11 warnings. --- headers/private/print/BeUtils.h | 18 +++++++++--------- src/kits/game/WindowScreen.cpp | 2 +- src/kits/print/BeUtils.cpp | 25 +++++++++++++++---------- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/headers/private/print/BeUtils.h b/headers/private/print/BeUtils.h index 54a0485c68..e237187b17 100644 --- a/headers/private/print/BeUtils.h +++ b/headers/private/print/BeUtils.h @@ -11,8 +11,8 @@ // Ithamar R. Adema // Michael Pfeiffer // -// This application and all source files used in its construction, except -// where noted, are licensed under the MIT License, and have been written +// This application and all source files used in its construction, except +// where noted, are licensed under the MIT License, and have been written // and are: // // Copyright (c) 2001, 2002 Haiku Project @@ -20,18 +20,18 @@ // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // -// The above copyright notice and this permission notice shall be included +// The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. /*****************************************************************************/ @@ -59,7 +59,7 @@ public: // After construction reference count is 1 Object() : fRefCount(1) { } // dtor should be private, but ie. ObjectList requires a public dtor! - virtual ~Object() { }; + virtual ~Object(); // thread-safe as long as thread that calls Acquire has already // a reference to the object @@ -81,7 +81,7 @@ public: class AutoReply { BMessage* fSender; BMessage fReply; - + public: AutoReply(BMessage* sender, uint32 what); ~AutoReply(); diff --git a/src/kits/game/WindowScreen.cpp b/src/kits/game/WindowScreen.cpp index ffc0026b94..7ba130ab8e 100644 --- a/src/kits/game/WindowScreen.cpp +++ b/src/kits/game/WindowScreen.cpp @@ -618,7 +618,7 @@ BWindowScreen::_InitData(uint32 space, uint32 attributes) if (fDebugSem < B_OK) throw (status_t)fDebugSem; - memcpy(fPalette, screen.ColorMap()->color_list, sizeof(fPalette)); + memcpy((void*)fPalette, screen.ColorMap()->color_list, sizeof(fPalette)); fActivateState = false; fWorkState = true; diff --git a/src/kits/print/BeUtils.cpp b/src/kits/print/BeUtils.cpp index 8300bf9ff3..e6afc186d6 100644 --- a/src/kits/print/BeUtils.cpp +++ b/src/kits/print/BeUtils.cpp @@ -11,8 +11,8 @@ // Ithamar R. Adema // Michael Pfeiffer // -// This application and all source files used in its construction, except -// where noted, are licensed under the MIT License, and have been written +// This application and all source files used in its construction, except +// where noted, are licensed under the MIT License, and have been written // and are: // // Copyright (c) 2001, 2002 Haiku Project @@ -20,18 +20,18 @@ // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // -// The above copyright notice and this permission notice shall be included +// The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. /*****************************************************************************/ @@ -58,7 +58,7 @@ status_t TestForAddonExistence(const char* name, directory_which which, const char* section, BPath& outPath) { status_t err = B_OK; - + if ((err=find_directory(which, &outPath)) == B_OK && (err=outPath.Append(section)) == B_OK && (err=outPath.Append(name)) == B_OK) @@ -66,15 +66,20 @@ status_t TestForAddonExistence(const char* name, directory_which which, const ch struct stat buf; err = stat(outPath.Path(), &buf); } - + return err; } +// Implementation of Object + +Object::~Object() { +} + // Implementation of AutoReply AutoReply::AutoReply(BMessage* sender, uint32 what) : fSender(sender) - , fReply(what) + , fReply(what) { }