summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--defines.h9
-rw-r--r--progressmeter.c21
-rw-r--r--scp.c9
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 @@
120030428
2 - (bal) [defines.h progressmeter.c scp.c] Some more culling of non 64bit
3 hacked code.
4
120030427 520030427
2 - (bal) Bug #541: return; was dropped by mistake. Reported by 6 - (bal) Bug #541: return; was dropped by mistake. Reported by
3 furrier@iglou.com 7 furrier@iglou.com
@@ -1345,4 +1349,4 @@
1345 save auth method before monitor_reset_key_state(); bugzilla bug #284; 1349 save auth method before monitor_reset_key_state(); bugzilla bug #284;
1346 ok provos@ 1350 ok provos@
1347 1351
1348$Id: ChangeLog,v 1.2662 2003/04/27 18:44:31 mouring Exp $ 1352$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 @@
1#ifndef _DEFINES_H 1#ifndef _DEFINES_H
2#define _DEFINES_H 2#define _DEFINES_H
3 3
4/* $Id: defines.h,v 1.97 2003/01/24 00:50:32 djm Exp $ */ 4/* $Id: defines.h,v 1.98 2003/04/28 23:30:43 mouring Exp $ */
5 5
6 6
7/* Constants */ 7/* Constants */
@@ -188,28 +188,21 @@ typedef unsigned long u_int32_t;
188#ifndef HAVE_INT64_T 188#ifndef HAVE_INT64_T
189# if (SIZEOF_LONG_INT == 8) 189# if (SIZEOF_LONG_INT == 8)
190typedef long int int64_t; 190typedef long int int64_t;
191# define HAVE_INT64_T 1
192# else 191# else
193# if (SIZEOF_LONG_LONG_INT == 8) 192# if (SIZEOF_LONG_LONG_INT == 8)
194typedef long long int int64_t; 193typedef long long int int64_t;
195# define HAVE_INT64_T 1
196# endif 194# endif
197# endif 195# endif
198#endif 196#endif
199#ifndef HAVE_U_INT64_T 197#ifndef HAVE_U_INT64_T
200# if (SIZEOF_LONG_INT == 8) 198# if (SIZEOF_LONG_INT == 8)
201typedef unsigned long int u_int64_t; 199typedef unsigned long int u_int64_t;
202# define HAVE_U_INT64_T 1
203# else 200# else
204# if (SIZEOF_LONG_LONG_INT == 8) 201# if (SIZEOF_LONG_LONG_INT == 8)
205typedef unsigned long long int u_int64_t; 202typedef unsigned long long int u_int64_t;
206# define HAVE_U_INT64_T 1
207# endif 203# endif
208# endif 204# endif
209#endif 205#endif
210#if !defined(HAVE_LONG_LONG_INT) && (SIZEOF_LONG_LONG_INT == 8)
211# define HAVE_LONG_LONG_INT 1
212#endif
213 206
214#ifndef HAVE_U_CHAR 207#ifndef HAVE_U_CHAR
215typedef unsigned char u_char; 208typedef 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()
215 215
216 nspaces = MIN(get_tty_width() - 79, sizeof(spaces) - 1); 216 nspaces = MIN(get_tty_width() - 79, sizeof(spaces) - 1);
217 217
218#ifdef HAVE_LONG_LONG_INT
219 snprintf(buf, sizeof(buf), 218 snprintf(buf, sizeof(buf),
220 "\r%-45.45s%.*s%3d%% %4lld%c%c %3lld.%01d%cB/s", 219 "\r%-45.45s%.*s%3d%% %4lld%c%c %3lld.%01d%cB/s",
221 curfile, 220 curfile,
222 nspaces, 221 nspaces,
223 spaces, 222 spaces,
224 ratio, 223 ratio,
225 (long long)abbrevsize, 224 (int64_t)abbrevsize,
226 prefixes[ai], 225 prefixes[ai],
227 ai == 0 ? ' ' : 'B', 226 ai == 0 ? ' ' : 'B',
228 (long long)(bytespersec / 1024), 227 (int64_t)(bytespersec / 1024),
229 (int)((bytespersec % 1024) * 10 / 1024), 228 (int)((bytespersec % 1024) * 10 / 1024),
230 prefixes[bi] 229 prefixes[bi]
231 ); 230 );
232#else
233 /* XXX: Handle integer overflow? */
234 snprintf(buf, sizeof(buf),
235 "\r%-45.45s%.*s%3d%% %4lu%c%c %3lu.%01d%cB/s",
236 curfile,
237 nspaces,
238 spaces,
239 ratio,
240 (u_long)abbrevsize,
241 prefixes[ai],
242 ai == 0 ? ' ' : 'B',
243 (u_long)(bytespersec / 1024),
244 (int)((bytespersec % 1024) * 10 / 1024),
245 prefixes[bi]
246 );
247#endif
248 231
249 if (cursize <= 0 || elapsed <= 0.0 || cursize > totalbytes) { 232 if (cursize <= 0 || elapsed <= 0.0 || cursize > totalbytes) {
250 snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), 233 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));
554 goto next; 554 goto next;
555 } 555 }
556#define FILEMODEMASK (S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO) 556#define FILEMODEMASK (S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO)
557#ifdef HAVE_LONG_LONG_INT
558 snprintf(buf, sizeof buf, "C%04o %lld %s\n", 557 snprintf(buf, sizeof buf, "C%04o %lld %s\n",
559 (u_int) (stb.st_mode & FILEMODEMASK), 558 (u_int) (stb.st_mode & FILEMODEMASK),
560 (long long)stb.st_size, last); 559 (int64_t)stb.st_size, last);
561#else
562 /* XXX: Handle integer overflow? */
563 snprintf(buf, sizeof buf, "C%04o %lu %s\n",
564 (u_int) (stb.st_mode & FILEMODEMASK),
565 (u_long) stb.st_size, last);
566#endif
567 if (verbose_mode) { 560 if (verbose_mode) {
568 fprintf(stderr, "Sending file modes: %s", buf); 561 fprintf(stderr, "Sending file modes: %s", buf);
569 } 562 }