summaryrefslogtreecommitdiff
path: root/firmware/drivers/fat.c
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2002-11-22 23:55:08 +0000
committerBjörn Stenberg <bjorn@haxx.se>2002-11-22 23:55:08 +0000
commitac88b9e5ff8bc16f93a8454e3b5e42c97c408ff0 (patch)
tree047dcec1a1d18f911d40be7de602dd43c43a5525 /firmware/drivers/fat.c
parentb5184d761b9c3b0fa79ba891ae148b0a44f13757 (diff)
downloadrockbox-ac88b9e5ff8bc16f93a8454e3b5e42c97c408ff0.tar.gz
rockbox-ac88b9e5ff8bc16f93a8454e3b5e42c97c408ff0.zip
Fixed warnings.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2876 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/fat.c')
-rw-r--r--firmware/drivers/fat.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c
index 6418349943..907947f31b 100644
--- a/firmware/drivers/fat.c
+++ b/firmware/drivers/fat.c
@@ -638,6 +638,7 @@ static int flush_fat(void)
638 return 0; 638 return 0;
639} 639}
640 640
641#ifdef HAVE_RTC
641static void fat_time(unsigned short* date, 642static void fat_time(unsigned short* date,
642 unsigned short* time, 643 unsigned short* time,
643 unsigned short* tenth ) 644 unsigned short* tenth )
@@ -657,6 +658,7 @@ static void fat_time(unsigned short* date,
657 if (tenth) 658 if (tenth)
658 *tenth = (tm->tm_sec & 1) * 100; 659 *tenth = (tm->tm_sec & 1) * 100;
659} 660}
661#endif
660 662
661static int write_long_name(struct fat_file* file, 663static int write_long_name(struct fat_file* file,
662 unsigned int firstentry, 664 unsigned int firstentry,
@@ -1044,7 +1046,6 @@ static int update_file_size( struct fat_file* file, int size )
1044 unsigned int* sizeptr; 1046 unsigned int* sizeptr;
1045 unsigned short* clusptr; 1047 unsigned short* clusptr;
1046 struct fat_file dir; 1048 struct fat_file dir;
1047 unsigned short date=0, time=0;
1048 int err; 1049 int err;
1049 1050
1050 LDEBUGF("update_file_size(cluster:%x entry:%d size:%d)\n", 1051 LDEBUGF("update_file_size(cluster:%x entry:%d size:%d)\n",
@@ -1076,10 +1077,13 @@ static int update_file_size( struct fat_file* file, int size )
1076 *sizeptr = SWAB32(size); 1077 *sizeptr = SWAB32(size);
1077 1078
1078#ifdef HAVE_RTC 1079#ifdef HAVE_RTC
1079 fat_time(&date, &time, NULL); 1080 {
1080 *(unsigned short*)(entry + FATDIR_WRTTIME) = SWAB16(time); 1081 unsigned short date=0, time=0;
1081 *(unsigned short*)(entry + FATDIR_WRTDATE) = SWAB16(date); 1082 fat_time(&date, &time, NULL);
1082 *(unsigned short*)(entry + FATDIR_LSTACCDATE) = SWAB16(date); 1083 *(unsigned short*)(entry + FATDIR_WRTTIME) = SWAB16(time);
1084 *(unsigned short*)(entry + FATDIR_WRTDATE) = SWAB16(date);
1085 *(unsigned short*)(entry + FATDIR_LSTACCDATE) = SWAB16(date);
1086 }
1083#endif 1087#endif
1084 1088
1085 err = fat_seek( &dir, sector ); 1089 err = fat_seek( &dir, sector );