Game & Print Kits: Fix GCC 11 warnings.

This commit is contained in:
Augustin Cavalier
2021-11-17 18:45:58 -05:00
parent f7338bb6a0
commit e4f18add74
3 changed files with 25 additions and 20 deletions
+9 -9
View File
@@ -11,8 +11,8 @@
// Ithamar R. Adema // Ithamar R. Adema
// Michael Pfeiffer // Michael Pfeiffer
// //
// This application and all source files used in its construction, except // This application and all source files used in its construction, except
// where noted, are licensed under the MIT License, and have been written // where noted, are licensed under the MIT License, and have been written
// and are: // and are:
// //
// Copyright (c) 2001, 2002 Haiku Project // Copyright (c) 2001, 2002 Haiku Project
@@ -20,18 +20,18 @@
// Permission is hereby granted, free of charge, to any person obtaining a // Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"), // copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation // to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense, // the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the // 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: // 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. // in all copies or substantial portions of the Software.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 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 // 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 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
/*****************************************************************************/ /*****************************************************************************/
@@ -59,7 +59,7 @@ public:
// After construction reference count is 1 // After construction reference count is 1
Object() : fRefCount(1) { } Object() : fRefCount(1) { }
// dtor should be private, but ie. ObjectList requires a public dtor! // 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 // thread-safe as long as thread that calls Acquire has already
// a reference to the object // a reference to the object
@@ -81,7 +81,7 @@ public:
class AutoReply { class AutoReply {
BMessage* fSender; BMessage* fSender;
BMessage fReply; BMessage fReply;
public: public:
AutoReply(BMessage* sender, uint32 what); AutoReply(BMessage* sender, uint32 what);
~AutoReply(); ~AutoReply();
+1 -1
View File
@@ -618,7 +618,7 @@ BWindowScreen::_InitData(uint32 space, uint32 attributes)
if (fDebugSem < B_OK) if (fDebugSem < B_OK)
throw (status_t)fDebugSem; throw (status_t)fDebugSem;
memcpy(fPalette, screen.ColorMap()->color_list, sizeof(fPalette)); memcpy((void*)fPalette, screen.ColorMap()->color_list, sizeof(fPalette));
fActivateState = false; fActivateState = false;
fWorkState = true; fWorkState = true;
+15 -10
View File
@@ -11,8 +11,8 @@
// Ithamar R. Adema // Ithamar R. Adema
// Michael Pfeiffer // Michael Pfeiffer
// //
// This application and all source files used in its construction, except // This application and all source files used in its construction, except
// where noted, are licensed under the MIT License, and have been written // where noted, are licensed under the MIT License, and have been written
// and are: // and are:
// //
// Copyright (c) 2001, 2002 Haiku Project // Copyright (c) 2001, 2002 Haiku Project
@@ -20,18 +20,18 @@
// Permission is hereby granted, free of charge, to any person obtaining a // Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"), // copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation // to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense, // the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the // 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: // 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. // in all copies or substantial portions of the Software.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // 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 // 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 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
/*****************************************************************************/ /*****************************************************************************/
@@ -58,7 +58,7 @@
status_t TestForAddonExistence(const char* name, directory_which which, const char* section, BPath& outPath) status_t TestForAddonExistence(const char* name, directory_which which, const char* section, BPath& outPath)
{ {
status_t err = B_OK; status_t err = B_OK;
if ((err=find_directory(which, &outPath)) == B_OK && if ((err=find_directory(which, &outPath)) == B_OK &&
(err=outPath.Append(section)) == B_OK && (err=outPath.Append(section)) == B_OK &&
(err=outPath.Append(name)) == 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; struct stat buf;
err = stat(outPath.Path(), &buf); err = stat(outPath.Path(), &buf);
} }
return err; return err;
} }
// Implementation of Object
Object::~Object() {
}
// Implementation of AutoReply // Implementation of AutoReply
AutoReply::AutoReply(BMessage* sender, uint32 what) AutoReply::AutoReply(BMessage* sender, uint32 what)
: fSender(sender) : fSender(sender)
, fReply(what) , fReply(what)
{ {
} }