diff --git a/headers/private/userlandfs/shared/HashMap.h b/headers/private/userlandfs/shared/HashMap.h index 7a748e938a..ad63811ed1 100644 --- a/headers/private/userlandfs/shared/HashMap.h +++ b/headers/private/userlandfs/shared/HashMap.h @@ -130,9 +130,9 @@ public: friend class HashMap; typedef OpenHashTable > ElementTable; - HashMap* fMap; - ElementTable::Iterator fIterator; - Element* fElement; + HashMap* fMap; + typename ElementTable::Iterator fIterator; + Element* fElement; }; HashMap(); diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp b/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp index 9705550289..a044d821c7 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp +++ b/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp @@ -97,7 +97,7 @@ UserlandFSServer::Init(const char* fileSystem, port_id port) RETURN_ERROR(error); // create the notification request port - fNotificationRequestPort = new(nothrow) RequestPort(kRequestPortSize); + fNotificationRequestPort = new(std::nothrow) RequestPort(kRequestPortSize); if (!fNotificationRequestPort) RETURN_ERROR(B_NO_MEMORY); error = fNotificationRequestPort->InitCheck(); @@ -105,7 +105,7 @@ UserlandFSServer::Init(const char* fileSystem, port_id port) RETURN_ERROR(error); // now create the request threads - fRequestThreads = new(nothrow) RequestThread[kRequestThreadCount]; + fRequestThreads = new(std::nothrow) RequestThread[kRequestThreadCount]; if (!fRequestThreads) RETURN_ERROR(B_NO_MEMORY); for (int32 i = 0; i < kRequestThreadCount; i++) { diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/haiku/HaikuKernelVolume.cpp b/src/add-ons/kernel/file_systems/userlandfs/server/haiku/HaikuKernelVolume.cpp index 0e9fba420f..ae0c5e34ff 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/haiku/HaikuKernelVolume.cpp +++ b/src/add-ons/kernel/file_systems/userlandfs/server/haiku/HaikuKernelVolume.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include "AutoDeleter.h" @@ -53,7 +54,7 @@ HaikuKernelVolume::HaikuKernelVolume(FileSystem* fileSystem, dev_t id, fVolume.sub_volume = NULL; fVolume.super_volume = NULL; fVolume.file_system = fFSModule; - fVolume.file_system_name = "dummy"; // TODO: Init correctly! + fVolume.file_system_name = strdup("dummy"); // TODO: Init correctly! fVolume.haikuVolume = this; } diff --git a/src/system/kernel/cache/block_cache.cpp b/src/system/kernel/cache/block_cache.cpp index 5cc2b436ce..36fd6127b8 100644 --- a/src/system/kernel/cache/block_cache.cpp +++ b/src/system/kernel/cache/block_cache.cpp @@ -1877,7 +1877,7 @@ cache_start_transaction(void* _cache) cache->last_transaction->id); } - cache_transaction* transaction = new(nothrow) cache_transaction; + cache_transaction* transaction = new(std::nothrow) cache_transaction; if (transaction == NULL) return B_NO_MEMORY; @@ -2096,7 +2096,7 @@ cache_detach_sub_transaction(void* _cache, int32 id, return B_BAD_VALUE; // create a new transaction for the sub transaction - cache_transaction* newTransaction = new(nothrow) cache_transaction; + cache_transaction* newTransaction = new(std::nothrow) cache_transaction; if (transaction == NULL) return B_NO_MEMORY; @@ -2466,7 +2466,7 @@ block_cache_delete(void* _cache, bool allowWrites) void* block_cache_create(int fd, off_t numBlocks, size_t blockSize, bool readOnly) { - block_cache* cache = new(nothrow) block_cache(fd, numBlocks, blockSize, + block_cache* cache = new(std::nothrow) block_cache(fd, numBlocks, blockSize, readOnly); if (cache == NULL) return NULL; diff --git a/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/BlockAllocator.cpp b/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/BlockAllocator.cpp index d7b015a5d4..41893439bf 100644 --- a/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/BlockAllocator.cpp +++ b/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/BlockAllocator.cpp @@ -3,6 +3,8 @@ // debugging #define BA_DEFINE_INLINES 1 +#include + #include "AllocationInfo.h" #include "BlockAllocator.h" #include "BlockAllocatorArea.h" @@ -23,7 +25,7 @@ BlockAllocator::BlockAllocator(size_t areaSize) { // create and init buckets fBucketCount = bucket_containing_size(areaSize) + 1; - fBuckets = new(nothrow) AreaBucket[fBucketCount]; + fBuckets = new(std::nothrow) AreaBucket[fBucketCount]; size_t minSize = 0; for (int32 i = 0; i < fBucketCount; i++) { size_t maxSize = (1 << i) * kMinNetBlockSize; diff --git a/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/BlockAllocatorMisc.h b/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/BlockAllocatorMisc.h index eb8f8fdc10..d9d184b474 100644 --- a/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/BlockAllocatorMisc.h +++ b/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/BlockAllocatorMisc.h @@ -33,4 +33,4 @@ bucket_containing_min_size(size_t size) { return (size ? bucket_containing_size(size - 1) + 1 : 0); } -#endif BLOCK_ALLOCATOR_MISC_H +#endif // BLOCK_ALLOCATOR_MISC_H diff --git a/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/BlockReferenceManager.cpp b/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/BlockReferenceManager.cpp index ebf78ccc48..6193c2cf9f 100644 --- a/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/BlockReferenceManager.cpp +++ b/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/BlockReferenceManager.cpp @@ -1,5 +1,7 @@ // BlockReferenceManager.cpp +#include + #include "AllocationInfo.h" #include "Block.h" #include "BlockAllocator.h" // only for BA_PANIC @@ -119,7 +121,7 @@ BlockReferenceManager::Table::Init(int32 size) { status_t error = (size > 0 ? B_OK : B_BAD_VALUE); if (error == B_OK) { - fReferences = new(nothrow) BlockReference[size]; + fReferences = new(std::nothrow) BlockReference[size]; if (fReferences) fSize = size; else diff --git a/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Directory.cpp b/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Directory.cpp index e96fa094be..a9dc77b1e5 100644 --- a/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Directory.cpp +++ b/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Directory.cpp @@ -1,5 +1,7 @@ // Directory.cpp +#include + #include "AllocationInfo.h" #include "Debug.h" #include "Directory.h" @@ -75,7 +77,7 @@ Directory::CreateDirectory(const char *name, Directory **directory) status_t error = (name && directory ? B_OK : B_BAD_VALUE); if (error == B_OK) { // create directory - if (Directory *node = new(nothrow) Directory(GetVolume())) { + if (Directory *node = new(std::nothrow) Directory(GetVolume())) { error = _CreateCommon(node, name); // deletes the node on failure if (error == B_OK) @@ -93,7 +95,7 @@ Directory::CreateFile(const char *name, File **file) status_t error = (name && file ? B_OK : B_BAD_VALUE); if (error == B_OK) { // create file - if (File *node = new(nothrow) File(GetVolume())) { + if (File *node = new(std::nothrow) File(GetVolume())) { error = _CreateCommon(node, name); // deletes the node on failure if (error == B_OK) @@ -111,7 +113,7 @@ Directory::CreateSymLink(const char *name, const char *path, SymLink **symLink) status_t error = (name && symLink ? B_OK : B_BAD_VALUE); if (error == B_OK) { // create symlink - if (SymLink *node = new(nothrow) SymLink(GetVolume())) { + if (SymLink *node = new(std::nothrow) SymLink(GetVolume())) { error = node->SetLinkedPath(path); if (error == B_OK) { error = _CreateCommon(node, name); @@ -152,7 +154,7 @@ Directory::CreateEntry(Node *node, const char *name, Entry **_entry) status_t error = (node ? B_OK : B_BAD_VALUE); if (error == B_OK) { // create an entry - Entry *entry = new(nothrow) Entry(name); + Entry *entry = new(std::nothrow) Entry(name); if (entry) { error = entry->InitCheck(); if (error == B_OK) { diff --git a/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/List.h b/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/List.h index 710ea25c70..724b6f4c34 100644 --- a/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/List.h +++ b/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/List.h @@ -4,14 +4,14 @@ // // 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 +// 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 // 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 @@ -19,7 +19,7 @@ // 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. -// +// // Except as contained in this notice, the name of a copyright holder shall // not be used in advertising or otherwise to promote the sale, use or other // dealings in this Software without prior written authorization of the @@ -28,10 +28,11 @@ #ifndef LIST_H #define LIST_H -#include #include #include +#include + #include template diff --git a/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/OpenHashTable.h b/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/OpenHashTable.h index fd618c07d7..9ddc7c3e1e 100644 --- a/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/OpenHashTable.h +++ b/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/OpenHashTable.h @@ -45,8 +45,9 @@ All rights reserved. #ifndef __OPEN_HASH_TABLE__ #define __OPEN_HASH_TABLE__ -#include -#include +#include + +#include #include "AreaUtils.h" #include "Misc.h" diff --git a/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/kernel_interface.cpp b/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/kernel_interface.cpp index 331f578214..6d03c4f3b4 100644 --- a/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/kernel_interface.cpp +++ b/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/kernel_interface.cpp @@ -7,12 +7,12 @@ // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA @@ -31,6 +31,8 @@ #include #include +#include + #include #include #include @@ -272,7 +274,7 @@ ramfs_mount(nspace_id nsid, const char */*device*/, ulong flags, // allocate and init the volume Volume *volume = NULL; if (error == B_OK) { - volume = new(nothrow) Volume; + volume = new(std::nothrow) Volume; if (!volume) SET_ERROR(error, B_NO_MEMORY); if (error == B_OK) @@ -312,7 +314,7 @@ ramfs_unmount(void *ns) // ramfs_initialize static -int +int ramfs_initialize(const char */*deviceName*/, void */*parameters*/, size_t /*len*/) { @@ -630,7 +632,7 @@ ramfs_create(void *ns, void *_dir, const char *name, int openMode, // create the file cookie FileCookie *cookie = NULL; if (error == B_OK) { - cookie = new(nothrow) FileCookie(openMode); + cookie = new(std::nothrow) FileCookie(openMode); if (!cookie) SET_ERROR(error, B_NO_MEMORY); } @@ -713,7 +715,7 @@ FUNCTION(("node: %Ld\n", node->GetID())); // create the cookie FileCookie *cookie = NULL; if (error == B_OK) { - cookie = new(nothrow) FileCookie(openMode); + cookie = new(std::nothrow) FileCookie(openMode); if (!cookie) SET_ERROR(error, B_NO_MEMORY); } @@ -1275,7 +1277,7 @@ FUNCTION(("dir: (%Lu)\n", node->GetID())); } // create a DirectoryCookie if (error == B_OK) { - DirectoryCookie *cookie = new(nothrow) DirectoryCookie(dir); + DirectoryCookie *cookie = new(std::nothrow) DirectoryCookie(dir); if (cookie) { error = cookie->Suspend(); if (error == B_OK) @@ -1343,7 +1345,7 @@ ramfs_rewind_dir(void */*ns*/, void */*_node*/, void *_cookie) { FUNCTION_START(); // No locking needed, since the Directory is guaranteed to live at this - // time and for iterators there is a separate locking. + // time and for iterators there is a separate locking. DirectoryCookie *cookie = (DirectoryCookie*)_cookie; // no need to Resume(), iterator remains suspended status_t error = cookie->Rewind(); @@ -1358,7 +1360,7 @@ ramfs_close_dir(void */*ns*/, void *DARG(_node), void *_cookie) FUNCTION_START(); FUNCTION(("dir: (%Lu)\n", ((Node*)_node)->GetID())); // No locking needed, since the Directory is guaranteed to live at this - // time and for iterators there is a separate locking. + // time and for iterators there is a separate locking. DirectoryCookie *cookie = (DirectoryCookie*)_cookie; cookie->Unset(); return B_OK; @@ -1514,7 +1516,7 @@ ramfs_read_link(void *ns, void *_node, char *buffer, size_t *bufferSize) // ramfs_open_attrdir static -int +int ramfs_open_attrdir(void *ns, void *_node, void **cookie) { FUNCTION_START(); @@ -1527,7 +1529,7 @@ ramfs_open_attrdir(void *ns, void *_node, void **cookie) // create iterator AttributeIterator *iterator = NULL; if (error == B_OK) { - iterator = new(nothrow) AttributeIterator(node); + iterator = new(std::nothrow) AttributeIterator(node); if (iterator) error = iterator->Suspend(); else @@ -1550,7 +1552,7 @@ ramfs_close_attrdir(void */*ns*/, void */*_node*/, void *cookie) { FUNCTION_START(); // No locking needed, since the Node is guaranteed to live at this time - // and for iterators there is a separate locking. + // and for iterators there is a separate locking. AttributeIterator *iterator = (AttributeIterator*)cookie; iterator->Unset(); return B_OK; @@ -1563,7 +1565,7 @@ ramfs_free_attrdir_cookie(void */*ns*/, void */*_node*/, void *cookie) { FUNCTION_START(); // No locking needed, since the Node is guaranteed to live at this time - // and for iterators there is a separate locking. + // and for iterators there is a separate locking. AttributeIterator *iterator = (AttributeIterator*)cookie; delete iterator; return B_OK; @@ -1576,7 +1578,7 @@ ramfs_rewind_attrdir(void */*ns*/, void */*_node*/, void *cookie) { FUNCTION_START(); // No locking needed, since the Node is guaranteed to live at this time - // and for iterators there is a separate locking. + // and for iterators there is a separate locking. AttributeIterator *iterator = (AttributeIterator*)cookie; // no need to Resume(), iterator remains suspended status_t error = iterator->Rewind(); @@ -1585,7 +1587,7 @@ ramfs_rewind_attrdir(void */*ns*/, void */*_node*/, void *cookie) // ramfs_read_attrdir static -int +int ramfs_read_attrdir(void *ns, void */*_node*/, void *cookie, long *count, struct dirent *buffer, size_t bufferSize) { @@ -1782,7 +1784,7 @@ ramfs_open_indexdir(void *ns, void **_cookie) if (VolumeReadLocker locker = volume) { // check whether an index directory exists if (volume->GetIndexDirectory()) { - IndexDirCookie *cookie = new(nothrow) IndexDirCookie; + IndexDirCookie *cookie = new(std::nothrow) IndexDirCookie; if (cookie) *_cookie = cookie; else diff --git a/src/tests/add-ons/kernel/kernelland_emu/debug.cpp b/src/tests/add-ons/kernel/kernelland_emu/debug.cpp index 367bcdc74e..a65cffe5ae 100644 --- a/src/tests/add-ons/kernel/kernelland_emu/debug.cpp +++ b/src/tests/add-ons/kernel/kernelland_emu/debug.cpp @@ -8,7 +8,9 @@ */ #include -#include +#include +#include +#include #include diff --git a/src/tests/add-ons/kernel/kernelland_emu/vm.cpp b/src/tests/add-ons/kernel/kernelland_emu/vm.cpp index 8c7d56c920..22c088237f 100644 --- a/src/tests/add-ons/kernel/kernelland_emu/vm.cpp +++ b/src/tests/add-ons/kernel/kernelland_emu/vm.cpp @@ -7,7 +7,7 @@ * Axel Dörfler, axeld@pinc-software.de. */ -#include +#include #include