From e01de52283efe0bd8fa107bd493df302c070204e Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Fri, 10 Apr 2015 14:57:04 +0200 Subject: [PATCH] More whitespace cleanup all over the place. --- headers/os/interface/AbstractLayout.h | 4 +- headers/os/interface/GroupLayout.h | 6 +-- headers/private/system/syscalls.h | 2 +- src/kits/interface/AbstractLayout.cpp | 2 +- src/kits/interface/CardLayout.cpp | 6 +-- src/kits/support/BlockCache.cpp | 56 +++++++++++++++------------ 6 files changed, 41 insertions(+), 35 deletions(-) diff --git a/headers/os/interface/AbstractLayout.h b/headers/os/interface/AbstractLayout.h index 3c88981d55..34eb34018f 100644 --- a/headers/os/interface/AbstractLayout.h +++ b/headers/os/interface/AbstractLayout.h @@ -31,7 +31,7 @@ public: virtual BAlignment BaseAlignment(); virtual BRect Frame(); - virtual void SetFrame(BRect frame); + virtual void SetFrame(BRect frame); virtual bool IsVisible(); virtual void SetVisible(bool visible); @@ -42,7 +42,7 @@ public: protected: // Archiving hook methods - virtual status_t AllArchived(BMessage* archive) const; + virtual status_t AllArchived(BMessage* archive) const; virtual status_t AllUnarchived(const BMessage* from); virtual status_t ItemArchived(BMessage* into, BLayoutItem* item, diff --git a/headers/os/interface/GroupLayout.h b/headers/os/interface/GroupLayout.h index d706b669bf..c15c5dd017 100644 --- a/headers/os/interface/GroupLayout.h +++ b/headers/os/interface/GroupLayout.h @@ -19,7 +19,7 @@ public: orientation Orientation() const; void SetOrientation(orientation orientation); - + float ItemWeight(int32 index) const; void SetItemWeight(int32 index, float weight); @@ -40,7 +40,7 @@ public: virtual status_t Perform(perform_code d, void* arg); -protected: +protected: virtual status_t AllArchived(BMessage* into) const; virtual status_t AllUnarchived(const BMessage* from); virtual status_t ItemArchived(BMessage* into, BLayoutItem* item, @@ -52,7 +52,7 @@ protected: virtual void ItemRemoved(BLayoutItem* item, int32 fromIndex); virtual void PrepareItems(orientation orientation); - + virtual int32 InternalCountColumns(); virtual int32 InternalCountRows(); virtual void GetColumnRowConstraints( diff --git a/headers/private/system/syscalls.h b/headers/private/system/syscalls.h index 86d407bbfe..51a52138c1 100644 --- a/headers/private/system/syscalls.h +++ b/headers/private/system/syscalls.h @@ -448,7 +448,7 @@ extern status_t _kern_close_port(port_id id); extern status_t _kern_delete_port(port_id id); extern port_id _kern_find_port(const char *port_name); extern status_t _kern_get_port_info(port_id id, struct port_info *info); -extern status_t _kern_get_next_port_info(team_id team, int32 *cookie, +extern status_t _kern_get_next_port_info(team_id team, int32 *cookie, struct port_info *info); extern ssize_t _kern_port_buffer_size_etc(port_id port, uint32 flags, bigtime_t timeout); diff --git a/src/kits/interface/AbstractLayout.cpp b/src/kits/interface/AbstractLayout.cpp index e61cd09964..ac9c29f2b9 100644 --- a/src/kits/interface/AbstractLayout.cpp +++ b/src/kits/interface/AbstractLayout.cpp @@ -51,7 +51,7 @@ struct BAbstractLayout::Proxy { virtual bool IsVisible(bool ancestorHidden) const = 0; virtual void SetVisible(bool visible) = 0; - + virtual status_t AddDataToArchive(BMessage* archive, bool ancestorHidden) = 0; virtual status_t RestoreDataFromArchive(const BMessage* archive) = 0; diff --git a/src/kits/interface/CardLayout.cpp b/src/kits/interface/CardLayout.cpp index 01844f2ea1..28e79b5109 100644 --- a/src/kits/interface/CardLayout.cpp +++ b/src/kits/interface/CardLayout.cpp @@ -193,8 +193,8 @@ BCardLayout::DoLayout() size.width = max_c(size.width, fMin.width); size.height = max_c(size.height, fMin.height); } - - if (fVisibleItem != NULL) + + if (fVisibleItem != NULL) fVisibleItem->AlignInFrame(BRect(LayoutArea().LeftTop(), size)); } @@ -258,7 +258,7 @@ BCardLayout::Instantiate(BMessage* from) return new BCardLayout(from); return NULL; } - + bool BCardLayout::ItemAdded(BLayoutItem* item, int32 atIndex) diff --git a/src/kits/support/BlockCache.cpp b/src/kits/support/BlockCache.cpp index b699ff5fee..1cebf9d5bc 100644 --- a/src/kits/support/BlockCache.cpp +++ b/src/kits/support/BlockCache.cpp @@ -1,22 +1,22 @@ /* * Copyright (c) 2003 Marcus Overhagen - * - * 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 + * + * 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 * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in + * + * 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 THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * 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 + * + * 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 THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * 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. */ @@ -26,9 +26,11 @@ #include #include + #define MAGIC1 0x9183f4d9 #define MAGIC2 0xa6b3c87d + struct BBlockCache::_FreeBlock { DEBUG_ONLY( uint32 magic1; ) _FreeBlock *next; @@ -42,16 +44,16 @@ struct BBlockCache::_FreeBlock { // Thus we need to create multiple small ones. // We maintain a list of free blocks. -BBlockCache::BBlockCache(uint32 blockCount, - size_t blockSize, - uint32 allocationType) - : fFreeList(0), - fBlockSize(blockSize), - fFreeBlocks(0), - fBlockCount(blockCount), +BBlockCache::BBlockCache(uint32 blockCount, size_t blockSize, + uint32 allocationType) + : + fFreeList(0), + fBlockSize(blockSize), + fFreeBlocks(0), + fBlockCount(blockCount), fLocker("some BBlockCache lock"), fAlloc(0), - fFree(0) + fFree(0) { switch (allocationType) { case B_OBJECT_CACHE: @@ -69,11 +71,11 @@ BBlockCache::BBlockCache(uint32 blockCount, // large enough to contain the _FreeBlock struct that is used. if (blockSize < sizeof(_FreeBlock)) blockSize = sizeof(_FreeBlock); - + // should have at least one block if (blockCount == 0) blockCount = 1; - + // create blocks and put them into the free list while (blockCount--) { _FreeBlock *block = reinterpret_cast<_FreeBlock *>(fAlloc(blockSize)); @@ -87,6 +89,7 @@ BBlockCache::BBlockCache(uint32 blockCount, } } + BBlockCache::~BBlockCache() { // walk the free list and deallocate all blocks @@ -102,6 +105,7 @@ BBlockCache::~BBlockCache() fLocker.Unlock(); } + void * BBlockCache::Get(size_t blockSize) { @@ -126,6 +130,7 @@ BBlockCache::Get(size_t blockSize) return pointer; } + void BBlockCache::Save(void *pointer, size_t blockSize) { @@ -146,5 +151,6 @@ BBlockCache::Save(void *pointer, size_t blockSize) fLocker.Unlock(); } + void BBlockCache::_ReservedBlockCache1() {} void BBlockCache::_ReservedBlockCache2() {}