summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2010-04-21 00:14:12 -0400
committerBehdad Esfahbod <behdad@behdad.org>2010-04-21 00:14:12 -0400
commit39620ce42fa212d4e76f49ac257d2b2cf6da20fa (patch)
treed7aaad4094f089576d6b71c43b25887f69ced032
parentb11755c2f68d0dfe1dac7a7bce29defa25255bc9 (diff)
downloadpango-39620ce42fa212d4e76f49ac257d2b2cf6da20fa.tar.gz
[HB] Simplify Tag struct
-rw-r--r--pango/opentype/hb-open-file-private.hh3
-rw-r--r--pango/opentype/hb-open-type-private.hh6
-rw-r--r--pango/opentype/hb-ot-layout-common-private.hh3
3 files changed, 5 insertions, 7 deletions
diff --git a/pango/opentype/hb-open-file-private.hh b/pango/opentype/hb-open-file-private.hh
index 0947747d..080975b7 100644
--- a/pango/opentype/hb-open-file-private.hh
+++ b/pango/opentype/hb-open-file-private.hh
@@ -84,7 +84,8 @@ typedef struct OffsetTable
}
inline bool find_table_index (hb_tag_t tag, unsigned int *table_index) const
{
- const Tag t = tag;
+ Tag t;
+ t.set (tag);
// TODO bsearch
unsigned int count = numTables;
for (unsigned int i = 0; i < count; i++)
diff --git a/pango/opentype/hb-open-type-private.hh b/pango/opentype/hb-open-type-private.hh
index 590b0d98..4dbff0dc 100644
--- a/pango/opentype/hb-open-type-private.hh
+++ b/pango/opentype/hb-open-type-private.hh
@@ -359,7 +359,7 @@ struct Sanitizer
struct NAME \
{ \
static inline unsigned int get_size () { return BYTES; } \
- inline NAME& set (TYPE i) { BIG_ENDIAN##_put_unaligned(v, i); return *this; } \
+ inline void set (TYPE i) { BIG_ENDIAN##_put_unaligned(v, i); } \
inline operator TYPE(void) const { return BIG_ENDIAN##_get_unaligned (v); } \
inline bool operator == (const NAME &o) const { return BIG_ENDIAN##_cmp_unaligned (v, o.v); } \
inline bool sanitize (SANITIZE_ARG_DEF) { \
@@ -383,10 +383,6 @@ DEFINE_INT_TYPE (LONG, , 32); /* 32-bit signed integer. */
* system, feature, or baseline */
struct Tag : ULONG
{
- inline Tag (const Tag &o) { *(ULONG*)this = (ULONG&) o; }
- 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" */
inline operator const char* (void) const { return CONST_CHARP(this); }
inline operator char* (void) { return CHARP(this); }
diff --git a/pango/opentype/hb-ot-layout-common-private.hh b/pango/opentype/hb-ot-layout-common-private.hh
index 2cb59d64..1f6cf4a2 100644
--- a/pango/opentype/hb-ot-layout-common-private.hh
+++ b/pango/opentype/hb-ot-layout-common-private.hh
@@ -84,7 +84,8 @@ struct RecordArrayOf : ArrayOf<Record<Type> > {
}
inline bool find_index (hb_tag_t tag, unsigned int *index) const
{
- const Tag t = tag;
+ Tag t;
+ t.set (tag);
// TODO bsearch
const Record<Type> *a = this->const_array();
unsigned int count = this->len;