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
This commit is contained in:
Ingo Weinhold 2007-05-07 13:41:12 +00:00
parent 3bef51f0ae
commit e23824d781
2 changed files with 12 additions and 11 deletions

View File

@ -31,6 +31,7 @@ struct fssh_stat {
// can only retrieve the R5 stat structure // can only retrieve the R5 stat structure
unsigned int fssh_st_type; /* attribute/index type */ unsigned int fssh_st_type; /* attribute/index type */
}; };
typedef struct fssh_stat fssh_struct_stat;
/* extended file types */ /* extended file types */
#define FSSH_S_ATTR_DIR 01000000000 /* attribute directory */ #define FSSH_S_ATTR_DIR 01000000000 /* attribute directory */

View File

@ -4959,17 +4959,17 @@ _kern_access(const char *path, int mode)
fssh_status_t fssh_status_t
_kern_read_stat(int fd, const char *path, bool traverseLeafLink, _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; fssh_struct_stat completeStat;
struct ::fssh_stat *originalStat = NULL; fssh_struct_stat *originalStat = NULL;
fssh_status_t status; fssh_status_t status;
if (statSize > sizeof(struct ::fssh_stat)) if (statSize > sizeof(fssh_struct_stat))
return FSSH_B_BAD_VALUE; return FSSH_B_BAD_VALUE;
// this supports different stat extensions // this supports different stat extensions
if (statSize < sizeof(struct ::fssh_stat)) { if (statSize < sizeof(fssh_struct_stat)) {
originalStat = stat; originalStat = stat;
stat = &completeStat; stat = &completeStat;
} }
@ -5028,16 +5028,16 @@ _kern_read_stat(int fd, const char *path, bool traverseLeafLink,
fssh_status_t fssh_status_t
_kern_write_stat(int fd, const char *path, bool traverseLeafLink, _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; return FSSH_B_BAD_VALUE;
// this supports different stat extensions // this supports different stat extensions
if (statSize < sizeof(struct ::fssh_stat)) { if (statSize < sizeof(fssh_struct_stat)) {
fssh_memset((uint8_t *)&completeStat + statSize, 0, sizeof(struct ::fssh_stat) - statSize); fssh_memset((uint8_t *)&completeStat + statSize, 0, sizeof(fssh_struct_stat) - statSize);
fssh_memcpy(&completeStat, stat, statSize); fssh_memcpy(&completeStat, stat, statSize);
stat = &completeStat; stat = &completeStat;
} }
@ -5128,7 +5128,7 @@ _kern_create_index(fssh_dev_t device, const char *name, uint32_t type, uint32_t
fssh_status_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); return index_name_read_stat(device, name, stat, true);
} }