Made the UserlandFS code gcc4 friendly.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20322 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2007-03-04 08:26:45 +00:00
parent 48d60fa69c
commit 6aeea78c6e
18 changed files with 56 additions and 35 deletions
+3 -1
View File
@@ -5,6 +5,8 @@
#include <OS.h> #include <OS.h>
class KernelDebug;
namespace UserlandFSUtil { namespace UserlandFSUtil {
struct PortInfo { struct PortInfo {
@@ -40,7 +42,7 @@ public:
status_t Receive(bigtime_t timeout = -1); status_t Receive(bigtime_t timeout = -1);
private: private:
friend class KernelDebug; friend class ::KernelDebug;
Info fInfo; Info fInfo;
uint8* fBuffer; uint8* fBuffer;
@@ -41,7 +41,7 @@ private:
void _PopAllocator(); void _PopAllocator();
private: private:
friend class KernelDebug; friend class ::KernelDebug;
struct AllocatorNode; struct AllocatorNode;
Port fPort; Port fPort;
+4 -4
View File
@@ -190,8 +190,8 @@ protected:
template<typename Key, typename Value> template<typename Key, typename Value>
class SynchronizedHashMap : public Locker { class SynchronizedHashMap : public Locker {
public: public:
typedef HashMap<Key, Value>::Entry Entry; typedef typename HashMap<Key, Value>::Entry Entry;
typedef HashMap<Key, Value>::Iterator Iterator; typedef typename HashMap<Key, Value>::Iterator Iterator;
SynchronizedHashMap() : Locker("synchronized hash map") {} SynchronizedHashMap() : Locker("synchronized hash map") {}
~SynchronizedHashMap() { Lock(); } ~SynchronizedHashMap() { Lock(); }
@@ -420,7 +420,7 @@ HashMap<Key, Value>::Size() const
// GetIterator // GetIterator
template<typename Key, typename Value> template<typename Key, typename Value>
HashMap<Key, Value>::Iterator typename HashMap<Key, Value>::Iterator
HashMap<Key, Value>::GetIterator() HashMap<Key, Value>::GetIterator()
{ {
return Iterator(this); return Iterator(this);
@@ -428,7 +428,7 @@ HashMap<Key, Value>::GetIterator()
// _FindElement // _FindElement
template<typename Key, typename Value> template<typename Key, typename Value>
HashMap<Key, Value>::Element * typename HashMap<Key, Value>::Element *
HashMap<Key, Value>::_FindElement(const Key& key) const HashMap<Key, Value>::_FindElement(const Key& key) const
{ {
Element* element = fTable.FindFirst(key.GetHashCode()); Element* element = fTable.FindFirst(key.GetHashCode());
+14 -14
View File
@@ -382,7 +382,7 @@ _VECTOR_CLASS_NAME::Remove(const Value &value)
removed), or Null(), if \a index was out of range. removed), or Null(), if \a index was out of range.
*/ */
_VECTOR_TEMPLATE_LIST _VECTOR_TEMPLATE_LIST
_VECTOR_CLASS_NAME::Iterator typename _VECTOR_CLASS_NAME::Iterator
_VECTOR_CLASS_NAME::Erase(int32 index) _VECTOR_CLASS_NAME::Erase(int32 index)
{ {
if (index >= 0 && index < fItemCount) { if (index >= 0 && index < fItemCount) {
@@ -403,7 +403,7 @@ _VECTOR_CLASS_NAME::Erase(int32 index)
(in this case including End()). (in this case including End()).
*/ */
_VECTOR_TEMPLATE_LIST _VECTOR_TEMPLATE_LIST
_VECTOR_CLASS_NAME::Iterator typename _VECTOR_CLASS_NAME::Iterator
_VECTOR_CLASS_NAME::Erase(const Iterator &iterator) _VECTOR_CLASS_NAME::Erase(const Iterator &iterator)
{ {
int32 index = _IteratorIndex(iterator); int32 index = _IteratorIndex(iterator);
@@ -458,7 +458,7 @@ _VECTOR_CLASS_NAME::MakeEmpty()
*/ */
_VECTOR_TEMPLATE_LIST _VECTOR_TEMPLATE_LIST
inline inline
_VECTOR_CLASS_NAME::Iterator typename _VECTOR_CLASS_NAME::Iterator
_VECTOR_CLASS_NAME::Begin() _VECTOR_CLASS_NAME::Begin()
{ {
return Iterator(fItems); return Iterator(fItems);
@@ -474,7 +474,7 @@ _VECTOR_CLASS_NAME::Begin()
*/ */
_VECTOR_TEMPLATE_LIST _VECTOR_TEMPLATE_LIST
inline inline
_VECTOR_CLASS_NAME::ConstIterator typename _VECTOR_CLASS_NAME::ConstIterator
_VECTOR_CLASS_NAME::Begin() const _VECTOR_CLASS_NAME::Begin() const
{ {
return ConstIterator(fItems); return ConstIterator(fItems);
@@ -490,7 +490,7 @@ _VECTOR_CLASS_NAME::Begin() const
*/ */
_VECTOR_TEMPLATE_LIST _VECTOR_TEMPLATE_LIST
inline inline
_VECTOR_CLASS_NAME::Iterator typename _VECTOR_CLASS_NAME::Iterator
_VECTOR_CLASS_NAME::End() _VECTOR_CLASS_NAME::End()
{ {
return Iterator(fItems + fItemCount); return Iterator(fItems + fItemCount);
@@ -506,7 +506,7 @@ _VECTOR_CLASS_NAME::End()
*/ */
_VECTOR_TEMPLATE_LIST _VECTOR_TEMPLATE_LIST
inline inline
_VECTOR_CLASS_NAME::ConstIterator typename _VECTOR_CLASS_NAME::ConstIterator
_VECTOR_CLASS_NAME::End() const _VECTOR_CLASS_NAME::End() const
{ {
return ConstIterator(fItems + fItemCount); return ConstIterator(fItems + fItemCount);
@@ -522,7 +522,7 @@ _VECTOR_CLASS_NAME::End() const
*/ */
_VECTOR_TEMPLATE_LIST _VECTOR_TEMPLATE_LIST
inline inline
_VECTOR_CLASS_NAME::Iterator typename _VECTOR_CLASS_NAME::Iterator
_VECTOR_CLASS_NAME::Null() _VECTOR_CLASS_NAME::Null()
{ {
return Iterator(NULL); return Iterator(NULL);
@@ -538,7 +538,7 @@ _VECTOR_CLASS_NAME::Null()
*/ */
_VECTOR_TEMPLATE_LIST _VECTOR_TEMPLATE_LIST
inline inline
_VECTOR_CLASS_NAME::ConstIterator typename _VECTOR_CLASS_NAME::ConstIterator
_VECTOR_CLASS_NAME::Null() const _VECTOR_CLASS_NAME::Null() const
{ {
return ConstIterator(NULL); return ConstIterator(NULL);
@@ -551,7 +551,7 @@ _VECTOR_CLASS_NAME::Null() const
*/ */
_VECTOR_TEMPLATE_LIST _VECTOR_TEMPLATE_LIST
inline inline
_VECTOR_CLASS_NAME::Iterator typename _VECTOR_CLASS_NAME::Iterator
_VECTOR_CLASS_NAME::IteratorForIndex(int32 index) _VECTOR_CLASS_NAME::IteratorForIndex(int32 index)
{ {
if (index >= 0 && index <= fItemCount) if (index >= 0 && index <= fItemCount)
@@ -566,7 +566,7 @@ _VECTOR_CLASS_NAME::IteratorForIndex(int32 index)
*/ */
_VECTOR_TEMPLATE_LIST _VECTOR_TEMPLATE_LIST
inline inline
_VECTOR_CLASS_NAME::ConstIterator typename _VECTOR_CLASS_NAME::ConstIterator
_VECTOR_CLASS_NAME::IteratorForIndex(int32 index) const _VECTOR_CLASS_NAME::IteratorForIndex(int32 index) const
{ {
if (index >= 0 && index <= fItemCount) if (index >= 0 && index <= fItemCount)
@@ -637,7 +637,7 @@ _VECTOR_CLASS_NAME::IndexOf(const Value &value, int32 start) const
*/ */
_VECTOR_TEMPLATE_LIST _VECTOR_TEMPLATE_LIST
inline inline
_VECTOR_CLASS_NAME::Iterator typename _VECTOR_CLASS_NAME::Iterator
_VECTOR_CLASS_NAME::Find(const Value &value) _VECTOR_CLASS_NAME::Find(const Value &value)
{ {
return Find(value, Begin()); return Find(value, Begin());
@@ -654,7 +654,7 @@ _VECTOR_CLASS_NAME::Find(const Value &value)
invalid. invalid.
*/ */
_VECTOR_TEMPLATE_LIST _VECTOR_TEMPLATE_LIST
_VECTOR_CLASS_NAME::Iterator typename _VECTOR_CLASS_NAME::Iterator
_VECTOR_CLASS_NAME::Find(const Value &value, const Iterator &start) _VECTOR_CLASS_NAME::Find(const Value &value, const Iterator &start)
{ {
int32 index = IndexOf(value, _IteratorIndex(start)); int32 index = IndexOf(value, _IteratorIndex(start));
@@ -672,7 +672,7 @@ _VECTOR_CLASS_NAME::Find(const Value &value, const Iterator &start)
*/ */
_VECTOR_TEMPLATE_LIST _VECTOR_TEMPLATE_LIST
inline inline
_VECTOR_CLASS_NAME::ConstIterator typename _VECTOR_CLASS_NAME::ConstIterator
_VECTOR_CLASS_NAME::Find(const Value &value) const _VECTOR_CLASS_NAME::Find(const Value &value) const
{ {
return Find(value, Begin()); return Find(value, Begin());
@@ -689,7 +689,7 @@ _VECTOR_CLASS_NAME::Find(const Value &value) const
invalid. invalid.
*/ */
_VECTOR_TEMPLATE_LIST _VECTOR_TEMPLATE_LIST
_VECTOR_CLASS_NAME::ConstIterator typename _VECTOR_CLASS_NAME::ConstIterator
_VECTOR_CLASS_NAME::Find(const Value &value, const ConstIterator &start) const _VECTOR_CLASS_NAME::Find(const Value &value, const ConstIterator &start) const
{ {
int32 index = IndexOf(value, _IteratorIndex(start)); int32 index = IndexOf(value, _IteratorIndex(start));
@@ -4,7 +4,6 @@ local userlandFSTop = [ FDirName $(HAIKU_TOP) src add-ons kernel file_systems
userlandfs ] ; userlandfs ] ;
local userlandFSIncludes = [ PrivateHeaders userlandfs ] ; local userlandFSIncludes = [ PrivateHeaders userlandfs ] ;
#SubDirSysHdrs [ FDirName $(userlandFSIncludes) legacy ] ;
SubDirHdrs [ FDirName $(userlandFSIncludes) private ] ; SubDirHdrs [ FDirName $(userlandFSIncludes) private ] ;
SubDirHdrs [ FDirName $(userlandFSIncludes) shared ] ; SubDirHdrs [ FDirName $(userlandFSIncludes) shared ] ;
@@ -13,12 +12,6 @@ SEARCH_SOURCE += [ FDirName $(userlandFSTop) shared ] ;
DEFINES += DEBUG_APP="\\\"userlandfs\\\"" ; DEFINES += DEBUG_APP="\\\"userlandfs\\\"" ;
local kernelC++ ;
if $(OSPLAT) = X86 {
kernelC++ += kernel-cpp.cpp ;
SubDirC++Flags -include [ FDirName $(SUBDIR) kernel-cpp.h ] ;
}
KernelAddon userlandfs KernelAddon userlandfs
: AreaSupport.cpp : AreaSupport.cpp
Debug.cpp Debug.cpp
@@ -46,7 +39,5 @@ KernelAddon userlandfs
UserlandFS.cpp UserlandFS.cpp
Volume.cpp Volume.cpp
# $(kernelC++) : $(TARGET_GCC_LIBGCC) $(HAIKU_LIBSUPC++)
: $(TARGET_GCC_LIBGCC)
; ;
@@ -1,9 +1,12 @@
// RequestPortPool.cpp // RequestPortPool.cpp
#include "RequestPortPool.h"
#include <stdlib.h>
#include "AutoLocker.h" #include "AutoLocker.h"
#include "Debug.h" #include "Debug.h"
#include "RequestPort.h" #include "RequestPort.h"
#include "RequestPortPool.h"
typedef AutoLocker<RequestPortPool> PoolLocker; typedef AutoLocker<RequestPortPool> PoolLocker;
@@ -2,6 +2,8 @@
#include <new> #include <new>
#include <stdlib.h>
#include <driver_settings.h> #include <driver_settings.h>
#include "Debug.h" #include "Debug.h"
@@ -9,6 +11,8 @@
#include "IOCtlInfo.h" #include "IOCtlInfo.h"
#include "Settings.h" #include "Settings.h"
using std::nothrow;
static const char *kFSName = "userlandfs"; static const char *kFSName = "userlandfs";
// IOCtlInfoMap // IOCtlInfoMap
@@ -2,7 +2,6 @@
#include <KernelExport.h> #include <KernelExport.h>
#include "AutoLocker.h"
#include "Compatibility.h" #include "Compatibility.h"
#include "Debug.h" #include "Debug.h"
#include "DispatcherDefs.h" #include "DispatcherDefs.h"
@@ -12,7 +11,6 @@
#include "Requests.h" #include "Requests.h"
#include "UserlandFS.h" #include "UserlandFS.h"
typedef AutoLocker<UserlandFS::FileSystemMap> FileSystemLocker;
UserlandFS* UserlandFS::sUserlandFS = NULL; UserlandFS* UserlandFS::sUserlandFS = NULL;
@@ -5,6 +5,7 @@
#include <SupportDefs.h> #include <SupportDefs.h>
#include "AutoLocker.h"
#include "HashMap.h" #include "HashMap.h"
#include "String.h" #include "String.h"
@@ -40,6 +41,7 @@ private:
private: private:
friend class KernelDebug; friend class KernelDebug;
typedef SynchronizedHashMap<String, FileSystem*> FileSystemMap; typedef SynchronizedHashMap<String, FileSystem*> FileSystemMap;
typedef AutoLocker<UserlandFS::FileSystemMap> FileSystemLocker;
static UserlandFS* sUserlandFS; static UserlandFS* sUserlandFS;
@@ -2,5 +2,9 @@
#include "DispatcherDefs.h" #include "DispatcherDefs.h"
namespace UserlandFSUtil {
const char* kUserlandFSDispatcherPortName = "userland fs dispatcher"; const char* kUserlandFSDispatcherPortName = "userland fs dispatcher";
const char* kUserlandFSDispatcherReplyPortName = "userland fs dispatcher reply"; const char* kUserlandFSDispatcherReplyPortName = "userland fs dispatcher reply";
}
@@ -6,6 +6,8 @@
#include "Compatibility.h" #include "Compatibility.h"
#include "Port.h" #include "Port.h"
using std::nothrow;
// minimal and maximal port size // minimal and maximal port size
static const int32 kMinPortSize = 1024; // 1 kB static const int32 kMinPortSize = 1024; // 1 kB
static const int32 kMaxPortSize = 64 * 1024; // 64 kB static const int32 kMaxPortSize = 64 * 1024; // 64 kB
@@ -8,6 +8,8 @@
#include "Port.h" #include "Port.h"
#include "RequestAllocator.h" #include "RequestAllocator.h"
using std::nothrow;
// constructor // constructor
RequestAllocator::RequestAllocator(Port* port) RequestAllocator::RequestAllocator(Port* port)
: fError(B_NO_INIT), : fError(B_NO_INIT),
@@ -8,6 +8,8 @@
#include "RequestHandler.h" #include "RequestHandler.h"
#include "RequestPort.h" #include "RequestPort.h"
using std::nothrow;
// TODO: Limit the stacking of requests? // TODO: Limit the stacking of requests?
// AllocatorNode // AllocatorNode
@@ -2,5 +2,9 @@
#include "userlandfs_ioctl.h" #include "userlandfs_ioctl.h"
namespace UserlandFSUtil {
const char kUserlandFSIOCtlMagic[USERLAND_IOCTL_MAGIC_LENGTH] const char kUserlandFSIOCtlMagic[USERLAND_IOCTL_MAGIC_LENGTH]
= "userlandfs mAGiC666"; = "userlandfs mAGiC666";
}
@@ -6,6 +6,8 @@
#include "BeOSKernelVolume.h" #include "BeOSKernelVolume.h"
using std::nothrow;
// constructor // constructor
BeOSKernelFileSystem::BeOSKernelFileSystem(beos_vnode_ops* fsOps) BeOSKernelFileSystem::BeOSKernelFileSystem(beos_vnode_ops* fsOps)
: FileSystem(), : FileSystem(),
@@ -12,6 +12,8 @@
#include "Port.h" #include "Port.h"
#include "String.h" #include "String.h"
using std::nothrow;
namespace UserlandFS { namespace UserlandFS {
// FSInfo // FSInfo
@@ -8,6 +8,8 @@
#include "ServerDefs.h" #include "ServerDefs.h"
#include "UserlandRequestHandler.h" #include "UserlandRequestHandler.h"
using std::nothrow;
static const int32 sTLSVariable = tls_allocate(); static const int32 sTLSVariable = tls_allocate();
// constructor // constructor
@@ -28,7 +28,8 @@ ServerSettings::ShallEnterDebugger() const
} }
// the global settings // the global settings
ServerSettings gServerSettings; ServerSettings UserlandFS::gServerSettings;
const char* kUserlandFSDispatcherClipboardName = "userland fs dispatcher"; const char* UserlandFS::kUserlandFSDispatcherClipboardName
= "userland fs dispatcher";