gcc 4 fixes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29602 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -130,9 +130,9 @@ public:
|
|||||||
friend class HashMap<Key, Value>;
|
friend class HashMap<Key, Value>;
|
||||||
typedef OpenHashTable<HashMapTableDefinition<Key, Value> > ElementTable;
|
typedef OpenHashTable<HashMapTableDefinition<Key, Value> > ElementTable;
|
||||||
|
|
||||||
HashMap<Key, Value>* fMap;
|
HashMap<Key, Value>* fMap;
|
||||||
ElementTable::Iterator fIterator;
|
typename ElementTable::Iterator fIterator;
|
||||||
Element* fElement;
|
Element* fElement;
|
||||||
};
|
};
|
||||||
|
|
||||||
HashMap();
|
HashMap();
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ UserlandFSServer::Init(const char* fileSystem, port_id port)
|
|||||||
RETURN_ERROR(error);
|
RETURN_ERROR(error);
|
||||||
|
|
||||||
// create the notification request port
|
// create the notification request port
|
||||||
fNotificationRequestPort = new(nothrow) RequestPort(kRequestPortSize);
|
fNotificationRequestPort = new(std::nothrow) RequestPort(kRequestPortSize);
|
||||||
if (!fNotificationRequestPort)
|
if (!fNotificationRequestPort)
|
||||||
RETURN_ERROR(B_NO_MEMORY);
|
RETURN_ERROR(B_NO_MEMORY);
|
||||||
error = fNotificationRequestPort->InitCheck();
|
error = fNotificationRequestPort->InitCheck();
|
||||||
@@ -105,7 +105,7 @@ UserlandFSServer::Init(const char* fileSystem, port_id port)
|
|||||||
RETURN_ERROR(error);
|
RETURN_ERROR(error);
|
||||||
|
|
||||||
// now create the request threads
|
// now create the request threads
|
||||||
fRequestThreads = new(nothrow) RequestThread[kRequestThreadCount];
|
fRequestThreads = new(std::nothrow) RequestThread[kRequestThreadCount];
|
||||||
if (!fRequestThreads)
|
if (!fRequestThreads)
|
||||||
RETURN_ERROR(B_NO_MEMORY);
|
RETURN_ERROR(B_NO_MEMORY);
|
||||||
for (int32 i = 0; i < kRequestThreadCount; i++) {
|
for (int32 i = 0; i < kRequestThreadCount; i++) {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include <new>
|
#include <new>
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "AutoDeleter.h"
|
#include "AutoDeleter.h"
|
||||||
@@ -53,7 +54,7 @@ HaikuKernelVolume::HaikuKernelVolume(FileSystem* fileSystem, dev_t id,
|
|||||||
fVolume.sub_volume = NULL;
|
fVolume.sub_volume = NULL;
|
||||||
fVolume.super_volume = NULL;
|
fVolume.super_volume = NULL;
|
||||||
fVolume.file_system = fFSModule;
|
fVolume.file_system = fFSModule;
|
||||||
fVolume.file_system_name = "dummy"; // TODO: Init correctly!
|
fVolume.file_system_name = strdup("dummy"); // TODO: Init correctly!
|
||||||
fVolume.haikuVolume = this;
|
fVolume.haikuVolume = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1877,7 +1877,7 @@ cache_start_transaction(void* _cache)
|
|||||||
cache->last_transaction->id);
|
cache->last_transaction->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
cache_transaction* transaction = new(nothrow) cache_transaction;
|
cache_transaction* transaction = new(std::nothrow) cache_transaction;
|
||||||
if (transaction == NULL)
|
if (transaction == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
@@ -2096,7 +2096,7 @@ cache_detach_sub_transaction(void* _cache, int32 id,
|
|||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
// create a new transaction for the sub transaction
|
// 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)
|
if (transaction == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
@@ -2466,7 +2466,7 @@ block_cache_delete(void* _cache, bool allowWrites)
|
|||||||
void*
|
void*
|
||||||
block_cache_create(int fd, off_t numBlocks, size_t blockSize, bool readOnly)
|
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);
|
readOnly);
|
||||||
if (cache == NULL)
|
if (cache == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
+3
-1
@@ -3,6 +3,8 @@
|
|||||||
// debugging
|
// debugging
|
||||||
#define BA_DEFINE_INLINES 1
|
#define BA_DEFINE_INLINES 1
|
||||||
|
|
||||||
|
#include <new>
|
||||||
|
|
||||||
#include "AllocationInfo.h"
|
#include "AllocationInfo.h"
|
||||||
#include "BlockAllocator.h"
|
#include "BlockAllocator.h"
|
||||||
#include "BlockAllocatorArea.h"
|
#include "BlockAllocatorArea.h"
|
||||||
@@ -23,7 +25,7 @@ BlockAllocator::BlockAllocator(size_t areaSize)
|
|||||||
{
|
{
|
||||||
// create and init buckets
|
// create and init buckets
|
||||||
fBucketCount = bucket_containing_size(areaSize) + 1;
|
fBucketCount = bucket_containing_size(areaSize) + 1;
|
||||||
fBuckets = new(nothrow) AreaBucket[fBucketCount];
|
fBuckets = new(std::nothrow) AreaBucket[fBucketCount];
|
||||||
size_t minSize = 0;
|
size_t minSize = 0;
|
||||||
for (int32 i = 0; i < fBucketCount; i++) {
|
for (int32 i = 0; i < fBucketCount; i++) {
|
||||||
size_t maxSize = (1 << i) * kMinNetBlockSize;
|
size_t maxSize = (1 << i) * kMinNetBlockSize;
|
||||||
|
|||||||
+1
-1
@@ -33,4 +33,4 @@ bucket_containing_min_size(size_t size)
|
|||||||
{ return (size ? bucket_containing_size(size - 1) + 1 : 0); }
|
{ return (size ? bucket_containing_size(size - 1) + 1 : 0); }
|
||||||
|
|
||||||
|
|
||||||
#endif BLOCK_ALLOCATOR_MISC_H
|
#endif // BLOCK_ALLOCATOR_MISC_H
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
// BlockReferenceManager.cpp
|
// BlockReferenceManager.cpp
|
||||||
|
|
||||||
|
#include <new>
|
||||||
|
|
||||||
#include "AllocationInfo.h"
|
#include "AllocationInfo.h"
|
||||||
#include "Block.h"
|
#include "Block.h"
|
||||||
#include "BlockAllocator.h" // only for BA_PANIC
|
#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);
|
status_t error = (size > 0 ? B_OK : B_BAD_VALUE);
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
fReferences = new(nothrow) BlockReference[size];
|
fReferences = new(std::nothrow) BlockReference[size];
|
||||||
if (fReferences)
|
if (fReferences)
|
||||||
fSize = size;
|
fSize = size;
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
// Directory.cpp
|
// Directory.cpp
|
||||||
|
|
||||||
|
#include <new>
|
||||||
|
|
||||||
#include "AllocationInfo.h"
|
#include "AllocationInfo.h"
|
||||||
#include "Debug.h"
|
#include "Debug.h"
|
||||||
#include "Directory.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);
|
status_t error = (name && directory ? B_OK : B_BAD_VALUE);
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
// create directory
|
// create directory
|
||||||
if (Directory *node = new(nothrow) Directory(GetVolume())) {
|
if (Directory *node = new(std::nothrow) Directory(GetVolume())) {
|
||||||
error = _CreateCommon(node, name);
|
error = _CreateCommon(node, name);
|
||||||
// deletes the node on failure
|
// deletes the node on failure
|
||||||
if (error == B_OK)
|
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);
|
status_t error = (name && file ? B_OK : B_BAD_VALUE);
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
// create file
|
// create file
|
||||||
if (File *node = new(nothrow) File(GetVolume())) {
|
if (File *node = new(std::nothrow) File(GetVolume())) {
|
||||||
error = _CreateCommon(node, name);
|
error = _CreateCommon(node, name);
|
||||||
// deletes the node on failure
|
// deletes the node on failure
|
||||||
if (error == B_OK)
|
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);
|
status_t error = (name && symLink ? B_OK : B_BAD_VALUE);
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
// create symlink
|
// create symlink
|
||||||
if (SymLink *node = new(nothrow) SymLink(GetVolume())) {
|
if (SymLink *node = new(std::nothrow) SymLink(GetVolume())) {
|
||||||
error = node->SetLinkedPath(path);
|
error = node->SetLinkedPath(path);
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
error = _CreateCommon(node, name);
|
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);
|
status_t error = (node ? B_OK : B_BAD_VALUE);
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
// create an entry
|
// create an entry
|
||||||
Entry *entry = new(nothrow) Entry(name);
|
Entry *entry = new(std::nothrow) Entry(name);
|
||||||
if (entry) {
|
if (entry) {
|
||||||
error = entry->InitCheck();
|
error = entry->InitCheck();
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
|
|||||||
@@ -28,10 +28,11 @@
|
|||||||
#ifndef LIST_H
|
#ifndef LIST_H
|
||||||
#define LIST_H
|
#define LIST_H
|
||||||
|
|
||||||
#include <new.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <new>
|
||||||
|
|
||||||
#include <SupportDefs.h>
|
#include <SupportDefs.h>
|
||||||
|
|
||||||
template<typename ITEM>
|
template<typename ITEM>
|
||||||
|
|||||||
@@ -45,8 +45,9 @@ All rights reserved.
|
|||||||
#ifndef __OPEN_HASH_TABLE__
|
#ifndef __OPEN_HASH_TABLE__
|
||||||
#define __OPEN_HASH_TABLE__
|
#define __OPEN_HASH_TABLE__
|
||||||
|
|
||||||
#include <malloc.h>
|
#include <new>
|
||||||
#include <new.h>
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "AreaUtils.h"
|
#include "AreaUtils.h"
|
||||||
#include "Misc.h"
|
#include "Misc.h"
|
||||||
|
|||||||
+8
-6
@@ -31,6 +31,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
#include <new>
|
||||||
|
|
||||||
#include <fs_index.h>
|
#include <fs_index.h>
|
||||||
#include <fs_query.h>
|
#include <fs_query.h>
|
||||||
#include <KernelExport.h>
|
#include <KernelExport.h>
|
||||||
@@ -272,7 +274,7 @@ ramfs_mount(nspace_id nsid, const char */*device*/, ulong flags,
|
|||||||
// allocate and init the volume
|
// allocate and init the volume
|
||||||
Volume *volume = NULL;
|
Volume *volume = NULL;
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
volume = new(nothrow) Volume;
|
volume = new(std::nothrow) Volume;
|
||||||
if (!volume)
|
if (!volume)
|
||||||
SET_ERROR(error, B_NO_MEMORY);
|
SET_ERROR(error, B_NO_MEMORY);
|
||||||
if (error == B_OK)
|
if (error == B_OK)
|
||||||
@@ -630,7 +632,7 @@ ramfs_create(void *ns, void *_dir, const char *name, int openMode,
|
|||||||
// create the file cookie
|
// create the file cookie
|
||||||
FileCookie *cookie = NULL;
|
FileCookie *cookie = NULL;
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
cookie = new(nothrow) FileCookie(openMode);
|
cookie = new(std::nothrow) FileCookie(openMode);
|
||||||
if (!cookie)
|
if (!cookie)
|
||||||
SET_ERROR(error, B_NO_MEMORY);
|
SET_ERROR(error, B_NO_MEMORY);
|
||||||
}
|
}
|
||||||
@@ -713,7 +715,7 @@ FUNCTION(("node: %Ld\n", node->GetID()));
|
|||||||
// create the cookie
|
// create the cookie
|
||||||
FileCookie *cookie = NULL;
|
FileCookie *cookie = NULL;
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
cookie = new(nothrow) FileCookie(openMode);
|
cookie = new(std::nothrow) FileCookie(openMode);
|
||||||
if (!cookie)
|
if (!cookie)
|
||||||
SET_ERROR(error, B_NO_MEMORY);
|
SET_ERROR(error, B_NO_MEMORY);
|
||||||
}
|
}
|
||||||
@@ -1275,7 +1277,7 @@ FUNCTION(("dir: (%Lu)\n", node->GetID()));
|
|||||||
}
|
}
|
||||||
// create a DirectoryCookie
|
// create a DirectoryCookie
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
DirectoryCookie *cookie = new(nothrow) DirectoryCookie(dir);
|
DirectoryCookie *cookie = new(std::nothrow) DirectoryCookie(dir);
|
||||||
if (cookie) {
|
if (cookie) {
|
||||||
error = cookie->Suspend();
|
error = cookie->Suspend();
|
||||||
if (error == B_OK)
|
if (error == B_OK)
|
||||||
@@ -1527,7 +1529,7 @@ ramfs_open_attrdir(void *ns, void *_node, void **cookie)
|
|||||||
// create iterator
|
// create iterator
|
||||||
AttributeIterator *iterator = NULL;
|
AttributeIterator *iterator = NULL;
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
iterator = new(nothrow) AttributeIterator(node);
|
iterator = new(std::nothrow) AttributeIterator(node);
|
||||||
if (iterator)
|
if (iterator)
|
||||||
error = iterator->Suspend();
|
error = iterator->Suspend();
|
||||||
else
|
else
|
||||||
@@ -1782,7 +1784,7 @@ ramfs_open_indexdir(void *ns, void **_cookie)
|
|||||||
if (VolumeReadLocker locker = volume) {
|
if (VolumeReadLocker locker = volume) {
|
||||||
// check whether an index directory exists
|
// check whether an index directory exists
|
||||||
if (volume->GetIndexDirectory()) {
|
if (volume->GetIndexDirectory()) {
|
||||||
IndexDirCookie *cookie = new(nothrow) IndexDirCookie;
|
IndexDirCookie *cookie = new(std::nothrow) IndexDirCookie;
|
||||||
if (cookie)
|
if (cookie)
|
||||||
*_cookie = cookie;
|
*_cookie = cookie;
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -8,7 +8,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <string>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include <KernelExport.h>
|
#include <KernelExport.h>
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
* Axel Dörfler, axeld@pinc-software.de.
|
* Axel Dörfler, axeld@pinc-software.de.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string>
|
#include <string.h>
|
||||||
|
|
||||||
#include <KernelExport.h>
|
#include <KernelExport.h>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user