Rename all private sources and headers to C++ files
authorBehdad Esfahbod <behdad@behdad.org>
Wed, 20 Apr 2011 22:50:27 +0000 (18:50 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Wed, 20 Apr 2011 22:50:27 +0000 (18:50 -0400)
So we can liberally use the simple features of C++ that parts of the
codebase is already using.

24 files changed:
src/Makefile.am
src/hb-blob-private.hh [moved from src/hb-blob-private.h with 93% similarity]
src/hb-blob.cc
src/hb-buffer-private.hh
src/hb-common.cc [moved from src/hb-common.c with 95% similarity]
src/hb-font-private.hh [moved from src/hb-font-private.h with 95% similarity]
src/hb-font.cc
src/hb-ft.cc [moved from src/hb-ft.c with 99% similarity]
src/hb-glib.cc
src/hb-icu.cc
src/hb-object-private.hh [moved from src/hb-object-private.h with 94% similarity]
src/hb-open-type-private.hh
src/hb-ot-layout-gdef-private.hh
src/hb-ot-layout-private.hh
src/hb-ot-shape-complex-arabic-table.hh [moved from src/hb-ot-shape-complex-arabic-table.h with 99% similarity]
src/hb-ot-shape-complex-arabic.cc
src/hb-ot-shape-complex-private.hh
src/hb-ot-shape-private.hh
src/hb-ot-tag.cc [moved from src/hb-ot-tag.c with 99% similarity]
src/hb-private.hh [moved from src/hb-private.h with 98% similarity]
src/hb-shape.cc
src/hb-unicode-private.hh
src/hb-unicode.cc
src/hb-view.c

index 845c24a..1069307 100644 (file)
@@ -12,17 +12,17 @@ HBCFLAGS =
 HBLIBS =
 HBSOURCES =  \
        hb-blob.cc \
-       hb-blob-private.h \
+       hb-blob-private.hh \
        hb-buffer.cc \
        hb-buffer-private.hh \
-       hb-common.c \
+       hb-common.cc \
        hb-font.cc \
-       hb-font-private.h \
-       hb-object-private.h \
+       hb-font-private.hh \
+       hb-object-private.hh \
        hb-open-file-private.hh \
        hb-open-type-private.hh \
        hb-ot-head-private.hh \
-       hb-private.h \
+       hb-private.hh \
        hb-shape.cc \
        hb-unicode.cc \
        hb-unicode-private.hh \
@@ -49,10 +49,10 @@ HBSOURCES += \
        hb-ot-map-private.hh \
        hb-ot-shape.cc \
        hb-ot-shape-complex-arabic.cc \
-       hb-ot-shape-complex-arabic-table.h \
+       hb-ot-shape-complex-arabic-table.hh \
        hb-ot-shape-complex-private.hh \
        hb-ot-shape-private.hh \
-       hb-ot-tag.c \
+       hb-ot-tag.cc \
        $(NULL)
 HBHEADERS += \
        hb-ot.h \
@@ -87,7 +87,7 @@ if HAVE_FREETYPE
 HBCFLAGS += $(FREETYPE_CFLAGS)
 HBLIBS   += $(FREETYPE_LIBS)
 HBSOURCES += \
-       hb-ft.c \
+       hb-ft.cc \
        $(NULL)
 HBHEADERS += \
        hb-ft.h \
@@ -142,5 +142,6 @@ else
 dist_check_SCRIPTS += check-libstdc++.sh
 endif
 
+TESTS = $(dist_check_SCRIPTS)
 
 -include $(top_srcdir)/git.mk
similarity index 93%
rename from src/hb-blob-private.h
rename to src/hb-blob-private.hh
index cdc9b2f..4b421da 100644 (file)
  * Red Hat Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_BLOB_PRIVATE_H
-#define HB_BLOB_PRIVATE_H
+#ifndef HB_BLOB_PRIVATE_HH
+#define HB_BLOB_PRIVATE_HH
 
-#include "hb-private.h"
+#include "hb-private.hh"
 
 #include "hb-blob.h"
 
@@ -56,4 +56,4 @@ extern HB_INTERNAL hb_blob_t _hb_blob_nil;
 
 HB_END_DECLS
 
-#endif /* HB_BLOB_PRIVATE_H */
+#endif /* HB_BLOB_PRIVATE_HH */
index 511455b..e2af8b7 100644 (file)
@@ -24,9 +24,9 @@
  * Red Hat Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.h"
+#include "hb-private.hh"
 
-#include "hb-blob-private.h"
+#include "hb-blob-private.hh"
 
 #ifdef HAVE_SYS_MMAN_H
 #ifdef HAVE_UNISTD_H
index dfcc45d..4c2a3e6 100644 (file)
@@ -28,7 +28,7 @@
 #ifndef HB_BUFFER_PRIVATE_HH
 #define HB_BUFFER_PRIVATE_HH
 
-#include "hb-private.h"
+#include "hb-private.hh"
 #include "hb-buffer.h"
 #include "hb-unicode-private.hh"
 
similarity index 95%
rename from src/hb-common.c
rename to src/hb-common.cc
index c1c4c54..ece0980 100644 (file)
@@ -24,7 +24,7 @@
  * Red Hat Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.h"
+#include "hb-private.hh"
 
 HB_BEGIN_DECLS
 
@@ -70,8 +70,8 @@ static hb_bool_t
 lang_equal (const void *v1,
            const void *v2)
 {
-  const unsigned char *p1 = v1;
-  const unsigned char *p2 = v2;
+  const unsigned char *p1 = (const unsigned char *) v1;
+  const unsigned char *p2 = (const unsigned char *) v2;
 
   while (canon_map[*p1] && canon_map[*p1] == canon_map[*p2])
     {
@@ -118,7 +118,7 @@ hb_language_from_string (const char *str)
 
   if (unlikely (num_langs == num_alloced)) {
     unsigned int new_alloced = 2 * (8 + num_alloced);
-    hb_language_t *new_langs = realloc (langs, new_alloced * sizeof (langs[0]));
+    hb_language_t *new_langs = (hb_language_t *) realloc (langs, new_alloced * sizeof (langs[0]));
     if (!new_langs)
       return NULL;
     num_alloced = new_alloced;
similarity index 95%
rename from src/hb-font-private.h
rename to src/hb-font-private.hh
index 46686b7..da7255a 100644 (file)
  * Red Hat Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_FONT_PRIVATE_H
-#define HB_FONT_PRIVATE_H
+#ifndef HB_FONT_PRIVATE_HH
+#define HB_FONT_PRIVATE_HH
 
-#include "hb-private.h"
+#include "hb-private.hh"
 
 #include "hb-font.h"
 
@@ -94,4 +94,4 @@ struct _hb_font_t {
 
 HB_END_DECLS
 
-#endif /* HB_FONT_PRIVATE_H */
+#endif /* HB_FONT_PRIVATE_HH */
index 96ff4f5..a84dde4 100644 (file)
  * Red Hat Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.h"
+#include "hb-private.hh"
 
-#include "hb-font-private.h"
-#include "hb-blob-private.h"
+#include "hb-font-private.hh"
+#include "hb-blob-private.hh"
 #include "hb-open-file-private.hh"
 
 #include "hb-ot-layout-private.hh"
similarity index 99%
rename from src/hb-ft.c
rename to src/hb-ft.cc
index 96c035a..f583ce5 100644 (file)
  * Red Hat Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.h"
+#include "hb-private.hh"
 
 #include "hb-ft.h"
 
-#include "hb-font-private.h"
+#include "hb-font-private.hh"
 
 #include FT_TRUETYPE_TABLES_H
 
index 158a210..0f94f52 100644 (file)
@@ -24,7 +24,7 @@
  * Red Hat Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.h"
+#include "hb-private.hh"
 
 #include "hb-glib.h"
 
index 8fc8c81..2f31a07 100644 (file)
@@ -25,7 +25,7 @@
  * Red Hat Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.h"
+#include "hb-private.hh"
 
 #include "hb-icu.h"
 
similarity index 94%
rename from src/hb-object-private.h
rename to src/hb-object-private.hh
index c1787c5..8f0d5ae 100644 (file)
  * Red Hat Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_OBJECT_PRIVATE_H
-#define HB_OBJECT_PRIVATE_H
+#ifndef HB_OBJECT_PRIVATE_HH
+#define HB_OBJECT_PRIVATE_HH
 
-#include "hb-private.h"
+#include "hb-private.hh"
 
 HB_BEGIN_DECLS
 
@@ -53,8 +53,6 @@ typedef struct {
 
 #define HB_REFERENCE_COUNT_IS_INVALID(RC) (HB_REFERENCE_COUNT_GET_VALUE (RC) == HB_REFERENCE_COUNT_INVALID_VALUE)
 
-#define HB_REFERENCE_COUNT_HAS_REFERENCE(RC) (HB_REFERENCE_COUNT_GET_VALUE (RC) > 0)
-
 
 
 /* Debug */
@@ -131,4 +129,4 @@ _hb_trace_object (const void *obj,
 
 HB_END_DECLS
 
-#endif /* HB_OBJECT_PRIVATE_H */
+#endif /* HB_OBJECT_PRIVATE_HH */
index 241c5a0..490ea3a 100644 (file)
@@ -27,7 +27,7 @@
 #ifndef HB_OPEN_TYPE_PRIVATE_HH
 #define HB_OPEN_TYPE_PRIVATE_HH
 
-#include "hb-private.h"
+#include "hb-private.hh"
 
 #include "hb-blob.h"
 
index 4172a7c..242b33a 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "hb-ot-layout-common-private.hh"
 
-#include "hb-font-private.h"
+#include "hb-font-private.hh"
 
 HB_BEGIN_DECLS
 
index b0088fb..a802c63 100644 (file)
 #ifndef HB_OT_LAYOUT_PRIVATE_HH
 #define HB_OT_LAYOUT_PRIVATE_HH
 
-#include "hb-private.h"
+#include "hb-private.hh"
 
 #include "hb-ot-layout.h"
 #include "hb-ot-head-private.hh"
 
-#include "hb-font-private.h"
+#include "hb-font-private.hh"
 #include "hb-buffer-private.hh"
 
 HB_BEGIN_DECLS
similarity index 99%
rename from src/hb-ot-shape-complex-arabic-table.h
rename to src/hb-ot-shape-complex-arabic-table.hh
index 523fc84..27c6696 100644 (file)
  * Google Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_OT_SHAPE_COMPLEX_ARABIC_TABLE_H
-#define HB_OT_SHAPE_COMPLEX_ARABIC_TABLE_H
+#ifndef HB_OT_SHAPE_COMPLEX_ARABIC_TABLE_HH
+#define HB_OT_SHAPE_COMPLEX_ARABIC_TABLE_HH
 
-#include "hb-private.h"
+#include "hb-private.hh"
 
 HB_BEGIN_DECLS
 
@@ -671,4 +671,4 @@ static const uint8_t joining_table[] =
 
 HB_END_DECLS
 
-#endif /* HB_OT_SHAPE_COMPLEX_ARABIC_TABLE_H */
+#endif /* HB_OT_SHAPE_COMPLEX_ARABIC_TABLE_HH */
index cc08fbb..3e26568 100644 (file)
@@ -55,7 +55,7 @@ enum {
  * Joining types:
  */
 
-#include "hb-ot-shape-complex-arabic-table.h"
+#include "hb-ot-shape-complex-arabic-table.hh"
 
 static unsigned int get_joining_type (hb_codepoint_t u, hb_unicode_general_category_t gen_cat)
 {
index 8147945..8225b46 100644 (file)
@@ -27,7 +27,7 @@
 #ifndef HB_OT_SHAPE_COMPLEX_PRIVATE_HH
 #define HB_OT_SHAPE_COMPLEX_PRIVATE_HH
 
-#include "hb-private.h"
+#include "hb-private.hh"
 
 #include "hb-ot-shape-private.hh"
 
index 1a5c670..f334cda 100644 (file)
@@ -27,7 +27,7 @@
 #ifndef HB_OT_SHAPE_PRIVATE_HH
 #define HB_OT_SHAPE_PRIVATE_HH
 
-#include "hb-private.h"
+#include "hb-private.hh"
 
 #include "hb-ot-shape.h"
 
similarity index 99%
rename from src/hb-ot-tag.c
rename to src/hb-ot-tag.cc
index f7e8c95..7db1885 100644 (file)
@@ -24,7 +24,7 @@
  * Red Hat Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.h"
+#include "hb-private.hh"
 #include "hb-ot.h"
 
 #include <string.h>
@@ -619,9 +619,9 @@ hb_ot_tag_from_language (hb_language_t language)
   }
 
   /* find a language matching in the first component */
-  lang_tag = bsearch (lang_str, ot_languages,
-                     ARRAY_LENGTH (ot_languages), sizeof (LangTag),
-                     (hb_compare_func_t) lang_compare_first_component);
+  lang_tag = (LangTag *) bsearch (lang_str, ot_languages,
+                                 ARRAY_LENGTH (ot_languages), sizeof (LangTag),
+                                 (hb_compare_func_t) lang_compare_first_component);
 
   /* we now need to find the best language matching */
   if (lang_tag)
similarity index 98%
rename from src/hb-private.h
rename to src/hb-private.hh
index ae10b5d..d08a4d0 100644 (file)
@@ -24,8 +24,8 @@
  * Red Hat Author(s): Behdad Esfahbod
  */
 
-#ifndef HB_PRIVATE_H
-#define HB_PRIVATE_H
+#ifndef HB_PRIVATE_HH
+#define HB_PRIVATE_HH
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -293,9 +293,9 @@ _hb_trace (const char *what,
 }
 
 
-#include "hb-object-private.h"
+#include "hb-object-private.hh"
 
 
 HB_END_DECLS
 
-#endif /* HB_PRIVATE_H */
+#endif /* HB_PRIVATE_HH */
index 9d5d418..66d951b 100644 (file)
@@ -24,7 +24,7 @@
  * Red Hat Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.h"
+#include "hb-private.hh"
 
 #include "hb-shape.h"
 
index 67a60f5..af15c04 100644 (file)
@@ -31,7 +31,7 @@
 #ifndef HB_UNICODE_PRIVATE_HH
 #define HB_UNICODE_PRIVATE_HH
 
-#include "hb-private.h"
+#include "hb-private.hh"
 
 #include "hb-unicode.h"
 
index 9295be7..282a9b6 100644 (file)
@@ -28,7 +28,7 @@
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "hb-private.h"
+#include "hb-private.hh"
 
 #include "hb-unicode-private.hh"
 
index 60097b9..ac55908 100644 (file)
@@ -42,6 +42,9 @@
 #include <cairo-ft.h>
 #include <hb-ft.h>
 
+HB_BEGIN_DECLS
+
+
 /* Controlled by cmd-line options */
 static int margin_t = 10;
 static int margin_b = 10;
@@ -533,3 +536,6 @@ main (int argc, char **argv)
 
   return 0;
 }
+
+
+HB_END_DECLS