提交 22da7fd9 编写于 作者: B Behdad Esfahbod

Rename a few files to be C++ sources

In anticipation for buffer revamp coming.
上级 c3df649f
......@@ -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 \
......
/*
* 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.
*
......
/*
* 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;
}
......
......@@ -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 */
......@@ -31,7 +31,7 @@
#include "hb-font.h"
#include "hb-ot-layout-private.h"
#include "hb-ot-layout-private.hh"
HB_BEGIN_DECLS
......
......@@ -26,11 +26,11 @@
#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>
......
......@@ -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);
}
......
......@@ -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"
......
......@@ -29,7 +29,7 @@
#include "hb-ot-layout-common-private.hh"
#include "hb-font-private.h"
#include "hb-font-private.hh"
/*
......
......@@ -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"
......
......@@ -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
......
......@@ -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"
......
......@@ -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"
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册