diff options
author | Daniel Stenberg <daniel@haxx.se> | 2003-12-08 21:58:38 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2003-12-08 21:58:38 +0000 |
commit | ae960a9ece0552d1982e56e26cc4c3932f51f2ab (patch) | |
tree | cba0485d0dfa7febd5f751e2636c27919eb55551 /firmware/common/file.c | |
parent | 8b813d0b99bcda14d6101ea38cc8ebb498281675 (diff) | |
download | rockbox-ae960a9ece0552d1982e56e26cc4c3932f51f2ab.tar.gz rockbox-ae960a9ece0552d1982e56e26cc4c3932f51f2ab.zip |
my take at fixing the simulator warnings by adding mode_t, size_t, ssize_t
and off_t
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4116 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/common/file.c')
-rw-r--r-- | firmware/common/file.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c index b4b879f8fb..f81038fa77 100644 --- a/firmware/common/file.c +++ b/firmware/common/file.c | |||
@@ -52,7 +52,7 @@ static struct filedesc openfiles[MAX_OPEN_FILES]; | |||
52 | 52 | ||
53 | static int flush_cache(int fd); | 53 | static int flush_cache(int fd); |
54 | 54 | ||
55 | int creat(const char *pathname, int mode) | 55 | int creat(const char *pathname, mode_t mode) |
56 | { | 56 | { |
57 | (void)mode; | 57 | (void)mode; |
58 | return open(pathname, O_WRONLY|O_CREAT|O_TRUNC); | 58 | return open(pathname, O_WRONLY|O_CREAT|O_TRUNC); |
@@ -307,7 +307,7 @@ int rename(const char* path, const char* newpath) | |||
307 | return 0; | 307 | return 0; |
308 | } | 308 | } |
309 | 309 | ||
310 | int ftruncate(int fd, unsigned int size) | 310 | int ftruncate(int fd, off_t size) |
311 | { | 311 | { |
312 | int rc, sector; | 312 | int rc, sector; |
313 | struct filedesc* file = &openfiles[fd]; | 313 | struct filedesc* file = &openfiles[fd]; |
@@ -513,22 +513,22 @@ static int readwrite(int fd, void* buf, int count, bool write) | |||
513 | return nread; | 513 | return nread; |
514 | } | 514 | } |
515 | 515 | ||
516 | int write(int fd, void* buf, int count) | 516 | ssize_t write(int fd, const void* buf, size_t count) |
517 | { | 517 | { |
518 | if (!openfiles[fd].write) { | 518 | if (!openfiles[fd].write) { |
519 | errno = EACCES; | 519 | errno = EACCES; |
520 | return -1; | 520 | return -1; |
521 | } | 521 | } |
522 | return readwrite(fd, buf, count, true); | 522 | return readwrite(fd, (void *)buf, count, true); |
523 | } | 523 | } |
524 | 524 | ||
525 | int read(int fd, void* buf, int count) | 525 | ssize_t read(int fd, void* buf, size_t count) |
526 | { | 526 | { |
527 | return readwrite(fd, buf, count, false); | 527 | return readwrite(fd, buf, count, false); |
528 | } | 528 | } |
529 | 529 | ||
530 | 530 | ||
531 | int lseek(int fd, int offset, int whence) | 531 | off_t lseek(int fd, off_t offset, int whence) |
532 | { | 532 | { |
533 | int pos; | 533 | int pos; |
534 | int newsector; | 534 | int newsector; |