From 6259923c4e063a8f107bd024650d48c85ec42565 Mon Sep 17 00:00:00 2001 From: Blue_Dude Date: Tue, 6 Apr 2010 22:49:06 +0000 Subject: [PATCH] Another small bookmark.c revision, no functional change, saves bin size git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25503 a1c6a512-1295-4272-9138-f99709370657 --- apps/bookmark.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/bookmark.c b/apps/bookmark.c index 687290b90..1b82966be 100644 --- a/apps/bookmark.c +++ b/apps/bookmark.c @@ -62,7 +62,7 @@ struct bookmark_list }; /* bookmark flags */ -#define F_BMFILES 0x001 +#define F_BMFILES 0x01 /* bookmark values */ static struct { @@ -916,6 +916,12 @@ static const char* skip_token(const char* s) return s; } +static const char* long_token(const char* s, long* dest) +{ + *dest = atoi(s); /* Should be atol, but we don't have it. */ + return skip_token(s); +} + /* ----------------------------------------------------------------------- */ /* This function takes a bookmark and parses it. This function also */ /* validates the bookmark. Flags are set to indicate which bookmark */ @@ -927,7 +933,7 @@ static bool parse_bookmark(const char *bookmark, const int flags) const char* end; #define FLAG(a) (flags & a) -#define GET_INT_TOKEN(var) var = atoi(s); s = skip_token(s) +#define GET_INT_TOKEN(var) s = long_token(s, (long *)&var) #define GET_BOOL_TOKEN(var) var = (atoi(s)!=0); s = skip_token(s) GET_INT_TOKEN(bm.resume_index); -- 2.11.4.GIT