From 0f6b3796d6143f36300e7f3136ba4ad73ab41913 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Bernardy Date: Wed, 9 Feb 2005 10:56:54 +0000 Subject: long policy git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5863 a1c6a512-1295-4272-9138-f99709370657 --- apps/bookmark.c | 27 ++++++++++++++------------- apps/filetypes.c | 12 ++++++------ 2 files changed, 20 insertions(+), 19 deletions(-) (limited to 'apps') diff --git a/apps/bookmark.c b/apps/bookmark.c index 969371eeeb..e96561319b 100644 --- a/apps/bookmark.c +++ b/apps/bookmark.c @@ -1,4 +1,4 @@ - /*************************************************************************** +/*************************************************************************** * __________ __ ___. * Open \______ \ ____ ____ | | _\_ |__ _______ ___ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / @@ -6,7 +6,7 @@ * 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. * 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, char* resume_file, unsigned int resume_file_size, - int* ms, + long* ms, int * repeat_mode, bool *shuffle, char* file_name); @@ -778,7 +778,7 @@ static void display_bookmark(const char* bookmark, int bookmark_count) { int resume_index = 0; - int ms = 0; + long ms = 0; int repeat_mode = 0; bool playlist_shuffle = false; int len; @@ -834,19 +834,20 @@ static void display_bookmark(const char* bookmark, /* elapsed time*/ 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), ms / 60000, - ms % 60000 / 1000); + (unsigned int)(ms % 60000) / 1000); + /* unsigned int: hinting for 16bits archs */ } else { snprintf(global_temp_buffer, sizeof(global_temp_buffer), - "%s: %d:%02d:%02d", - str(LANG_BOOKMARK_SELECT_TIME_TEXT), - ms / 3600000, - ms % 3600000 / 60000, - ms % 60000 / 1000); + "%s: %ld:%02ld:%02d", + str(LANG_BOOKMARK_SELECT_TIME_TEXT), + ms / 3600000, + ms % 3600000 / 60000, + (unsigned int)(ms % 60000) / 1000); } lcd_puts_scroll(0, 3, global_temp_buffer); @@ -900,7 +901,7 @@ static void say_bookmark(const char* bookmark, int bookmark_id) { int resume_index; - int ms; + long ms; char dir[MAX_PATH]; 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, char* resume_file, unsigned int resume_file_size, - int* ms, + long* ms, int * repeat_mode, bool *shuffle, char* file_name) { diff --git a/apps/filetypes.c b/apps/filetypes.c index 09090c30d4..2788d3c151 100644 --- a/apps/filetypes.c +++ b/apps/filetypes.c @@ -209,8 +209,8 @@ int filetype_get_attr(const char* name) strlen(exttypes[i].extension)], exttypes[i].extension)) { - return ((((unsigned int)exttypes[i].type - - (unsigned int)&filetypes[0]) / + return ((((unsigned long)exttypes[i].type - + (unsigned long)&filetypes[0]) / sizeof(struct file_type)) << 8); } } @@ -594,8 +594,8 @@ static char* string2icon(const char* str) return NULL; if ((sizeof(string_buffer) + - (unsigned int) string_buffer - - (unsigned int) next_free_string) < ICON_LENGTH) + (unsigned long) string_buffer - + (unsigned long) next_free_string) < ICON_LENGTH) { splash(HZ,true,str(LANG_FILETYPES_STRING_BUFFER_EMPTY)); return NULL; @@ -643,8 +643,8 @@ static char* get_string(const char* str) return NULL; if (l <= (sizeof(string_buffer) + - (unsigned int) string_buffer - - (unsigned int) next_free_string)) + (unsigned long) string_buffer - + (unsigned long) next_free_string)) { strcpy(next_free_string,str); cp=next_free_string; -- cgit v1.2.3