summaryrefslogtreecommitdiff
path: root/otk
diff options
context:
space:
mode:
Diffstat (limited to 'otk')
-rw-r--r--otk/application.cc4
-rw-r--r--otk/appwidget.cc4
-rw-r--r--otk/button.cc4
-rw-r--r--otk/display.cc10
-rw-r--r--otk/eventdispatcher.cc11
-rw-r--r--otk/eventhandler.cc4
-rw-r--r--otk/font.cc11
-rw-r--r--otk/font.hh2
-rw-r--r--otk/label.cc4
-rw-r--r--otk/otk_test.cc4
-rw-r--r--otk/property.cc7
-rw-r--r--otk/property.hh3
-rw-r--r--otk/pseudorendercontrol.cc4
-rw-r--r--otk/rendercolor.cc10
-rw-r--r--otk/rendercontrol.cc4
-rw-r--r--otk/renderstyle.cc4
-rw-r--r--otk/rendertest.cc7
-rw-r--r--otk/screeninfo.cc4
-rw-r--r--otk/surface.cc4
-rw-r--r--otk/timer.cc13
-rw-r--r--otk/timer.hh15
-rw-r--r--otk/truerendercontrol.cc4
-rw-r--r--otk/ustring.cc8
-rw-r--r--otk/util.cc36
-rw-r--r--otk/util.hh11
25 files changed, 55 insertions, 137 deletions
diff --git a/otk/application.cc b/otk/application.cc
index ffa33ab8..94842ca5 100644
--- a/otk/application.cc
+++ b/otk/application.cc
@@ -1,8 +1,6 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif
+#include "config.h"
#include "application.hh"
#include "eventhandler.hh"
diff --git a/otk/appwidget.cc b/otk/appwidget.cc
index 5c963f7b..113998fe 100644
--- a/otk/appwidget.cc
+++ b/otk/appwidget.cc
@@ -1,8 +1,6 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif
+#include "config.h"
#include "appwidget.hh"
#include "application.hh"
diff --git a/otk/button.cc b/otk/button.cc
index c0f48100..774aa11b 100644
--- a/otk/button.cc
+++ b/otk/button.cc
@@ -1,8 +1,6 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif
+#include "config.h"
#include "button.hh"
diff --git a/otk/display.cc b/otk/display.cc
index cf4e22e3..cb13440a 100644
--- a/otk/display.cc
+++ b/otk/display.cc
@@ -1,8 +1,6 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif
+#include "config.h"
#include "display.hh"
#include "screeninfo.hh"
@@ -24,10 +22,6 @@ extern "C" {
#include <X11/extensions/Xinerama.h>
#endif // XINERAMA
-#ifdef HAVE_STDIO_H
-# include <stdio.h>
-#endif // HAVE_STDIO_H
-
#ifdef HAVE_SIGNAL_H
# include <signal.h>
#endif // HAVE_SIGNAL_H
@@ -45,6 +39,8 @@ extern "C" {
#define _(str) gettext(str)
}
+#include <cstdio>
+
namespace otk {
diff --git a/otk/eventdispatcher.cc b/otk/eventdispatcher.cc
index 8c245dde..0560eec8 100644
--- a/otk/eventdispatcher.cc
+++ b/otk/eventdispatcher.cc
@@ -1,18 +1,11 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif
+#include "config.h"
#include "eventdispatcher.hh"
#include "display.hh"
-extern "C" {
-#ifdef HAVE_STDIO_H
-# include <stdio.h>
-#endif
-}
-
+#include <cstdio>
#include <iostream>
namespace otk {
diff --git a/otk/eventhandler.cc b/otk/eventhandler.cc
index c867d809..6539d587 100644
--- a/otk/eventhandler.cc
+++ b/otk/eventhandler.cc
@@ -1,8 +1,6 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif
+#include "config.h"
#include "display.hh"
#include "eventhandler.hh"
diff --git a/otk/font.cc b/otk/font.cc
index 4c3a3476..424c13fb 100644
--- a/otk/font.cc
+++ b/otk/font.cc
@@ -1,15 +1,8 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif // HAVE_CONFIG_H
-
-extern "C" {
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif // HAVE_STDLIB_H
-}
+#include "config.h"
+#include <cstdlib>
#include <iostream>
#include <algorithm>
diff --git a/otk/font.hh b/otk/font.hh
index 16c47f27..618d4f6e 100644
--- a/otk/font.hh
+++ b/otk/font.hh
@@ -11,7 +11,7 @@ extern "C" {
#include <X11/Xft/Xft.h>
}
-#include <assert.h>
+#include <cassert>
namespace otk {
diff --git a/otk/label.cc b/otk/label.cc
index c17e295e..751fff34 100644
--- a/otk/label.cc
+++ b/otk/label.cc
@@ -1,8 +1,6 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif
+#include "config.h"
#include "label.hh"
#include "display.hh"
diff --git a/otk/otk_test.cc b/otk/otk_test.cc
index b438b3b1..f10c4b3b 100644
--- a/otk/otk_test.cc
+++ b/otk/otk_test.cc
@@ -1,8 +1,6 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif
+#include "config.h"
#include "application.hh"
#include "appwidget.hh"
diff --git a/otk/property.cc b/otk/property.cc
index 39626911..699dd91b 100644
--- a/otk/property.cc
+++ b/otk/property.cc
@@ -1,19 +1,16 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif // HAVE_CONFIG_H
+#include "config.h"
#include "property.hh"
#include "display.hh"
extern "C" {
#include <X11/Xatom.h>
-
-#include <assert.h>
}
#include <algorithm>
+#include <cassert>
namespace otk {
diff --git a/otk/property.hh b/otk/property.hh
index 1dc08937..22b62fe6 100644
--- a/otk/property.hh
+++ b/otk/property.hh
@@ -11,11 +11,10 @@
extern "C" {
#include <X11/Xlib.h>
-
-#include <assert.h>
}
#include <vector>
+#include <cassert>
namespace otk {
diff --git a/otk/pseudorendercontrol.cc b/otk/pseudorendercontrol.cc
index 813eb4d1..e239a4f0 100644
--- a/otk/pseudorendercontrol.cc
+++ b/otk/pseudorendercontrol.cc
@@ -1,8 +1,6 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif // HAVE_CONFIG_H
+#include "config.h"
#include "pseudorendercontrol.hh"
#include "display.hh"
diff --git a/otk/rendercolor.cc b/otk/rendercolor.cc
index be9521bf..5917b007 100644
--- a/otk/rendercolor.cc
+++ b/otk/rendercolor.cc
@@ -1,18 +1,12 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif // HAVE_CONFIG_H
+#include "config.h"
#include "rendercolor.hh"
#include "display.hh"
#include "screeninfo.hh"
-extern "C" {
-#ifdef HAVE_STDIO_H
-# include <stdio.h>
-#endif
-}
+#include <cstdio>
namespace otk {
diff --git a/otk/rendercontrol.cc b/otk/rendercontrol.cc
index bf69a4e5..58c8f555 100644
--- a/otk/rendercontrol.cc
+++ b/otk/rendercontrol.cc
@@ -1,8 +1,6 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif // HAVE_CONFIG_H
+#include "config.h"
#include "rendercontrol.hh"
#include "truerendercontrol.hh"
diff --git a/otk/renderstyle.cc b/otk/renderstyle.cc
index ae2a3a18..e7ae0e0a 100644
--- a/otk/renderstyle.cc
+++ b/otk/renderstyle.cc
@@ -1,8 +1,6 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif // HAVE_CONFIG_H
+#include "config.h"
#include "renderstyle.hh"
#include "display.hh"
diff --git a/otk/rendertest.cc b/otk/rendertest.cc
index 484a08ff..b3a03a03 100644
--- a/otk/rendertest.cc
+++ b/otk/rendertest.cc
@@ -1,9 +1,14 @@
+#include "config.h"
+
#include "otk.hh"
#include "rendercontrol.hh"
#include "rendertexture.hh"
-#include <stdio.h>
+extern "C" {
#include <X11/Xlib.h>
+}
+
+#include <cstdio>
int main(int argc, char **argv)
{
diff --git a/otk/screeninfo.cc b/otk/screeninfo.cc
index 535156e9..2838c897 100644
--- a/otk/screeninfo.cc
+++ b/otk/screeninfo.cc
@@ -1,8 +1,6 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif // HAVE_CONFIG_H
+#include "config.h"
extern "C" {
#include <X11/Xlib.h>
diff --git a/otk/surface.cc b/otk/surface.cc
index 60e6824c..7d7c0c53 100644
--- a/otk/surface.cc
+++ b/otk/surface.cc
@@ -1,8 +1,6 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif // HAVE_CONFIG_H
+#include "config.h"
#include "surface.hh"
#include "display.hh"
diff --git a/otk/timer.cc b/otk/timer.cc
index 4f993616..0a008314 100644
--- a/otk/timer.cc
+++ b/otk/timer.cc
@@ -1,8 +1,6 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif // HAVE_CONFIG_H
+#include "config.h"
#include "timer.hh"
#include "display.hh"
@@ -10,12 +8,11 @@
extern "C" {
#ifdef HAVE_SYS_SELECT_H
# include <sys/select.h>
-#else
-# ifdef HAVE_UNISTD_H
-# include <sys/types.h>
-# include <unistd.h>
-# endif // HAVE_UNISTD_H
#endif // HAVE_SYS_SELECT_H
+
+#ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
}
namespace otk {
diff --git a/otk/timer.hh b/otk/timer.hh
index 0ca8be8d..556475c1 100644
--- a/otk/timer.hh
+++ b/otk/timer.hh
@@ -7,16 +7,7 @@
*/
extern "C" {
-#ifdef TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else // !TIME_WITH_SYS_TIME
-# ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else // !HAVE_SYS_TIME_H
-# include <time.h>
-# endif // HAVE_SYS_TIME_H
-#endif // TIME_WITH_SYS_TIME
+#include <ctime>
}
#include <queue>
@@ -39,7 +30,9 @@ private:
struct TimerCompare {
//! Compares two timeval structs
inline bool operator()(const Timer *a, const Timer *b) const {
- return timercmp(&a->_timeout, &b->_timeout, >);
+ return ((&a->_timeout)->tv_sec == (&b->_timeout)->tv_sec) ?
+ ((&a->_timeout)->tv_usec > (&b->_timeout)->tv_usec) :
+ ((&a->_timeout)->tv_sec > (&b->_timeout)->tv_sec);
}
};
friend struct TimerCompare; // give access to _timeout for shitty compilers
diff --git a/otk/truerendercontrol.cc b/otk/truerendercontrol.cc
index fffaa05a..ec7bc461 100644
--- a/otk/truerendercontrol.cc
+++ b/otk/truerendercontrol.cc
@@ -1,8 +1,6 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif // HAVE_CONFIG_H
+#include "config.h"
#include "truerendercontrol.hh"
#include "display.hh"
diff --git a/otk/ustring.cc b/otk/ustring.cc
index 7dbe8ece..8ffe07fe 100644
--- a/otk/ustring.cc
+++ b/otk/ustring.cc
@@ -1,14 +1,10 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif // HAVE_CONFIG_H
+#include "config.h"
#include "ustring.hh"
-extern "C" {
-#include <assert.h>
-}
+#include <cassert>
namespace otk {
diff --git a/otk/util.cc b/otk/util.cc
index b33a1148..03df393e 100644
--- a/otk/util.cc
+++ b/otk/util.cc
@@ -1,39 +1,29 @@
// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif // HAVE_CONFIG_H
+#include "config.h"
extern "C" {
#include <X11/Xatom.h>
-#ifdef HAVE_STDIO_H
-#include <stdio.h>
-#endif
-
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif // HAVE_UNISTD_H
-#if defined(HAVE_PROCESS_H) && defined(__EMX__)
-# include <process.h>
-#endif // HAVE_PROCESS_H __EMX__
+// this is not checked in configure anymore!!
+//#if defined(HAVE_PROCESS_H) && defined(__EMX__)
+//# include <process.h>
+//#endif // HAVE_PROCESS_H __EMX__
#include "../src/gettext.h"
#define _(str) gettext(str)
-#include <assert.h>
}
#include <algorithm>
+#include <cassert>
+#include <cstdio>
+#include <cstring>
+#include <cstdlib>
#include "util.hh"
@@ -52,16 +42,16 @@ string expandTilde(const string& s) {
void bexec(const string& command, const string& displaystring) {
-#ifndef __EMX__
+//#ifndef __EMX__
if (! fork()) {
setsid();
putenv(displaystring);
int ret = execl("/bin/sh", "/bin/sh", "-c", command.c_str(), NULL);
exit(ret);
}
-#else // __EMX__
- spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", command.c_str(), NULL);
-#endif // !__EMX__
+//#else // __EMX__
+// spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", command.c_str(), NULL);
+//#endif // !__EMX__
}
diff --git a/otk/util.hh b/otk/util.hh
index e00a4e1b..22d45fba 100644
--- a/otk/util.hh
+++ b/otk/util.hh
@@ -5,17 +5,6 @@
extern "C" {
#include <X11/Xlib.h>
#include <X11/Xutil.h>
-
-#ifdef TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else // !TIME_WITH_SYS_TIME
-# ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else // !HAVE_SYS_TIME_H
-# include <time.h>
-# endif // HAVE_SYS_TIME_H
-#endif // TIME_WITH_SYS_TIME
}
#include <string>