summaryrefslogtreecommitdiffstats
path: root/apps/bookmark.c
diff options
context:
space:
mode:
authorJeffrey Goode <jeffg7@gmail.com>2010-04-06 22:49:06 +0000
committerJeffrey Goode <jeffg7@gmail.com>2010-04-06 22:49:06 +0000
commitbec92328573f3fc93b7f25a3f715901db0ea93cd (patch)
treeca05009bc0517b3b7160a2e46ea52677721135e6 /apps/bookmark.c
parentb2ba11201fb586d4bcf00501100ee788b8b78a20 (diff)
downloadrockbox-bec92328573f3fc93b7f25a3f715901db0ea93cd.tar.gz
rockbox-bec92328573f3fc93b7f25a3f715901db0ea93cd.tar.bz2
rockbox-bec92328573f3fc93b7f25a3f715901db0ea93cd.zip
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
Diffstat (limited to 'apps/bookmark.c')
-rw-r--r--apps/bookmark.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/bookmark.c b/apps/bookmark.c
index 687290b901..1b82966be8 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);