diff options
author | Jeffrey Goode <jeffg7@gmail.com> | 2010-04-10 21:53:55 +0000 |
---|---|---|
committer | Jeffrey Goode <jeffg7@gmail.com> | 2010-04-10 21:53:55 +0000 |
commit | e2eff494a3c11547758b3830854b63626f979853 (patch) | |
tree | 37ace4674764fd17620109f94eeee768aca1f6bb /apps | |
parent | 4f3f7dd8567f86d03ebd7ea6658fde54bcc4d5e5 (diff) |
Fix yellow: pointer cast
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25578 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/bookmark.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/apps/bookmark.c b/apps/bookmark.c index 2c9b3d5d17..029a56406f 100644 --- a/apps/bookmark.c +++ b/apps/bookmark.c @@ -942,9 +942,15 @@ static const char* skip_token(const char* s) return s; } +static const char* int_token(const char* s, int* dest) +{ + *dest = atoi(s); + return skip_token(s); +} + static const char* long_token(const char* s, long* dest) { - *dest = atoi(s); /* Should be atol, but we don't have it. */ + *dest = atoi(s); /* Should be atol, but we don't have it. */ return skip_token(s); } @@ -958,7 +964,8 @@ static bool parse_bookmark(const char *bookmark, const bool parse_filenames) const char* s = bookmark; const char* end; -#define GET_INT_TOKEN(var) s = long_token(s, (long *)&var) +#define GET_INT_TOKEN(var) s = int_token(s, &var) +#define GET_LONG_TOKEN(var) s = long_token(s, &var) #define GET_BOOL_TOKEN(var) var = (atoi(s)!=0); s = skip_token(s) /* if new format bookmark, extract the optional content flags, @@ -973,11 +980,11 @@ static bool parse_bookmark(const char *bookmark, const bool parse_filenames) /* extract all original bookmark tokens */ GET_INT_TOKEN(bm.resume_index); - GET_INT_TOKEN(bm.resume_offset); + GET_LONG_TOKEN(bm.resume_offset); GET_INT_TOKEN(bm.resume_seed); if (!new_format) /* skip deprecated token */ s = skip_token(s); - GET_INT_TOKEN(bm.resume_time); + GET_LONG_TOKEN(bm.resume_time); GET_INT_TOKEN(bm.repeat_mode); GET_BOOL_TOKEN(bm.shuffle); |