Changeset 8670008c in rtems


Ignore:
Timestamp:
Oct 16, 2001, 7:06:11 PM (20 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
f11615f
Parents:
059a3714
Message:

2001-10-16 Chris Johns <ccj@…>

  • imfs/imfs_load_tar.c: Changed the code around to remove an internal compiler error on the Coldfire target.
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/libfs/ChangeLog

    r059a3714 r8670008c  
     12001-10-16      Chris Johns <ccj@acm.org>
     2
     3        * imfs/imfs_load_tar.c: Changed the code around to remove an
     4        internal compiler error on the Coldfire target.
     5
    162001-10-11      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    27
  • c/src/exec/libfs/src/imfs/imfs_load_tar.c

    r059a3714 r8670008c  
    6666#define MIN(a,b)   ((a)>(b)?(b):(a))
    6767
    68 
    69 /**************************************************************************
    70  * This converts octal ASCII number representations into an
    71  * unsigned long.  Only support 32-bit numbers for now.
    72  *************************************************************************/
    73 static unsigned long
    74 octal2ulong(char *octascii, int len)
    75 {
    76    int           i;
    77    unsigned long num;
    78    unsigned long mult;
    79 
    80    num = 0;
    81    mult = 1;
    82    for (i=len-1; i>=0; i--)
    83    {
    84       if ((octascii[i] < '0') || (octascii[i] > '9'))
    85          continue;
    86 
    87       num  += mult*((unsigned long)(octascii[i] - '0'));
    88       mult *= 8;
    89    }
    90    return(num);
    91 }
    92 
    93 
    94 /************************************************************************
    95  * Compute the TAR checksum and check with the value in
    96  * the archive.  The checksum is computed over the entire
    97  * header, but the checksum field is substituted with blanks.
    98  ************************************************************************/
    99 static int
    100 compute_tar_header_checksum(char *bufr)
    101 {
    102    int  i, sum;
    103 
    104 
    105    sum = 0;
    106    for (i=0; i<512; i++)
    107    {
    108       if ((i >= 148) && (i < 156))
    109          sum += 0xff & ' ';
    110       else
    111          sum += 0xff & bufr[i];
    112    }
    113    return(sum);
    114 }
    115 
     68static unsigned long octal2ulong(char *octascii, int len);
     69static int compute_tar_header_checksum(char *bufr);
    11670
    11771/**************************************************************************
     
    252206}
    253207
     208/**************************************************************************
     209 * This converts octal ASCII number representations into an
     210 * unsigned long.  Only support 32-bit numbers for now.
     211 *************************************************************************/
     212static unsigned long
     213octal2ulong(char *octascii, int len)
     214{
     215   int           i;
     216   unsigned long num;
     217   unsigned long mult;
     218
     219   num = 0;
     220   mult = 1;
     221   for (i=len-1; i>=0; i--)
     222   {
     223      if ((octascii[i] < '0') || (octascii[i] > '9'))
     224         continue;
     225
     226      num  += mult*((unsigned long)(octascii[i] - '0'));
     227      mult *= 8;
     228   }
     229   return(num);
     230}
     231
     232
     233/************************************************************************
     234 * Compute the TAR checksum and check with the value in
     235 * the archive.  The checksum is computed over the entire
     236 * header, but the checksum field is substituted with blanks.
     237 ************************************************************************/
     238static int
     239compute_tar_header_checksum(char *bufr)
     240{
     241   int  i, sum;
     242
     243
     244   sum = 0;
     245   for (i=0; i<512; i++)
     246   {
     247      if ((i >= 148) && (i < 156))
     248         sum += 0xff & ' ';
     249      else
     250         sum += 0xff & bufr[i];
     251   }
     252   return(sum);
     253}
  • c/src/libfs/ChangeLog

    r059a3714 r8670008c  
     12001-10-16      Chris Johns <ccj@acm.org>
     2
     3        * imfs/imfs_load_tar.c: Changed the code around to remove an
     4        internal compiler error on the Coldfire target.
     5
    162001-10-11      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    27
  • c/src/libfs/src/imfs/imfs_load_tar.c

    r059a3714 r8670008c  
    6666#define MIN(a,b)   ((a)>(b)?(b):(a))
    6767
    68 
    69 /**************************************************************************
    70  * This converts octal ASCII number representations into an
    71  * unsigned long.  Only support 32-bit numbers for now.
    72  *************************************************************************/
    73 static unsigned long
    74 octal2ulong(char *octascii, int len)
    75 {
    76    int           i;
    77    unsigned long num;
    78    unsigned long mult;
    79 
    80    num = 0;
    81    mult = 1;
    82    for (i=len-1; i>=0; i--)
    83    {
    84       if ((octascii[i] < '0') || (octascii[i] > '9'))
    85          continue;
    86 
    87       num  += mult*((unsigned long)(octascii[i] - '0'));
    88       mult *= 8;
    89    }
    90    return(num);
    91 }
    92 
    93 
    94 /************************************************************************
    95  * Compute the TAR checksum and check with the value in
    96  * the archive.  The checksum is computed over the entire
    97  * header, but the checksum field is substituted with blanks.
    98  ************************************************************************/
    99 static int
    100 compute_tar_header_checksum(char *bufr)
    101 {
    102    int  i, sum;
    103 
    104 
    105    sum = 0;
    106    for (i=0; i<512; i++)
    107    {
    108       if ((i >= 148) && (i < 156))
    109          sum += 0xff & ' ';
    110       else
    111          sum += 0xff & bufr[i];
    112    }
    113    return(sum);
    114 }
    115 
     68static unsigned long octal2ulong(char *octascii, int len);
     69static int compute_tar_header_checksum(char *bufr);
    11670
    11771/**************************************************************************
     
    252206}
    253207
     208/**************************************************************************
     209 * This converts octal ASCII number representations into an
     210 * unsigned long.  Only support 32-bit numbers for now.
     211 *************************************************************************/
     212static unsigned long
     213octal2ulong(char *octascii, int len)
     214{
     215   int           i;
     216   unsigned long num;
     217   unsigned long mult;
     218
     219   num = 0;
     220   mult = 1;
     221   for (i=len-1; i>=0; i--)
     222   {
     223      if ((octascii[i] < '0') || (octascii[i] > '9'))
     224         continue;
     225
     226      num  += mult*((unsigned long)(octascii[i] - '0'));
     227      mult *= 8;
     228   }
     229   return(num);
     230}
     231
     232
     233/************************************************************************
     234 * Compute the TAR checksum and check with the value in
     235 * the archive.  The checksum is computed over the entire
     236 * header, but the checksum field is substituted with blanks.
     237 ************************************************************************/
     238static int
     239compute_tar_header_checksum(char *bufr)
     240{
     241   int  i, sum;
     242
     243
     244   sum = 0;
     245   for (i=0; i<512; i++)
     246   {
     247      if ((i >= 148) && (i < 156))
     248         sum += 0xff & ' ';
     249      else
     250         sum += 0xff & bufr[i];
     251   }
     252   return(sum);
     253}
  • cpukit/libfs/ChangeLog

    r059a3714 r8670008c  
     12001-10-16      Chris Johns <ccj@acm.org>
     2
     3        * imfs/imfs_load_tar.c: Changed the code around to remove an
     4        internal compiler error on the Coldfire target.
     5
    162001-10-11      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    27
  • cpukit/libfs/src/imfs/imfs_load_tar.c

    r059a3714 r8670008c  
    6666#define MIN(a,b)   ((a)>(b)?(b):(a))
    6767
    68 
    69 /**************************************************************************
    70  * This converts octal ASCII number representations into an
    71  * unsigned long.  Only support 32-bit numbers for now.
    72  *************************************************************************/
    73 static unsigned long
    74 octal2ulong(char *octascii, int len)
    75 {
    76    int           i;
    77    unsigned long num;
    78    unsigned long mult;
    79 
    80    num = 0;
    81    mult = 1;
    82    for (i=len-1; i>=0; i--)
    83    {
    84       if ((octascii[i] < '0') || (octascii[i] > '9'))
    85          continue;
    86 
    87       num  += mult*((unsigned long)(octascii[i] - '0'));
    88       mult *= 8;
    89    }
    90    return(num);
    91 }
    92 
    93 
    94 /************************************************************************
    95  * Compute the TAR checksum and check with the value in
    96  * the archive.  The checksum is computed over the entire
    97  * header, but the checksum field is substituted with blanks.
    98  ************************************************************************/
    99 static int
    100 compute_tar_header_checksum(char *bufr)
    101 {
    102    int  i, sum;
    103 
    104 
    105    sum = 0;
    106    for (i=0; i<512; i++)
    107    {
    108       if ((i >= 148) && (i < 156))
    109          sum += 0xff & ' ';
    110       else
    111          sum += 0xff & bufr[i];
    112    }
    113    return(sum);
    114 }
    115 
     68static unsigned long octal2ulong(char *octascii, int len);
     69static int compute_tar_header_checksum(char *bufr);
    11670
    11771/**************************************************************************
     
    252206}
    253207
     208/**************************************************************************
     209 * This converts octal ASCII number representations into an
     210 * unsigned long.  Only support 32-bit numbers for now.
     211 *************************************************************************/
     212static unsigned long
     213octal2ulong(char *octascii, int len)
     214{
     215   int           i;
     216   unsigned long num;
     217   unsigned long mult;
     218
     219   num = 0;
     220   mult = 1;
     221   for (i=len-1; i>=0; i--)
     222   {
     223      if ((octascii[i] < '0') || (octascii[i] > '9'))
     224         continue;
     225
     226      num  += mult*((unsigned long)(octascii[i] - '0'));
     227      mult *= 8;
     228   }
     229   return(num);
     230}
     231
     232
     233/************************************************************************
     234 * Compute the TAR checksum and check with the value in
     235 * the archive.  The checksum is computed over the entire
     236 * header, but the checksum field is substituted with blanks.
     237 ************************************************************************/
     238static int
     239compute_tar_header_checksum(char *bufr)
     240{
     241   int  i, sum;
     242
     243
     244   sum = 0;
     245   for (i=0; i<512; i++)
     246   {
     247      if ((i >= 148) && (i < 156))
     248         sum += 0xff & ' ';
     249      else
     250         sum += 0xff & bufr[i];
     251   }
     252   return(sum);
     253}
Note: See TracChangeset for help on using the changeset viewer.