summaryrefslogtreecommitdiffstats
path: root/utils/imxtools/sbtools/elftosb1.c
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-08-21 22:20:53 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-08-21 22:20:53 +0200
commit99f3ca174e3e6a3e6a55931b012208be64d8be39 (patch)
tree2a8a1a6ab55f44be85d287c06f9f35e0a5bd92fc /utils/imxtools/sbtools/elftosb1.c
parent1357e0a4f1567e4bf5f3ecb27c28457d1dfc1ab4 (diff)
downloadrockbox-99f3ca174e3e6a3e6a55931b012208be64d8be39.tar.gz
rockbox-99f3ca174e3e6a3e6a55931b012208be64d8be39.tar.bz2
rockbox-99f3ca174e3e6a3e6a55931b012208be64d8be39.zip
sbtools: more code refactoring
Factor all printf method with a unique one defined in misc.h Change-Id: I58fbf8916b76e873a2e6678506d2c8aece7834ec
Diffstat (limited to 'utils/imxtools/sbtools/elftosb1.c')
-rw-r--r--utils/imxtools/sbtools/elftosb1.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/utils/imxtools/sbtools/elftosb1.c b/utils/imxtools/sbtools/elftosb1.c
index 43f9b1e9be..83e1c175bc 100644
--- a/utils/imxtools/sbtools/elftosb1.c
+++ b/utils/imxtools/sbtools/elftosb1.c
@@ -68,24 +68,6 @@ static char *cmd_line_next_arg(void *user)
return *(uu->argv - 1);
}
-static bool elf_read(void *user, uint32_t addr, void *buf, size_t count)
-{
- if(fseek((FILE *)user, addr, SEEK_SET) == -1)
- return false;
- return fread(buf, 1, count, (FILE *)user) == count;
-}
-
-static void elf_printf(void *user, bool error, const char *fmt, ...)
-{
- if(!g_debug && !error)
- return;
- (void) user;
- va_list args;
- va_start(args, fmt);
- vprintf(fmt, args);
- va_end(args);
-}
-
static int sb1_add_inst(struct sb1_file_t *sb, struct sb1_inst_t *insts, int nr_insts)
{
sb->insts = augment_array(sb->insts, sizeof(struct sb1_inst_t), sb->nr_insts,
@@ -402,7 +384,7 @@ static int load_elf(struct sb1_file_t *sb, const char *filename, int act)
if(g_debug)
printf("Loading elf file '%s'...\n", filename);
elf_init(&elf);
- bool loaded = elf_read_file(&elf, elf_read, elf_printf, fd);
+ bool loaded = elf_read_file(&elf, elf_std_read, generic_std_printf, fd);
fclose(fd);
if(!loaded)
bug("error loading elf file '%s'\n", filename);