]> Dogcows Code - chaz/openbox/commitdiff
use the c++ std cheaders
authorDana Jansens <danakj@orodu.net>
Sun, 9 Feb 2003 23:07:54 +0000 (23:07 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 9 Feb 2003 23:07:54 +0000 (23:07 +0000)
34 files changed:
configure.ac
otk/application.cc
otk/appwidget.cc
otk/button.cc
otk/display.cc
otk/eventdispatcher.cc
otk/eventhandler.cc
otk/font.cc
otk/font.hh
otk/label.cc
otk/otk_test.cc
otk/property.cc
otk/property.hh
otk/pseudorendercontrol.cc
otk/rendercolor.cc
otk/rendercontrol.cc
otk/renderstyle.cc
otk/rendertest.cc
otk/screeninfo.cc
otk/surface.cc
otk/timer.cc
otk/timer.hh
otk/truerendercontrol.cc
otk/ustring.cc
otk/util.cc
otk/util.hh
src/actions.cc
src/bindings.cc
src/client.cc
src/frame.cc
src/main.cc
src/openbox.cc
src/screen.cc
wrap/ob.i

index 3511aa424ff26cf22f73bca3172850c18a7ef4ea..c5302aa4cf9a049e9f71f916ac8bb04becfde1fb 100644 (file)
@@ -39,8 +39,8 @@ ALL_LINGUAS=""
 AM_GNU_GETTEXT_VERSION(0.11.5)
 AM_GNU_GETTEXT([external])
 
-AC_CHECK_HEADERS(ctype.h dirent.h fcntl.h libgen.h locale.h nl_types.h process.h signal.h stdarg.h stdint.h stdio.h stdlib.h string.h time.h unistd.h sys/param.h sys/select.h sys/signal.h sys/stat.h sys/time.h sys/types.h sys/wait.h)
-AC_HEADER_TIME
+AC_CHECK_HEADERS(fcntl.h signal.h stdarg.h stdint.h unistd.h sys/select.h sys/signal.h sys/stat.h sys/time.h sys/types.h sys/wait.h)
+AC_HEADER_TIME
 # AC_TYPE_SIGNAL
 
 # Check for Xft2
index ffa33ab800487928b5f0cd2a4fafbe154e043a64..94842ca5848dd96617e84a91d6cb20ed54cbfc52 100644 (file)
@@ -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"
index 5c963f7b58a5acbbf90703c487e7d78eb7b952c5..113998feed5f37d6875a8dac0e63fb9a29134017 100644 (file)
@@ -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"
index c0f48100056d0648f9e1496640ed60a8f14485b0..774aa11bf87eeb10e03a9a332604074297b21737 100644 (file)
@@ -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"
 
index cf4e22e33face83d08e9b8c15247a291ad9b6d25..cb13440a561bf3070bdcee985ed08e5744923f16 100644 (file)
@@ -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 {
 
 
index 8c245ddeb3f00a24d517806ab82a8fbe46cc8b8f..0560eec8609e27b21c56233e5f53dad9a96a4e15 100644 (file)
@@ -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 {
index c867d809c8294aef3b70dfd43f7a2ff8a25b70bd..6539d58790d435afca95de406ba0cd2f33549c50 100644 (file)
@@ -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"
index 4c3a347670b321cb6d4415e06a52d9e4bdd14b03..424c13fbf69eead412931234c927d4bb2f2989b4 100644 (file)
@@ -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>
 
index 16c47f27aed9f2c5c2c28e4cdcc03561ba264209..618d4f6ebb99cd38a5c768c40b7f6b75c5b061ff 100644 (file)
@@ -11,7 +11,7 @@ extern "C" {
 #include <X11/Xft/Xft.h>
 }
 
-#include <assert.h>
+#include <cassert>
 
 namespace otk {
 
index c17e295e49f4119c08551894f479a088fb3424a0..751fff3421197c55954ef41404f8b1dc611e8ac1 100644 (file)
@@ -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"
index b438b3b170f4b75dca63ce807410b5df26e22de2..f10c4b3bb3651532af1788ea8050ee99828a3148 100644 (file)
@@ -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"
index 39626911da9976dfd0b9a01e9da9bf86a3e3d14a..699dd91b36a5e73b2fe93ada7085198eb6ad0ab1 100644 (file)
@@ -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 {
 
index 1dc089376de31d8608b2bd661e0316529017e451..22b62fe67c55cf3fe445ec3548a659a589170f23 100644 (file)
 
 extern "C" {
 #include <X11/Xlib.h>
-
-#include <assert.h>
 }
 
 #include <vector>
+#include <cassert>
 
 namespace otk {
 
index 813eb4d18b750a44627a8c3f344d90cc35e31899..e239a4f040172a996d8b9b775de69e0fb72118fc 100644 (file)
@@ -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"
index be9521bf5fded0bd44c9f8b95e8897a15b9d0967..5917b00732bba72a70ebb08c10946c3deaad1fba 100644 (file)
@@ -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 {
 
index bf69a4e5c7c7694cd3322353fd74f86c57752776..58c8f555732d8fdd405b010d14c68e7d90ee61dc 100644 (file)
@@ -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"
index ae2a3a18f8bf5323fd6cf7349060ca79a245f77e..e7ae0e0a00f315a7c63a4fcf3c93e49aefd7953b 100644 (file)
@@ -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"
index 484a08ffe601d508937f8a81634cc97c01db0355..b3a03a03b9b53c50f55b09aa0b42fec50e1e94cf 100644 (file)
@@ -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)
 {
index 535156e99eadb74037d363ce6436779901001f19..2838c897f888f46180dd3b7f355f2ecc205d21ec 100644 (file)
@@ -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>
index 60e6824cd50e037fe63d8180710adb68badb0970..7d7c0c53b5831607cae40699e6b1a4f537594dcb 100644 (file)
@@ -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"
index 4f993616b1ac0a6df3af1b1ad69be8a73a6c5f44..0a0083146afee234012a7e30796f33d4bd60b393 100644 (file)
@@ -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"
 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 {
index 0ca8be8d83af025e12c44da48b6c5b255f4b4c05..556475c19296a7828f6bb3314e246d0a20aa69d2 100644 (file)
@@ -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
index fffaa05a24fe9240b7bbf470f77b93b51a6e807d..ec7bc46157e0b1c88003b0dfdc01d1e446a306c9 100644 (file)
@@ -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"
index 7dbe8ece3e1c431d8cceae240fde723bf0ce1523..8ffe07fe000ba7c5febf3639b1fd7cf3f7151633 100644 (file)
@@ -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 {
 
index b33a1148116ca54e192b7b8cb9e6a4ccdc89c072..03df393e40139d5a45052599b1801631ed412b87 100644 (file)
@@ -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__
 }
 
 
index e00a4e1b60b444ebe2a3cef4e85d874545efaa4f..22d45fba1d5d9b4fe8817089af28a5c1e9143ebc 100644 (file)
@@ -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>
index bb5088e92447e23d9b1da283e90e1f835247a51a..3eb292158bf257f0a908a2587d73e03953e96b62 100644 (file)
@@ -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 "actions.hh"
 #include "openbox.hh"
@@ -13,7 +11,7 @@
 #include "bindings.hh"
 #include "otk/display.hh"
 
-#include <stdio.h>
+#include <cstdio>
 #include <algorithm>
 
 namespace ob {
index 167d0a854439ded9415da00bde70c404bc3b7fb5..138aba8194de9689d488345309b6dba41eebaa51 100644 (file)
@@ -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 "bindings.hh"
 #include "screen.hh"
index e2c2dcb4f1dc7e9be172739ea24454615521e0c4..254345730a84e9bbf1c22dbb9b6113a139303d6a 100644 (file)
@@ -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 "client.hh"
 #include "frame.hh"
index 17ebdb65f1dd54ff5056beb59f21a488e6ac770e..5f63d17cf1f22f79a798651eeef7307561e8cbe2 100644 (file)
@@ -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"
 
 extern "C" {
 #ifdef    SHAPE
index 83cbf516103d5fbb5bfe195b76b34590e6665200..13047780fafa0175b9715a31609d54b12d0d7147 100644 (file)
@@ -4,19 +4,9 @@
   @brief Main entry point for the application
 */
 
-#ifdef    HAVE_CONFIG_H
-#  include "../config.h"
-#endif // HAVE_CONFIG_H
+#include "config.h"
 
 extern "C" {
-#ifdef    HAVE_LOCALE_H
-# include <locale.h>
-#endif // HAVE_LOCALE_H
-
-#ifdef    HAVE_STDIO_H
-# include <stdio.h>
-#endif // HAVE_STDIO_H
-
 #ifdef    HAVE_UNISTD_H
 #  include <sys/types.h>
 #  include <unistd.h>
@@ -28,6 +18,9 @@ extern "C" {
 #include "openbox.hh"
 #include "otk/util.hh"
 
+#include <clocale>
+#include <cstdio>
+
 int main(int argc, char **argv) {
   // initialize the locale
   if (!setlocale(LC_ALL, ""))
index 24b3278615bed12dfec0a3679567e103c6d0607e..9c1041acfce5f4baa31d0d8fa6964bbd06a0f83a 100644 (file)
@@ -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 "openbox.hh"
 #include "client.hh"
 extern "C" {
 #include <X11/cursorfont.h>
 
-#ifdef    HAVE_STDIO_H
-#  include <stdio.h>
-#endif // HAVE_STDIO_H
-
-#ifdef    HAVE_STDLIB_H
-#  include <stdlib.h>
-#endif // HAVE_STDLIB_H
-
 #ifdef    HAVE_SIGNAL_H
 #  include <signal.h>
 #endif // HAVE_SIGNAL_H
@@ -45,6 +35,8 @@ extern "C" {
 }
 
 #include <algorithm>
+#include <cstdio>
+#include <cstdlib>
 
 namespace ob {
 
index 4878d7b658296e8c4871dce71019792191764d92..024c50949c81089ad315fdcec048d867b370ac69 100644 (file)
@@ -1,18 +1,8 @@
 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
 
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif
+#include "config.h"
 
 extern "C" {
-#ifdef    HAVE_STDIO_H
-#  include <stdio.h>
-#endif // HAVE_STDIO_H
-
-#ifdef    HAVE_STRING_H
-#  include <string.h>
-#endif // HAVE_STRING_H
-
 #ifdef    HAVE_UNISTD_H
 #  include <sys/types.h>
 #  include <unistd.h>
@@ -33,6 +23,8 @@ extern "C" {
 
 #include <vector>
 #include <algorithm>
+#include <cstdio>
+#include <cstring>
 
 static bool running;
 static int anotherWMRunning(Display *display, XErrorEvent *) {
index 33cc5403f0c70714d04cfad592cd14fda2fd687c..0ba9a90e75be4a6da8ad2ecce6ac0d5ed72ab7c0 100644 (file)
--- a/wrap/ob.i
+++ b/wrap/ob.i
@@ -3,9 +3,7 @@
 %module ob
 
 %{
-#ifdef HAVE_CONFIG_H
-#  include "../config.h"
-#endif
+#include "config.h"
 
 #include "frame.hh"
 #include "openbox.hh"
This page took 0.047381 seconds and 4 git commands to generate.