summaryrefslogtreecommitdiff
path: root/chat/spectrum/patches
diff options
context:
space:
mode:
authorschnoebe <schnoebe@pkgsrc.org>2012-12-21 00:10:59 +0000
committerschnoebe <schnoebe@pkgsrc.org>2012-12-21 00:10:59 +0000
commitbac51e7b57799a2f4cbd876cb0aea0123356b6d3 (patch)
tree448e4c6e39a8f282e2f04a35315b7429988904b8 /chat/spectrum/patches
parentd55a31ab7e6e9cd40f52eea2fa9f811ac3335b81 (diff)
downloadpkgsrc-bac51e7b57799a2f4cbd876cb0aea0123356b6d3.tar.gz
Add two new patches:
* handle building with NetBSD 6's 64bit time_t on a 32 bit platform * reorder src/utf8/checked.h to define the append() function before using it later on in the same file. Also updated the MASTER_SITES to reference the new download site.
Diffstat (limited to 'chat/spectrum/patches')
-rw-r--r--chat/spectrum/patches/patch-src_statshandler.cpp24
-rw-r--r--chat/spectrum/patches/patch-src_utf8_checked.h79
2 files changed, 103 insertions, 0 deletions
diff --git a/chat/spectrum/patches/patch-src_statshandler.cpp b/chat/spectrum/patches/patch-src_statshandler.cpp
new file mode 100644
index 00000000000..e34078e04df
--- /dev/null
+++ b/chat/spectrum/patches/patch-src_statshandler.cpp
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_statshandler.cpp,v 1.1 2012/12/21 00:10:59 schnoebe Exp $
+
+Force the seconds of uptime to be an integer quantity.
+
+Shouldn't cause a problem, as I doubt any system will be ever be up for
+30+ years, so representing in a signed, potentially 32 bit quantity
+shouldn't be a problem.
+
+--- src/statshandler.cpp.orig 2011-06-11 13:17:44.000000000 +0000
++++ src/statshandler.cpp
+@@ -172,7 +172,12 @@ Tag* GlooxStatsHandler::handleTag (Tag *
+ t = new Tag("stat");
+ t->addAttribute("name","uptime");
+ t->addAttribute("units","seconds");
+- t->addAttribute("value",seconds - m_startTime);
++ // no more than integer number of seconds
++ // of uptime (NetBSD 6.0 and later have time_t
++ // as a 64 bit qauntity, but I doubt any single
++ // system will ever be up 30 years, so an int
++ // (32 bits on some platforms) should suffice)
++ t->addAttribute("value", (int)(seconds - m_startTime));
+ query->addChild(t);
+ } else if (name == "users/registered") {
+ t = new Tag("stat");
diff --git a/chat/spectrum/patches/patch-src_utf8_checked.h b/chat/spectrum/patches/patch-src_utf8_checked.h
new file mode 100644
index 00000000000..8d2e41b3bd8
--- /dev/null
+++ b/chat/spectrum/patches/patch-src_utf8_checked.h
@@ -0,0 +1,79 @@
+$NetBSD: patch-src_utf8_checked.h,v 1.1 2012/12/21 00:10:59 schnoebe Exp $
+
+Reorder the template definitions so append() was defined in the class
+before its first use.
+
+--- src/utf8/checked.h.orig 2010-10-08 07:15:22.000000000 +0000
++++ src/utf8/checked.h
+@@ -65,6 +65,35 @@ namespace utf8
+
+ /// The library API - functions intended to be called by the users
+
++ template <typename octet_iterator>
++ octet_iterator append(uint32_t cp, octet_iterator result)
++ {
++ if (!internal::is_code_point_valid(cp))
++ throw invalid_code_point(cp);
++
++ if (cp < 0x80) // one octet
++ *(result++) = static_cast<uint8_t>(cp);
++ else if (cp < 0x800) { // two octets
++ *(result++) = static_cast<uint8_t>((cp >> 6) | 0xc0);
++ *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
++ }
++ else if (cp < 0x10000) { // three octets
++ *(result++) = static_cast<uint8_t>((cp >> 12) | 0xe0);
++ *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80);
++ *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
++ }
++ else if (cp <= internal::CODE_POINT_MAX) { // four octets
++ *(result++) = static_cast<uint8_t>((cp >> 18) | 0xf0);
++ *(result++) = static_cast<uint8_t>(((cp >> 12)& 0x3f) | 0x80);
++ *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80);
++ *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
++ }
++ else
++ throw invalid_code_point(cp);
++
++ return result;
++ }
++
+ template <typename octet_iterator, typename output_iterator>
+ output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out, uint32_t replacement)
+ {
+@@ -104,35 +133,6 @@ namespace utf8
+ }
+
+ template <typename octet_iterator>
+- octet_iterator append(uint32_t cp, octet_iterator result)
+- {
+- if (!internal::is_code_point_valid(cp))
+- throw invalid_code_point(cp);
+-
+- if (cp < 0x80) // one octet
+- *(result++) = static_cast<uint8_t>(cp);
+- else if (cp < 0x800) { // two octets
+- *(result++) = static_cast<uint8_t>((cp >> 6) | 0xc0);
+- *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
+- }
+- else if (cp < 0x10000) { // three octets
+- *(result++) = static_cast<uint8_t>((cp >> 12) | 0xe0);
+- *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80);
+- *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
+- }
+- else if (cp <= internal::CODE_POINT_MAX) { // four octets
+- *(result++) = static_cast<uint8_t>((cp >> 18) | 0xf0);
+- *(result++) = static_cast<uint8_t>(((cp >> 12)& 0x3f) | 0x80);
+- *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80);
+- *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
+- }
+- else
+- throw invalid_code_point(cp);
+-
+- return result;
+- }
+-
+- template <typename octet_iterator>
+ uint32_t next(octet_iterator& it, octet_iterator end)
+ {
+ uint32_t cp = 0;