Index: Makefile
===================================================================
RCS file: /cvs/obsd/ports/x11/blackbox/Makefile,v
retrieving revision 1.51
diff -u -p -u -p -r1.51 Makefile
--- Makefile	21 Mar 2013 08:48:55 -0000	1.51
+++ Makefile	31 Aug 2013 05:13:29 -0000
@@ -3,7 +3,7 @@
 COMMENT=	small & pretty window manager for 8 and more bits displays
 
 DISTNAME=		blackbox-0.70.1
-REVISION=		2
+REVISION=		4
 CATEGORIES=		x11
 
 HOMEPAGE=		http://blackboxwm.sourceforge.net/
Index: patches/patch-lib_Resource_cc
===================================================================
RCS file: patches/patch-lib_Resource_cc
diff -N patches/patch-lib_Resource_cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-lib_Resource_cc	31 Aug 2013 05:13:29 -0000
@@ -0,0 +1,20 @@
+$OpenBSD$
+
+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
+ }
+ 
+ 
++void bt::Resource::write(const char* resource, unsigned long long value) {
++  char tmp[64];
++  sprintf(tmp, "%llu", value);
++  write(resource, tmp);
++}
++
++
+ void bt::Resource::write(const char* resource, bool value)
+ { write(resource, boolAsString(value)); }
+ 
Index: patches/patch-lib_Resource_hh
===================================================================
RCS file: patches/patch-lib_Resource_hh
diff -N patches/patch-lib_Resource_hh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-lib_Resource_hh	31 Aug 2013 05:13:29 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+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 {
+     void write(const char* resource, unsigned int value);
+     void write(const char* resource, 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);
+     void write(const char* resource, double value);
+ 
Index: patches/patch-lib_Timer_cc
===================================================================
RCS file: patches/patch-lib_Timer_cc
diff -N patches/patch-lib_Timer_cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-lib_Timer_cc	31 Aug 2013 05:13:29 -0000
@@ -0,0 +1,25 @@
+$OpenBSD$
+
+64bit time_t fix.
+
+--- lib/Timer.cc.orig	Fri Mar 18 01:07:09 2005
++++ lib/Timer.cc	Sat Aug 17 22:43:13 2013
+@@ -28,8 +28,7 @@
+ 
+ 
+ bt::timeval::timeval(const ::timeval &t)
+-  : tv_sec(t.tv_sec), tv_usec(t.tv_usec)
+-{ }
++{ tv_sec = t.tv_sec; tv_usec = t.tv_usec; }
+ 
+ 
+ bool bt::timeval::operator<(const timeval &tv)
+@@ -105,7 +104,7 @@ void bt::Timer::adjustStartTime(const timeval &offset)
+ { _start += offset; }
+ 
+ 
+-void bt::Timer::setTimeout(long t) {
++void bt::Timer::setTimeout(time_t t) {
+   _timeout.tv_sec = t / 1000;
+   _timeout.tv_usec = t % 1000;
+   _timeout.tv_usec *= 1000;
Index: patches/patch-lib_Timer_hh
===================================================================
RCS file: patches/patch-lib_Timer_hh
diff -N patches/patch-lib_Timer_hh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-lib_Timer_hh	31 Aug 2013 05:13:29 -0000
@@ -0,0 +1,36 @@
+$OpenBSD$
+
+64bit time_t fix.
+
+--- lib/Timer.hh.orig	Fri Mar 18 01:07:09 2005
++++ lib/Timer.hh	Sat Aug 17 22:43:03 2013
+@@ -37,16 +37,12 @@ struct timeval;
+ namespace bt {
+ 
+   // use a wrapper class to avoid the header as well
+-  struct timeval {
+-    long tv_sec;
+-    long tv_usec;
++  struct timeval : public ::timeval {
+ 
+     inline timeval(void)
+-      : tv_sec(0l), tv_usec(0l)
+-    { }
+-    inline timeval(long s, long u)
+-      : tv_sec(s), tv_usec(u)
+-    { }
++    { tv_sec = 0; tv_usec = 0; }
++    inline timeval(time_t s, long u)
++    { tv_sec = s; tv_usec = u; }
+ 
+     bool operator<(const timeval &);
+     timeval operator+(const timeval &);
+@@ -106,7 +102,7 @@ namespace bt {
+     inline void recurring(bool b)
+     { recur = b; }
+ 
+-    void setTimeout(long t);
++    void setTimeout(time_t t);
+     void setTimeout(const timeval &t);
+ 
+     void start(void);  // manager acquires timer
Index: patches/patch-lib_Unicode_cc
===================================================================
RCS file: /cvs/obsd/ports/x11/blackbox/patches/patch-lib_Unicode_cc,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-lib_Unicode_cc
--- patches/patch-lib_Unicode_cc	23 Jun 2005 20:35:23 -0000	1.1
+++ patches/patch-lib_Unicode_cc	31 Aug 2013 05:13:29 -0000
@@ -1,12 +1,27 @@
 $OpenBSD$
---- lib/Unicode.cc.orig	Mon Jan  3 10:42:53 2005
-+++ lib/Unicode.cc	Tue Jun  7 07:33:56 2005
-@@ -166,7 +166,7 @@ bool bt::hasUnicode() {
+
+Fixes "skip over" invalid character sequence code inside #else part of
+#ifdef HAVE_GNU_LIBICONV. Looks like a typo.
+
+Append "//TRANSLIT" to iconv conversion, so best effort replacement
+characters will be used when no direct character representation exist.
+
+--- lib/Unicode.cc.orig	Mon Jan  3 01:42:53 2005
++++ lib/Unicode.cc	Tue Jul  9 12:08:50 2013
+@@ -125,7 +125,7 @@ namespace bt {
+             // POSIX compliant iconv(3)
+             inp =
+               reinterpret_cast<char *>
+-              (const_cast<typename _Source::value_type *>(in.data()));
++              (const_cast<typename _Source::value_type *>(in.data())) + off;
+ #endif
+             in_bytes = in_size - off;
+             break;
+@@ -168,6 +168,7 @@ bool bt::hasUnicode() {
  
-   setlocale(LC_ALL, "");
- 
--#ifdef HAVE_NL_LANGINFO
-+#if defined(HAVE_NL_LANGINFO) && ! defined(__OpenBSD__) 
+ #ifdef HAVE_NL_LANGINFO
    codeset = nl_langinfo(CODESET);
++  codeset += "//TRANSLIT";
  #else
    std::string locale = setlocale(LC_CTYPE, 0);
+   std::string::const_iterator it = locale.begin();
Index: patches/patch-src_ScreenResource_cc
===================================================================
RCS file: patches/patch-src_ScreenResource_cc
diff -N patches/patch-src_ScreenResource_cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_ScreenResource_cc	31 Aug 2013 05:13:29 -0000
@@ -0,0 +1,15 @@
+$OpenBSD$
+
+Fix for warning: deprecated conversion from string constant to 'char*'
+
+--- src/ScreenResource.cc.orig	Tue Apr 12 22:54:08 2005
++++ src/ScreenResource.cc	Fri Aug 30 14:12:43 2013
+@@ -61,7 +61,7 @@ static const unsigned char close_bits[] =
+ 
+ void ScreenResource::save(bt::Resource& res, BScreen* screen) {
+   char rc_string[128];
+-  char *placement = (char *) 0;
++  const char *placement = NULL;
+   unsigned int number = screen->screenNumber();
+ 
+   switch (_slitOptions.placement) {
Index: patches/patch-src_Toolbar_cc
===================================================================
RCS file: /cvs/obsd/ports/x11/blackbox/patches/patch-src_Toolbar_cc,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-src_Toolbar_cc
--- patches/patch-src_Toolbar_cc	16 Aug 2013 19:37:45 -0000	1.1
+++ patches/patch-src_Toolbar_cc	31 Aug 2013 05:13:29 -0000
@@ -1,18 +1,24 @@
 $OpenBSD$
 
-Fix build failure when time_t is long long.
+64bit time_t fix.
 
---- src/Toolbar.cc.orig	Tue Apr 12 09:38:00 2005
-+++ src/Toolbar.cc	Fri Aug 16 21:33:33 2013
-@@ -43,8 +43,10 @@
- long nextTimeout(int resolution)
+--- src/Toolbar.cc.orig	Tue Apr 12 00:38:00 2005
++++ src/Toolbar.cc	Sat Aug 17 22:47:24 2013
+@@ -40,12 +40,14 @@
+ #include <assert.h>
+ 
+ 
+-long nextTimeout(int resolution)
++time_t nextTimeout(int resolution)
  {
    timeval now;
-+  int secs;
    gettimeofday(&now, 0);
 -  return (std::max(1000l, ((((resolution - (now.tv_sec % resolution)) * 1000l))
-+  secs = now.tv_sec % resolution;
-+  return (std::max(1000l, ((((resolution - secs) * 1000l))
-                            - (now.tv_usec / 1000l))));
+-                           - (now.tv_usec / 1000l))));
++  time_t	t;
++  t = (resolution - (now.tv_sec % resolution)) * 1000l;
++  t -= now.tv_usec / 1000l;
++  return std::max(t, (time_t)1000);
  }
+ 
  
Index: patches/patch-src_blackbox_cc
===================================================================
RCS file: patches/patch-src_blackbox_cc
diff -N patches/patch-src_blackbox_cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_blackbox_cc	31 Aug 2013 05:13:29 -0000
@@ -0,0 +1,24 @@
+$OpenBSD$
+
+Fix for warning: deprecated conversion from string constant to 'char*'
+
+--- src/blackbox.cc.orig	Tue Oct 18 04:33:25 2005
++++ src/blackbox.cc	Fri Aug 30 14:17:31 2013
+@@ -75,7 +75,7 @@ void Blackbox::reload_rc(void) {
+ 
+ 
+ void Blackbox::init_icccm(void) {
+-  char* atoms[7] = {
++  const char* atoms[7] = {
+     "WM_COLORMAP_WINDOWS",
+     "WM_PROTOCOLS",
+     "WM_STATE",
+@@ -85,7 +85,7 @@ void Blackbox::init_icccm(void) {
+     "_MOTIF_WM_HINTS"
+   };
+   Atom atoms_return[7];
+-  XInternAtoms(XDisplay(), atoms, 7, false, atoms_return);
++  XInternAtoms(XDisplay(), (char **)atoms, 7, false, atoms_return);
+   xa_wm_colormap_windows = atoms_return[0];
+   xa_wm_protocols = atoms_return[1];
+   xa_wm_state = atoms_return[2];
