[Libsysio-commit] HEAD: libsysio/src fs.c getdirentries.c inode.c ioctx.c module.mk statvfs.c statvf
Brought to you by:
lward
|
From: Lee W. <lw...@us...> - 2004-02-24 15:12:45
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32223/src Modified Files: fs.c getdirentries.c inode.c ioctx.c module.mk statvfs.c statvfs64.c Log Message: Cleaned out all the pointer arithmetic utilizing void pointers. No longer build the empty statvfs{64} modules. All in an attempt to make the code C99 compliant. Index: fs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fs.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- fs.c 6 Feb 2004 20:07:30 -0000 1.9 +++ fs.c 24 Feb 2004 14:58:26 -0000 1.10 @@ -96,7 +96,7 @@ _sysio_fssw_register(const char *name, s fssw = malloc(sizeof(struct fsswent) + strlen(name) + 1); if (!fssw) return -errno; - fssw->fssw_name = (void *)fssw + sizeof(struct fsswent); + fssw->fssw_name = (char *)fssw + sizeof(struct fsswent); (void )strcpy((char *)fssw->fssw_name, name); fssw->fssw_ops = *ops; Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- getdirentries.c 26 Jan 2004 16:48:34 -0000 1.7 +++ getdirentries.c 24 Feb 2004 14:58:26 -0000 1.8 @@ -186,13 +186,13 @@ getdirentries(int fd, } dp->d_type = d64p->d_type; dp->d_reclen = reclen; - nxtdp = (void *)dp + dp->d_reclen; + nxtdp = (struct dirent *)((char *)dp + dp->d_reclen); (void )memcpy(dp->d_name, d64p->d_name, n); for (cp = dp->d_name + n; cp < (char *)nxtdp; *cp++ = '\0') ; cc -= d64p->d_reclen; od64p = d64p; - d64p = (void *)d64p + d64p->d_reclen; + d64p = (struct dirent64 *)((char *)d64p + d64p->d_reclen); nbytes -= reclen; #if defined(BSD) || defined(REDSTORM) off += reclen; Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -b -B -p -r1.13 -r1.14 --- inode.c 6 Feb 2004 20:07:30 -0000 1.13 +++ inode.c 24 Feb 2004 14:58:26 -0000 1.14 @@ -196,15 +196,15 @@ static unsigned hash(struct file_identifier *fid) { size_t n; - void *p; + unsigned char *ucp; unsigned hkey; n = fid->fid_len; - p = fid->fid_data; + ucp = fid->fid_data; hkey = 0; do { hkey <<= 1; - hkey += *(unsigned char *)p++; + hkey += *ucp++; } while (--n); return hkey; } @@ -388,7 +388,7 @@ _sysio_pb_new(struct qstr *name, struct * We have put the space for the name immediately behind * the record in order to maximize spatial locality. */ - cp = (void *)pb + sizeof(struct pnode_base); + cp = (char *)pb + sizeof(struct pnode_base); (void )strncpy(cp, name->name, name->len); pb->pb_name.name = cp; assert(name->hashval); Index: ioctx.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctx.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- ioctx.c 14 Feb 2004 19:42:59 -0000 1.8 +++ ioctx.c 24 Feb 2004 14:58:26 -0000 1.9 @@ -386,7 +386,7 @@ _sysio_enumerate_extents(const struct in if (acc && cc <= acc) abort(); /* paranoia */ acc = cc; - iovec.iov_base += cc; + iovec.iov_base = (char *)iovec.iov_base + cc; iovec.iov_len -= cc; } else { start = iov; Index: module.mk =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/module.mk,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -b -B -p -r1.2 -r1.3 --- module.mk 6 Feb 2004 20:07:30 -0000 1.2 +++ module.mk 24 Feb 2004 14:58:26 -0000 1.3 @@ -1,3 +1,7 @@ +# +# Note; Remove statvfs{,64}.c until we decide what to do with them. +# Lee; Tue Feb 24 09:37:32 EST 2004 +# SRCDIR_SRCS = src/access.c src/chdir.c src/chmod.c \ src/chown.c src/dev.c src/dup.c src/fcntl.c \ src/file.c src/fs.c src/fsync.c \ @@ -7,6 +11,6 @@ SRCDIR_SRCS = src/access.c src/chdir.c s src/mknod.c src/mount.c src/namei.c \ src/open.c src/rw.c src/rename.c \ src/rmdir.c src/stat64.c src/stat.c \ - src/statvfs64.c src/statvfs.c src/symlink.c \ + src/symlink.c \ src/truncate.c src/unlink.c src/utime.c SRCDIR_EXTRA = src/module.mk Index: statvfs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- statvfs.c 26 Jan 2004 16:34:54 -0000 1.6 +++ statvfs.c 24 Feb 2004 14:58:26 -0000 1.7 @@ -41,8 +41,6 @@ * le...@sa... */ -#ifdef _HAVE_STATVFS - #ifndef BSD #include <unistd.h> @@ -157,4 +155,3 @@ sysio_sym_weak_alias(fstatvfs, __fstatvf #endif #endif /* ifndef BSD */ -#endif /* defined(_HAVE_STATVFS) */ Index: statvfs64.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs64.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- statvfs64.c 6 Feb 2004 20:07:30 -0000 1.8 +++ statvfs64.c 24 Feb 2004 14:58:26 -0000 1.9 @@ -41,8 +41,6 @@ * le...@sa... */ -#ifdef _HAVE_STATVFS - #ifndef BSD #include <unistd.h> #include <errno.h> @@ -115,4 +113,3 @@ sysio_sym_weak_alias(fstatvfs64, __fstat #endif #endif /* ifndef BSD */ -#endif /* define(_HAVE_STATVFS) */ |