[HarfBuzz] harfbuzz-ng: Branch 'master' - 2 commits
Behdad Esfahbod
behdad at kemper.freedesktop.org
Fri Nov 20 12:35:22 PST 2009
src/hb-open-type-private.hh | 8 ++++----
src/hb-ot-layout-common-private.hh | 2 +-
src/hb-ot-layout-gdef-private.hh | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
New commits:
commit 807b8aa486753474e05e09f4fcca8ac94021b97c
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Thu Nov 19 20:28:03 2009 -0500
Another C++ strictness fix
Pango Bug 602408 - Invalid C++ code breaks compile with Sun C++ Compiler
(Error: A union member cannot have a user-defined assignment operator)
According to the bug:
C++ Programming Language by Bjarne Stroustrup: Chapter 10.4.12 forbids
explicitly using of union members with constructors, destructors or assignment
operations.
So we use a set() method instead of the assignment operator. Ugly, but hey,
that's life.
diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh
index 63b9fe7..32f6787 100644
--- a/src/hb-open-type-private.hh
+++ b/src/hb-open-type-private.hh
@@ -262,7 +262,7 @@ _hb_sanitize_edit (SANITIZE_ARG_DEF,
#define NEUTER(Var, Val) \
(SANITIZE_OBJ (Var) && \
_hb_sanitize_edit (SANITIZE_ARG, CONST_CHARP(&(Var)), sizeof (Var)) && \
- ((Var) = (Val), true))
+ ((Var).set (Val), true))
/* Template to sanitize an object. */
@@ -349,7 +349,7 @@ struct Sanitizer
#define _DEFINE_INT_TYPE1_UNALIGNED(NAME, TYPE, BIG_ENDIAN, BYTES) \
struct NAME \
{ \
- inline NAME& operator = (TYPE i) { (TYPE&) v = BIG_ENDIAN (i); return *this; } \
+ inline NAME& set (TYPE i) { (TYPE&) v = BIG_ENDIAN (i); return *this; } \
inline operator TYPE(void) const { return BIG_ENDIAN ((TYPE&) v); } \
inline bool operator== (NAME o) const { return (TYPE&) v == (TYPE&) o.v; } \
inline bool sanitize (SANITIZE_ARG_DEF) { \
@@ -363,7 +363,7 @@ struct Sanitizer
#define DEFINE_INT_TYPE1(NAME, TYPE, BIG_ENDIAN, BYTES) \
struct NAME \
{ \
- inline NAME& operator = (TYPE i) { BIG_ENDIAN##_put_unaligned(v, i); return *this; } \
+ inline NAME& set (TYPE i) { BIG_ENDIAN##_put_unaligned(v, i); return *this; } \
inline operator TYPE(void) const { return BIG_ENDIAN##_get_unaligned (v); } \
inline bool operator== (NAME o) const { return BIG_ENDIAN##_cmp_unaligned (v, o.v); } \
inline bool sanitize (SANITIZE_ARG_DEF) { \
@@ -388,7 +388,7 @@ DEFINE_INT_TYPE (LONG, , 32); /* 32-bit signed integer. */
struct Tag : ULONG
{
inline Tag (const Tag &o) { *(ULONG*)this = (ULONG&) o; }
- inline Tag (uint32_t i) { *(ULONG*)this = i; }
+ inline Tag (uint32_t i) { (*(ULONG*)this).set (i); }
inline Tag (const char *c) { *(ULONG*)this = *(ULONG*)c; }
inline bool operator== (const char *c) const { return *(ULONG*)this == *(ULONG*)c; }
/* What the char* converters return is NOT nul-terminated. Print using "%.4s" */
diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh
index fc69c89..9a0abe5 100644
--- a/src/hb-ot-layout-common-private.hh
+++ b/src/hb-ot-layout-common-private.hh
@@ -328,7 +328,7 @@ struct CoverageFormat1
if (HB_UNLIKELY (glyph_id > 0xFFFF))
return NOT_COVERED;
GlyphID gid;
- gid = glyph_id;
+ gid.set (glyph_id);
// TODO: bsearch
unsigned int num_glyphs = glyphArray.len;
for (unsigned int i = 0; i < num_glyphs; i++)
commit 8b9b866d3e495c186f0530fcf4e00ffcdc170d3f
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Thu Nov 19 20:27:57 2009 -0500
Fix warning
diff --git a/src/hb-ot-layout-gdef-private.hh b/src/hb-ot-layout-gdef-private.hh
index 9c829e2..a047cb2 100644
--- a/src/hb-ot-layout-gdef-private.hh
+++ b/src/hb-ot-layout-gdef-private.hh
@@ -91,7 +91,7 @@ struct CaretValueFormat1
friend struct CaretValue;
private:
- inline int get_caret_value (hb_ot_layout_context_t *context, hb_codepoint_t glyph_id) const
+ inline int get_caret_value (hb_ot_layout_context_t *context, hb_codepoint_t glyph_id HB_GNUC_UNUSED) const
{
/* TODO vertical */
return context->font->x_scale * coordinate / 0x10000;
More information about the HarfBuzz
mailing list