Made ReiserFS code gcc 4 friendly.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20324 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2007-03-04 09:18:55 +00:00
parent 1ac141b1f8
commit aa46234e72
9 changed files with 29 additions and 14 deletions

View File

@ -19,6 +19,8 @@
// You can alternatively use *this file* under the terms of the the MIT
// license included in this package.
#include <new>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
@ -32,6 +34,8 @@
#include "Debug.h"
#include "reiserfs.h"
using std::nothrow;
/*!
\class BlockCache
\brief Implements a cache for disk blocks.

View File

@ -36,7 +36,7 @@ public:
uint16 GetLen() const { return le2h(ih_item_len); }
uint16 GetLocation() const { return le2h(ih_item_location); }
uint16 GetVersion() const { return le2h(ih_version); }
const Key *GetKey() const { return static_cast<const Key*>(&ih_key); }
const Key *GetKey() const { return Key::CastFrom(&ih_key); }
VKey *GetKey(VKey *k) const { k->SetTo(GetKey(), GetVersion()); return k; }
// indirect item only

View File

@ -313,7 +313,7 @@ TreeIterator::GoTo(uint32 direction)
\return \c B_OK, if everything went fine
*/
status_t
TreeIterator::GoToPreviousLeaf(LeafNode **node = NULL)
TreeIterator::GoToPreviousLeaf(LeafNode **node)
{
status_t error = InitCheck();
if (error == B_OK) {
@ -355,7 +355,7 @@ TreeIterator::GoToPreviousLeaf(LeafNode **node = NULL)
\return \c B_OK, if everything went fine
*/
status_t
TreeIterator::GoToNextLeaf(LeafNode **node = NULL)
TreeIterator::GoToNextLeaf(LeafNode **node)
{
status_t error = InitCheck();
if (error == B_OK) {
@ -392,7 +392,7 @@ TreeIterator::GoToNextLeaf(LeafNode **node = NULL)
\return \c B_OK, if everything went fine.
*/
status_t
TreeIterator::FindRightMostLeaf(const VKey *k, LeafNode **node = NULL)
TreeIterator::FindRightMostLeaf(const VKey *k, LeafNode **node)
{
//printf("TreeIterator::FindRightMostLeaf()\n");
status_t error = (k ? InitCheck() : B_BAD_VALUE);

View File

@ -49,6 +49,11 @@ public:
Key(const Key &k) : key(k) {}
~Key() {}
static Key* CastFrom(key* k)
{ return static_cast<Key*>(k); }
static const Key* CastFrom(const key* k)
{ return static_cast<const Key*>(k); }
void SetTo(uint32 dirID, uint32 objectID, uint64 offset, uint32 type,
uint16 version)
{

View File

@ -88,7 +88,7 @@ private:
// sDefaultItem
template<typename ITEM, typename DEFAULT_ITEM_SUPPLIER>
List<ITEM, DEFAULT_ITEM_SUPPLIER>::item_t
typename List<ITEM, DEFAULT_ITEM_SUPPLIER>::item_t
List<ITEM, DEFAULT_ITEM_SUPPLIER>::sDefaultItem(
DEFAULT_ITEM_SUPPLIER::GetItem());
@ -116,7 +116,7 @@ List<ITEM, DEFAULT_ITEM_SUPPLIER>::~List()
// GetDefaultItem
template<typename ITEM, typename DEFAULT_ITEM_SUPPLIER>
inline
const List<ITEM, DEFAULT_ITEM_SUPPLIER>::item_t &
const typename List<ITEM, DEFAULT_ITEM_SUPPLIER>::item_t &
List<ITEM, DEFAULT_ITEM_SUPPLIER>::GetDefaultItem() const
{
return sDefaultItem;
@ -125,7 +125,7 @@ List<ITEM, DEFAULT_ITEM_SUPPLIER>::GetDefaultItem() const
// GetDefaultItem
template<typename ITEM, typename DEFAULT_ITEM_SUPPLIER>
inline
List<ITEM, DEFAULT_ITEM_SUPPLIER>::item_t &
typename List<ITEM, DEFAULT_ITEM_SUPPLIER>::item_t &
List<ITEM, DEFAULT_ITEM_SUPPLIER>::GetDefaultItem()
{
return sDefaultItem;
@ -264,7 +264,7 @@ List<ITEM, DEFAULT_ITEM_SUPPLIER>::IsEmpty() const
// ItemAt
template<typename ITEM, typename DEFAULT_ITEM_SUPPLIER>
const List<ITEM, DEFAULT_ITEM_SUPPLIER>::item_t &
const typename List<ITEM, DEFAULT_ITEM_SUPPLIER>::item_t &
List<ITEM, DEFAULT_ITEM_SUPPLIER>::ItemAt(int32 index) const
{
if (index >= 0 && index < fItemCount)
@ -274,7 +274,7 @@ List<ITEM, DEFAULT_ITEM_SUPPLIER>::ItemAt(int32 index) const
// ItemAt
template<typename ITEM, typename DEFAULT_ITEM_SUPPLIER>
List<ITEM, DEFAULT_ITEM_SUPPLIER>::item_t &
typename List<ITEM, DEFAULT_ITEM_SUPPLIER>::item_t &
List<ITEM, DEFAULT_ITEM_SUPPLIER>::ItemAt(int32 index)
{
if (index >= 0 && index < fItemCount)
@ -284,7 +284,7 @@ List<ITEM, DEFAULT_ITEM_SUPPLIER>::ItemAt(int32 index)
// Items
template<typename ITEM, typename DEFAULT_ITEM_SUPPLIER>
const List<ITEM, DEFAULT_ITEM_SUPPLIER>::item_t *
const typename List<ITEM, DEFAULT_ITEM_SUPPLIER>::item_t *
List<ITEM, DEFAULT_ITEM_SUPPLIER>::Items() const
{
return fItems;

View File

@ -24,6 +24,8 @@
#include "Settings.h"
#include "Debug.h"
using std::nothrow;
/*!
\class Settings
\brief Manages the ReiserFS settings.

View File

@ -42,13 +42,13 @@
*/
class StatData {
public:
StatData() : fVersion(STAT_DATA_V2), fCurrentData(NULL) {}
StatData() : fCurrentData(NULL), fVersion(STAT_DATA_V2) {}
StatData(const StatData &data)
: fVersion(STAT_DATA_V2), fCurrentData(NULL) { *this = data; }
: fCurrentData(NULL), fVersion(STAT_DATA_V2) { *this = data; }
StatData(stat_data_v1 *data, bool clone = false)
: fVersion(STAT_DATA_V2), fCurrentData(NULL) { SetTo(data, clone); }
: fCurrentData(NULL), fVersion(STAT_DATA_V2) { SetTo(data, clone); }
StatData(stat_data *data, bool clone = false)
: fVersion(STAT_DATA_V2), fCurrentData(NULL) { SetTo(data, clone); }
: fCurrentData(NULL), fVersion(STAT_DATA_V2) { SetTo(data, clone); }
~StatData() { Unset(); }
status_t SetTo(stat_data_v1 *data, bool clone = false)

View File

@ -24,6 +24,8 @@
#include "String.h"
using std::nothrow;
/*!
\class String
\brief A very simple string class.

View File

@ -26,6 +26,8 @@
#include "Debug.h"
#include "SuperBlock.h"
using std::nothrow;
/*!
\class DirEntry
\brief Represents the on-disk structure for super block of the FS.