mirror of
https://github.com/ckolivas/lrzip.git
synced 2025-12-06 07:12:00 +01:00
Minor tidying.
This commit is contained in:
parent
8d9b64e1ec
commit
25705aec28
16
main.c
16
main.c
|
|
@ -86,8 +86,8 @@ static void write_magic(int fd_in, int fd_out)
|
||||||
|
|
||||||
static void read_magic(int fd_in, i64 *expected_size)
|
static void read_magic(int fd_in, i64 *expected_size)
|
||||||
{
|
{
|
||||||
uint32_t v;
|
|
||||||
char magic[24];
|
char magic[24];
|
||||||
|
uint32_t v;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (read(fd_in, magic, sizeof(magic)) != sizeof(magic))
|
if (read(fd_in, magic, sizeof(magic)) != sizeof(magic))
|
||||||
|
|
@ -220,9 +220,9 @@ static void read_tmpinfile(int fd_in)
|
||||||
*/
|
*/
|
||||||
static void decompress_file(void)
|
static void decompress_file(void)
|
||||||
{
|
{
|
||||||
|
char *tmp, *tmpoutfile, *infilecopy = NULL;
|
||||||
int fd_in, fd_out = -1, fd_hist = -1;
|
int fd_in, fd_out = -1, fd_hist = -1;
|
||||||
i64 expected_size;
|
i64 expected_size;
|
||||||
char *tmp, *tmpoutfile, *infilecopy = NULL;
|
|
||||||
|
|
||||||
if (!(control.flags & FLAG_STDIN)) {
|
if (!(control.flags & FLAG_STDIN)) {
|
||||||
if ((tmp = strrchr(control.infile, '.')) && strcmp(tmp,control.suffix)) {
|
if ((tmp = strrchr(control.infile, '.')) && strcmp(tmp,control.suffix)) {
|
||||||
|
|
@ -347,12 +347,12 @@ static void decompress_file(void)
|
||||||
|
|
||||||
static void get_fileinfo(void)
|
static void get_fileinfo(void)
|
||||||
{
|
{
|
||||||
struct stat st;
|
|
||||||
int fd_in, ctype = 0;
|
int fd_in, ctype = 0;
|
||||||
|
long double cratio;
|
||||||
i64 expected_size;
|
i64 expected_size;
|
||||||
i64 infile_size;
|
i64 infile_size;
|
||||||
|
struct stat st;
|
||||||
int seekspot;
|
int seekspot;
|
||||||
long double cratio;
|
|
||||||
|
|
||||||
char *tmp, *infilecopy = NULL;
|
char *tmp, *infilecopy = NULL;
|
||||||
|
|
||||||
|
|
@ -433,10 +433,10 @@ static void get_fileinfo(void)
|
||||||
*/
|
*/
|
||||||
static void compress_file(void)
|
static void compress_file(void)
|
||||||
{
|
{
|
||||||
int fd_in, fd_out;
|
|
||||||
const char *tmp, *tmpinfile; /* we're just using this as a proxy for control.infile.
|
const char *tmp, *tmpinfile; /* we're just using this as a proxy for control.infile.
|
||||||
* Spares a compiler warning
|
* Spares a compiler warning
|
||||||
*/
|
*/
|
||||||
|
int fd_in, fd_out;
|
||||||
char header[24];
|
char header[24];
|
||||||
|
|
||||||
memset(header, 0, sizeof(header));
|
memset(header, 0, sizeof(header));
|
||||||
|
|
@ -566,12 +566,12 @@ static i64 get_ram(void)
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
extern int optind;
|
|
||||||
int c, i, maxwin = 0;
|
|
||||||
struct timeval start_time, end_time;
|
struct timeval start_time, end_time;
|
||||||
struct sigaction handler;
|
struct sigaction handler;
|
||||||
int hours,minutes;
|
|
||||||
double seconds,total_time; // for timers
|
double seconds,total_time; // for timers
|
||||||
|
int c, i, maxwin = 0;
|
||||||
|
int hours,minutes;
|
||||||
|
extern int optind;
|
||||||
char *eptr; /* for environment */
|
char *eptr; /* for environment */
|
||||||
|
|
||||||
memset(&control, 0, sizeof(control));
|
memset(&control, 0, sizeof(control));
|
||||||
|
|
|
||||||
3
runzip.c
3
runzip.c
|
|
@ -200,10 +200,9 @@ static i64 runzip_chunk(int fd_in, int fd_out, int fd_hist, i64 expected_size, i
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* decompress a open file. Call fatal() on error
|
/* Decompress an open file. Call fatal() on error
|
||||||
return the number of bytes that have been retrieved
|
return the number of bytes that have been retrieved
|
||||||
*/
|
*/
|
||||||
|
|
||||||
i64 runzip_fd(int fd_in, int fd_out, int fd_hist, i64 expected_size)
|
i64 runzip_fd(int fd_in, int fd_out, int fd_hist, i64 expected_size)
|
||||||
{
|
{
|
||||||
struct timeval start,end;
|
struct timeval start,end;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue