diff --git a/src/vol/namei_ops.c b/src/vol/namei_ops.c index 9e28fbc1c0..2d6f1ce51d 100644 --- a/src/vol/namei_ops.c +++ b/src/vol/namei_ops.c @@ -2742,7 +2742,7 @@ convertVolumeInfo(FD_t fdr, FD_t fdw, afs_uint32 vid) struct VolumeDiskData vd; char *p; - if (OS_READ(fdr, (char *)&vd, sizeof(struct VolumeDiskData)) != + if (OS_READ(fdr, &vd, sizeof(struct VolumeDiskData)) != sizeof(struct VolumeDiskData)) { Log("1 convertVolumeInfo: read failed for %lu with code %d\n", afs_printable_uint32_lu(vid), @@ -2761,7 +2761,7 @@ convertVolumeInfo(FD_t fdr, FD_t fdw, afs_uint32 vid) if (p && !strcmp(p, ".readonly")) { memset(p, 0, 9); } - if (OS_WRITE(fdw, (char *)&vd, sizeof(struct VolumeDiskData)) != + if (OS_WRITE(fdw, &vd, sizeof(struct VolumeDiskData)) != sizeof(struct VolumeDiskData)) { Log("1 convertVolumeInfo: write failed for %lu with code %d\n", afs_printable_uint32_lu(vid), diff --git a/src/vol/ntops.c b/src/vol/ntops.c index 6931fb132a..715480d5ee 100644 --- a/src/vol/ntops.c +++ b/src/vol/ntops.c @@ -76,7 +76,7 @@ nt_unlink(char *name) * the handle or -1 on error. */ FD_t -nt_open(char *name, int flags, int mode) +nt_open(const char *name, int flags, int mode) { HANDLE fh; DWORD nt_access = 0; @@ -141,12 +141,12 @@ nt_close(FD_t fd) } int -nt_write(FD_t fd, char *buf, afs_sfsize_t size) +nt_write(FD_t fd, void *buf, afs_sfsize_t size) { BOOL code; DWORD nbytes; - code = WriteFile((HANDLE) fd, (void *)buf, (DWORD) size, &nbytes, NULL); + code = WriteFile((HANDLE) fd, buf, (DWORD) size, &nbytes, NULL); if (!code) { errno = nterr_nt2unix(GetLastError(), EBADF); @@ -181,12 +181,12 @@ nt_pwrite(FD_t fd, const void * buf, afs_sfsize_t count, afs_foff_t offset) } int -nt_read(FD_t fd, char *buf, afs_sfsize_t size) +nt_read(FD_t fd, void *buf, afs_sfsize_t size) { BOOL code; DWORD nbytes; - code = ReadFile((HANDLE) fd, (void *)buf, (DWORD) size, &nbytes, NULL); + code = ReadFile((HANDLE) fd, buf, (DWORD) size, &nbytes, NULL); if (!code) { DWORD gle = GetLastError(); diff --git a/src/vol/ntops.h b/src/vol/ntops.h index e19dfd61dd..6661979106 100644 --- a/src/vol/ntops.h +++ b/src/vol/ntops.h @@ -22,10 +22,10 @@ extern char *PrintInode(char *, Inode); #endif /* Basic file operations */ -extern FD_t nt_open(char *name, int flags, int mode); +extern FD_t nt_open(const char *name, int flags, int mode); extern int nt_close(FD_t fd); -extern int nt_write(FD_t fd, char *buf, afs_sfsize_t size); -extern int nt_read(FD_t fd, char *buf, afs_sfsize_t size); +extern int nt_write(FD_t fd, void *buf, afs_sfsize_t size); +extern int nt_read(FD_t fd, void *buf, afs_sfsize_t size); extern int nt_pread(FD_t fd, void * buf, afs_sfsize_t count, afs_foff_t offset); extern int nt_pwrite(FD_t fd, const void * buf, afs_sfsize_t count, afs_foff_t offset); extern afs_sfsize_t nt_size(FD_t fd);