summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2001-10-16 19:06:11 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2001-10-16 19:06:11 +0000
commit8670008cb1c9773bfa115921f9f75daafb8aac33 (patch)
tree645b08389d596d6fe6f21bdbff6204084afd2583 /cpukit
parent059a371409f8e35a635e412cd9061a41d4cf7c46 (diff)
downloadrtems-8670008cb1c9773bfa115921f9f75daafb8aac33.tar.bz2
2001-10-16 Chris Johns <ccj@acm.org>
* imfs/imfs_load_tar.c: Changed the code around to remove an internal compiler error on the Coldfire target.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/libfs/ChangeLog5
-rw-r--r--cpukit/libfs/src/imfs/imfs_load_tar.c96
2 files changed, 53 insertions, 48 deletions
diff --git a/cpukit/libfs/ChangeLog b/cpukit/libfs/ChangeLog
index e8b7d42d46..361d8702bf 100644
--- a/cpukit/libfs/ChangeLog
+++ b/cpukit/libfs/ChangeLog
@@ -1,3 +1,8 @@
+2001-10-16 Chris Johns <ccj@acm.org>
+
+ * imfs/imfs_load_tar.c: Changed the code around to remove an
+ internal compiler error on the Coldfire target.
+
2001-10-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* .cvsignore: Add autom4te.cache for autoconf > 2.52.
diff --git a/cpukit/libfs/src/imfs/imfs_load_tar.c b/cpukit/libfs/src/imfs/imfs_load_tar.c
index c8697724f2..b74ff884ea 100644
--- a/cpukit/libfs/src/imfs/imfs_load_tar.c
+++ b/cpukit/libfs/src/imfs/imfs_load_tar.c
@@ -65,54 +65,8 @@
#define MIN(a,b) ((a)>(b)?(b):(a))
-
-/**************************************************************************
- * This converts octal ASCII number representations into an
- * unsigned long. Only support 32-bit numbers for now.
- *************************************************************************/
-static unsigned long
-octal2ulong(char *octascii, int len)
-{
- int i;
- unsigned long num;
- unsigned long mult;
-
- num = 0;
- mult = 1;
- for (i=len-1; i>=0; i--)
- {
- if ((octascii[i] < '0') || (octascii[i] > '9'))
- continue;
-
- num += mult*((unsigned long)(octascii[i] - '0'));
- mult *= 8;
- }
- return(num);
-}
-
-
-/************************************************************************
- * Compute the TAR checksum and check with the value in
- * the archive. The checksum is computed over the entire
- * header, but the checksum field is substituted with blanks.
- ************************************************************************/
-static int
-compute_tar_header_checksum(char *bufr)
-{
- int i, sum;
-
-
- sum = 0;
- for (i=0; i<512; i++)
- {
- if ((i >= 148) && (i < 156))
- sum += 0xff & ' ';
- else
- sum += 0xff & bufr[i];
- }
- return(sum);
-}
-
+static unsigned long octal2ulong(char *octascii, int len);
+static int compute_tar_header_checksum(char *bufr);
/**************************************************************************
* rtems_tarfs_load
@@ -251,3 +205,49 @@ rtems_tarfs_load(char *mountpoint,
return(status);
}
+/**************************************************************************
+ * This converts octal ASCII number representations into an
+ * unsigned long. Only support 32-bit numbers for now.
+ *************************************************************************/
+static unsigned long
+octal2ulong(char *octascii, int len)
+{
+ int i;
+ unsigned long num;
+ unsigned long mult;
+
+ num = 0;
+ mult = 1;
+ for (i=len-1; i>=0; i--)
+ {
+ if ((octascii[i] < '0') || (octascii[i] > '9'))
+ continue;
+
+ num += mult*((unsigned long)(octascii[i] - '0'));
+ mult *= 8;
+ }
+ return(num);
+}
+
+
+/************************************************************************
+ * Compute the TAR checksum and check with the value in
+ * the archive. The checksum is computed over the entire
+ * header, but the checksum field is substituted with blanks.
+ ************************************************************************/
+static int
+compute_tar_header_checksum(char *bufr)
+{
+ int i, sum;
+
+
+ sum = 0;
+ for (i=0; i<512; i++)
+ {
+ if ((i >= 148) && (i < 156))
+ sum += 0xff & ' ';
+ else
+ sum += 0xff & bufr[i];
+ }
+ return(sum);
+}