From 8670008cb1c9773bfa115921f9f75daafb8aac33 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 16 Oct 2001 19:06:11 +0000 Subject: 2001-10-16 Chris Johns * imfs/imfs_load_tar.c: Changed the code around to remove an internal compiler error on the Coldfire target. --- c/src/exec/libfs/ChangeLog | 5 ++ c/src/exec/libfs/src/imfs/imfs_load_tar.c | 96 +++++++++++++++---------------- c/src/libfs/ChangeLog | 5 ++ c/src/libfs/src/imfs/imfs_load_tar.c | 96 +++++++++++++++---------------- cpukit/libfs/ChangeLog | 5 ++ cpukit/libfs/src/imfs/imfs_load_tar.c | 96 +++++++++++++++---------------- 6 files changed, 159 insertions(+), 144 deletions(-) diff --git a/c/src/exec/libfs/ChangeLog b/c/src/exec/libfs/ChangeLog index e8b7d42d46..361d8702bf 100644 --- a/c/src/exec/libfs/ChangeLog +++ b/c/src/exec/libfs/ChangeLog @@ -1,3 +1,8 @@ +2001-10-16 Chris Johns + + * imfs/imfs_load_tar.c: Changed the code around to remove an + internal compiler error on the Coldfire target. + 2001-10-11 Ralf Corsepius * .cvsignore: Add autom4te.cache for autoconf > 2.52. diff --git a/c/src/exec/libfs/src/imfs/imfs_load_tar.c b/c/src/exec/libfs/src/imfs/imfs_load_tar.c index c8697724f2..b74ff884ea 100644 --- a/c/src/exec/libfs/src/imfs/imfs_load_tar.c +++ b/c/src/exec/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); +} diff --git a/c/src/libfs/ChangeLog b/c/src/libfs/ChangeLog index e8b7d42d46..361d8702bf 100644 --- a/c/src/libfs/ChangeLog +++ b/c/src/libfs/ChangeLog @@ -1,3 +1,8 @@ +2001-10-16 Chris Johns + + * imfs/imfs_load_tar.c: Changed the code around to remove an + internal compiler error on the Coldfire target. + 2001-10-11 Ralf Corsepius * .cvsignore: Add autom4te.cache for autoconf > 2.52. diff --git a/c/src/libfs/src/imfs/imfs_load_tar.c b/c/src/libfs/src/imfs/imfs_load_tar.c index c8697724f2..b74ff884ea 100644 --- a/c/src/libfs/src/imfs/imfs_load_tar.c +++ b/c/src/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); +} 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 + + * imfs/imfs_load_tar.c: Changed the code around to remove an + internal compiler error on the Coldfire target. + 2001-10-11 Ralf Corsepius * .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); +} -- cgit v1.2.3