On 06/24/14 20:56, Stuart Henderson wrote:
On 2014/06/24 20:36, Brian Callahan wrote:
+$OpenBSD$
+
+Fix a time_t warning.
+
+--- src/ServerStat.cc.orig     Mon Jun 23 23:59:36 2014
++++ src/ServerStat.cc  Tue Jun 24 00:03:56 2014
+@@ -205,7 +205,7 @@ bool ServerStat::operator==(const ServerStat& serverSt
+ std::string ServerStat::toString() const
+ {
+   return fmt("host=%s, protocol=%s, dl_speed=%d, sc_avg_speed=%d,"
+-             " mc_avg_speed=%d, last_updated=%ld, counter=%d, status=%s",
++             " mc_avg_speed=%d, last_updated=%lld, counter=%d, status=%s",
+              getHostname().c_str(),
+              getProtocol().c_str(),
+              getDownloadSpeed(),
Nearly, but you should also cast the parameter, so it can be fed
upstream (otherwise this patch will break on OS which have 32 bit time_t).
This ought to do:

   return fmt("host=%s, protocol=%s, dl_speed=%d, sc_avg_speed=%d,"
              " mc_avg_speed=%d, last_updated=%lld, counter=%d, status=%s",
              getHostname().c_str(),
              getProtocol().c_str(),
              getDownloadSpeed(),
              getSingleConnectionAvgSpeed(),
              getMultiConnectionAvgSpeed(),
              (long long)getLastUpdated().getTime(),
              getCounter(),
              STATUS_STRING[getStatus()]);


Thanks Stuart. Updated diff attached.

Index: Makefile
===================================================================
RCS file: /cvs/ports/www/aria2/Makefile,v
retrieving revision 1.28
diff -u -p -r1.28 Makefile
--- Makefile	2 May 2014 15:06:31 -0000	1.28
+++ Makefile	25 Jun 2014 01:05:07 -0000
@@ -2,7 +2,7 @@
 
 COMMENT =		lightweight multi-protocol & multi-source download utility
 DISTNAME =		aria2-1.18.5
-REVISION =		1
+REVISION =		2
 CATEGORIES =		www
 HOMEPAGE =		http://aria2.sourceforge.net/
 
@@ -38,10 +38,5 @@ CONFIGURE_ARGS +=	--with-sqlite3 \
 			--with-openssl \
 			--without-gnutls \
 			--without-libxml2
-
-# Prevent gcc 4.2.1 from running out of memory.
-.if ${MACHINE_ARCH:Mmips64*}
-CFLAGS +=		-O0
-.endif
 
 .include <bsd.port.mk>
Index: patches/patch-src_ServerStat_cc
===================================================================
RCS file: patches/patch-src_ServerStat_cc
diff -N patches/patch-src_ServerStat_cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_ServerStat_cc	25 Jun 2014 01:05:07 -0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+
+Fix a time_t warning.
+
+--- src/ServerStat.cc.orig	Sun Mar 30 05:23:59 2014
++++ src/ServerStat.cc	Tue Jun 24 21:03:46 2014
+@@ -205,13 +205,13 @@ bool ServerStat::operator==(const ServerStat& serverSt
+ std::string ServerStat::toString() const
+ {
+   return fmt("host=%s, protocol=%s, dl_speed=%d, sc_avg_speed=%d,"
+-             " mc_avg_speed=%d, last_updated=%ld, counter=%d, status=%s",
++             " mc_avg_speed=%d, last_updated=%lld, counter=%d, status=%s",
+              getHostname().c_str(),
+              getProtocol().c_str(),
+              getDownloadSpeed(),
+              getSingleConnectionAvgSpeed(),
+              getMultiConnectionAvgSpeed(),
+-             getLastUpdated().getTime(),
++             (long long)getLastUpdated().getTime(),
+              getCounter(),
+              STATUS_STRING[getStatus()]);
+ }

Reply via email to