From 0774a741c21bfe3a168e3b447b58cfc6a8745843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 12 Sep 2003 07:19:50 +0000 Subject: [PATCH] The small_data section now makes use of the const keyword :-) git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4649 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/bfs/bfs.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/add-ons/kernel/file_systems/bfs/bfs.h b/src/add-ons/kernel/file_systems/bfs/bfs.h index ee6601bae6..b48dd9d2ae 100644 --- a/src/add-ons/kernel/file_systems/bfs/bfs.h +++ b/src/add-ons/kernel/file_systems/bfs/bfs.h @@ -139,11 +139,11 @@ struct small_data { uint16 NameSize() const { return BFS_ENDIAN_TO_HOST_INT16(name_size); } uint16 DataSize() const { return BFS_ENDIAN_TO_HOST_INT16(data_size); } - inline char *Name(); - inline uint8 *Data(); - inline uint32 Size(); - inline small_data *Next(); - inline bool IsLast(bfs_inode *inode); + inline char *Name() const; + inline uint8 *Data() const; + inline uint32 Size() const; + inline small_data *Next() const; + inline bool IsLast(const bfs_inode *inode) const; }; // the file name is part of the small_data structure @@ -325,35 +325,35 @@ block_run::Run(int32 group, uint16 start, uint16 length) inline char * -small_data::Name() +small_data::Name() const { - return name; + return const_cast(name); } inline uint8 * -small_data::Data() +small_data::Data() const { return (uint8 *)name + NameSize() + 3; } inline uint32 -small_data::Size() +small_data::Size() const { return sizeof(small_data) + NameSize() + 3 + DataSize() + 1; } inline small_data * -small_data::Next() +small_data::Next() const { return (small_data *)((uint8 *)this + Size()); } inline bool -small_data::IsLast(bfs_inode *inode) +small_data::IsLast(const bfs_inode *inode) const { // we need to check the location first, because if name_size is already beyond // the block, we would touch invalid memory (although that can't cause wrong