diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-06-28 09:27:48 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-06-28 09:27:48 +0000 |
commit | 75392da5299c358302398d9126a56cd8c01a5f12 (patch) | |
tree | 768309c482115ac7643e3b4a2a86a881ee98450b | |
parent | 622a2c5eee944c2149c2635bb56c5ac7071de1b8 (diff) | |
download | cpio-75392da5299c358302398d9126a56cd8c01a5f12.tar.gz cpio-75392da5299c358302398d9126a56cd8c01a5f12.tar.bz2 |
Use size_t for buffer sizes and off_t for total I/O bytes.
-rw-r--r-- | src/extern.h | 11 | ||||
-rw-r--r-- | src/global.c | 18 |
2 files changed, 8 insertions, 21 deletions
diff --git a/src/extern.h b/src/extern.h index 6eb4cea..91f5d69 100644 --- a/src/extern.h +++ b/src/extern.h @@ -81,13 +81,10 @@ extern int debug_flag; extern char *input_buffer, *output_buffer; extern char *in_buff, *out_buff; -extern long input_buffer_size; -extern long input_size, output_size; -#ifdef __GNUC__ -extern long long input_bytes, output_bytes; -#else -extern long input_bytes, output_bytes; -#endif +extern size_t input_buffer_size; +extern size_t input_size, output_size; +extern off_t input_bytes, output_bytes; + extern char *directory_name; extern char **save_patterns; extern int num_patterns; diff --git a/src/global.c b/src/global.c index b2be72b..5d1b1ed 100644 --- a/src/global.c +++ b/src/global.c @@ -147,25 +147,15 @@ unsigned int crc; char *input_buffer, *output_buffer; /* The size of the input buffer. */ -long input_buffer_size; +size_t input_buffer_size; /* Current locations in `input_buffer' and `output_buffer'. */ char *in_buff, *out_buff; /* Current number of bytes stored at `input_buff' and `output_buff'. */ -long input_size, output_size; - -/* Total number of bytes read and written for all files. - Now that many tape drives hold more than 4Gb we need more than 32 - bits to hold input_bytes and output_bytes. But it's not worth - the trouble of adding special multi-precision arithmetic if the - compiler doesn't support 64 bit ints since input_bytes and - output_bytes are only used to print the number of blocks copied. */ -#ifdef __GNUC__ -long long input_bytes, output_bytes; -#else -long input_bytes, output_bytes; -#endif +size_t input_size, output_size; + +off_t input_bytes, output_bytes; /* Saving of argument values for later reference. */ char *directory_name = NULL; |