From 2b3c0783a0722098be33fd296a256bbf4d3ea1bd Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Mon, 21 Jul 2008 00:27:44 +0000 Subject: [PATCH] mmlr + bonefish + axeld: * Fixed build: round_up() has been renamed to key_align(). * Whitespace cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26532 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../boot/loader/file_systems/bfs/BPlusTree.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/system/boot/loader/file_systems/bfs/BPlusTree.h b/src/system/boot/loader/file_systems/bfs/BPlusTree.h index cb58b462d0..6273ed3835 100644 --- a/src/system/boot/loader/file_systems/bfs/BPlusTree.h +++ b/src/system/boot/loader/file_systems/bfs/BPlusTree.h @@ -4,7 +4,7 @@ ** ** Initial version by Axel Dörfler, axeld@pinc-software.de ** Roughly based on 'btlib' written by Marcus J. Ranum -** +** ** Copyright (c) 2001-2002 pinc Software. All Rights Reserved. ** This file may be used under the terms of the OpenBeOS License. */ @@ -110,7 +110,7 @@ struct bplustree_node { enum bplustree_traversing { BPLUSTREE_FORWARD = 1, BPLUSTREE_BACKWARD = -1, - + BPLUSTREE_BEGIN = 0, BPLUSTREE_END = 1 }; @@ -292,7 +292,8 @@ bplustree_header::IsValidLink(off_t link) inline uint16 * bplustree_node::KeyLengths() const { - return (uint16 *)(((char *)this) + round_up(sizeof(bplustree_node) + AllKeyLength())); + return (uint16 *)(((char *)this) + + key_align(sizeof(bplustree_node) + AllKeyLength())); } inline off_t * @@ -310,10 +311,11 @@ bplustree_node::Keys() const inline int32 bplustree_node::Used() const { - return round_up(sizeof(bplustree_node) + AllKeyLength()) + NumKeys() * (sizeof(uint16) + sizeof(off_t)); + return key_align(sizeof(bplustree_node) + AllKeyLength()) + + NumKeys() * (sizeof(uint16) + sizeof(off_t)); } -inline bool +inline bool bplustree_node::IsLeaf() const { return OverflowLink() == BPLUSTREE_NULL; @@ -349,7 +351,7 @@ bplustree_node::MakeLink(uint8 type, off_t link, uint32 fragmentIndex) } -inline bool +inline bool bplustree_node::IsDuplicate(off_t link) { return (LinkType(link) & (BPLUSTREE_DUPLICATE_NODE | BPLUSTREE_DUPLICATE_FRAGMENT)) > 0;