Skip to content
Browse files

removed _c and _cpp suffixes from files

  • Loading branch information...
1 parent 197ec1b commit 81f2f1d8af21b240a08f703fdbd2596ee372667f @valyala committed Dec 23, 2011
Showing with 20 additions and 14 deletions.
  1. +7 −5 README
  2. +1 −1 gheap_c.h → gheap.h
  3. +8 −0 gheap.hpp
  4. +2 −2 tests_c.c → tests.c
  5. +2 −6 tests_cpp.cpp → tests.cpp
View
12 README
@@ -63,21 +63,23 @@ The implementation provides the following functions:
The implementation is inspired by http://queue.acm.org/detail.cfm?id=1814327 ,
but it is more generalized. The implementation is optimized for speed.
-There are the following file:
+There are the following files:
* gheap_cpp03.hpp - gheap optimized for C++03.
* gheap_cpp11.hpp - gheap optimized for C++11.
-* gheap_c.h - gheap optimized for C99.
+* gheap.hpp - switch file, which includes either gheap_cpp03.hpp
+ or gheap_cpp11.hpp depending on whether GHEAP_CPP11 macro is defined.
+* gheap.h - gheap optimized for C99.
Don't forget passing -DNDEBUG option to the compiler when creating optimized
builds. This significantly speeds up gheap code by removing debug assertions.
-Also pass -ftracer option to gcc when building a file with gheap_c.h included.
+Also pass -ftracer option to gcc when building a file with gheap.h included.
This significantly improves gheap performance.
===============================================================================
gheap for C++ usage
-#include "gheap_cpp11.hpp"
+#include "gheap.hpp"
...
@@ -101,7 +103,7 @@ heapsort<paged_binary_heap>(a);
===============================================================================
gheap for C usage
-#include "gheap_c.h"
+#include "gheap.h"
static void less(const void *const a, const void *const b)
{
View
2 gheap_c.h → gheap.h
@@ -7,7 +7,7 @@
* Don't forget passing -DNDEBUG option to the compiler when creating optimized
* builds. This significantly speeds up gheap code by removing debug assertions.
*
- * Pass -ftracer option to gcc when building a file with gheap_c.h included.
+ * Pass -ftracer option to gcc when building a file with gheap.h included.
* This significantly improves gheap performance.
*
* Author: Aliaksandr Valialkin <valyala@gmail.com>.
View
8 gheap.hpp
@@ -0,0 +1,8 @@
+// Pass -DGHEAP_CPP11 to compiler for including gheap optimized for C++11.
+// Otherwise gheap optimized for C++03 will be included.
+
+#ifdef GHEAP_CPP11
+# include "gheap_cpp11.hpp"
+#else
+# include "gheap_cpp03.hpp"
+#endif
View
4 tests_c.c → tests.c
@@ -1,6 +1,6 @@
-/* Tests for gheap_c. */
+/* Tests for C99 gheap */
-#include "gheap_c.h"
+#include "gheap.h"
#include <assert.h>
#include <stdio.h> /* for printf() */
View
8 tests_cpp.cpp → tests.cpp
@@ -1,13 +1,9 @@
-// Tests for gheap_cpp*.
+// Tests for C++03 and C++11 gheap.
//
// Pass -DGHEAP_CPP11 to compiler for gheap_cpp11.hpp tests,
// otherwise gheap_cpp03.hpp will be tested.
-#ifdef GHEAP_CPP11
-# include "gheap_cpp11.hpp"
-#else
-# include "gheap_cpp03.hpp"
-#endif
+#include "gheap.hpp"
#include <cassert>
#include <cstdlib> // for srand(), rand()

0 comments on commit 81f2f1d

Please sign in to comment.
Something went wrong with that request. Please try again.