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