diff options
| author | Jean-Philippe Bernardy <jeanphilippe.bernardy@gmail.com> | 2005-02-12 11:26:36 +0000 |
|---|---|---|
| committer | Jean-Philippe Bernardy <jeanphilippe.bernardy@gmail.com> | 2005-02-12 11:26:36 +0000 |
| commit | 45e0de3e638ce224df30abef489a6cd3db874f48 (patch) | |
| tree | ad0db8c3c8855391326330e204cdd7751a1c1c96 /apps | |
| parent | dbe19115ec6df78a612ac338e1716281df64455f (diff) | |
| download | rockbox-45e0de3e638ce224df30abef489a6cd3db874f48.zip rockbox-45e0de3e638ce224df30abef489a6cd3db874f48.tar.gz rockbox-45e0de3e638ce224df30abef489a6cd3db874f48.tar.bz2 rockbox-45e0de3e638ce224df30abef489a6cd3db874f48.tar.xz | |
long policy
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5929 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/settings.h | 2 | ||||
| -rw-r--r-- | apps/talk.c | 30 | ||||
| -rw-r--r-- | apps/talk.h | 8 |
3 files changed, 20 insertions, 20 deletions
diff --git a/apps/settings.h b/apps/settings.h index dd9c268..4f95027 100644 --- a/apps/settings.h +++ b/apps/settings.h @@ -296,7 +296,7 @@ enum optiontype { INT, BOOL }; struct opt_items { unsigned const char* string; - int voice_id; + long voice_id; }; /* prototypes */ diff --git a/apps/talk.c b/apps/talk.c index e1f2c6f..6fb75c2 100644 --- a/apps/talk.c +++ b/apps/talk.c @@ -69,7 +69,7 @@ struct voicefile /* file format of our voice file */ struct queue_entry /* one entry of the internal queue */ { unsigned char* buf; - int len; + long len; }; @@ -86,7 +86,7 @@ static int sent; /* how many bytes handed over to playback, owned by ISR */ static unsigned char curr_hd[3]; /* current frame header, for re-sync */ static int filehandle; /* global, so the MMC variant can keep the file open */ static unsigned char* p_silence; /* VOICE_PAUSE clip, used for termination */ -static int silence_len; /* length of the VOICE_PAUSE clip */ +static long silence_len; /* length of the VOICE_PAUSE clip */ static unsigned char* p_lastclip; /* address of latest clip, for silence add */ @@ -95,9 +95,9 @@ static unsigned char* p_lastclip; /* address of latest clip, for silence add */ static void load_voicefile(void); static void mp3_callback(unsigned char** start, int* size); static int shutup(void); -static int queue_clip(unsigned char* buf, int size, bool enqueue); +static int queue_clip(unsigned char* buf, long size, bool enqueue); static int open_voicefile(void); -static unsigned char* get_clip(int id, int* p_size); +static unsigned char* get_clip(long id, long* p_size); /***************** Private implementation *****************/ @@ -149,7 +149,7 @@ static void load_voicefile(void) /* thumbnail buffer is the remaining space behind */ p_thumbnail = mp3buf + file_size; - p_thumbnail += (int)p_thumbnail % 2; /* 16-bit align */ + p_thumbnail += (long)p_thumbnail % 2; /* 16-bit align */ size_for_thumbnail = mp3end - p_thumbnail; } else @@ -292,7 +292,7 @@ static int shutup(void) /* schedule a clip, at the end or discard the existing queue */ -static int queue_clip(unsigned char* buf, int size, bool enqueue) +static int queue_clip(unsigned char* buf, long size, bool enqueue) { int queue_level; @@ -335,9 +335,9 @@ static int queue_clip(unsigned char* buf, int size, bool enqueue) } /* fetch a clip from the voice file */ -static unsigned char* get_clip(int id, int* p_size) +static unsigned char* get_clip(long id, long* p_size) { - int clipsize; + long clipsize; unsigned char* clipbuf; if (id > VOICEONLY_DELIMITER) @@ -426,9 +426,9 @@ int talk_buffer_steal(void) /* play a voice ID from voicefile */ -int talk_id(int id, bool enqueue) +int talk_id(long id, bool enqueue) { - int clipsize; + long clipsize; unsigned char* clipbuf; int unit; @@ -445,10 +445,10 @@ int talk_id(int id, bool enqueue) return -1; /* check if this is a special ID, with a value */ - unit = ((unsigned)id) >> UNIT_SHIFT; + unit = ((unsigned long)id) >> UNIT_SHIFT; if (unit) { /* sign-extend the value */ - id = (unsigned)id << (32-UNIT_SHIFT); + id = (unsigned long)id << (32-UNIT_SHIFT); id >>= (32-UNIT_SHIFT); talk_value(id, unit, enqueue); /* speak it */ return 0; /* and stop, end of special case */ @@ -507,10 +507,10 @@ int talk_file(const char* filename, bool enqueue) /* say a numeric value, this word ordering works for english, but not necessarily for other languages (e.g. german) */ -int talk_number(int n, bool enqueue) +int talk_number(long n, bool enqueue) { int level = 0; /* mille count */ - int mil = 1000000000; /* highest possible "-illion" */ + long mil = 1000000000; /* highest possible "-illion" */ if (mpeg_status()) /* busy, buffer in use */ return -1; @@ -570,7 +570,7 @@ int talk_number(int n, bool enqueue) } /* singular/plural aware saying of a value */ -int talk_value(int n, int unit, bool enqueue) +int talk_value(long n, int unit, bool enqueue) { int unit_id; static const int unit_voiced[] = diff --git a/apps/talk.h b/apps/talk.h index d07f955..213e180 100644 --- a/apps/talk.h +++ b/apps/talk.h @@ -49,7 +49,7 @@ enum { /* make a "talkable" ID from number + unit unit is upper 4 bits, number the remaining (in regular 2's complement) */ -#define TALK_ID(n,u) ((u)<<UNIT_SHIFT | ((n) & ~(-1<<UNIT_SHIFT))) +#define TALK_ID(n,u) (((long)(u))<<UNIT_SHIFT | ((n) & ~(-1L<<UNIT_SHIFT))) /* convenience macro to have both virtual pointer and ID as arguments */ #define STR(id) ID2P(id), id @@ -60,10 +60,10 @@ extern const char* const file_thumbnail_ext; /* ".talk" for file voicing */ void talk_init(void); int talk_buffer_steal(void); /* claim the mp3 buffer e.g. for play/record */ -int talk_id(int id, bool enqueue); /* play a voice ID from voicefont */ +int talk_id(long id, bool enqueue); /* play a voice ID from voicefont */ int talk_file(const char* filename, bool enqueue); /* play a thumbnail from file */ -int talk_number(int n, bool enqueue); /* say a number */ -int talk_value(int n, int unit, bool enqueue); /* say a numeric value */ +int talk_number(long n, bool enqueue); /* say a number */ +int talk_value(long n, int unit, bool enqueue); /* say a numeric value */ int talk_spell(const char* spell, bool enqueue); /* spell a string */ #endif /* __TALK_H__ */ |