additional time_t fix for 32-bit arch

This commit is contained in:
sthen 2013-09-02 10:36:31 +00:00
parent 0edbdb972e
commit ae7a01935c
2 changed files with 24 additions and 12 deletions

View File

@ -1,20 +1,30 @@
$OpenBSD: patch-lib_Resource_cc,v 1.1 2013/09/01 12:49:10 sthen Exp $
$OpenBSD: patch-lib_Resource_cc,v 1.2 2013/09/02 10:36:31 sthen Exp $
64bit time_t fix.
--- lib/Resource.cc.orig Wed Apr 6 14:16:50 2005
+++ lib/Resource.cc Sat Aug 17 22:26:11 2013
@@ -207,6 +207,13 @@ void bt::Resource::write(const char* resource, unsigne
--- lib/Resource.cc.orig Wed Apr 6 15:16:50 2005
+++ lib/Resource.cc Mon Sep 2 04:35:08 2013
@@ -200,9 +200,23 @@ void bt::Resource::write(const char* resource, long va
}
+void bt::Resource::write(const char* resource, unsigned long long value) {
+void bt::Resource::write(const char* resource, long long value) {
+ char tmp[64];
+ sprintf(tmp, "%llu", value);
+ sprintf(tmp, "%lld", value);
+ write(resource, tmp);
+}
+
+
void bt::Resource::write(const char* resource, bool value)
{ write(resource, boolAsString(value)); }
void bt::Resource::write(const char* resource, unsigned long value) {
char tmp[64];
sprintf(tmp, "%lu", value);
+ write(resource, tmp);
+}
+
+
+void bt::Resource::write(const char* resource, unsigned long long value) {
+ char tmp[64];
+ sprintf(tmp, "%llu", value);
write(resource, tmp);
}

View File

@ -1,12 +1,14 @@
$OpenBSD: patch-lib_Resource_hh,v 1.1 2013/09/01 12:49:10 sthen Exp $
$OpenBSD: patch-lib_Resource_hh,v 1.2 2013/09/02 10:36:31 sthen Exp $
64bit time_t fix.
--- lib/Resource.hh.orig Mon Jan 3 01:42:52 2005
+++ lib/Resource.hh Sat Aug 17 22:25:59 2013
@@ -78,6 +78,7 @@ namespace bt {
--- lib/Resource.hh.orig Mon Jan 3 02:42:52 2005
+++ lib/Resource.hh Mon Sep 2 04:35:21 2013
@@ -77,7 +77,9 @@ namespace bt {
void write(const char* resource, int value);
void write(const char* resource, unsigned int value);
void write(const char* resource, long value);
+ void write(const char* resource, long long value);
void write(const char* resource, unsigned long value);
+ void write(const char* resource, unsigned long long value);
void write(const char* resource, bool value);