summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2010-08-31 22:14:57 +0100
committerAlbert Astals Cid <aacid@kde.org>2010-08-31 22:14:57 +0100
commitae79fc504c5424be2fa21dbc5498ced4db6e5dd3 (patch)
tree86db72524dda6e4252d5ff17809d4069ebbbd5fa
parentd3f32f2c4f9f46620c0287c44bef686f340461f3 (diff)
Make GBool a bool instead of an int
Passes the regression tests and might make things faster and use a bit less memory
-rw-r--r--cpp/tests/CMakeLists.txt2
-rw-r--r--cpp/tests/Makefile.am2
-rw-r--r--goo/gtypes.h7
-rw-r--r--utils/CMakeLists.txt2
-rw-r--r--utils/Makefile.am2
-rw-r--r--utils/parseargs.cc (renamed from utils/parseargs.c)0
6 files changed, 8 insertions, 7 deletions
diff --git a/cpp/tests/CMakeLists.txt b/cpp/tests/CMakeLists.txt
index f7182902..85e20fb0 100644
--- a/cpp/tests/CMakeLists.txt
+++ b/cpp/tests/CMakeLists.txt
@@ -18,5 +18,5 @@ macro(CPP_ADD_SIMPLETEST exe)
endmacro(CPP_ADD_SIMPLETEST)
-cpp_add_simpletest(poppler-dump poppler-dump.cpp ${CMAKE_SOURCE_DIR}/utils/parseargs.c)
+cpp_add_simpletest(poppler-dump poppler-dump.cpp ${CMAKE_SOURCE_DIR}/utils/parseargs.cc)
target_link_libraries(poppler-dump poppler)
diff --git a/cpp/tests/Makefile.am b/cpp/tests/Makefile.am
index 50668892..87a4f7a6 100644
--- a/cpp/tests/Makefile.am
+++ b/cpp/tests/Makefile.am
@@ -14,7 +14,7 @@ noinst_PROGRAMS = \
poppler-dump
poppler_dump_SOURCES = \
- $(top_srcdir)/utils/parseargs.c \
+ $(top_srcdir)/utils/parseargs.cc \
poppler-dump.cpp
poppler_dump_LDADD = $(LDADDS)
diff --git a/goo/gtypes.h b/goo/gtypes.h
index a6887ad0..b7a2dd2d 100644
--- a/goo/gtypes.h
+++ b/goo/gtypes.h
@@ -14,6 +14,7 @@
// under GPL version 2 or later
//
// Copyright (C) 2010 Patrick Spendrin <ps_ml@gmx.de>
+// Copyright (C) 2010 Albert Astals Cid <aacid@kde.org>
//
// To see a description of the changes please see the Changelog file that
// came with your tarball or type make ChangeLog if you are building from git
@@ -27,9 +28,9 @@
* These have stupid names to avoid conflicts with some (but not all)
* C++ compilers which define them.
*/
-typedef int GBool;
-#define gTrue 1
-#define gFalse 0
+typedef bool GBool;
+#define gTrue true
+#define gFalse false
#ifdef _MSC_VER
#pragma warning(disable: 4800) /* 'type' : forcing value to bool 'true' or 'false' (performance warning) */
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
index f8e8f4c8..7b44b05c 100644
--- a/utils/CMakeLists.txt
+++ b/utils/CMakeLists.txt
@@ -1,6 +1,6 @@
set(common_srcs
- parseargs.c
+ parseargs.cc
)
set(common_libs
poppler
diff --git a/utils/Makefile.am b/utils/Makefile.am
index e57c71b9..56f2cfd2 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -57,7 +57,7 @@ dist_man1_MANS = \
pdftohtml.1 \
$(pdftoppm_manpage)
-common = parseargs.c parseargs.h
+common = parseargs.cc parseargs.h
pdffonts_SOURCES = \
pdffonts.cc \
diff --git a/utils/parseargs.c b/utils/parseargs.cc
index c5f3007e..c5f3007e 100644
--- a/utils/parseargs.c
+++ b/utils/parseargs.cc