long policy

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5863 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jean-Philippe Bernardy 2005-02-09 10:56:54 +00:00
parent c1d7708dfa
commit 0f6b3796d6
3 changed files with 31 additions and 30 deletions

View file

@ -1,4 +1,4 @@
/*************************************************************************** /***************************************************************************
* __________ __ ___. * __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
@ -6,7 +6,7 @@
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/ * \/ \/ \/ \/ \/
* *
* Copyright (C) 2003 by Benjamin Metzler * Copyright (C)2003 by Benjamin Metzler
* *
* All files in this archive are subject to the GNU General Public License. * All files in this archive are subject to the GNU General Public License.
* See the file COPYING in the source tree root for full license agreement. * See the file COPYING in the source tree root for full license agreement.
@ -70,7 +70,7 @@ static bool parse_bookmark(const char *bookmark,
int *resume_first_index, int *resume_first_index,
char* resume_file, char* resume_file,
unsigned int resume_file_size, unsigned int resume_file_size,
int* ms, long* ms,
int * repeat_mode, int * repeat_mode,
bool *shuffle, bool *shuffle,
char* file_name); char* file_name);
@ -778,7 +778,7 @@ static void display_bookmark(const char* bookmark,
int bookmark_count) int bookmark_count)
{ {
int resume_index = 0; int resume_index = 0;
int ms = 0; long ms = 0;
int repeat_mode = 0; int repeat_mode = 0;
bool playlist_shuffle = false; bool playlist_shuffle = false;
int len; int len;
@ -834,19 +834,20 @@ static void display_bookmark(const char* bookmark,
/* elapsed time*/ /* elapsed time*/
if ( ms < 3600000 ) if ( ms < 3600000 )
{ {
snprintf(global_temp_buffer, sizeof(global_temp_buffer), "%s: %d:%02d", snprintf(global_temp_buffer, sizeof(global_temp_buffer), "%s: %ld:%02d",
str(LANG_BOOKMARK_SELECT_TIME_TEXT), str(LANG_BOOKMARK_SELECT_TIME_TEXT),
ms / 60000, ms / 60000,
ms % 60000 / 1000); (unsigned int)(ms % 60000) / 1000);
/* unsigned int: hinting for 16bits archs */
} }
else else
{ {
snprintf(global_temp_buffer, sizeof(global_temp_buffer), snprintf(global_temp_buffer, sizeof(global_temp_buffer),
"%s: %d:%02d:%02d", "%s: %ld:%02ld:%02d",
str(LANG_BOOKMARK_SELECT_TIME_TEXT), str(LANG_BOOKMARK_SELECT_TIME_TEXT),
ms / 3600000, ms / 3600000,
ms % 3600000 / 60000, ms % 3600000 / 60000,
ms % 60000 / 1000); (unsigned int)(ms % 60000) / 1000);
} }
lcd_puts_scroll(0, 3, global_temp_buffer); lcd_puts_scroll(0, 3, global_temp_buffer);
@ -900,7 +901,7 @@ static void say_bookmark(const char* bookmark,
int bookmark_id) int bookmark_id)
{ {
int resume_index; int resume_index;
int ms; long ms;
char dir[MAX_PATH]; char dir[MAX_PATH];
bool enqueue = false; /* only the first voice is not queued */ bool enqueue = false; /* only the first voice is not queued */
@ -987,7 +988,7 @@ static bool parse_bookmark(const char *bookmark,
int *resume_first_index, int *resume_first_index,
char* resume_file, char* resume_file,
unsigned int resume_file_size, unsigned int resume_file_size,
int* ms, long* ms,
int * repeat_mode, bool *shuffle, int * repeat_mode, bool *shuffle,
char* file_name) char* file_name)
{ {

View file

@ -209,8 +209,8 @@ int filetype_get_attr(const char* name)
strlen(exttypes[i].extension)], strlen(exttypes[i].extension)],
exttypes[i].extension)) exttypes[i].extension))
{ {
return ((((unsigned int)exttypes[i].type - return ((((unsigned long)exttypes[i].type -
(unsigned int)&filetypes[0]) / (unsigned long)&filetypes[0]) /
sizeof(struct file_type)) << 8); sizeof(struct file_type)) << 8);
} }
} }
@ -594,8 +594,8 @@ static char* string2icon(const char* str)
return NULL; return NULL;
if ((sizeof(string_buffer) + if ((sizeof(string_buffer) +
(unsigned int) string_buffer - (unsigned long) string_buffer -
(unsigned int) next_free_string) < ICON_LENGTH) (unsigned long) next_free_string) < ICON_LENGTH)
{ {
splash(HZ,true,str(LANG_FILETYPES_STRING_BUFFER_EMPTY)); splash(HZ,true,str(LANG_FILETYPES_STRING_BUFFER_EMPTY));
return NULL; return NULL;
@ -643,8 +643,8 @@ static char* get_string(const char* str)
return NULL; return NULL;
if (l <= (sizeof(string_buffer) + if (l <= (sizeof(string_buffer) +
(unsigned int) string_buffer - (unsigned long) string_buffer -
(unsigned int) next_free_string)) (unsigned long) next_free_string))
{ {
strcpy(next_free_string,str); strcpy(next_free_string,str);
cp=next_free_string; cp=next_free_string;

View file

@ -41,15 +41,15 @@
#include "mp3data.h" #include "mp3data.h"
#include "system.h" #include "system.h"
#define UNSYNC(b0,b1,b2,b3) (((b0 & 0x7F) << (3*7)) | \ #define UNSYNC(b0,b1,b2,b3) (((long)(b0 & 0x7F) << (3*7)) | \
((b1 & 0x7F) << (2*7)) | \ ((long)(b1 & 0x7F) << (2*7)) | \
((b2 & 0x7F) << (1*7)) | \ ((long)(b2 & 0x7F) << (1*7)) | \
((b3 & 0x7F) << (0*7))) ((long)(b3 & 0x7F) << (0*7)))
#define BYTES2INT(b0,b1,b2,b3) (((b0 & 0xFF) << (3*8)) | \ #define BYTES2INT(b0,b1,b2,b3) (((long)(b0 & 0xFF) << (3*8)) | \
((b1 & 0xFF) << (2*8)) | \ ((long)(b1 & 0xFF) << (2*8)) | \
((b2 & 0xFF) << (1*8)) | \ ((long)(b2 & 0xFF) << (1*8)) | \
((b3 & 0xFF) << (0*8))) ((long)(b3 & 0xFF) << (0*8)))
static const char* const genres[] = { static const char* const genres[] = {
"Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", "Grunge", "Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", "Grunge",
@ -171,7 +171,7 @@ static int unsynchronize(char* tag, int len, bool *ff_found)
wp++; wp++;
} }
} }
return (int)wp - (int)tag; return (long)wp - (long)tag;
} }
static int unsynchronize_frame(char* tag, int len) static int unsynchronize_frame(char* tag, int len)
@ -292,7 +292,7 @@ static const struct tag_resolver taglist[] = {
(for valid 8-bit ASCII characters). If it's not unicode, we leave (for valid 8-bit ASCII characters). If it's not unicode, we leave
it alone. At some point we should fully support unicode strings */ it alone. At some point we should fully support unicode strings */
static int unicode_munge(char** string, int *len) { static int unicode_munge(char** string, int *len) {
int tmp; long tmp;
bool le = false; bool le = false;
int i; int i;
char *str = *string; char *str = *string;
@ -460,7 +460,7 @@ static void setid3v2title(int fd, struct mp3entry *entry)
{ {
int minframesize; int minframesize;
int size; int size;
int bufferpos = 0, totframelen, framelen; long bufferpos = 0, totframelen, framelen;
char header[10]; char header[10];
char tmp[4]; char tmp[4];
unsigned char version; unsigned char version;