mirror of
https://github.com/vivier/EMILE.git
synced 2026-10-22 04:02:33 +00:00
off_t: fix mixed type and printf format
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
1 parent
d9b3b67692
commit
7c6c6b8f3e
12 files changed
+18
-18
No files matched your search
@@ -164,7 +164,7 @@ char* emile_floppy_add(int fd, char *image)
|
||||
if (size == -1)
|
||||
return NULL;
|
||||
|
||||
sprintf(buf, "block:(fd0)0x%lx,0x%zx", offset / 512, size);
|
||||
sprintf(buf, "block:(fd0)0x%jx,0x%zx", offset / 512, size);
|
||||
|
||||
return strdup(buf);
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
#include "libext2.h"
|
||||
#include "ext2.h"
|
||||
|
||||
int ext2_lseek(stream_FILE *_file, long offset, int whence)
|
||||
int ext2_lseek(stream_FILE *_file, off_t offset, int whence)
|
||||
{
|
||||
ext2_FILE *file = (ext2_FILE*)_file;
|
||||
long new_offset;
|
||||
ext2_FILE *file = (ext2_FILE*)_file;
|
||||
long new_offset;
|
||||
|
||||
switch(whence)
|
||||
{
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ extern void ext2_closedir(stream_DIR *dir);
|
||||
extern stream_FILE* ext2_open(stream_VOLUME *, char* pathname);
|
||||
extern size_t ext2_read(stream_FILE *file, void *buf, size_t count);
|
||||
extern void ext2_close(stream_FILE *file);
|
||||
extern int ext2_lseek(stream_FILE *file, long offset, int whence);
|
||||
extern int ext2_lseek(stream_FILE *file, off_t offset, int whence);
|
||||
extern int ext2_fstat(stream_FILE *file, struct stream_stat *buf);
|
||||
|
||||
#endif /* __LIBEXT2_H__ */
|
||||
@@ -9,10 +9,10 @@
|
||||
#include "libiso9660.h"
|
||||
#include "iso9660.h"
|
||||
|
||||
int iso9660_lseek(stream_FILE *_file, long offset, int whence)
|
||||
int iso9660_lseek(stream_FILE *_file, off_t offset, int whence)
|
||||
{
|
||||
iso9660_FILE *file = (iso9660_FILE*)_file;
|
||||
long new_offset;
|
||||
iso9660_FILE *file = (iso9660_FILE*)_file;
|
||||
long new_offset;
|
||||
|
||||
switch(whence)
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ extern struct iso_directory_record *iso9660_readdir(stream_DIR *dir);
|
||||
extern int iso9660_is_directory(struct iso_directory_record * idr);
|
||||
extern size_t iso9660_read(stream_FILE *file, void *buf, size_t count);
|
||||
extern void iso9660_close(stream_FILE *file);
|
||||
extern int iso9660_lseek(stream_FILE *file, long offset, int whence);
|
||||
extern int iso9660_lseek(stream_FILE *file, off_t offset, int whence);
|
||||
extern int iso9660_fstat(stream_FILE *file, struct stream_stat *buf);
|
||||
extern void iso9660_name(stream_VOLUME *volume, struct iso_directory_record * idr, char *buffer);
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ typedef stream_FILE *(*stream_open_t)(stream_VOLUME *volume, char *path);
|
||||
typedef int (*stream_umount_t)(stream_VOLUME *volume);
|
||||
|
||||
typedef size_t (*stream_read_t)(stream_FILE *file, void *buf, size_t count);
|
||||
typedef int (*stream_lseek_t)(stream_FILE *file, long offset, int whence);
|
||||
typedef int (*stream_lseek_t)(stream_FILE *file, off_t offset, int whence);
|
||||
typedef void (*stream_close_t)(stream_FILE *file);
|
||||
typedef int (*stream_fstat_t)(stream_FILE *file, struct stream_stat *buf);
|
||||
|
||||
@@ -91,7 +91,7 @@ extern stream_t *stream_open(char *dev);
|
||||
extern int stream_read_sector(stream_t *stream,
|
||||
off_t offset, void* buffer, size_t size);
|
||||
extern int stream_read(stream_t *stream, void *buf, size_t count);
|
||||
extern int stream_lseek(stream_t *stream, long offset, int whence);
|
||||
extern int stream_lseek(stream_t *stream, off_t offset, int whence);
|
||||
extern int stream_close(stream_t *stream);
|
||||
extern int stream_uncompress(stream_t *stream);
|
||||
extern int stream_fstat(stream_t *stream, struct stream_stat *buf);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "libstream.h"
|
||||
|
||||
int stream_lseek(stream_t *stream, long offset, int whence)
|
||||
int stream_lseek(stream_t *stream, off_t offset, int whence)
|
||||
{
|
||||
return stream->fs.lseek(stream->file, offset, whence);
|
||||
return stream->fs.lseek(stream->file, offset, whence);
|
||||
}
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
extern void console_init(void);
|
||||
extern int console_putchar(int c);
|
||||
extern void console_putstring(const char *s);
|
||||
int wait_char;
|
||||
extern int wait_char;
|
||||
#ifdef USE_CLI
|
||||
extern int console_keypressed(int timeout);
|
||||
extern int console_getchar(void);
|
||||
|
||||
+1
-1
@@ -294,7 +294,7 @@ char* load_chainloader(char *path)
|
||||
|
||||
if (ret != stat.st_size)
|
||||
{
|
||||
printf("Cannot read %ld from %s\n", stat.st_size, path);
|
||||
printf("Cannot read %jd from %s\n", stat.st_size, path);
|
||||
free(loader);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ static int put_driver(map_t *map, int partition, char* appledriver)
|
||||
code = malloc(st.st_size);
|
||||
if (code == NULL)
|
||||
{
|
||||
fprintf(stderr, "ERROR: cannot malloc %ld\n", st.st_size);
|
||||
fprintf(stderr, "ERROR: cannot malloc %jd\n", st.st_size);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -568,7 +568,7 @@ static int8_t *set_config_no_fs(char *config_path)
|
||||
return NULL;
|
||||
}
|
||||
sprintf(chainloader,
|
||||
"block:(sd%d)0x%x,0x%lx", unit_id,
|
||||
"block:(sd%d)0x%x,0x%jx", unit_id,
|
||||
container->blocks[0].offset,
|
||||
st.st_size);
|
||||
free(container);
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ int main(int argc, char **argv)
|
||||
if (get_info) {
|
||||
struct stream_stat st;
|
||||
iso9660_fstat(file, &st);
|
||||
printf("%ld %ld\n", st.st_base * 4, st.st_size);
|
||||
printf("%jd %jd\n", st.st_base * 4, st.st_size);
|
||||
} else {
|
||||
while((size = iso9660_read(file, buffer, 512)) > 0)
|
||||
write(STDOUT_FILENO, buffer, size);
|
||||
|
||||
Reference in new issue
Block a user