Made RamFS code gcc4 friendly.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20323 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -30,10 +30,14 @@
|
|||||||
|
|
||||||
#include <new>
|
#include <new>
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <OS.h>
|
#include <OS.h>
|
||||||
|
|
||||||
#include "Misc.h"
|
#include "Misc.h"
|
||||||
|
|
||||||
|
using std::nothrow;
|
||||||
|
|
||||||
// maximal height of a tree
|
// maximal height of a tree
|
||||||
static const int kMaxAVLTreeHeight = 32;
|
static const int kMaxAVLTreeHeight = 32;
|
||||||
|
|
||||||
|
|||||||
@@ -25,11 +25,11 @@
|
|||||||
// dealings in this Software without prior written authorization of the
|
// dealings in this Software without prior written authorization of the
|
||||||
// copyright holder.
|
// copyright holder.
|
||||||
|
|
||||||
#include <algobase.h>
|
|
||||||
#include <OS.h>
|
#include <OS.h>
|
||||||
|
|
||||||
#include "AreaUtils.h"
|
#include "AreaUtils.h"
|
||||||
#include "Debug.h"
|
#include "Debug.h"
|
||||||
|
#include "Misc.h"
|
||||||
|
|
||||||
#ifndef USE_STANDARD_FUNCTIONS
|
#ifndef USE_STANDARD_FUNCTIONS
|
||||||
#define USE_STANDARD_FUNCTIONS 0
|
#define USE_STANDARD_FUNCTIONS 0
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ private:
|
|||||||
|
|
||||||
// sDefaultItem
|
// sDefaultItem
|
||||||
template<typename ITEM, typename DEFAULT_ITEM_SUPPLIER>
|
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(
|
List<ITEM, DEFAULT_ITEM_SUPPLIER>::sDefaultItem(
|
||||||
DEFAULT_ITEM_SUPPLIER::GetItem());
|
DEFAULT_ITEM_SUPPLIER::GetItem());
|
||||||
|
|
||||||
@@ -129,7 +129,7 @@ List<ITEM, DEFAULT_ITEM_SUPPLIER>::~List()
|
|||||||
// GetDefaultItem
|
// GetDefaultItem
|
||||||
template<typename ITEM, typename DEFAULT_ITEM_SUPPLIER>
|
template<typename ITEM, typename DEFAULT_ITEM_SUPPLIER>
|
||||||
inline
|
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
|
List<ITEM, DEFAULT_ITEM_SUPPLIER>::GetDefaultItem() const
|
||||||
{
|
{
|
||||||
return sDefaultItem;
|
return sDefaultItem;
|
||||||
@@ -138,7 +138,7 @@ List<ITEM, DEFAULT_ITEM_SUPPLIER>::GetDefaultItem() const
|
|||||||
// GetDefaultItem
|
// GetDefaultItem
|
||||||
template<typename ITEM, typename DEFAULT_ITEM_SUPPLIER>
|
template<typename ITEM, typename DEFAULT_ITEM_SUPPLIER>
|
||||||
inline
|
inline
|
||||||
List<ITEM, DEFAULT_ITEM_SUPPLIER>::item_t &
|
typename List<ITEM, DEFAULT_ITEM_SUPPLIER>::item_t &
|
||||||
List<ITEM, DEFAULT_ITEM_SUPPLIER>::GetDefaultItem()
|
List<ITEM, DEFAULT_ITEM_SUPPLIER>::GetDefaultItem()
|
||||||
{
|
{
|
||||||
return sDefaultItem;
|
return sDefaultItem;
|
||||||
@@ -310,7 +310,7 @@ List<ITEM, DEFAULT_ITEM_SUPPLIER>::IsEmpty() const
|
|||||||
|
|
||||||
// ItemAt
|
// ItemAt
|
||||||
template<typename ITEM, typename DEFAULT_ITEM_SUPPLIER>
|
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
|
List<ITEM, DEFAULT_ITEM_SUPPLIER>::ItemAt(int32 index) const
|
||||||
{
|
{
|
||||||
if (index >= 0 && index < fItemCount)
|
if (index >= 0 && index < fItemCount)
|
||||||
@@ -320,7 +320,7 @@ List<ITEM, DEFAULT_ITEM_SUPPLIER>::ItemAt(int32 index) const
|
|||||||
|
|
||||||
// ItemAt
|
// ItemAt
|
||||||
template<typename ITEM, typename DEFAULT_ITEM_SUPPLIER>
|
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)
|
List<ITEM, DEFAULT_ITEM_SUPPLIER>::ItemAt(int32 index)
|
||||||
{
|
{
|
||||||
if (index >= 0 && index < fItemCount)
|
if (index >= 0 && index < fItemCount)
|
||||||
@@ -330,7 +330,7 @@ List<ITEM, DEFAULT_ITEM_SUPPLIER>::ItemAt(int32 index)
|
|||||||
|
|
||||||
// Items
|
// Items
|
||||||
template<typename ITEM, typename DEFAULT_ITEM_SUPPLIER>
|
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
|
List<ITEM, DEFAULT_ITEM_SUPPLIER>::Items() const
|
||||||
{
|
{
|
||||||
return fItems;
|
return fItems;
|
||||||
|
|||||||
@@ -11,4 +11,4 @@ class Volume;
|
|||||||
typedef AutoLocker<Volume, AutoLockerReadLocking<Volume> > VolumeReadLocker;
|
typedef AutoLocker<Volume, AutoLockerReadLocking<Volume> > VolumeReadLocker;
|
||||||
typedef AutoLocker<Volume, AutoLockerWriteLocking<Volume> > VolumeWriteLocker;
|
typedef AutoLocker<Volume, AutoLockerWriteLocking<Volume> > VolumeWriteLocker;
|
||||||
|
|
||||||
#endif LOCKING_H
|
#endif // LOCKING_H
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ NodeChildTable<ParentNode, NodeChild>::GetNodeChild(vnode_id id,
|
|||||||
|
|
||||||
// _FindElement
|
// _FindElement
|
||||||
template<typename ParentNode, typename NodeChild>
|
template<typename ParentNode, typename NodeChild>
|
||||||
NodeChildTable<ParentNode, NodeChild>::Element *
|
typename NodeChildTable<ParentNode, NodeChild>::Element *
|
||||||
NodeChildTable<ParentNode, NodeChild>::_FindElement(vnode_id id,
|
NodeChildTable<ParentNode, NodeChild>::_FindElement(vnode_id id,
|
||||||
const char *name) const
|
const char *name) const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1449,13 +1449,13 @@ Expression::ParseEquation(char **expr)
|
|||||||
{
|
{
|
||||||
skipWhitespace(expr);
|
skipWhitespace(expr);
|
||||||
|
|
||||||
bool not = false;
|
bool nott = false; // note: not is a C++ keyword
|
||||||
if (**expr == '!') {
|
if (**expr == '!') {
|
||||||
skipWhitespace(expr, 1);
|
skipWhitespace(expr, 1);
|
||||||
if (**expr != '(')
|
if (**expr != '(')
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
not = true;
|
nott = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (**expr == ')') {
|
if (**expr == ')') {
|
||||||
@@ -1475,7 +1475,7 @@ Expression::ParseEquation(char **expr)
|
|||||||
|
|
||||||
// If the term is negated, we just complement the tree, to get
|
// If the term is negated, we just complement the tree, to get
|
||||||
// rid of the not, a.k.a. DeMorgan's Law.
|
// rid of the not, a.k.a. DeMorgan's Law.
|
||||||
if (not)
|
if (nott)
|
||||||
term->Complement();
|
term->Complement();
|
||||||
|
|
||||||
skipWhitespace(expr, 1);
|
skipWhitespace(expr, 1);
|
||||||
|
|||||||
@@ -141,6 +141,8 @@ private:
|
|||||||
GetKey;
|
GetKey;
|
||||||
typedef AVLTree<Value, Key, Node, KeyCompare, GetKey, NodeAllocator,
|
typedef AVLTree<Value, Key, Node, KeyCompare, GetKey, NodeAllocator,
|
||||||
GetValue> BaseClass;
|
GetValue> BaseClass;
|
||||||
|
public:
|
||||||
|
typedef typename BaseClass::Iterator Iterator;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TwoKeyAVLTree();
|
TwoKeyAVLTree();
|
||||||
@@ -210,7 +212,7 @@ Value *
|
|||||||
TWO_KEY_AVL_TREE_CLASS_NAME::FindFirst(const PrimaryKey &key,
|
TWO_KEY_AVL_TREE_CLASS_NAME::FindFirst(const PrimaryKey &key,
|
||||||
Iterator *iterator)
|
Iterator *iterator)
|
||||||
{
|
{
|
||||||
Node *node = fRoot;
|
Node *node = BaseClass::fRoot;
|
||||||
while (node) {
|
while (node) {
|
||||||
int cmp = fPrimaryKeyCompare(key, fGetPrimaryKey(fGetValue(node)));
|
int cmp = fPrimaryKeyCompare(key, fGetPrimaryKey(fGetValue(node)));
|
||||||
if (cmp == 0) {
|
if (cmp == 0) {
|
||||||
@@ -237,7 +239,7 @@ Value *
|
|||||||
TWO_KEY_AVL_TREE_CLASS_NAME::FindLast(const PrimaryKey &key,
|
TWO_KEY_AVL_TREE_CLASS_NAME::FindLast(const PrimaryKey &key,
|
||||||
Iterator *iterator)
|
Iterator *iterator)
|
||||||
{
|
{
|
||||||
Node *node = fRoot;
|
Node *node = BaseClass::fRoot;
|
||||||
while (node) {
|
while (node) {
|
||||||
int cmp = fPrimaryKeyCompare(key, fGetPrimaryKey(fGetValue(node)));
|
int cmp = fPrimaryKeyCompare(key, fGetPrimaryKey(fGetValue(node)));
|
||||||
if (cmp == 0) {
|
if (cmp == 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user