Rename a few files to be C++ sources
authorBehdad Esfahbod <behdad@behdad.org>
Wed, 12 May 2010 22:23:21 +0000 (18:23 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Wed, 12 May 2010 22:23:21 +0000 (18:23 -0400)
In anticipation for buffer revamp coming.

15 files changed:
src/Makefile.am
src/hb-buffer-private.hh [moved from src/hb-buffer-private.h with 98% similarity]
src/hb-buffer.cc [moved from src/hb-buffer.c with 95% similarity]
src/hb-common.h
src/hb-font-private.hh [moved from src/hb-font-private.h with 98% similarity]
src/hb-font.cc
src/hb-ft.cc [moved from src/hb-ft.c with 97% similarity]
src/hb-ot-layout-common-private.hh
src/hb-ot-layout-gdef-private.hh
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-private.hh [moved from src/hb-ot-layout-private.h with 98% similarity]
src/hb-ot-layout.cc
src/hb-ot-shape-private.hh [moved from src/hb-ot-shape-private.h with 100% similarity]
src/hb-ot-shape.cc [moved from src/hb-ot-shape.c with 98% similarity]
src/hb-shape.cc [moved from src/hb-shape.c with 98% similarity]

index 7b10fe2..9c534a6 100644 (file)
@@ -12,16 +12,16 @@ HBLIBS =
 HBSOURCES =  \
        hb-blob.c \
        hb-blob-private.h \
-       hb-buffer.c \
-       hb-buffer-private.h \
+       hb-buffer.cc \
+       hb-buffer-private.hh \
        hb-font.cc \
-       hb-font-private.h \
+       hb-font-private.hh \
        hb-object-private.h \
        hb-open-file-private.hh \
        hb-open-type-private.hh \
        hb-language.c \
        hb-private.h \
-       hb-shape.c \
+       hb-shape.cc \
        hb-unicode.c \
        hb-unicode-private.h \
        $(NULL)
@@ -43,9 +43,9 @@ HBSOURCES += \
        hb-ot-layout-gpos-private.hh \
        hb-ot-layout-gsubgpos-private.hh \
        hb-ot-layout-gsub-private.hh \
-       hb-ot-layout-private.h \
-       hb-ot-shape.c \
-       hb-ot-shape-private.h \
+       hb-ot-layout-private.hh \
+       hb-ot-shape.cc \
+       hb-ot-shape-private.hh \
        hb-ot-tag.c \
        $(NULL)
 HBHEADERS += \
@@ -80,7 +80,7 @@ if HAVE_FREETYPE
 HBCFLAGS += $(FREETYPE_CFLAGS)
 HBLIBS   += $(FREETYPE_LIBS)
 HBSOURCES += \
-       hb-ft.c \
+       hb-ft.cc \
        $(NULL)
 HBHEADERS += \
        hb-ft.h \
similarity index 98%
rename from src/hb-buffer-private.h
rename to src/hb-buffer-private.hh
index bc562ba..1a3ac70 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1998-2004  David Turner and Werner Lemberg
- * Copyright (C) 2004,2007,2009  Red Hat, Inc.
+ * Copyright (C) 2004,2007,2009,2010  Red Hat, Inc.
  *
  * This is part of HarfBuzz, a text shaping library.
  *
similarity index 95%
rename from src/hb-buffer.c
rename to src/hb-buffer.cc
index adec7c1..9588d5e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 1998-2004  David Turner and Werner Lemberg
- * Copyright (C) 2004,2007  Red Hat, Inc.
+ * Copyright (C) 2004,2007,2009,2010  Red Hat, Inc.
  *
  * This is part of HarfBuzz, a text shaping library.
  *
@@ -25,7 +25,7 @@
  * Red Hat Author(s): Owen Taylor, Behdad Esfahbod
  */
 
-#include "hb-buffer-private.h"
+#include "hb-buffer-private.hh"
 
 #include <string.h>
 
@@ -66,7 +66,7 @@ hb_buffer_ensure_separate (hb_buffer_t *buffer, unsigned int size)
   {
     assert (buffer->have_output);
     if (!buffer->positions)
-      buffer->positions = calloc (buffer->allocated, sizeof (buffer->positions[0]));
+      buffer->positions = (hb_internal_glyph_position_t *) calloc (buffer->allocated, sizeof (buffer->positions[0]));
 
     buffer->out_string = (hb_internal_glyph_info_t *) buffer->positions;
     memcpy (buffer->out_string, buffer->in_string, buffer->out_length * sizeof (buffer->out_string[0]));
@@ -200,16 +200,16 @@ hb_buffer_ensure (hb_buffer_t *buffer, unsigned int size)
       new_allocated += (new_allocated >> 1) + 8;
 
     if (buffer->positions)
-      buffer->positions = realloc (buffer->positions, new_allocated * sizeof (buffer->positions[0]));
+      buffer->positions = (hb_internal_glyph_position_t *) realloc (buffer->positions, new_allocated * sizeof (buffer->positions[0]));
 
     if (buffer->out_string != buffer->in_string)
     {
-      buffer->in_string = realloc (buffer->in_string, new_allocated * sizeof (buffer->in_string[0]));
+      buffer->in_string = (hb_internal_glyph_info_t *) realloc (buffer->in_string, new_allocated * sizeof (buffer->in_string[0]));
       buffer->out_string = (hb_internal_glyph_info_t *) buffer->positions;
     }
     else
     {
-      buffer->in_string = realloc (buffer->in_string, new_allocated * sizeof (buffer->in_string[0]));
+      buffer->in_string = (hb_internal_glyph_info_t *) realloc (buffer->in_string, new_allocated * sizeof (buffer->in_string[0]));
       buffer->out_string = buffer->in_string;
     }
 
@@ -260,7 +260,7 @@ hb_buffer_clear_positions (hb_buffer_t *buffer)
 
   if (unlikely (!buffer->positions))
   {
-    buffer->positions = calloc (buffer->allocated, sizeof (buffer->positions[0]));
+    buffer->positions = (hb_internal_glyph_position_t *) calloc (buffer->allocated, sizeof (buffer->positions[0]));
     return;
   }
 
index a2bc114..cc673ad 100644 (file)
@@ -83,6 +83,7 @@ typedef enum _hb_direction_t {
 #define HB_DIRECTION_IS_VERTICAL(dir)  ((dir) == HB_DIRECTION_TTB || (dir) == HB_DIRECTION_BTT)
 #define HB_DIRECTION_IS_FORWARD(dir)   ((dir) == HB_DIRECTION_LTR || (dir) == HB_DIRECTION_TTB)
 #define HB_DIRECTION_IS_BACKWARD(dir)  ((dir) == HB_DIRECTION_RTL || (dir) == HB_DIRECTION_BTT)
+#define HB_DIRECTION_REVERSE(dir)      ((hb_direction_t) (((unsigned int) (dir)) ^ 1))
 
 
 #endif /* HB_COMMON_H */
similarity index 98%
rename from src/hb-font-private.h
rename to src/hb-font-private.hh
index 2b024cc..ec07931 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "hb-font.h"
 
-#include "hb-ot-layout-private.h"
+#include "hb-ot-layout-private.hh"
 
 HB_BEGIN_DECLS
 
index 20aeb16..46b63a4 100644 (file)
 
 #include "hb-private.h"
 
-#include "hb-font-private.h"
+#include "hb-font-private.hh"
 #include "hb-blob-private.h"
 #include "hb-open-file-private.hh"
 
-#include "hb-ot-layout-private.h"
+#include "hb-ot-layout-private.hh"
 
 #include <string.h>
 
similarity index 97%
rename from src/hb-ft.c
rename to src/hb-ft.cc
index e6f3e84..5b911bc 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "hb-ft.h"
 
-#include "hb-font-private.h"
+#include "hb-font-private.hh"
 
 #include FT_TRUETYPE_TABLES_H
 
@@ -160,7 +160,7 @@ _get_table  (hb_tag_t tag, void *user_data)
     return hb_blob_create_empty ();
 
   /* TODO Use FT_Memory? */
-  buffer = malloc (length);
+  buffer = (FT_Byte *) malloc (length);
   if (buffer == NULL)
     return NULL;
 
@@ -200,7 +200,7 @@ hb_ft_face_create (FT_Face           ft_face,
 static void
 hb_ft_face_finalize (FT_Face ft_face)
 {
-  hb_face_destroy (ft_face->generic.data);
+  hb_face_destroy ((hb_face_t *) ft_face->generic.data);
 }
 
 hb_face_t *
@@ -215,7 +215,7 @@ hb_ft_face_create_cached (FT_Face ft_face)
     ft_face->generic.finalizer = (FT_Generic_Finalizer) hb_ft_face_finalize;
   }
 
-  return hb_face_reference (ft_face->generic.data);
+  return hb_face_reference ((hb_face_t *) ft_face->generic.data);
 }
 
 
index 75cbc64..8c04150 100644 (file)
@@ -27,7 +27,7 @@
 #ifndef HB_OT_LAYOUT_COMMON_PRIVATE_HH
 #define HB_OT_LAYOUT_COMMON_PRIVATE_HH
 
-#include "hb-ot-layout-private.h"
+#include "hb-ot-layout-private.hh"
 
 #include "hb-open-type-private.hh"
 
index 517f9ef..d43a4c2 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "hb-ot-layout-common-private.hh"
 
-#include "hb-font-private.h"
+#include "hb-font-private.hh"
 
 
 /*
index 09c817d..066abbd 100644 (file)
@@ -27,7 +27,7 @@
 #ifndef HB_OT_LAYOUT_GSUBGPOS_PRIVATE_HH
 #define HB_OT_LAYOUT_GSUBGPOS_PRIVATE_HH
 
-#include "hb-buffer-private.h"
+#include "hb-buffer-private.hh"
 #include "hb-ot-layout-gdef-private.hh"
 
 
similarity index 98%
rename from src/hb-ot-layout-private.h
rename to src/hb-ot-layout-private.hh
index a9d4c57..e18222b 100644 (file)
@@ -32,7 +32,7 @@
 #include "hb-ot-layout.h"
 
 #include "hb-font.h"
-#include "hb-buffer-private.h"
+#include "hb-buffer-private.hh"
 
 
 HB_BEGIN_DECLS
index 5908cdd..63186a3 100644 (file)
@@ -28,7 +28,7 @@
 
 #define HB_OT_LAYOUT_CC
 
-#include "hb-ot-layout-private.h"
+#include "hb-ot-layout-private.hh"
 
 #include "hb-ot-layout-gdef-private.hh"
 #include "hb-ot-layout-gsub-private.hh"
similarity index 98%
rename from src/hb-ot-shape.c
rename to src/hb-ot-shape.cc
index 7ff8166..61f67cd 100644 (file)
@@ -24,9 +24,9 @@
  * Red Hat Author(s): Behdad Esfahbod
  */
 
-#include "hb-ot-shape-private.h"
+#include "hb-ot-shape-private.hh"
 
-#include "hb-buffer-private.h"
+#include "hb-buffer-private.hh"
 
 #include "hb-ot-layout.h"
 
similarity index 98%
rename from src/hb-shape.c
rename to src/hb-shape.cc
index 6818891..ef10375 100644 (file)
@@ -28,9 +28,9 @@
 
 #include "hb-shape.h"
 
-#include "hb-buffer-private.h"
+#include "hb-buffer-private.hh"
 
-#include "hb-ot-shape-private.h"
+#include "hb-ot-shape-private.hh"
 
 
 /* Prepare */
@@ -64,7 +64,7 @@ hb_ensure_native_direction (hb_buffer_t *buffer)
       original_direction != _hb_script_get_horizontal_direction (buffer->script))
   {
     hb_buffer_reverse_clusters (buffer);
-    buffer->direction ^=  1;
+    buffer->direction = HB_DIRECTION_REVERSE (buffer->direction);
   }
 
   return original_direction;