src/hb-aat-layout-ankr-table.hh | 2 +- src/hb-aat-layout-bsln-table.hh | 2 +- src/hb-aat-layout-common.hh | 4 ++-- src/hb-aat-layout-feat-table.hh | 2 +- src/hb-aat-layout-just-table.hh | 2 +- src/hb-aat-layout-kerx-table.hh | 10 +++++----- src/hb-aat-layout-lcar-table.hh | 2 +- src/hb-aat-layout-morx-table.hh | 14 +++++++------- src/hb-aat-layout-trak-table.hh | 2 +- src/hb-aat-ltag-table.hh | 2 +- src/hb-dsalgs.hh | 16 ++++++++-------- src/hb-map.hh | 2 +- src/hb-ot-cmap-table.hh | 2 +- src/hb-ot-color-cbdt-table.hh | 4 ++-- src/hb-ot-color-colr-table.hh | 2 +- src/hb-ot-color-cpal-table.hh | 2 +- src/hb-ot-color-sbix-table.hh | 2 +- src/hb-ot-color-svg-table.hh | 2 +- src/hb-ot-glyf-table.hh | 4 ++-- src/hb-ot-hdmx-table.hh | 2 +- src/hb-ot-head-table.hh | 2 +- src/hb-ot-hhea-table.hh | 4 ++-- src/hb-ot-hmtx-table.hh | 14 +++++++------- src/hb-ot-kern-table.hh | 14 +++++++------- src/hb-ot-layout-base-table.hh | 2 +- src/hb-ot-layout-gdef-table.hh | 2 +- src/hb-ot-layout-gpos-table.hh | 2 +- src/hb-ot-layout-gsub-table.hh | 2 +- src/hb-ot-layout-jstf-table.hh | 2 +- src/hb-ot-layout.cc | 4 ++-- src/hb-ot-math-table.hh | 2 +- src/hb-ot-maxp-table.hh | 2 +- src/hb-ot-name-table.hh | 2 +- src/hb-ot-os2-table.hh | 2 +- src/hb-ot-post-table.hh | 2 +- src/hb-ot-stat-table.hh | 2 +- src/hb-ot-var-avar-table.hh | 2 +- src/hb-ot-var-fvar-table.hh | 2 +- src/hb-ot-var-hvar-table.hh | 8 ++++---- src/hb-ot-var-mvar-table.hh | 2 +- src/hb-ot-vorg-table.hh | 2 +- src/hb-set-digest.hh | 14 +++++++------- 42 files changed, 85 insertions(+), 85 deletions(-)
New commits: commit 5c4fead734b082e0168e6811bec4bcaa19acc36a Author: Behdad Esfahbod <[email protected]> Date: Thu Nov 29 15:04:34 2018 -0500 Convert "static const hb_tag_t" constants to enum diff --git a/src/hb-aat-layout-ankr-table.hh b/src/hb-aat-layout-ankr-table.hh index b793245a..763bbedd 100644 --- a/src/hb-aat-layout-ankr-table.hh +++ b/src/hb-aat-layout-ankr-table.hh @@ -58,7 +58,7 @@ typedef LArrayOf<Anchor> GlyphAnchors; struct ankr { - static const hb_tag_t tableTag = HB_AAT_TAG_ankr; + enum { tableTag = HB_AAT_TAG_ankr }; inline const Anchor &get_anchor (hb_codepoint_t glyph_id, unsigned int i, diff --git a/src/hb-aat-layout-bsln-table.hh b/src/hb-aat-layout-bsln-table.hh index b8640862..d2ea71d1 100644 --- a/src/hb-aat-layout-bsln-table.hh +++ b/src/hb-aat-layout-bsln-table.hh @@ -116,7 +116,7 @@ struct BaselineTableFormat3Part struct bsln { - static const hb_tag_t tableTag = HB_AAT_TAG_bsln; + enum { tableTag = HB_AAT_TAG_bsln }; inline bool sanitize (hb_sanitize_context_t *c) const { diff --git a/src/hb-aat-layout-feat-table.hh b/src/hb-aat-layout-feat-table.hh index 4e63ec8e..1565d432 100644 --- a/src/hb-aat-layout-feat-table.hh +++ b/src/hb-aat-layout-feat-table.hh @@ -155,7 +155,7 @@ struct FeatureName struct feat { - static const hb_tag_t tableTag = HB_AAT_TAG_feat; + enum { tableTag = HB_AAT_TAG_feat }; inline bool has_data (void) const { return version.to_int (); } diff --git a/src/hb-aat-layout-just-table.hh b/src/hb-aat-layout-just-table.hh index 92ca6603..295205fd 100644 --- a/src/hb-aat-layout-just-table.hh +++ b/src/hb-aat-layout-just-table.hh @@ -382,7 +382,7 @@ struct JustificationHeader struct just { - static const hb_tag_t tableTag = HB_AAT_TAG_just; + enum { tableTag = HB_AAT_TAG_just }; inline bool sanitize (hb_sanitize_context_t *c) const { diff --git a/src/hb-aat-layout-kerx-table.hh b/src/hb-aat-layout-kerx-table.hh index 9a2351a1..b25feea2 100644 --- a/src/hb-aat-layout-kerx-table.hh +++ b/src/hb-aat-layout-kerx-table.hh @@ -982,7 +982,7 @@ struct kerx : KerxTable<kerx> { friend struct KerxTable<kerx>; - static const hb_tag_t tableTag = HB_AAT_TAG_kerx; + enum { tableTag = HB_AAT_TAG_kerx }; enum { minVersion = 2u }; typedef KerxSubTableHeader SubTableHeader; diff --git a/src/hb-aat-layout-lcar-table.hh b/src/hb-aat-layout-lcar-table.hh index 40d34f59..9bfb6849 100644 --- a/src/hb-aat-layout-lcar-table.hh +++ b/src/hb-aat-layout-lcar-table.hh @@ -40,7 +40,7 @@ typedef ArrayOf<HBINT16> LigCaretClassEntry; struct lcar { - static const hb_tag_t tableTag = HB_AAT_TAG_lcar; + enum { tableTag = HB_AAT_TAG_lcar }; inline unsigned int get_lig_carets (hb_font_t *font, hb_direction_t direction, diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh index e8a0cdfc..9b37a713 100644 --- a/src/hb-aat-layout-morx-table.hh +++ b/src/hb-aat-layout-morx-table.hh @@ -1096,7 +1096,7 @@ struct Chain template <typename Types> struct mortmorx { - static const hb_tag_t tableTag = HB_AAT_TAG_morx; + enum { tableTag = HB_AAT_TAG_morx }; inline bool has_data (void) const { return version != 0; } @@ -1158,11 +1158,11 @@ struct mortmorx struct morx : mortmorx<ExtendedTypes> { - static const hb_tag_t tableTag = HB_AAT_TAG_morx; + enum { tableTag = HB_AAT_TAG_morx }; }; struct mort : mortmorx<ObsoleteTypes> { - static const hb_tag_t tableTag = HB_AAT_TAG_mort; + enum { tableTag = HB_AAT_TAG_mort }; }; diff --git a/src/hb-aat-layout-trak-table.hh b/src/hb-aat-layout-trak-table.hh index 5474d1d1..1658e0fe 100644 --- a/src/hb-aat-layout-trak-table.hh +++ b/src/hb-aat-layout-trak-table.hh @@ -166,7 +166,7 @@ struct TrackData struct trak { - static const hb_tag_t tableTag = HB_AAT_TAG_trak; + enum { tableTag = HB_AAT_TAG_trak }; inline bool has_data (void) const { return version.to_int (); } diff --git a/src/hb-aat-ltag-table.hh b/src/hb-aat-ltag-table.hh index 8a42b351..c7c4b461 100644 --- a/src/hb-aat-ltag-table.hh +++ b/src/hb-aat-ltag-table.hh @@ -60,7 +60,7 @@ struct FTStringRange struct ltag { - static const hb_tag_t tableTag = HB_AAT_TAG_ltag; + enum { tableTag = HB_AAT_TAG_ltag }; inline hb_language_t get_language (unsigned int i) const { diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh index a2e611c9..7f32fb3b 100644 --- a/src/hb-ot-cmap-table.hh +++ b/src/hb-ot-cmap-table.hh @@ -843,7 +843,7 @@ struct EncodingRecord struct cmap { - static const hb_tag_t tableTag = HB_OT_TAG_cmap; + enum { tableTag = HB_OT_TAG_cmap }; struct subset_plan { diff --git a/src/hb-ot-color-cbdt-table.hh b/src/hb-ot-color-cbdt-table.hh index 47774fd8..2b49f2c6 100644 --- a/src/hb-ot-color-cbdt-table.hh +++ b/src/hb-ot-color-cbdt-table.hh @@ -332,7 +332,7 @@ struct CBLC { friend struct CBDT; - static const hb_tag_t tableTag = HB_OT_TAG_CBLC; + enum { tableTag = HB_OT_TAG_CBLC }; inline bool sanitize (hb_sanitize_context_t *c) const { @@ -378,7 +378,7 @@ struct CBLC struct CBDT { - static const hb_tag_t tableTag = HB_OT_TAG_CBDT; + enum { tableTag = HB_OT_TAG_CBDT }; struct accelerator_t { diff --git a/src/hb-ot-color-colr-table.hh b/src/hb-ot-color-colr-table.hh index 84c34332..fd73255a 100644 --- a/src/hb-ot-color-colr-table.hh +++ b/src/hb-ot-color-colr-table.hh @@ -87,7 +87,7 @@ struct BaseGlyphRecord struct COLR { - static const hb_tag_t tableTag = HB_OT_TAG_COLR; + enum { tableTag = HB_OT_TAG_COLR }; inline bool has_data (void) const { return numBaseGlyphs; } diff --git a/src/hb-ot-color-cpal-table.hh b/src/hb-ot-color-cpal-table.hh index 332f0dd7..095f96f2 100644 --- a/src/hb-ot-color-cpal-table.hh +++ b/src/hb-ot-color-cpal-table.hh @@ -110,7 +110,7 @@ typedef HBUINT32 BGRAColor; struct CPAL { - static const hb_tag_t tableTag = HB_OT_TAG_CPAL; + enum { tableTag = HB_OT_TAG_CPAL }; inline bool has_data (void) const { return numPalettes; } diff --git a/src/hb-ot-color-sbix-table.hh b/src/hb-ot-color-sbix-table.hh index 08dee2a0..2d24fba2 100644 --- a/src/hb-ot-color-sbix-table.hh +++ b/src/hb-ot-color-sbix-table.hh @@ -130,7 +130,7 @@ struct SBIXStrike struct sbix { - static const hb_tag_t tableTag = HB_OT_TAG_sbix; + enum { tableTag = HB_OT_TAG_sbix }; inline bool has_data (void) const { return version; } diff --git a/src/hb-ot-color-svg-table.hh b/src/hb-ot-color-svg-table.hh index ad355103..0b8ec1a9 100644 --- a/src/hb-ot-color-svg-table.hh +++ b/src/hb-ot-color-svg-table.hh @@ -73,7 +73,7 @@ struct SVGDocumentIndexEntry struct SVG { - static const hb_tag_t tableTag = HB_OT_TAG_SVG; + enum { tableTag = HB_OT_TAG_SVG }; inline bool has_data (void) const { return svgDocEntries; } diff --git a/src/hb-ot-glyf-table.hh b/src/hb-ot-glyf-table.hh index c88f4338..23d16a79 100644 --- a/src/hb-ot-glyf-table.hh +++ b/src/hb-ot-glyf-table.hh @@ -45,7 +45,7 @@ struct loca { friend struct glyf; - static const hb_tag_t tableTag = HB_OT_TAG_loca; + enum { tableTag = HB_OT_TAG_loca }; inline bool sanitize (hb_sanitize_context_t *c HB_UNUSED) const { @@ -71,7 +71,7 @@ struct loca struct glyf { - static const hb_tag_t tableTag = HB_OT_TAG_glyf; + enum { tableTag = HB_OT_TAG_glyf }; inline bool sanitize (hb_sanitize_context_t *c HB_UNUSED) const { diff --git a/src/hb-ot-hdmx-table.hh b/src/hb-ot-hdmx-table.hh index 0fea24bc..6545f261 100644 --- a/src/hb-ot-hdmx-table.hh +++ b/src/hb-ot-hdmx-table.hh @@ -123,7 +123,7 @@ struct DeviceRecord struct hdmx { - static const hb_tag_t tableTag = HB_OT_TAG_hdmx; + enum { tableTag = HB_OT_TAG_hdmx }; inline unsigned int get_size (void) const { diff --git a/src/hb-ot-head-table.hh b/src/hb-ot-head-table.hh index 602e365c..931ccd40 100644 --- a/src/hb-ot-head-table.hh +++ b/src/hb-ot-head-table.hh @@ -45,7 +45,7 @@ struct head { friend struct OffsetTable; - static const hb_tag_t tableTag = HB_OT_TAG_head; + enum { tableTag = HB_OT_TAG_head }; inline unsigned int get_upem (void) const { diff --git a/src/hb-ot-hhea-table.hh b/src/hb-ot-hhea-table.hh index 3336cadd..0f47c63d 100644 --- a/src/hb-ot-hhea-table.hh +++ b/src/hb-ot-hhea-table.hh @@ -86,10 +86,10 @@ struct _hea }; struct hhea : _hea<hhea> { - static const hb_tag_t tableTag = HB_OT_TAG_hhea; + enum { tableTag = HB_OT_TAG_hhea }; }; struct vhea : _hea<vhea> { - static const hb_tag_t tableTag = HB_OT_TAG_vhea; + enum { tableTag = HB_OT_TAG_vhea }; }; diff --git a/src/hb-ot-hmtx-table.hh b/src/hb-ot-hmtx-table.hh index 091b6011..f22ed1d7 100644 --- a/src/hb-ot-hmtx-table.hh +++ b/src/hb-ot-hmtx-table.hh @@ -192,7 +192,7 @@ struct hmtxvmtx default_advance = default_advance_ ? default_advance_ : hb_face_get_upem (face); bool got_font_extents = false; - if (T::os2Tag) + if (T::os2Tag != HB_TAG_NONE) { #define USE_TYPO_METRICS (1u<<7) if (0 != (face->table.OS2->fsSelection & USE_TYPO_METRICS)) @@ -327,14 +327,14 @@ struct hmtxvmtx }; struct hmtx : hmtxvmtx<hmtx, hhea> { - static const hb_tag_t tableTag = HB_OT_TAG_hmtx; - static const hb_tag_t variationsTag = HB_OT_TAG_HVAR; - static const hb_tag_t os2Tag = HB_OT_TAG_OS2; + enum { tableTag = HB_OT_TAG_hmtx }; + enum { variationsTag = HB_OT_TAG_HVAR }; + enum { os2Tag = HB_OT_TAG_OS2 }; }; struct vmtx : hmtxvmtx<vmtx, vhea> { - static const hb_tag_t tableTag = HB_OT_TAG_vmtx; - static const hb_tag_t variationsTag = HB_OT_TAG_VVAR; - static const hb_tag_t os2Tag = HB_TAG_NONE; + enum { tableTag = HB_OT_TAG_vmtx }; + enum { variationsTag = HB_OT_TAG_VVAR }; + enum { os2Tag = HB_TAG_NONE }; }; struct hmtx_accelerator_t : hmtx::accelerator_t {}; diff --git a/src/hb-ot-kern-table.hh b/src/hb-ot-kern-table.hh index 956bf3f8..e1348b70 100644 --- a/src/hb-ot-kern-table.hh +++ b/src/hb-ot-kern-table.hh @@ -197,7 +197,7 @@ struct KernOT : AAT::KerxTable<KernOT> { friend struct AAT::KerxTable<KernOT>; - static const hb_tag_t tableTag = HB_OT_TAG_kern; + enum { tableTag = HB_OT_TAG_kern }; enum { minVersion = 0u }; typedef KernOTSubTableHeader SubTableHeader; @@ -252,7 +252,7 @@ struct KernAAT : AAT::KerxTable<KernAAT> { friend struct AAT::KerxTable<KernAAT>; - static const hb_tag_t tableTag = HB_OT_TAG_kern; + enum { tableTag = HB_OT_TAG_kern }; enum { minVersion = 0x00010000u }; typedef KernAATSubTableHeader SubTableHeader; @@ -269,7 +269,7 @@ struct KernAAT : AAT::KerxTable<KernAAT> struct kern { - static const hb_tag_t tableTag = HB_OT_TAG_kern; + enum { tableTag = HB_OT_TAG_kern }; inline bool has_data (void) const { return u.version32; } inline unsigned int get_type (void) const { return u.major; } diff --git a/src/hb-ot-layout-base-table.hh b/src/hb-ot-layout-base-table.hh index fb57e762..320f0034 100644 --- a/src/hb-ot-layout-base-table.hh +++ b/src/hb-ot-layout-base-table.hh @@ -465,7 +465,7 @@ struct Axis struct BASE { - static const hb_tag_t tableTag = HB_OT_TAG_BASE; + enum { tableTag = HB_OT_TAG_BASE }; inline const Axis &get_axis (hb_direction_t direction) const { return HB_DIRECTION_IS_VERTICAL (direction) ? this+vAxis : this+hAxis; } diff --git a/src/hb-ot-layout-gdef-table.hh b/src/hb-ot-layout-gdef-table.hh index a0ae27e7..f1052d8f 100644 --- a/src/hb-ot-layout-gdef-table.hh +++ b/src/hb-ot-layout-gdef-table.hh @@ -340,7 +340,7 @@ struct MarkGlyphSets struct GDEF { - static const hb_tag_t tableTag = HB_OT_TAG_GDEF; + enum { tableTag = HB_OT_TAG_GDEF }; enum GlyphClasses { UnclassifiedGlyph = 0, diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index 2589218d..32ed13c0 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh @@ -1628,7 +1628,7 @@ struct PosLookup : Lookup struct GPOS : GSUBGPOS { - static const hb_tag_t tableTag = HB_OT_TAG_GPOS; + enum { tableTag = HB_OT_TAG_GPOS }; inline const PosLookup& get_lookup (unsigned int i) const { return CastR<PosLookup> (GSUBGPOS::get_lookup (i)); } diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index 27bd440d..6acdcf2f 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -1475,7 +1475,7 @@ struct SubstLookup : Lookup struct GSUB : GSUBGPOS { - static const hb_tag_t tableTag = HB_OT_TAG_GSUB; + enum { tableTag = HB_OT_TAG_GSUB }; inline const SubstLookup& get_lookup (unsigned int i) const { return CastR<SubstLookup> (GSUBGPOS::get_lookup (i)); } diff --git a/src/hb-ot-layout-jstf-table.hh b/src/hb-ot-layout-jstf-table.hh index 2fb23cbc..d05f813f 100644 --- a/src/hb-ot-layout-jstf-table.hh +++ b/src/hb-ot-layout-jstf-table.hh @@ -195,7 +195,7 @@ struct JstfScript struct JSTF { - static const hb_tag_t tableTag = HB_OT_TAG_JSTF; + enum { tableTag = HB_OT_TAG_JSTF }; inline unsigned int get_script_count (void) const { return scriptList.len; } diff --git a/src/hb-ot-math-table.hh b/src/hb-ot-math-table.hh index 153a4179..e100991c 100644 --- a/src/hb-ot-math-table.hh +++ b/src/hb-ot-math-table.hh @@ -680,7 +680,7 @@ struct MathVariants struct MATH { - static const hb_tag_t tableTag = HB_OT_TAG_MATH; + enum { tableTag = HB_OT_TAG_MATH }; inline bool has_data (void) const { return version.to_int (); } diff --git a/src/hb-ot-maxp-table.hh b/src/hb-ot-maxp-table.hh index 198dd251..885685d6 100644 --- a/src/hb-ot-maxp-table.hh +++ b/src/hb-ot-maxp-table.hh @@ -71,7 +71,7 @@ struct maxpV1Tail struct maxp { - static const hb_tag_t tableTag = HB_OT_TAG_maxp; + enum { tableTag = HB_OT_TAG_maxp }; inline unsigned int get_num_glyphs (void) const { diff --git a/src/hb-ot-name-table.hh b/src/hb-ot-name-table.hh index ab07b719..4f24d737 100644 --- a/src/hb-ot-name-table.hh +++ b/src/hb-ot-name-table.hh @@ -151,7 +151,7 @@ _hb_ot_name_entry_cmp (const void *pa, const void *pb) struct name { - static const hb_tag_t tableTag = HB_OT_TAG_name; + enum { tableTag = HB_OT_TAG_name }; inline unsigned int get_size (void) const { return min_size + count * nameRecordZ[0].min_size; } diff --git a/src/hb-ot-os2-table.hh b/src/hb-ot-os2-table.hh index a5a9c07e..e53eda73 100644 --- a/src/hb-ot-os2-table.hh +++ b/src/hb-ot-os2-table.hh @@ -40,7 +40,7 @@ namespace OT { struct OS2 { - static const hb_tag_t tableTag = HB_OT_TAG_OS2; + enum { tableTag = HB_OT_TAG_OS2 }; inline bool sanitize (hb_sanitize_context_t *c) const { diff --git a/src/hb-ot-post-table.hh b/src/hb-ot-post-table.hh index 98df3e78..0ca3760b 100644 --- a/src/hb-ot-post-table.hh +++ b/src/hb-ot-post-table.hh @@ -71,7 +71,7 @@ struct postV2Tail struct post { - static const hb_tag_t tableTag = HB_OT_TAG_post; + enum { tableTag = HB_OT_TAG_post }; inline bool subset (hb_subset_plan_t *plan) const { diff --git a/src/hb-ot-stat-table.hh b/src/hb-ot-stat-table.hh index 02c376e5..7ad45db2 100644 --- a/src/hb-ot-stat-table.hh +++ b/src/hb-ot-stat-table.hh @@ -225,7 +225,7 @@ struct AxisValue struct STAT { - static const hb_tag_t tableTag = HB_OT_TAG_STAT; + enum { tableTag = HB_OT_TAG_STAT }; inline bool sanitize (hb_sanitize_context_t *c) const { diff --git a/src/hb-ot-var-avar-table.hh b/src/hb-ot-var-avar-table.hh index c2b110a2..70feb124 100644 --- a/src/hb-ot-var-avar-table.hh +++ b/src/hb-ot-var-avar-table.hh @@ -99,7 +99,7 @@ struct SegmentMaps : ArrayOf<AxisValueMap> struct avar { - static const hb_tag_t tableTag = HB_OT_TAG_avar; + enum { tableTag = HB_OT_TAG_avar }; inline bool sanitize (hb_sanitize_context_t *c) const { diff --git a/src/hb-ot-var-fvar-table.hh b/src/hb-ot-var-fvar-table.hh index fed334e8..975dae92 100644 --- a/src/hb-ot-var-fvar-table.hh +++ b/src/hb-ot-var-fvar-table.hh @@ -96,7 +96,7 @@ struct AxisRecord struct fvar { - static const hb_tag_t tableTag = HB_OT_TAG_fvar; + enum { tableTag = HB_OT_TAG_fvar }; inline bool has_data (void) const { return version.to_int (); } diff --git a/src/hb-ot-var-hvar-table.hh b/src/hb-ot-var-hvar-table.hh index 62a6547b..a60e35b9 100644 --- a/src/hb-ot-var-hvar-table.hh +++ b/src/hb-ot-var-hvar-table.hh @@ -102,8 +102,8 @@ struct DeltaSetIndexMap struct HVARVVAR { - static const hb_tag_t HVARTag = HB_OT_TAG_HVAR; - static const hb_tag_t VVARTag = HB_OT_TAG_VVAR; + enum { HVARTag = HB_OT_TAG_HVAR }; + enum { VVARTag = HB_OT_TAG_VVAR }; inline bool sanitize (hb_sanitize_context_t *c) const { @@ -143,10 +143,10 @@ struct HVARVVAR }; struct HVAR : HVARVVAR { - static const hb_tag_t tableTag = HB_OT_TAG_HVAR; + enum { tableTag = HB_OT_TAG_HVAR }; }; struct VVAR : HVARVVAR { - static const hb_tag_t tableTag = HB_OT_TAG_VVAR; + enum { tableTag = HB_OT_TAG_VVAR }; inline bool sanitize (hb_sanitize_context_t *c) const { diff --git a/src/hb-ot-var-mvar-table.hh b/src/hb-ot-var-mvar-table.hh index b16a09b3..23d2649b 100644 --- a/src/hb-ot-var-mvar-table.hh +++ b/src/hb-ot-var-mvar-table.hh @@ -58,7 +58,7 @@ struct VariationValueRecord struct MVAR { - static const hb_tag_t tableTag = HB_OT_TAG_MVAR; + enum { tableTag = HB_OT_TAG_MVAR }; inline bool sanitize (hb_sanitize_context_t *c) const { diff --git a/src/hb-ot-vorg-table.hh b/src/hb-ot-vorg-table.hh index a0480cbc..f724fe04 100644 --- a/src/hb-ot-vorg-table.hh +++ b/src/hb-ot-vorg-table.hh @@ -57,7 +57,7 @@ struct VertOriginMetric struct VORG { - static const hb_tag_t tableTag = HB_OT_TAG_VORG; + enum { tableTag = HB_OT_TAG_VORG }; inline bool has_data (void) const { return version.to_int (); } commit 9e4138c82548c2b29a1ae8801d2c6c7c1f1a9c7a Author: Behdad Esfahbod <[email protected]> Date: Thu Nov 29 15:01:10 2018 -0500 Convert misc "static const" constants to enum diff --git a/src/hb-aat-layout-kerx-table.hh b/src/hb-aat-layout-kerx-table.hh index d0b44609..9a2351a1 100644 --- a/src/hb-aat-layout-kerx-table.hh +++ b/src/hb-aat-layout-kerx-table.hh @@ -947,7 +947,7 @@ struct KerxTable { TRACE_SANITIZE (this); if (unlikely (!thiz()->version.sanitize (c) || - thiz()->version < T::minVersion || + (unsigned) thiz()->version < (unsigned) T::minVersion || !thiz()->tableCount.sanitize (c))) return_trace (false); @@ -983,7 +983,7 @@ struct kerx : KerxTable<kerx> friend struct KerxTable<kerx>; static const hb_tag_t tableTag = HB_AAT_TAG_kerx; - static const uint16_t minVersion = 2; + enum { minVersion = 2u }; typedef KerxSubTableHeader SubTableHeader; typedef SubTableHeader::Types Types; diff --git a/src/hb-map.hh b/src/hb-map.hh index c54c9d7b..16b2255d 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -168,7 +168,7 @@ struct hb_map_t inline hb_codepoint_t operator [] (unsigned int key) const { return get (key); } - static const hb_codepoint_t INVALID = HB_MAP_VALUE_INVALID; + enum { INVALID = HB_MAP_VALUE_INVALID }; inline void clear (void) { diff --git a/src/hb-ot-kern-table.hh b/src/hb-ot-kern-table.hh index 3b71ac80..956bf3f8 100644 --- a/src/hb-ot-kern-table.hh +++ b/src/hb-ot-kern-table.hh @@ -198,7 +198,7 @@ struct KernOT : AAT::KerxTable<KernOT> friend struct AAT::KerxTable<KernOT>; static const hb_tag_t tableTag = HB_OT_TAG_kern; - static const uint16_t minVersion = 0; + enum { minVersion = 0u }; typedef KernOTSubTableHeader SubTableHeader; typedef SubTableHeader::Types Types; @@ -253,7 +253,7 @@ struct KernAAT : AAT::KerxTable<KernAAT> friend struct AAT::KerxTable<KernAAT>; static const hb_tag_t tableTag = HB_OT_TAG_kern; - static const uint32_t minVersion = 0x00010000u; + enum { minVersion = 0x00010000u }; typedef KernAATSubTableHeader SubTableHeader; typedef SubTableHeader::Types Types; diff --git a/src/hb-set-digest.hh b/src/hb-set-digest.hh index 4e99df0e..1daefad1 100644 --- a/src/hb-set-digest.hh +++ b/src/hb-set-digest.hh @@ -50,13 +50,13 @@ struct hb_set_digest_lowest_bits_t { enum { mask_bytes = sizeof (mask_t) }; enum { mask_bits = sizeof (mask_t) * 8 }; - static const unsigned int num_bits = 0 - + (mask_bytes >= 1 ? 3 : 0) - + (mask_bytes >= 2 ? 1 : 0) - + (mask_bytes >= 4 ? 1 : 0) - + (mask_bytes >= 8 ? 1 : 0) - + (mask_bytes >= 16? 1 : 0) - + 0; + enum { num_bits = 0 + + (mask_bytes >= 1 ? 3 : 0) + + (mask_bytes >= 2 ? 1 : 0) + + (mask_bytes >= 4 ? 1 : 0) + + (mask_bytes >= 8 ? 1 : 0) + + (mask_bytes >= 16? 1 : 0) + + 0 }; static_assert ((shift < sizeof (hb_codepoint_t) * 8), ""); static_assert ((shift + num_bits <= sizeof (hb_codepoint_t) * 8), ""); commit 44cbd2ea3dc36312bd80860983b6616586e78c6c Author: Behdad Esfahbod <[email protected]> Date: Thu Nov 29 14:53:43 2018 -0500 Convert "static const bool" constants to anonymous enum diff --git a/src/hb-aat-layout-common.hh b/src/hb-aat-layout-common.hh index c0b0e375..588dbdf2 100644 --- a/src/hb-aat-layout-common.hh +++ b/src/hb-aat-layout-common.hh @@ -675,7 +675,7 @@ struct ClassTable struct ObsoleteTypes { - static const bool extended = false; + enum { extended = false }; typedef HBUINT16 HBUINT; typedef HBUINT8 HBUSHORT; typedef ClassTable<HBUINT8> ClassTypeNarrow; @@ -705,7 +705,7 @@ struct ObsoleteTypes }; struct ExtendedTypes { - static const bool extended = true; + enum { extended = true }; typedef HBUINT32 HBUINT; typedef HBUINT16 HBUSHORT; typedef Lookup<HBUINT16> ClassTypeNarrow; diff --git a/src/hb-aat-layout-kerx-table.hh b/src/hb-aat-layout-kerx-table.hh index 7caf45d5..d0b44609 100644 --- a/src/hb-aat-layout-kerx-table.hh +++ b/src/hb-aat-layout-kerx-table.hh @@ -211,7 +211,7 @@ struct KerxSubTableFormat1 struct driver_context_t { - static const bool in_place = true; + enum { in_place = true }; enum { DontAdvance = Format1EntryT::DontAdvance, @@ -472,7 +472,7 @@ struct KerxSubTableFormat4 struct driver_context_t { - static const bool in_place = true; + enum { in_place = true }; enum Flags { Mark = 0x8000, /* If set, remember this glyph as the marked glyph. */ diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh index 171ee4a1..e8a0cdfc 100644 --- a/src/hb-aat-layout-morx-table.hh +++ b/src/hb-aat-layout-morx-table.hh @@ -54,7 +54,7 @@ struct RearrangementSubtable struct driver_context_t { - static const bool in_place = true; + enum { in_place = true }; enum Flags { MarkFirst = 0x8000, /* If set, make the current glyph the first @@ -204,7 +204,7 @@ struct ContextualSubtable struct driver_context_t { - static const bool in_place = true; + enum { in_place = true }; enum Flags { SetMark = 0x8000, /* If set, make the current glyph the marked glyph. */ @@ -424,7 +424,7 @@ struct LigatureSubtable struct driver_context_t { - static const bool in_place = false; + enum { in_place = false }; enum { DontAdvance = LigatureEntryT::DontAdvance, @@ -660,7 +660,7 @@ struct InsertionSubtable struct driver_context_t { - static const bool in_place = false; + enum { in_place = false }; enum Flags { SetMark = 0x8000, /* If set, mark the current glyph. */ diff --git a/src/hb-dsalgs.hh b/src/hb-dsalgs.hh index 57735960..4a8144ba 100644 --- a/src/hb-dsalgs.hh +++ b/src/hb-dsalgs.hh @@ -735,26 +735,26 @@ inline hb_sorted_array_t<T> hb_sorted_array (T *array, unsigned int len) struct HbOpOr { - static const bool passthru_left = true; - static const bool passthru_right = true; + enum { passthru_left = true }; + enum { passthru_right = true }; template <typename T> static void process (T &o, const T &a, const T &b) { o = a | b; } }; struct HbOpAnd { - static const bool passthru_left = false; - static const bool passthru_right = false; + enum { passthru_left = false }; + enum { passthru_right = false }; template <typename T> static void process (T &o, const T &a, const T &b) { o = a & b; } }; struct HbOpMinus { - static const bool passthru_left = true; - static const bool passthru_right = false; + enum { passthru_left = true }; + enum { passthru_right = false }; template <typename T> static void process (T &o, const T &a, const T &b) { o = a & ~b; } }; struct HbOpXor { - static const bool passthru_left = true; - static const bool passthru_right = true; + enum { passthru_left = true }; + enum { passthru_right = true }; template <typename T> static void process (T &o, const T &a, const T &b) { o = a ^ b; } }; diff --git a/src/hb-ot-kern-table.hh b/src/hb-ot-kern-table.hh index b57ebaea..3b71ac80 100644 --- a/src/hb-ot-kern-table.hh +++ b/src/hb-ot-kern-table.hh @@ -160,7 +160,7 @@ struct KernSubTable struct KernOTSubTableHeader { - static const bool apple = false; + enum { apple = false }; typedef AAT::ObsoleteTypes Types; inline unsigned int tuple_count (void) const { return 0; } @@ -215,7 +215,7 @@ struct KernOT : AAT::KerxTable<KernOT> struct KernAATSubTableHeader { - static const bool apple = true; + enum { apple = true }; typedef AAT::ObsoleteTypes Types; inline unsigned int tuple_count (void) const { return 0; } diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index d0b22efe..b08ee7f6 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -1299,7 +1299,7 @@ hb_ot_layout_feature_get_characters (hb_face_t *face, struct GSUBProxy { enum { table_index = 0 }; - static const bool inplace = false; + enum { inplace = false }; typedef OT::SubstLookup Lookup; GSUBProxy (hb_face_t *face) : @@ -1313,7 +1313,7 @@ struct GSUBProxy struct GPOSProxy { enum { table_index = 1 }; - static const bool inplace = true; + enum { inplace = true }; typedef OT::PosLookup Lookup; GPOSProxy (hb_face_t *face) : _______________________________________________ HarfBuzz mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/harfbuzz
