From 0e7f4363f3d7b2ae707709607fd816f663c7449a Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Mon, 28 Apr 2003 23:30:43 +0000 Subject: [PATCH] - (bal) [defines.h progressmeter.c scp.c] Some more culling of non 64bit hacked code. --- ChangeLog | 6 +++++- defines.h | 9 +-------- progressmeter.c | 21 ++------------------- scp.c | 9 +-------- 4 files changed, 9 insertions(+), 36 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0e9fc354b..3959098e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20030428 + - (bal) [defines.h progressmeter.c scp.c] Some more culling of non 64bit + hacked code. + 20030427 - (bal) Bug #541: return; was dropped by mistake. Reported by furrier@iglou.com @@ -1345,4 +1349,4 @@ save auth method before monitor_reset_key_state(); bugzilla bug #284; ok provos@ -$Id: ChangeLog,v 1.2662 2003/04/27 18:44:31 mouring Exp $ +$Id: ChangeLog,v 1.2663 2003/04/28 23:30:43 mouring Exp $ diff --git a/defines.h b/defines.h index 73fbe077b..da1bef320 100644 --- a/defines.h +++ b/defines.h @@ -1,7 +1,7 @@ #ifndef _DEFINES_H #define _DEFINES_H -/* $Id: defines.h,v 1.97 2003/01/24 00:50:32 djm Exp $ */ +/* $Id: defines.h,v 1.98 2003/04/28 23:30:43 mouring Exp $ */ /* Constants */ @@ -188,28 +188,21 @@ typedef unsigned long u_int32_t; #ifndef HAVE_INT64_T # if (SIZEOF_LONG_INT == 8) typedef long int int64_t; -# define HAVE_INT64_T 1 # else # if (SIZEOF_LONG_LONG_INT == 8) typedef long long int int64_t; -# define HAVE_INT64_T 1 # endif # endif #endif #ifndef HAVE_U_INT64_T # if (SIZEOF_LONG_INT == 8) typedef unsigned long int u_int64_t; -# define HAVE_U_INT64_T 1 # else # if (SIZEOF_LONG_LONG_INT == 8) typedef unsigned long long int u_int64_t; -# define HAVE_U_INT64_T 1 # endif # endif #endif -#if !defined(HAVE_LONG_LONG_INT) && (SIZEOF_LONG_LONG_INT == 8) -# define HAVE_LONG_LONG_INT 1 -#endif #ifndef HAVE_U_CHAR typedef unsigned char u_char; diff --git a/progressmeter.c b/progressmeter.c index fbfece203..343e1b7d5 100644 --- a/progressmeter.c +++ b/progressmeter.c @@ -215,36 +215,19 @@ draw_progress_meter() nspaces = MIN(get_tty_width() - 79, sizeof(spaces) - 1); -#ifdef HAVE_LONG_LONG_INT snprintf(buf, sizeof(buf), "\r%-45.45s%.*s%3d%% %4lld%c%c %3lld.%01d%cB/s", curfile, nspaces, spaces, ratio, - (long long)abbrevsize, + (int64_t)abbrevsize, prefixes[ai], ai == 0 ? ' ' : 'B', - (long long)(bytespersec / 1024), + (int64_t)(bytespersec / 1024), (int)((bytespersec % 1024) * 10 / 1024), prefixes[bi] ); -#else - /* XXX: Handle integer overflow? */ - snprintf(buf, sizeof(buf), - "\r%-45.45s%.*s%3d%% %4lu%c%c %3lu.%01d%cB/s", - curfile, - nspaces, - spaces, - ratio, - (u_long)abbrevsize, - prefixes[ai], - ai == 0 ? ' ' : 'B', - (u_long)(bytespersec / 1024), - (int)((bytespersec % 1024) * 10 / 1024), - prefixes[bi] - ); -#endif if (cursize <= 0 || elapsed <= 0.0 || cursize > totalbytes) { snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), diff --git a/scp.c b/scp.c index 35d4c5f71..42ebec0fe 100644 --- a/scp.c +++ b/scp.c @@ -554,16 +554,9 @@ syserr: run_err("%s: %s", name, strerror(errno)); goto next; } #define FILEMODEMASK (S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO) -#ifdef HAVE_LONG_LONG_INT snprintf(buf, sizeof buf, "C%04o %lld %s\n", (u_int) (stb.st_mode & FILEMODEMASK), - (long long)stb.st_size, last); -#else - /* XXX: Handle integer overflow? */ - snprintf(buf, sizeof buf, "C%04o %lu %s\n", - (u_int) (stb.st_mode & FILEMODEMASK), - (u_long) stb.st_size, last); -#endif + (int64_t)stb.st_size, last); if (verbose_mode) { fprintf(stderr, "Sending file modes: %s", buf); }