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),
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),
* 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;
}
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);
}
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();
#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);