Host platform gcc 4 fixes.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15026 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2005-11-18 22:29:31 +00:00
parent 9a05e71e91
commit 29306dbe81
3 changed files with 17 additions and 4 deletions
+3
View File
@@ -29,6 +29,7 @@
#define MESSAGEFIELD_H #define MESSAGEFIELD_H
// Standard Includes ----------------------------------------------------------- // Standard Includes -----------------------------------------------------------
#include <new>
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <vector> #include <vector>
@@ -58,6 +59,8 @@
#define MSG_LAST_ENTRY 0x0 #define MSG_LAST_ENTRY 0x0
using namespace std;
// Globals --------------------------------------------------------------------- // Globals ---------------------------------------------------------------------
namespace BPrivate { namespace BPrivate {
@@ -64,8 +64,9 @@ SYSHDRS = $(HAIKU_HDRS) ;
$(malloc_debug_defines) $(malloc_debug_defines)
$(buildPlatformDefines) $(buildPlatformDefines)
] ; ] ;
SubDirCcFlags $(defines) $(malloc_debug_flags) ; SubDirCcFlags $(defines) $(malloc_debug_flags) -nostdinc ;
SubDirC++Flags $(defines) -fno-exceptions -fno-rtti $(malloc_debug_flags) SubDirC++Flags $(defines) -fno-exceptions -fno-rtti $(malloc_debug_flags)
-nostdinc
-include [ FDirName $(SUBDIR) Debug.h ] ; -include [ FDirName $(SUBDIR) Debug.h ] ;
} }
@@ -1605,8 +1605,11 @@ Inode::ShrinkStream(Transaction *transaction, off_t size)
data_stream *data = &Node()->data; data_stream *data = &Node()->data;
if (data->MaxDoubleIndirectRange() > size) { if (data->MaxDoubleIndirectRange() > size) {
off_t *maxDoubleIndirect = &data->max_double_indirect_range;
// gcc 4 work-around: "error: cannot bind packed field
// 'data->data_stream::max_double_indirect_range' to 'off_t&'"
FreeStaticStreamArray(transaction, 0, data->double_indirect, size, FreeStaticStreamArray(transaction, 0, data->double_indirect, size,
data->MaxIndirectRange(), data->max_double_indirect_range); data->MaxIndirectRange(), *maxDoubleIndirect);
if (size <= data->MaxIndirectRange()) { if (size <= data->MaxIndirectRange()) {
fVolume->Free(transaction, data->double_indirect); fVolume->Free(transaction, data->double_indirect);
@@ -1624,8 +1627,11 @@ Inode::ShrinkStream(Transaction *transaction, off_t size)
if (array == NULL) if (array == NULL)
break; break;
off_t *maxIndirect = &data->max_indirect_range;
// gcc 4 work-around: "error: cannot bind packed field
// 'data->data_stream::max_indirect_range' to 'off_t&'"
if (FreeStreamArray(transaction, array, fVolume->BlockSize() / sizeof(block_run), if (FreeStreamArray(transaction, array, fVolume->BlockSize() / sizeof(block_run),
size, offset, data->max_indirect_range) == B_OK) size, offset, *maxIndirect) == B_OK)
cached.WriteBack(transaction); cached.WriteBack(transaction);
} }
if (data->max_direct_range == data->max_indirect_range) { if (data->max_direct_range == data->max_indirect_range) {
@@ -1636,8 +1642,11 @@ Inode::ShrinkStream(Transaction *transaction, off_t size)
} }
if (data->MaxDirectRange() > size) { if (data->MaxDirectRange() > size) {
off_t offset = 0; off_t offset = 0;
off_t *maxDirect = &data->max_direct_range;
// gcc 4 work-around: "error: cannot bind packed field
// 'data->data_stream::max_indirect_range' to 'off_t&'"
FreeStreamArray(transaction, data->direct, NUM_DIRECT_BLOCKS, size, offset, FreeStreamArray(transaction, data->direct, NUM_DIRECT_BLOCKS, size, offset,
data->max_direct_range); *maxDirect);
} }
data->size = HOST_ENDIAN_TO_BFS_INT64(size); data->size = HOST_ENDIAN_TO_BFS_INT64(size);