From 08a740ff436a4c0dc1aa53d671f6f14b8bf2348a Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Wed, 15 Aug 2001 06:41:24 +0000 Subject: [PATCH] Fix casts when some variables are printed out. --- batch.c | 20 ++++++++++---------- clientserver.c | 4 ++-- flist.c | 4 ++-- main.c | 5 +++-- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/batch.c b/batch.c index 200ff8bc..5f6c8510 100644 --- a/batch.c +++ b/batch.c @@ -1,6 +1,7 @@ -/* +/* -*- c-file-style: "linux" -*- + Weiss 1/1999 - Batch utilities + Batch utilities for rsync. */ @@ -379,7 +380,6 @@ void write_batch_csum_info(int *flist_entry, int flist_count, struct sum_struct { int i; int int_zero = 0; - extern int block_size; extern int csum_length; fdb_open = 1; @@ -545,15 +545,15 @@ void show_flist(int index, struct file_struct **fptr) int i; for (i=0;iflags=%x\n",fptr[i]->flags); - rprintf(FINFO,"flist->modtime=%x\n",fptr[i]->modtime); - rprintf(FINFO,"flist->length=%x\n",fptr[i]->length); - rprintf(FINFO,"flist->mode=%x\n",fptr[i]->mode); - rprintf(FINFO,"flist->basename=%s\n",fptr[i]->basename); + rprintf(FINFO, "flist->flags=%#x\n",fptr[i]->flags); + rprintf(FINFO, "flist->modtime=%#x\n",fptr[i]->modtime); + rprintf(FINFO, "flist->length=%.0f\n", (double) fptr[i]->length); + rprintf(FINFO, "flist->mode=%#o\n", (int) fptr[i]->mode); + rprintf(FINFO, "flist->basename=%s\n",fptr[i]->basename); if (fptr[i]->dirname) - rprintf(FINFO,"flist->dirname=%s\n",fptr[i]->dirname); + rprintf(FINFO, "flist->dirname=%s\n",fptr[i]->dirname); if (fptr[i]->basedir) - rprintf(FINFO,"flist->basedir=%s\n",fptr[i]->basedir); + rprintf(FINFO, "flist->basedir=%s\n",fptr[i]->basedir); } } diff --git a/clientserver.c b/clientserver.c index 00efea49..dd383d0b 100644 --- a/clientserver.c +++ b/clientserver.c @@ -261,13 +261,13 @@ static int rsync_module(int fd, int i) if (am_root) { if (setgid(gid)) { - rsyserr(FERROR, errno, "setgid %d failed", gid); + rsyserr(FERROR, errno, "setgid %d failed", (int) gid); io_printf(fd,"@ERROR: setgid failed\n"); return -1; } if (setuid(uid)) { - rsyserr(FERROR, errno, "setuid %d failed", uid); + rsyserr(FERROR, errno, "setuid %d failed", (int) uid); io_printf(fd,"@ERROR: setuid failed\n"); return -1; } diff --git a/flist.c b/flist.c index edd6024f..0cc57f2d 100644 --- a/flist.c +++ b/flist.c @@ -1104,10 +1104,10 @@ static void clean_flist(struct file_list *flist, int strip_root) for (i=0;icount;i++) { rprintf(FINFO,"[%d] i=%d %s %s mode=0%o len=%.0f\n", - getpid(), i, + (int) getpid(), i, NS(flist->files[i]->dirname), NS(flist->files[i]->basename), - flist->files[i]->mode, + (int) flist->files[i]->mode, (double)flist->files[i]->length); } } diff --git a/main.c b/main.c index 50005aac..a103ff31 100644 --- a/main.c +++ b/main.c @@ -2,6 +2,7 @@ Copyright (C) 1996-2001 by Andrew Tridgell Copyright (C) Paul Mackerras 1996 + Copyright (C) 2001 by Martin Pool This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -528,7 +529,7 @@ int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[]) } if (pid != -1) { if (verbose > 3) - rprintf(FINFO,"client_run waiting on %d\n",pid); + rprintf(FINFO,"client_run waiting on %d\n", (int) pid); io_flush(); wait_process(pid, &status); } @@ -558,7 +559,7 @@ int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[]) if (pid != -1) { if (verbose > 3) - rprintf(FINFO,"client_run2 waiting on %d\n",pid); + rprintf(FINFO,"client_run2 waiting on %d\n", (int) pid); io_flush(); wait_process(pid, &status); } -- 2.34.1