From e23824d781d789eb9844a0fe3701a203c33b8586 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Mon, 7 May 2007 13:41:12 +0000 Subject: [PATCH] Surprising how much gcc 4 compilers on Linux differ. Another attempt to make both gcc 2.95.3 and the plethora of gcc 4s happy: Typedefed struct fssh_stat to fssh_struct_stat, thus hopefully avoiding spurious errors concerning clashes with the function or regarding namespacing. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21055 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/fs_shell/fssh_stat.h | 1 + src/tools/fs_shell/vfs.cpp | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/headers/private/fs_shell/fssh_stat.h b/headers/private/fs_shell/fssh_stat.h index b85f5dea7d..ea72633152 100644 --- a/headers/private/fs_shell/fssh_stat.h +++ b/headers/private/fs_shell/fssh_stat.h @@ -31,6 +31,7 @@ struct fssh_stat { // can only retrieve the R5 stat structure unsigned int fssh_st_type; /* attribute/index type */ }; +typedef struct fssh_stat fssh_struct_stat; /* extended file types */ #define FSSH_S_ATTR_DIR 01000000000 /* attribute directory */ diff --git a/src/tools/fs_shell/vfs.cpp b/src/tools/fs_shell/vfs.cpp index f171e408ff..a5ba099d5b 100644 --- a/src/tools/fs_shell/vfs.cpp +++ b/src/tools/fs_shell/vfs.cpp @@ -4959,17 +4959,17 @@ _kern_access(const char *path, int mode) fssh_status_t _kern_read_stat(int fd, const char *path, bool traverseLeafLink, - struct ::fssh_stat *stat, fssh_size_t statSize) + fssh_struct_stat *stat, fssh_size_t statSize) { - struct ::fssh_stat completeStat; - struct ::fssh_stat *originalStat = NULL; + fssh_struct_stat completeStat; + fssh_struct_stat *originalStat = NULL; fssh_status_t status; - if (statSize > sizeof(struct ::fssh_stat)) + if (statSize > sizeof(fssh_struct_stat)) return FSSH_B_BAD_VALUE; // this supports different stat extensions - if (statSize < sizeof(struct ::fssh_stat)) { + if (statSize < sizeof(fssh_struct_stat)) { originalStat = stat; stat = &completeStat; } @@ -5028,16 +5028,16 @@ _kern_read_stat(int fd, const char *path, bool traverseLeafLink, fssh_status_t _kern_write_stat(int fd, const char *path, bool traverseLeafLink, - const struct ::fssh_stat *stat, fssh_size_t statSize, int statMask) + const fssh_struct_stat *stat, fssh_size_t statSize, int statMask) { - struct ::fssh_stat completeStat; + fssh_struct_stat completeStat; - if (statSize > sizeof(struct ::fssh_stat)) + if (statSize > sizeof(fssh_struct_stat)) return FSSH_B_BAD_VALUE; // this supports different stat extensions - if (statSize < sizeof(struct ::fssh_stat)) { - fssh_memset((uint8_t *)&completeStat + statSize, 0, sizeof(struct ::fssh_stat) - statSize); + if (statSize < sizeof(fssh_struct_stat)) { + fssh_memset((uint8_t *)&completeStat + statSize, 0, sizeof(fssh_struct_stat) - statSize); fssh_memcpy(&completeStat, stat, statSize); stat = &completeStat; } @@ -5128,7 +5128,7 @@ _kern_create_index(fssh_dev_t device, const char *name, uint32_t type, uint32_t fssh_status_t -_kern_read_index_stat(fssh_dev_t device, const char *name, struct ::fssh_stat *stat) +_kern_read_index_stat(fssh_dev_t device, const char *name, fssh_struct_stat *stat) { return index_name_read_stat(device, name, stat, true); }