fix vc8 errors reported by andrew: (thanks!)

- made file_io_wait buffer non-const (less const_casting around -
buffers are really non-const. besides which, inadvertent use will be
caught via MMU)
- zip: disambiguate abs() param

This was SVN commit r3426.
This commit is contained in:
janwas 2006-01-25 07:37:20 +00:00
parent 1ea2d25373
commit afe37d9fe2
3 changed files with 11 additions and 6 deletions

View File

@ -271,7 +271,7 @@ extern LibError file_io_issue(File* f, off_t ofs, size_t size, void* buf, FileIo
extern int file_io_has_completed(FileIo* io);
// wait for the given IO to complete. passes back its buffer and size.
extern LibError file_io_wait(FileIo* io, const void*& p, size_t& size);
extern LibError file_io_wait(FileIo* io, void*& p, size_t& size);
// indicates the IO's buffer is no longer needed and frees that memory.
extern LibError file_io_discard(FileIo* io);

View File

@ -132,7 +132,7 @@ int file_io_has_completed(FileIo* io)
}
LibError file_io_wait(FileIo* io, const void*& p, size_t& size)
LibError file_io_wait(FileIo* io, void*& p, size_t& size)
{
debug_printf("FILE| wait io=%p\n", io);

View File

@ -527,13 +527,18 @@ static void test_fat_timedate_conversion()
// note: FAT time stores second/2, which means converting may
// end up off by 1 second.
time_t t = time(0);
time_t converted_t = time_t_from_FAT(FAT_from_time_t(t));
TEST(abs(converted_t-t) < 2);
time_t t, converted_t;
long dt;
t = time(0);
converted_t = time_t_from_FAT(FAT_from_time_t(t));
dt = converted_t-t; // disambiguate abs() parameter
TEST(abs(dt) < 2);
t++;
converted_t = time_t_from_FAT(FAT_from_time_t(t));
TEST(abs(converted_t-t) < 2);
dt = converted_t-t; // disambiguate abs() parameter
TEST(abs(dt) < 2);
}
static void self_test()