portability:

void * arithmetic is a GNU extension

(Logical change 1.26)
edge.strict_endians
flatcap.org!flatcap 2002-12-01 18:13:20 +00:00
parent 86126fa972
commit 3e1b7a9165
3 changed files with 17 additions and 17 deletions

View File

@ -687,7 +687,7 @@ res_err_out:
/* Update progress counters. */
total += to_read;
count -= to_read;
b += to_read;
(u8*)b += to_read;
continue;
}
/* It is a real lcn, read it into @dst. */
@ -703,7 +703,7 @@ retry:
if (br > 0) {
total += br;
count -= br;
b += br;
(u8*)b += br;
continue;
}
/* If the syscall was interrupted, try again. */
@ -927,7 +927,7 @@ s64 ntfs_attr_pwrite(ntfs_attr *na, const s64 pos, s64 count, void *b)
int i;
u8 *b2;
b2 = b + (to_write &
b2 = (u8*)b + (to_write &
~(sizeof(unsigned long) - 1));
for (i = 0; i < cnt; i++) {
if (b2[i]) {
@ -949,7 +949,7 @@ s64 ntfs_attr_pwrite(ntfs_attr *na, const s64 pos, s64 count, void *b)
*/
total += to_write;
count -= to_write;
b += to_write;
(u8*)b += to_write;
continue;
}
/* It is a real lcn, write it to the volume. */
@ -965,7 +965,7 @@ retry:
if (written > 0) {
total += written;
count -= written;
b += written;
(u8*)b += written;
continue;
}
/* If the syscall was interrupted, try again. */
@ -1079,7 +1079,7 @@ s64 ntfs_attr_mst_pread(ntfs_attr *na, const s64 pos, const s64 bk_cnt,
if (br <= 0)
return br;
br /= bk_size;
for (end = b + br * bk_size; b < end; b += bk_size)
for (end = (u8*)b + br * bk_size; b < end; (u8*)b += bk_size)
ntfs_post_read_mst_fixup((NTFS_RECORD*)b, bk_size);
/* Finally, return the number of blocks read. */
return br;
@ -1133,8 +1133,8 @@ s64 ntfs_attr_mst_pwrite(ntfs_attr *na, const s64 pos, s64 bk_cnt,
for (i = 0; i < bk_cnt; ++i) {
int err;
err = ntfs_pre_write_mst_fixup((NTFS_RECORD*)(b + i * bk_size),
bk_size);
err = ntfs_pre_write_mst_fixup((NTFS_RECORD*)
((u8*)b + i * bk_size), bk_size);
if (err < 0) {
/* Abort write at this position. */
if (!i)
@ -1147,7 +1147,7 @@ s64 ntfs_attr_mst_pwrite(ntfs_attr *na, const s64 pos, s64 bk_cnt,
written = ntfs_attr_pwrite(na, pos, bk_cnt * bk_size, b);
/* Quickly deprotect the data again. */
for (i = 0; i < bk_cnt; ++i)
ntfs_post_write_mst_fixup((NTFS_RECORD*)(b + i * bk_size));
ntfs_post_write_mst_fixup((NTFS_RECORD*)((u8*)b + i * bk_size));
if (written <= 0)
return written;
/* Finally, return the number of complete blocks written. */

View File

@ -193,8 +193,8 @@ s64 ntfs_mst_pread(const int fd, const s64 pos, s64 count,
*/
count = br / bksize;
for (i = 0; i < count; ++i)
ntfs_post_read_mst_fixup((NTFS_RECORD*)(b + i * bksize),
bksize);
ntfs_post_read_mst_fixup((NTFS_RECORD*)
((u8*)b + i * bksize), bksize);
/* Finally, return the number of complete blocks read. */
return count;
}
@ -244,8 +244,8 @@ s64 ntfs_mst_pwrite(const int fd, const s64 pos, s64 count,
for (i = 0; i < count; ++i) {
int err;
err = ntfs_pre_write_mst_fixup((NTFS_RECORD*)(b + i * bksize),
bksize);
err = ntfs_pre_write_mst_fixup((NTFS_RECORD*)
((u8*)b + i * bksize), bksize);
if (err < 0) {
/* Abort write at this position. */
if (!i)
@ -258,7 +258,7 @@ s64 ntfs_mst_pwrite(const int fd, const s64 pos, s64 count,
written = ntfs_pwrite(fd, pos, count * bksize, b);
/* Quickly deprotect the data again. */
for (i = 0; i < count; ++i)
ntfs_post_write_mst_fixup((NTFS_RECORD*)(b + i * bksize));
ntfs_post_write_mst_fixup((NTFS_RECORD*)((u8*)b + i * bksize));
if (written <= 0)
return written;
/* Finally, return the number of complete blocks written. */

View File

@ -1054,7 +1054,7 @@ s64 ntfs_rl_pwrite(const ntfs_volume *vol, const run_list_element *rl,
int i;
u8 *b2;
b2 = b + (to_write &
b2 = (u8*)b + (to_write &
~(sizeof(unsigned long) - 1));
for (i = 0; i < cnt; i++) {
if (b2[i])
@ -1067,7 +1067,7 @@ s64 ntfs_rl_pwrite(const ntfs_volume *vol, const run_list_element *rl,
*/
total += to_write;
count -= to_write;
b += to_write;
(u8*)b += to_write;
continue;
}
/* It is a real lcn, write it to the volume. */
@ -1080,7 +1080,7 @@ retry:
if (written > 0) {
total += written;
count -= written;
b += written;
(u8*)b += written;
continue;
}
/* If the syscall was interrupted, try again. */