From e41200859997ccf8fd7d36fff654f3ceea3a4160 Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Mon, 17 Dec 2018 21:31:01 +0330 Subject: [PATCH] Remove redundant void from C++ sources (#1486) --- src/dump-indic-data.cc | 2 +- src/dump-khmer-data.cc | 2 +- src/dump-myanmar-data.cc | 2 +- src/dump-use-data.cc | 2 +- src/hb-aat-fdsc-table.hh | 4 +- src/hb-aat-layout-common.hh | 23 +++--- src/hb-aat-layout-feat-table.hh | 8 +-- src/hb-aat-layout-just-table.hh | 2 +- src/hb-aat-layout-kerx-table.hh | 21 +++--- src/hb-aat-layout-morx-table.hh | 10 +-- src/hb-aat-layout-trak-table.hh | 4 +- src/hb-aat-layout.cc | 6 +- src/hb-aat-map.hh | 4 +- src/hb-array.hh | 24 +++---- src/hb-atomic.hh | 18 ++--- src/hb-blob.cc | 8 +-- src/hb-blob.hh | 33 ++++----- src/hb-buffer-serialize.cc | 2 +- src/hb-buffer.cc | 24 +++---- src/hb-buffer.hh | 51 ++++++------- src/hb-cache.hh | 6 +- src/hb-cff-interp-common.hh | 113 +++++++++++++---------------- src/hb-cff-interp-cs-common.hh | 26 +++---- src/hb-cff-interp-dict-common.hh | 12 ++-- src/hb-cff1-interp-cs.hh | 4 +- src/hb-cff2-interp-cs.hh | 24 +++---- src/hb-common.cc | 20 +++--- src/hb-coretext.cc | 2 +- src/hb-debug.hh | 6 +- src/hb-directwrite.cc | 16 ++--- src/hb-dsalgs.hh | 2 +- src/hb-face.cc | 6 +- src/hb-face.hh | 8 +-- src/hb-font.cc | 6 +- src/hb-font.hh | 6 +- src/hb-ft.cc | 18 ++--- src/hb-glib.cc | 8 +-- src/hb-gobject-enums.cc.tmpl | 2 +- src/hb-gobject-enums.h.tmpl | 2 +- src/hb-gobject-structs.cc | 2 +- src/hb-icu.cc | 8 +-- src/hb-iter.hh | 15 ++-- src/hb-machinery.hh | 150 ++++++++++++++++----------------------- src/hb-map.cc | 4 +- src/hb-map.hh | 24 +++---- src/hb-mutex.hh | 10 +-- src/hb-null.hh | 32 ++++----- src/hb-object.hh | 22 +++--- src/hb-open-file.hh | 32 ++++----- src/hb-open-type.hh | 66 +++++++++-------- src/hb-ot-cff-common.hh | 30 ++++---- src/hb-ot-cff1-table.cc | 17 ++--- src/hb-ot-cff1-table.hh | 52 ++++++-------- src/hb-ot-cff2-table.cc | 8 +-- src/hb-ot-cff2-table.hh | 34 ++++----- src/hb-ot-cmap-table.hh | 10 +-- src/hb-ot-color-cbdt-table.hh | 4 +- src/hb-ot-color-colr-table.hh | 2 +- src/hb-ot-color-cpal-table.hh | 10 +-- src/hb-ot-color-sbix-table.hh | 11 ++- src/hb-ot-color-svg-table.hh | 7 +- src/hb-ot-face.cc | 2 +- src/hb-ot-face.hh | 2 +- src/hb-ot-font.cc | 8 +-- src/hb-ot-glyf-table.hh | 6 +- src/hb-ot-hdmx-table.hh | 4 +- src/hb-ot-head-table.hh | 8 +-- src/hb-ot-hmtx-table.hh | 2 +- src/hb-ot-kern-table.hh | 20 +++--- src/hb-ot-layout-base-table.hh | 10 +-- src/hb-ot-layout-common.hh | 67 +++++++++-------- src/hb-ot-layout-gdef-table.hh | 20 +++--- src/hb-ot-layout-gpos-table.hh | 34 ++++----- src/hb-ot-layout-gsub-table.hh | 24 +++---- src/hb-ot-layout-gsubgpos.hh | 92 +++++++++++------------- src/hb-ot-layout-jstf-table.hh | 8 +-- src/hb-ot-map.cc | 2 +- src/hb-ot-map.hh | 8 +-- src/hb-ot-math-table.hh | 11 ++- src/hb-ot-maxp-table.hh | 5 +- src/hb-ot-name-table.hh | 6 +- src/hb-ot-os2-table.hh | 18 ++--- src/hb-ot-post-table.hh | 4 +- src/hb-ot-shape.cc | 2 +- src/hb-ot-shape.hh | 2 +- src/hb-ot-tag.cc | 4 +- src/hb-ot-var-fvar-table.hh | 9 ++- src/hb-ot-var-hvar-table.hh | 9 +-- src/hb-ot-vorg-table.hh | 2 +- src/hb-set-digest.hh | 4 +- src/hb-set.cc | 4 +- src/hb-set.hh | 38 +++++----- src/hb-shape-plan.cc | 2 +- src/hb-shape-plan.hh | 5 +- src/hb-shape.cc | 10 +-- src/hb-shaper.cc | 14 ++-- src/hb-shaper.hh | 6 +- src/hb-static.cc | 4 +- src/hb-subset-cff-common.hh | 91 +++++++++++------------- src/hb-subset-cff1.cc | 20 ++---- src/hb-subset-cff2.cc | 8 +-- src/hb-subset-input.cc | 2 +- src/hb-subset.hh | 4 +- src/hb-ucdn.cc | 10 +-- src/hb-unicode.cc | 64 ++++++++--------- src/hb-uniscribe.cc | 12 ++-- src/hb-vector.hh | 38 +++++----- src/hb.hh | 6 +- src/test-unicode-ranges.cc | 4 +- util/ansi-print.cc | 6 +- util/hb-fc.cc | 2 +- util/hb-shape.cc | 5 +- util/helper-cairo.cc | 2 +- util/helper-cairo.hh | 2 +- util/main-font-text.hh | 2 +- util/options.cc | 8 +-- util/options.hh | 22 +++--- util/view-cairo.hh | 14 ++-- 118 files changed, 861 insertions(+), 1024 deletions(-) diff --git a/src/dump-indic-data.cc b/src/dump-indic-data.cc index a506889..8ddc9d5 100644 --- a/src/dump-indic-data.cc +++ b/src/dump-indic-data.cc @@ -27,7 +27,7 @@ #include "hb-ot-shape-complex-indic.hh" int -main (void) +main () { for (hb_codepoint_t u = 0; u <= 0x10FFFF; u++) { diff --git a/src/dump-khmer-data.cc b/src/dump-khmer-data.cc index 1e79a97..cffbb92 100644 --- a/src/dump-khmer-data.cc +++ b/src/dump-khmer-data.cc @@ -27,7 +27,7 @@ #include "hb-ot-shape-complex-khmer.hh" int -main (void) +main () { for (hb_codepoint_t u = 0; u <= 0x10FFFF; u++) { diff --git a/src/dump-myanmar-data.cc b/src/dump-myanmar-data.cc index 9f8b12e..c1a303f 100644 --- a/src/dump-myanmar-data.cc +++ b/src/dump-myanmar-data.cc @@ -27,7 +27,7 @@ #include "hb-ot-shape-complex-myanmar.hh" int -main (void) +main () { for (hb_codepoint_t u = 0; u <= 0x10FFFF; u++) { diff --git a/src/dump-use-data.cc b/src/dump-use-data.cc index 4a8b258..d639426 100644 --- a/src/dump-use-data.cc +++ b/src/dump-use-data.cc @@ -27,7 +27,7 @@ #include "hb-ot-shape-complex-use.hh" int -main (void) +main () { for (hb_codepoint_t u = 0; u <= 0x10FFFF; u++) { diff --git a/src/hb-aat-fdsc-table.hh b/src/hb-aat-fdsc-table.hh index 02392a6..a1af595 100644 --- a/src/hb-aat-fdsc-table.hh +++ b/src/hb-aat-fdsc-table.hh @@ -40,11 +40,11 @@ namespace AAT { struct FontDescriptor { - bool has_data (void) const { return tag; } + bool has_data () const { return tag; } int cmp (hb_tag_t a) const { return tag.cmp (a); } - float get_value (void) const { return u.value.to_float (); } + float get_value () const { return u.value.to_float (); } enum non_alphabetic_value_t { Alphabetic = 0, diff --git a/src/hb-aat-layout-common.hh b/src/hb-aat-layout-common.hh index 16e2c1b..95d6b31 100644 --- a/src/hb-aat-layout-common.hh +++ b/src/hb-aat-layout-common.hh @@ -419,17 +419,14 @@ struct Lookup /* Ugly hand-coded null objects for template Lookup<> :(. */ extern HB_INTERNAL const unsigned char _hb_Null_AAT_Lookup[2]; template <> -/*static*/ inline const AAT::Lookup& Null > (void) { - return *reinterpret_cast *> (_hb_Null_AAT_Lookup); -} +/*static*/ inline const AAT::Lookup& Null > () +{ return *reinterpret_cast *> (_hb_Null_AAT_Lookup); } template <> -/*static*/ inline const AAT::Lookup& Null > (void) { - return *reinterpret_cast *> (_hb_Null_AAT_Lookup); -} +/*static*/ inline const AAT::Lookup& Null > () +{ return *reinterpret_cast *> (_hb_Null_AAT_Lookup); } template <> -/*static*/ inline const AAT::Lookup >& Null > > (void) { - return *reinterpret_cast > *> (_hb_Null_AAT_Lookup); -} +/*static*/ inline const AAT::Lookup >& Null > > () +{ return *reinterpret_cast > *> (_hb_Null_AAT_Lookup); } namespace AAT { enum { DELETED_GLYPH = 0xFFFF }; @@ -511,7 +508,7 @@ struct StateTable return (this+classTable).get_class (glyph_id, num_glyphs, 1); } - const Entry *get_entries (void) const + const Entry *get_entries () const { return (this+entryTable).arrayZ; } const Entry *get_entryZ (int state, unsigned int klass) const @@ -816,10 +813,10 @@ struct ankr; struct hb_aat_apply_context_t : hb_dispatch_context_t { - const char *get_name (void) { return "APPLY"; } + const char *get_name () { return "APPLY"; } template return_t dispatch (const T &obj) { return obj.apply (this); } - static return_t default_return_value (void) { return false; } + static return_t default_return_value () { return false; } bool stop_sublookup_iteration (return_t r) const { return r; } const hb_ot_shape_plan_t *plan; @@ -839,7 +836,7 @@ struct hb_aat_apply_context_t : hb_buffer_t *buffer_, hb_blob_t *blob = const_cast (&Null(hb_blob_t))); - HB_INTERNAL ~hb_aat_apply_context_t (void); + HB_INTERNAL ~hb_aat_apply_context_t (); HB_INTERNAL void set_ankr_table (const AAT::ankr *ankr_table_, const char *ankr_end_); diff --git a/src/hb-aat-layout-feat-table.hh b/src/hb-aat-layout-feat-table.hh index 16560cb..63c69a2 100644 --- a/src/hb-aat-layout-feat-table.hh +++ b/src/hb-aat-layout-feat-table.hh @@ -44,7 +44,7 @@ struct SettingName int cmp (hb_aat_layout_feature_selector_t key) const { return (int) key - (int) setting; } - hb_aat_layout_feature_selector_t get_selector (void) const + hb_aat_layout_feature_selector_t get_selector () const { return (hb_aat_layout_feature_selector_t) (unsigned) setting; } void get_info (hb_aat_layout_feature_selector_info_t *s, @@ -125,10 +125,10 @@ struct FeatureName return settings_table.len; } - hb_aat_layout_feature_type_t get_feature_type (void) const + hb_aat_layout_feature_type_t get_feature_type () const { return (hb_aat_layout_feature_type_t) (unsigned int) feature; } - hb_ot_name_id_t get_feature_name_id (void) const { return nameIndex; } + hb_ot_name_id_t get_feature_name_id () const { return nameIndex; } bool sanitize (hb_sanitize_context_t *c, const void *base) const { @@ -157,7 +157,7 @@ struct feat { enum { tableTag = HB_AAT_TAG_feat }; - bool has_data (void) const { return version.to_int (); } + bool has_data () const { return version.to_int (); } unsigned int get_feature_types (unsigned int start_offset, unsigned int *count, diff --git a/src/hb-aat-layout-just-table.hh b/src/hb-aat-layout-just-table.hh index b91b046..d39945a 100644 --- a/src/hb-aat-layout-just-table.hh +++ b/src/hb-aat-layout-just-table.hh @@ -178,7 +178,7 @@ struct RepeatedAddGlyphAction struct ActionSubrecord { - unsigned int get_length (void) const { return u.header.actionLength; } + unsigned int get_length () const { return u.header.actionLength; } 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 db16d9c..291f3e3 100644 --- a/src/hb-aat-layout-kerx-table.hh +++ b/src/hb-aat-layout-kerx-table.hh @@ -66,8 +66,7 @@ struct hb_glyph_pair_t struct KernPair { - int get_kerning (void) const - { return value; } + int get_kerning () const { return value; } int cmp (const hb_glyph_pair_t &o) const { @@ -635,7 +634,7 @@ struct KerxSubTableFormat6 ValuesAreLong = 0x00000001, }; - bool is_long (void) const { return flags & ValuesAreLong; } + bool is_long () const { return flags & ValuesAreLong; } int get_kerning (hb_codepoint_t left, hb_codepoint_t right, hb_aat_apply_context_t *c) const @@ -743,8 +742,8 @@ struct KerxSubTableHeader { typedef ExtendedTypes Types; - unsigned int tuple_count (void) const { return tupleCount; } - bool is_horizontal (void) const { return !(coverage & Vertical); } + unsigned int tuple_count () const { return tupleCount; } + bool is_horizontal () const { return !(coverage & Vertical); } enum Coverage { @@ -778,8 +777,8 @@ struct KerxSubTable { friend struct kerx; - unsigned int get_size (void) const { return u.header.length; } - unsigned int get_type (void) const { return u.header.coverage & u.header.SubtableType; } + unsigned int get_size () const { return u.header.length; } + unsigned int get_type () const { return u.header.coverage & u.header.SubtableType; } template typename context_t::return_t dispatch (context_t *c) const @@ -829,9 +828,9 @@ template struct KerxTable { /* https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern */ - const T* thiz (void) const { return static_cast (this); } + const T* thiz () const { return static_cast (this); } - bool has_state_machine (void) const + bool has_state_machine () const { typedef typename T::SubTable SubTable; @@ -846,7 +845,7 @@ struct KerxTable return false; } - bool has_cross_stream (void) const + bool has_cross_stream () const { typedef typename T::SubTable SubTable; @@ -989,7 +988,7 @@ struct kerx : KerxTable typedef SubTableHeader::Types Types; typedef KerxSubTable SubTable; - bool has_data (void) const { return version; } + bool has_data () const { return version; } protected: HBUINT16 version; /* The version number of the extended kerning table diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh index ea3a7d1..c7600aa 100644 --- a/src/hb-aat-layout-morx-table.hh +++ b/src/hb-aat-layout-morx-table.hh @@ -868,9 +868,9 @@ struct ChainSubtable template friend struct Chain; - unsigned int get_size (void) const { return length; } - unsigned int get_type (void) const { return coverage & 0xFF; } - unsigned int get_coverage (void) const { return coverage >> (sizeof (HBUINT) * 8 - 8); } + unsigned int get_size () const { return length; } + unsigned int get_type () const { return coverage & 0xFF; } + unsigned int get_coverage () const { return coverage >> (sizeof (HBUINT) * 8 - 8); } enum Coverage { @@ -1049,7 +1049,7 @@ struct Chain } } - unsigned int get_size (void) const { return length; } + unsigned int get_size () const { return length; } bool sanitize (hb_sanitize_context_t *c, unsigned int version HB_UNUSED) const { @@ -1098,7 +1098,7 @@ struct mortmorx { enum { tableTag = HB_AAT_TAG_morx }; - bool has_data (void) const { return version != 0; } + bool has_data () const { return version != 0; } void compile_flags (const hb_aat_map_builder_t *mapper, hb_aat_map_t *map) const diff --git a/src/hb-aat-layout-trak-table.hh b/src/hb-aat-layout-trak-table.hh index 9dc9421..0648f61 100644 --- a/src/hb-aat-layout-trak-table.hh +++ b/src/hb-aat-layout-trak-table.hh @@ -46,7 +46,7 @@ struct TrackTableEntry { friend struct TrackData; - float get_track_value (void) const { return track.to_float (); } + float get_track_value () const { return track.to_float (); } int get_value (const void *base, unsigned int index, unsigned int table_size) const @@ -162,7 +162,7 @@ struct trak { enum { tableTag = HB_AAT_TAG_trak }; - bool has_data (void) const { return version.to_int (); } + bool has_data () const { return version.to_int (); } bool apply (hb_aat_apply_context_t *c) const { diff --git a/src/hb-aat-layout.cc b/src/hb-aat-layout.cc index a59ad08..8a868a0 100644 --- a/src/hb-aat-layout.cc +++ b/src/hb-aat-layout.cc @@ -167,10 +167,8 @@ AAT::hb_aat_apply_context_t::hb_aat_apply_context_t (const hb_ot_shape_plan_t *p sanitizer.set_max_ops (HB_SANITIZE_MAX_OPS_MAX); } -AAT::hb_aat_apply_context_t::~hb_aat_apply_context_t (void) -{ - sanitizer.end_processing (); -} +AAT::hb_aat_apply_context_t::~hb_aat_apply_context_t () +{ sanitizer.end_processing (); } void AAT::hb_aat_apply_context_t::set_ankr_table (const AAT::ankr *ankr_table_, diff --git a/src/hb-aat-map.hh b/src/hb-aat-map.hh index 6797d09..fa312db 100644 --- a/src/hb-aat-map.hh +++ b/src/hb-aat-map.hh @@ -36,12 +36,12 @@ struct hb_aat_map_t public: - void init (void) + void init () { memset (this, 0, sizeof (*this)); chain_flags.init (); } - void fini (void) { chain_flags.fini (); } + void fini () { chain_flags.fini (); } public: hb_vector_t chain_flags; diff --git a/src/hb-array.hh b/src/hb-array.hh index e0400e5..5e3f745 100644 --- a/src/hb-array.hh +++ b/src/hb-array.hh @@ -42,7 +42,7 @@ struct hb_array_t /* * Constructors. */ - hb_array_t (void) : arrayZ (nullptr), len (0) {} + hb_array_t () : arrayZ (nullptr), len (0) {} hb_array_t (const hb_array_t &o) : arrayZ (o.arrayZ), len (o.len) {} hb_array_t (Type *array_, unsigned int len_) : arrayZ (array_), len (len_) {} template hb_array_t (Type (&array_)[len_]) : arrayZ (array_), len (len_) {} @@ -58,11 +58,11 @@ struct hb_array_t return arrayZ[i]; } - explicit_operator bool (void) const { return len; } - Type * operator & (void) const { return arrayZ; } - Type & operator * (void) { return (this->operator [])[0]; } - operator hb_array_t (void) { return hb_array_t (arrayZ, len); } - template operator T * (void) const { return arrayZ; } + explicit_operator bool () const { return len; } + Type * operator & () const { return arrayZ; } + Type & operator * () { return (this->operator [])[0]; } + operator hb_array_t () { return hb_array_t (arrayZ, len); } + template operator T * () const { return arrayZ; } hb_array_t & operator += (unsigned int count) { @@ -79,8 +79,8 @@ struct hb_array_t len -= count; return *this; } - hb_array_t & operator ++ (void) { *this += 1; } - hb_array_t & operator -- (void) { *this -= 1; } + hb_array_t & operator ++ () { *this += 1; } + hb_array_t & operator -- () { *this -= 1; } hb_array_t operator + (unsigned int count) { hb_array_t copy (*this); *this += count; return copy; } hb_array_t operator - (unsigned int count) @@ -132,7 +132,7 @@ struct hb_array_t ::qsort (arrayZ, len, item_size, cmp_); return hb_sorted_array_t (*this); } - hb_sorted_array_t qsort (void) + hb_sorted_array_t qsort () { ::qsort (arrayZ, len, item_size, Type::cmp); return hb_sorted_array_t (*this); @@ -148,7 +148,7 @@ struct hb_array_t * Other methods. */ - unsigned int get_size (void) const { return len * item_size; } + unsigned int get_size () const { return len * item_size; } hb_array_t sub_array (unsigned int start_offset = 0, unsigned int *seg_count = nullptr /* IN/OUT */) const { @@ -168,7 +168,7 @@ struct hb_array_t { return sub_array (start_offset, &seg_count); } /* Only call if you allocated the underlying array using malloc() or similar. */ - void free (void) + void free () { ::free ((void *) arrayZ); arrayZ = nullptr; len = 0; } template @@ -198,7 +198,7 @@ enum hb_bfind_not_found_t template struct hb_sorted_array_t : hb_array_t { - hb_sorted_array_t (void) : hb_array_t () {} + hb_sorted_array_t () : hb_array_t () {} hb_sorted_array_t (const hb_array_t &o) : hb_array_t (o) {} hb_sorted_array_t (Type *array_, unsigned int len_) : hb_array_t (array_, len_) {} diff --git a/src/hb-atomic.hh b/src/hb-atomic.hh index 575d536..7df4fe9 100644 --- a/src/hb-atomic.hh +++ b/src/hb-atomic.hh @@ -104,7 +104,7 @@ _hb_atomic_ptr_impl_cmplexch (const void **P, const void *O_, const void *N) #include -static inline void _hb_memory_barrier (void) +static inline void _hb_memory_barrier () { #if !defined(MemoryBarrier) /* MinGW has a convoluted history of supporting MemoryBarrier. */ @@ -269,10 +269,10 @@ struct hb_atomic_int_t { void set_relaxed (int v_) { hb_atomic_int_impl_set_relaxed (&v, v_); } void set (int v_) { hb_atomic_int_impl_set (&v, v_); } - int get_relaxed (void) const { return hb_atomic_int_impl_get_relaxed (&v); } - int get (void) const { return hb_atomic_int_impl_get (&v); } - int inc (void) { return hb_atomic_int_impl_add (&v, 1); } - int dec (void) { return hb_atomic_int_impl_add (&v, -1); } + int get_relaxed () const { return hb_atomic_int_impl_get_relaxed (&v); } + int get () const { return hb_atomic_int_impl_get (&v); } + int inc () { return hb_atomic_int_impl_add (&v, 1); } + int dec () { return hb_atomic_int_impl_add (&v, -1); } int v; }; @@ -286,12 +286,12 @@ struct hb_atomic_ptr_t void init (T* v_ = nullptr) { set_relaxed (v_); } void set_relaxed (T* v_) { hb_atomic_ptr_impl_set_relaxed (&v, v_); } - T *get_relaxed (void) const { return (T *) hb_atomic_ptr_impl_get_relaxed (&v); } - T *get (void) const { return (T *) hb_atomic_ptr_impl_get ((void **) &v); } + T *get_relaxed () const { return (T *) hb_atomic_ptr_impl_get_relaxed (&v); } + T *get () const { return (T *) hb_atomic_ptr_impl_get ((void **) &v); } bool cmpexch (const T *old, T *new_) const { return hb_atomic_ptr_impl_cmpexch ((void **) &v, (void *) old, (void *) new_); } - T * operator -> (void) const { return get (); } - template operator C * (void) const { return get (); } + T * operator -> () const { return get (); } + template operator C * () const { return get (); } T *v; }; diff --git a/src/hb-blob.cc b/src/hb-blob.cc index 8ebedca..b53b20b 100644 --- a/src/hb-blob.cc +++ b/src/hb-blob.cc @@ -188,7 +188,7 @@ hb_blob_copy_writable_or_fail (hb_blob_t *blob) * Since: 0.9.2 **/ hb_blob_t * -hb_blob_get_empty (void) +hb_blob_get_empty () { return const_cast (&Null(hb_blob_t)); } @@ -378,7 +378,7 @@ hb_blob_get_data_writable (hb_blob_t *blob, unsigned int *length) bool -hb_blob_t::try_make_writable_inplace_unix (void) +hb_blob_t::try_make_writable_inplace_unix () { #if defined(HAVE_SYS_MMAN_H) && defined(HAVE_MPROTECT) uintptr_t pagesize = -1, mask, length; @@ -421,7 +421,7 @@ hb_blob_t::try_make_writable_inplace_unix (void) } bool -hb_blob_t::try_make_writable_inplace (void) +hb_blob_t::try_make_writable_inplace () { DEBUG_MSG_FUNC (BLOB, this, "making writable inplace\n"); @@ -436,7 +436,7 @@ hb_blob_t::try_make_writable_inplace (void) } bool -hb_blob_t::try_make_writable (void) +hb_blob_t::try_make_writable () { if (hb_object_is_immutable (this)) return false; diff --git a/src/hb-blob.hh b/src/hb-blob.hh index 2ed5155..4ea13f8 100644 --- a/src/hb-blob.hh +++ b/src/hb-blob.hh @@ -38,12 +38,9 @@ struct hb_blob_t { - void fini_shallow (void) - { - destroy_user_data (); - } + void fini_shallow () { destroy_user_data (); } - void destroy_user_data (void) + void destroy_user_data () { if (destroy) { @@ -53,16 +50,16 @@ struct hb_blob_t } } - HB_INTERNAL bool try_make_writable (void); - HB_INTERNAL bool try_make_writable_inplace (void); - HB_INTERNAL bool try_make_writable_inplace_unix (void); + HB_INTERNAL bool try_make_writable (); + HB_INTERNAL bool try_make_writable_inplace (); + HB_INTERNAL bool try_make_writable_inplace_unix (); template - const Type* as (void) const + const Type* as () const { return length < hb_null_size (Type) ? &Null(Type) : reinterpret_cast (data); } - hb_bytes_t as_bytes (void) const + hb_bytes_t as_bytes () const { return hb_bytes_t (data, length); } public: @@ -88,14 +85,14 @@ struct hb_blob_ptr_t hb_blob_ptr_t (hb_blob_t *b_ = nullptr) : b (b_) {} hb_blob_t * operator = (hb_blob_t *b_) { return b = b_; } - const T * operator -> (void) const { return get (); } - const T & operator * (void) const { return *get (); } - template operator const C * (void) const { return get (); } - operator const char * (void) const { return (const char *) get (); } - const T * get (void) const { return b->as (); } - hb_blob_t * get_blob (void) const { return b.get_raw (); } - unsigned int get_length (void) const { return b.get ()->length; } - void destroy (void) { hb_blob_destroy (b.get ()); b = nullptr; } + const T * operator -> () const { return get (); } + const T & operator * () const { return *get (); } + template operator const C * () const { return get (); } + operator const char * () const { return (const char *) get (); } + const T * get () const { return b->as (); } + hb_blob_t * get_blob () const { return b.get_raw (); } + unsigned int get_length () const { return b.get ()->length; } + void destroy () { hb_blob_destroy (b.get ()); b = nullptr; } hb_nonnull_ptr_t b; }; diff --git a/src/hb-buffer-serialize.cc b/src/hb-buffer-serialize.cc index 343ae1c..6e265e8 100644 --- a/src/hb-buffer-serialize.cc +++ b/src/hb-buffer-serialize.cc @@ -44,7 +44,7 @@ static const char *serialize_formats[] = { * Since: 0.9.7 **/ const char ** -hb_buffer_serialize_list_formats (void) +hb_buffer_serialize_list_formats () { return serialize_formats; } diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc index 3266c57..2dc02e9 100644 --- a/src/hb-buffer.cc +++ b/src/hb-buffer.cc @@ -215,7 +215,7 @@ hb_buffer_t::get_scratch_buffer (unsigned int *size) /* HarfBuzz-Internal API */ void -hb_buffer_t::reset (void) +hb_buffer_t::reset () { if (unlikely (hb_object_is_immutable (this))) return; @@ -230,7 +230,7 @@ hb_buffer_t::reset (void) } void -hb_buffer_t::clear (void) +hb_buffer_t::clear () { if (unlikely (hb_object_is_immutable (this))) return; @@ -287,7 +287,7 @@ hb_buffer_t::add_info (const hb_glyph_info_t &glyph_info) void -hb_buffer_t::remove_output (void) +hb_buffer_t::remove_output () { if (unlikely (hb_object_is_immutable (this))) return; @@ -300,7 +300,7 @@ hb_buffer_t::remove_output (void) } void -hb_buffer_t::clear_output (void) +hb_buffer_t::clear_output () { if (unlikely (hb_object_is_immutable (this))) return; @@ -313,7 +313,7 @@ hb_buffer_t::clear_output (void) } void -hb_buffer_t::clear_positions (void) +hb_buffer_t::clear_positions () { if (unlikely (hb_object_is_immutable (this))) return; @@ -328,7 +328,7 @@ hb_buffer_t::clear_positions (void) } void -hb_buffer_t::swap_buffers (void) +hb_buffer_t::swap_buffers () { if (unlikely (!successful)) return; @@ -480,7 +480,7 @@ hb_buffer_t::reverse_range (unsigned int start, } void -hb_buffer_t::reverse (void) +hb_buffer_t::reverse () { if (unlikely (!len)) return; @@ -489,7 +489,7 @@ hb_buffer_t::reverse (void) } void -hb_buffer_t::reverse_clusters (void) +hb_buffer_t::reverse_clusters () { unsigned int i, start, count, last_cluster; @@ -574,7 +574,7 @@ hb_buffer_t::merge_out_clusters (unsigned int start, set_cluster (out_info[i], cluster); } void -hb_buffer_t::delete_glyph (void) +hb_buffer_t::delete_glyph () { /* The logic here is duplicated in hb_ot_hide_default_ignorables(). */ @@ -636,7 +636,7 @@ hb_buffer_t::unsafe_to_break_from_outbuffer (unsigned int start, unsigned int en } void -hb_buffer_t::guess_segment_properties (void) +hb_buffer_t::guess_segment_properties () { assert (content_type == HB_BUFFER_CONTENT_TYPE_UNICODE || (!len && content_type == HB_BUFFER_CONTENT_TYPE_INVALID)); @@ -709,7 +709,7 @@ DEFINE_NULL_INSTANCE (hb_buffer_t) = * Since: 0.9.2 **/ hb_buffer_t * -hb_buffer_create (void) +hb_buffer_create () { hb_buffer_t *buffer; @@ -734,7 +734,7 @@ hb_buffer_create (void) * Since: 0.9.2 **/ hb_buffer_t * -hb_buffer_get_empty (void) +hb_buffer_get_empty () { return const_cast (&Null(hb_buffer_t)); } diff --git a/src/hb-buffer.hh b/src/hb-buffer.hh index c7a99a7..0ac88c0 100644 --- a/src/hb-buffer.hh +++ b/src/hb-buffer.hh @@ -166,7 +166,7 @@ struct hb_buffer_t assert (bits == (allocated_var_bits & bits)); #endif } - void deallocate_var_all (void) + void deallocate_var_all () { #ifndef HB_NDEBUG allocated_var_bits = 0; @@ -179,34 +179,32 @@ struct hb_buffer_t hb_glyph_position_t &cur_pos (unsigned int i = 0) { return pos[idx + i]; } hb_glyph_position_t cur_pos (unsigned int i = 0) const { return pos[idx + i]; } - hb_glyph_info_t &prev (void) { return out_info[out_len ? out_len - 1 : 0]; } - hb_glyph_info_t prev (void) const { return out_info[out_len ? out_len - 1 : 0]; } + hb_glyph_info_t &prev () { return out_info[out_len ? out_len - 1 : 0]; } + hb_glyph_info_t prev () const { return out_info[out_len ? out_len - 1 : 0]; } - bool has_separate_output (void) const { return info != out_info; } + bool has_separate_output () const { return info != out_info; } - HB_INTERNAL void reset (void); - HB_INTERNAL void clear (void); + HB_INTERNAL void reset (); + HB_INTERNAL void clear (); - unsigned int backtrack_len (void) const - { return have_output? out_len : idx; } - unsigned int lookahead_len (void) const - { return len - idx; } - unsigned int next_serial (void) { return serial++; } + unsigned int backtrack_len () const { return have_output? out_len : idx; } + unsigned int lookahead_len () const { return len - idx; } + unsigned int next_serial () { return serial++; } HB_INTERNAL void add (hb_codepoint_t codepoint, unsigned int cluster); HB_INTERNAL void add_info (const hb_glyph_info_t &glyph_info); HB_INTERNAL void reverse_range (unsigned int start, unsigned int end); - HB_INTERNAL void reverse (void); - HB_INTERNAL void reverse_clusters (void); - HB_INTERNAL void guess_segment_properties (void); + HB_INTERNAL void reverse (); + HB_INTERNAL void reverse_clusters (); + HB_INTERNAL void guess_segment_properties (); - HB_INTERNAL void swap_buffers (void); - HB_INTERNAL void remove_output (void); - HB_INTERNAL void clear_output (void); - HB_INTERNAL void clear_positions (void); + HB_INTERNAL void swap_buffers (); + HB_INTERNAL void remove_output (); + HB_INTERNAL void clear_output (); + HB_INTERNAL void clear_positions (); HB_INTERNAL void replace_glyphs (unsigned int num_in, unsigned int num_out, @@ -247,7 +245,7 @@ struct hb_buffer_t out_len++; } /* Copies glyph at idx to output but doesn't advance idx */ - void copy_glyph (void) + void copy_glyph () { if (unlikely (!make_room_for (0, 1))) return; @@ -258,7 +256,7 @@ struct hb_buffer_t /* Copies glyph at idx to output and advance idx. * If there's no output, just advance idx. */ void - next_glyph (void) + next_glyph () { if (have_output) { @@ -290,10 +288,7 @@ struct hb_buffer_t idx += n; } /* Advance idx without copying to output. */ - void skip_glyph (void) - { - idx++; - } + void skip_glyph () { idx++; } void reset_masks (hb_mask_t mask) { for (unsigned int j = 0; j < len; j++) @@ -316,7 +311,7 @@ struct hb_buffer_t HB_INTERNAL void merge_clusters_impl (unsigned int start, unsigned int end); HB_INTERNAL void merge_out_clusters (unsigned int start, unsigned int end); /* Merge clusters for deleting current glyph, and skip it. */ - HB_INTERNAL void delete_glyph (void); + HB_INTERNAL void delete_glyph (); void unsafe_to_break (unsigned int start, unsigned int end) @@ -350,7 +345,7 @@ struct hb_buffer_t HB_INTERNAL void sort (unsigned int start, unsigned int end, int(*compar)(const hb_glyph_info_t *, const hb_glyph_info_t *)); - bool messaging (void) { return unlikely (message_func); } + bool messaging () { return unlikely (message_func); } bool message (hb_font_t *font, const char *fmt, ...) HB_PRINTF_FUNC(3, 4) { if (!messaging ()) @@ -398,9 +393,9 @@ struct hb_buffer_t } } - void unsafe_to_break_all (void) + void unsafe_to_break_all () { unsafe_to_break_impl (0, len); } - void safe_to_break_all (void) + void safe_to_break_all () { for (unsigned int i = 0; i < len; i++) info[i].mask &= ~HB_GLYPH_FLAG_UNSAFE_TO_BREAK; diff --git a/src/hb-cache.hh b/src/hb-cache.hh index 436993f..bf26d96 100644 --- a/src/hb-cache.hh +++ b/src/hb-cache.hh @@ -39,10 +39,10 @@ struct hb_cache_t static_assert ((key_bits + value_bits - cache_bits <= 8 * sizeof (hb_atomic_int_t)), ""); static_assert (sizeof (hb_atomic_int_t) == sizeof (unsigned int), ""); - void init (void) { clear (); } - void fini (void) {} + void init () { clear (); } + void fini () {} - void clear (void) + void clear () { for (unsigned i = 0; i < ARRAY_LENGTH (values); i++) values[i].set_relaxed (-1); diff --git a/src/hb-cff-interp-common.hh b/src/hb-cff-interp-common.hh index 90ba8b4..c2be034 100644 --- a/src/hb-cff-interp-common.hh +++ b/src/hb-cff-interp-common.hh @@ -217,23 +217,22 @@ inline unsigned int OpCode_Size (OpCode op) { return Is_OpCode_ESC (op) ? 2: 1; struct Number { - void init (void) { set_real (0.0); } - void fini (void) {} + void init () { set_real (0.0); } + void fini () {} void set_int (int v) { value = (double) v; } - int to_int (void) const { return (int) value; } + int to_int () const { return (int) value; } + void set_fixed (int32_t v) { value = v / 65536.0; } - int32_t to_fixed (void) const - { - return (int32_t)(value * 65536.0); - } - void set_real (double v) { value = v; } - double to_real (void) const { return value; } + int32_t to_fixed () const { return (int32_t) (value * 65536.0); } + + void set_real (double v) { value = v; } + double to_real () const { return value; } - int ceil (void) const { return (int) ::ceil (value); } - int floor (void) const { return (int) ::floor (value); } + int ceil () const { return (int) ::ceil (value); } + int floor () const { return (int) ::floor (value); } - bool in_int_range (void) const + bool in_int_range () const { return ((double) (int16_t) to_int () == value); } bool operator > (const Number &n) const @@ -300,7 +299,7 @@ struct UnsizedByteStr : UnsizedArrayOf struct ByteStr { - ByteStr (void) + ByteStr () : str (&Null(UnsizedByteStr)), len (0) {} ByteStr (const UnsizedByteStr& s, unsigned int l) : str (&s), len (l) {} @@ -333,7 +332,7 @@ struct ByteStr return_trace (true); } - unsigned int get_size (void) const { return len; } + unsigned int get_size () const { return len; } bool check_limit (unsigned int offset, unsigned int count) const { return (offset + count <= len); } @@ -344,17 +343,17 @@ struct ByteStr struct SubByteStr { - SubByteStr (void) + SubByteStr () { init (); } - void init (void) + void init () { str = ByteStr (0); offset = 0; error = false; } - void fini (void) {} + void fini () {} SubByteStr (const ByteStr &str_, unsigned int offset_ = 0) : str (str_), offset (offset_), error (false) {} @@ -376,7 +375,7 @@ struct SubByteStr return str[offset + i]; } - operator ByteStr (void) const { return ByteStr (str, offset, str.len - offset); } + operator ByteStr () const { return ByteStr (str, offset, str.len - offset); } bool avail (unsigned int count=1) const { @@ -395,8 +394,8 @@ struct SubByteStr } } - void set_error (void) { error = true; } - bool in_error (void) const { return error; } + void set_error () { error = true; } + bool in_error () const { return error; } ByteStr str; unsigned int offset; /* beginning of the sub-string within str */ @@ -411,7 +410,7 @@ typedef hb_vector_t ByteStrArray; template struct Stack { - void init (void) + void init () { error = false; count = 0; @@ -421,7 +420,7 @@ struct Stack elements[i].init (); } - void fini (void) + void fini () { elements.fini_deep (); } @@ -440,7 +439,7 @@ struct Stack set_error (); } - ELEM &push (void) + ELEM &push () { if (likely (count < elements.len)) return elements[count++]; @@ -451,7 +450,7 @@ struct Stack } } - ELEM& pop (void) + ELEM& pop () { if (likely (count > 0)) return elements[--count]; @@ -470,7 +469,7 @@ struct Stack set_error (); } - const ELEM& peek (void) + const ELEM& peek () { if (likely (count > 0)) return elements[count-1]; @@ -481,7 +480,7 @@ struct Stack } } - void unpop (void) + void unpop () { if (likely (count < elements.len)) count++; @@ -489,13 +488,13 @@ struct Stack set_error (); } - void clear (void) { count = 0; } + void clear () { count = 0; } - bool in_error (void) const { return (error || elements.in_error ()); } - void set_error (void) { error = true; } + bool in_error () const { return (error || elements.in_error ()); } + void set_error () { error = true; } - unsigned int get_count (void) const { return count; } - bool is_empty (void) const { return count == 0; } + unsigned int get_count () const { return count; } + bool is_empty () const { return count == 0; } static const unsigned int kSizeLimit = LIMIT; @@ -527,19 +526,13 @@ struct ArgStack : Stack n.set_real (v); } - ARG& pop_num (void) - { - return this->pop (); - } + ARG& pop_num () { return this->pop (); } - int pop_int (void) - { - return this->pop ().to_int (); - } + int pop_int () { return this->pop ().to_int (); } - unsigned int pop_uint (void) + unsigned int pop_uint () { - int i = pop_int (); + int i = pop_int (); if (unlikely (i < 0)) { i = 0; @@ -575,8 +568,8 @@ struct ArgStack : Stack /* an operator prefixed by its operands in a byte string */ struct OpStr { - void init (void) {} - void fini (void) {} + void init () {} + void fini () {} OpCode op; ByteStr str; @@ -600,16 +593,12 @@ struct OpSerializer template struct ParsedValues { - void init (void) + void init () { opStart = 0; values.init (); } - - void fini (void) - { - values.fini_deep (); - } + void fini () { values.fini_deep (); } void add_op (OpCode op, const SubByteStr& substr = SubByteStr ()) { @@ -634,7 +623,7 @@ struct ParsedValues return false; } - unsigned get_count (void) const { return values.len; } + unsigned get_count () const { return values.len; } const VAL &get_value (unsigned int i) const { return values[i]; } const VAL &operator [] (unsigned int i) const { return get_value (i); } @@ -651,20 +640,14 @@ struct InterpEnv argStack.init (); error = false; } + void fini () { argStack.fini (); } - void fini (void) - { - argStack.fini (); - } - - bool in_error (void) const - { - return error || substr.in_error () || argStack.in_error (); - } + bool in_error () const + { return error || substr.in_error () || argStack.in_error (); } - void set_error (void) { error = true; } + void set_error () { error = true; } - OpCode fetch_op (void) + OpCode fetch_op () { OpCode op = OpCode_Invalid; if (unlikely (!substr.avail ())) @@ -685,7 +668,7 @@ struct InterpEnv return argStack[i]; } - ARG& pop_arg (void) + ARG& pop_arg () { return argStack.pop (); } @@ -695,7 +678,7 @@ struct InterpEnv argStack.pop (n); } - void clear_args (void) + void clear_args () { pop_n_args (argStack.get_count ()); } @@ -749,9 +732,9 @@ struct OpSet template struct Interpreter { - ~Interpreter(void) { fini (); } + ~Interpreter() { fini (); } - void fini (void) { env.fini (); } + void fini () { env.fini (); } ENV env; }; diff --git a/src/hb-cff-interp-cs-common.hh b/src/hb-cff-interp-cs-common.hh index 8838bf6..e78d557 100644 --- a/src/hb-cff-interp-cs-common.hh +++ b/src/hb-cff-interp-cs-common.hh @@ -48,7 +48,7 @@ struct CallContext subr_num = subr_num_; } - void fini (void) {} + void fini () {} SubByteStr substr; CSType type; @@ -74,10 +74,10 @@ struct BiasedSubrs bias = 32768; } - void fini (void) {} + void fini () {} - unsigned int get_count (void) const { return (subrs == nullptr)? 0: subrs->count; } - unsigned int get_bias (void) const { return bias; } + unsigned int get_count () const { return (subrs == nullptr)? 0: subrs->count; } + unsigned int get_bias () const { return bias; } ByteStr operator [] (unsigned int index) const { @@ -94,7 +94,7 @@ struct BiasedSubrs struct Point { - void init (void) + void init () { x.init (); y.init (); @@ -132,7 +132,7 @@ struct CSInterpEnv : InterpEnv globalSubrs.init (globalSubrs_); localSubrs.init (localSubrs_); } - void fini (void) + void fini () { InterpEnv::fini (); @@ -141,7 +141,7 @@ struct CSInterpEnv : InterpEnv localSubrs.fini (); } - bool in_error (void) const + bool in_error () const { return callStack.in_error () || SUPER::in_error (); } @@ -174,7 +174,7 @@ struct CSInterpEnv : InterpEnv SUPER::substr = context.substr; } - void returnFromSubr (void) + void returnFromSubr () { if (unlikely (SUPER::substr.in_error ())) SUPER::set_error (); @@ -182,7 +182,7 @@ struct CSInterpEnv : InterpEnv SUPER::substr = context.substr; } - void determine_hintmask_size (void) + void determine_hintmask_size () { if (!seen_hintmask) { @@ -193,11 +193,11 @@ struct CSInterpEnv : InterpEnv } void set_endchar (bool endchar_flag_) { endchar_flag = endchar_flag_; } - bool is_endchar (void) const { return endchar_flag; } + bool is_endchar () const { return endchar_flag; } - const Number &get_x (void) const { return pt.x; } - const Number &get_y (void) const { return pt.y; } - const Point &get_pt (void) const { return pt; } + const Number &get_x () const { return pt.x; } + const Number &get_y () const { return pt.y; } + const Point &get_pt () const { return pt; } void moveto (const Point &pt_ ) { pt = pt_; } diff --git a/src/hb-cff-interp-dict-common.hh b/src/hb-cff-interp-dict-common.hh index 8815bbf..91d298c 100644 --- a/src/hb-cff-interp-dict-common.hh +++ b/src/hb-cff-interp-dict-common.hh @@ -37,8 +37,8 @@ using namespace OT; /* an opstr and the parsed out dict value(s) */ struct DictVal : OpStr { - void init (void) { single_val.set_int (0); } - void fini (void) {} + void init () { single_val.set_int (0); } + void fini () {} Number single_val; }; @@ -50,17 +50,13 @@ template struct DictValues : ParsedValues {}; template struct TopDictValues : DictValues { - void init (void) + void init () { DictValues::init (); charStringsOffset = 0; FDArrayOffset = 0; } - - void fini (void) - { - DictValues::fini (); - } + void fini () { DictValues::fini (); } unsigned int calculate_serialized_op_size (const OPSTR& opstr) const { diff --git a/src/hb-cff1-interp-cs.hh b/src/hb-cff1-interp-cs.hh index c4ff351..68e1d81 100644 --- a/src/hb-cff1-interp-cs.hh +++ b/src/hb-cff1-interp-cs.hh @@ -47,7 +47,7 @@ struct CFF1CSInterpEnv : CSInterpEnv in_seac = false; } - void fini (void) { SUPER::fini (); } + void fini () { SUPER::fini (); } void set_width (bool has_width_) { @@ -63,7 +63,7 @@ struct CFF1CSInterpEnv : CSInterpEnv processed_width = true; } - void clear_args (void) + void clear_args () { arg_start = 0; SUPER::clear_args (); diff --git a/src/hb-cff2-interp-cs.hh b/src/hb-cff2-interp-cs.hh index bf482a9..7756ca8 100644 --- a/src/hb-cff2-interp-cs.hh +++ b/src/hb-cff2-interp-cs.hh @@ -35,13 +35,13 @@ using namespace OT; struct BlendArg : Number { - void init (void) + void init () { Number::init (); deltas.init (); } - void fini (void) + void fini () { Number::fini (); deltas.fini_deep (); @@ -61,8 +61,8 @@ struct BlendArg : Number deltas[i] = blends_[i]; } - bool blending (void) const { return deltas.len > 0; } - void reset_blends (void) + bool blending () const { return deltas.len > 0; } + void reset_blends () { numValues = valueIndex = 0; deltas.resize (0); @@ -94,13 +94,13 @@ struct CFF2CSInterpEnv : CSInterpEnv set_ivs (acc.privateDicts[fd].ivs); } - void fini (void) + void fini () { scalars.fini (); SUPER::fini (); } - OpCode fetch_op (void) + OpCode fetch_op () { if (this->substr.avail ()) return SUPER::fetch_op (); @@ -119,14 +119,14 @@ struct CFF2CSInterpEnv : CSInterpEnv return arg; } - const BlendArg& pop_arg (void) + const BlendArg& pop_arg () { BlendArg &arg = argStack.pop (); blend_arg (arg); return arg; } - void process_blend (void) + void process_blend () { if (!seen_blend) { @@ -142,7 +142,7 @@ struct CFF2CSInterpEnv : CSInterpEnv } } - void process_vsindex (void) + void process_vsindex () { unsigned int index = argStack.pop_uint (); if (unlikely (seen_vsindex () || seen_blend)) @@ -156,11 +156,11 @@ struct CFF2CSInterpEnv : CSInterpEnv seen_vsindex_ = true; } - unsigned int get_region_count (void) const { return region_count; } + unsigned int get_region_count () const { return region_count; } void set_region_count (unsigned int region_count_) { region_count = region_count_; } - unsigned int get_ivs (void) const { return ivs; } + unsigned int get_ivs () const { return ivs; } void set_ivs (unsigned int ivs_) { ivs = ivs_; } - bool seen_vsindex (void) const { return seen_vsindex_; } + bool seen_vsindex () const { return seen_vsindex_; } protected: void blend_arg (BlendArg &arg) diff --git a/src/hb-common.cc b/src/hb-common.cc index c64b489..93f5b79 100644 --- a/src/hb-common.cc +++ b/src/hb-common.cc @@ -51,7 +51,7 @@ hb_atomic_int_t _hb_options; void -_hb_options_init (void) +_hb_options_init () { hb_options_union_t u; u.i = 0; @@ -267,7 +267,7 @@ struct hb_language_item_t { return *this; } - void fini (void) { free ((void *) lang); } + void fini () { free ((void *) lang); } }; @@ -277,7 +277,7 @@ static hb_atomic_ptr_t langs; #if HB_USE_ATEXIT static void -free_langs (void) +free_langs () { retry: hb_language_item_t *first_lang = langs; @@ -403,7 +403,7 @@ hb_language_to_string (hb_language_t language) * Since: 0.9.2 **/ hb_language_t -hb_language_get_default (void) +hb_language_get_default () { static hb_atomic_ptr_t default_language; @@ -667,7 +667,7 @@ hb_version (unsigned int *major, * Since: 0.9.2 **/ const char * -hb_version_string (void) +hb_version_string () { return HB_VERSION_STRING; } @@ -780,13 +780,13 @@ parse_uint32 (const char **pp, const char *end, uint32_t *pv) #ifdef USE_XLOCALE #if HB_USE_ATEXIT -static void free_static_C_locale (void); +static void free_static_C_locale (); #endif static struct hb_C_locale_lazy_loader_t : hb_lazy_loader_t { - static HB_LOCALE_T create (void) + static HB_LOCALE_T create () { HB_LOCALE_T C_locale = HB_CREATE_LOCALE ("C"); @@ -800,7 +800,7 @@ static struct hb_C_locale_lazy_loader_t : hb_lazy_loader_t= sizeof (hb_options_union_t)), ""); HB_INTERNAL void -_hb_options_init (void); +_hb_options_init (); extern HB_INTERNAL hb_atomic_int_t _hb_options; static inline hb_options_t -hb_options (void) +hb_options () { /* Make a local copy, so we can access bitfield threadsafely. */ hb_options_union_t u; @@ -284,7 +284,7 @@ struct hb_auto_trace_t _hb_debug_msg_va (what, obj, func, true, plevel ? *plevel : 0, +1, message, ap); va_end (ap); } - ~hb_auto_trace_t (void) + ~hb_auto_trace_t () { _hb_warn_no_return (returned); if (!returned) { diff --git a/src/hb-directwrite.cc b/src/hb-directwrite.cc index ceaffa8..e93cf90 100644 --- a/src/hb-directwrite.cc +++ b/src/hb-directwrite.cc @@ -59,8 +59,8 @@ public: // IUnknown interface IFACEMETHOD (QueryInterface) (IID const& iid, OUT void** ppObject) { return S_OK; } - IFACEMETHOD_ (ULONG, AddRef) (void) { return 1; } - IFACEMETHOD_ (ULONG, Release) (void) { return 1; } + IFACEMETHOD_ (ULONG, AddRef) () { return 1; } + IFACEMETHOD_ (ULONG, Release) () { return 1; } // IDWriteFontFileLoader methods virtual HRESULT STDMETHODCALLTYPE @@ -88,8 +88,8 @@ public: // IUnknown interface IFACEMETHOD (QueryInterface) (IID const& iid, OUT void** ppObject) { return S_OK; } - IFACEMETHOD_ (ULONG, AddRef) (void) { return 1; } - IFACEMETHOD_ (ULONG, Release) (void) { return 1; } + IFACEMETHOD_ (ULONG, AddRef) () { return 1; } + IFACEMETHOD_ (ULONG, Release) () { return 1; } // IDWriteFontFileStream methods virtual HRESULT STDMETHODCALLTYPE @@ -253,8 +253,8 @@ public: IFACEMETHOD (QueryInterface) (IID const& iid, OUT void** ppObject) { return S_OK; } - IFACEMETHOD_ (ULONG, AddRef) (void) { return 1; } - IFACEMETHOD_ (ULONG, Release) (void) { return 1; } + IFACEMETHOD_ (ULONG, AddRef) () { return 1; } + IFACEMETHOD_ (ULONG, Release) () { return 1; } // A single contiguous run of characters containing the same analysis // results. @@ -283,7 +283,7 @@ public: const wchar_t* localeName, DWRITE_READING_DIRECTION readingDirection) : mText (text), mTextLength (textLength), mLocaleName (localeName), mReadingDirection (readingDirection), mCurrentRun (nullptr) {} - ~TextAnalysis (void) + ~TextAnalysis () { // delete runs, except mRunHead which is part of the TextAnalysis object for (Run *run = mRunHead.nextRun; run;) @@ -360,7 +360,7 @@ public: } IFACEMETHODIMP_ (DWRITE_READING_DIRECTION) - GetParagraphReadingDirection (void) { return mReadingDirection; } + GetParagraphReadingDirection () { return mReadingDirection; } IFACEMETHODIMP GetLocaleName (uint32_t textPosition, uint32_t* textLength, wchar_t const** localeName) diff --git a/src/hb-dsalgs.hh b/src/hb-dsalgs.hh index 7273c7e..b56cd74 100644 --- a/src/hb-dsalgs.hh +++ b/src/hb-dsalgs.hh @@ -592,7 +592,7 @@ struct hb_vector_size_t { return process (o); } hb_vector_size_t operator ^ (const hb_vector_size_t &o) const { return process (o); } - hb_vector_size_t operator ~ (void) const + hb_vector_size_t operator ~ () const { hb_vector_size_t r; #if HB_VECTOR_SIZE && 0 diff --git a/src/hb-face.cc b/src/hb-face.cc index d8b5026..4bf84b9 100644 --- a/src/hb-face.cc +++ b/src/hb-face.cc @@ -224,7 +224,7 @@ hb_face_create (hb_blob_t *blob, * Since: 0.9.2 **/ hb_face_t * -hb_face_get_empty (void) +hb_face_get_empty () { return const_cast (&Null(hb_face_t)); } @@ -603,7 +603,7 @@ struct hb_face_builder_data_t }; static hb_face_builder_data_t * -_hb_face_builder_data_create (void) +_hb_face_builder_data_create () { hb_face_builder_data_t *data = (hb_face_builder_data_t *) calloc (1, sizeof (hb_face_builder_data_t)); if (unlikely (!data)) @@ -692,7 +692,7 @@ _hb_face_builder_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void * Since: 1.9.0 **/ hb_face_t * -hb_face_builder_create (void) +hb_face_builder_create () { hb_face_builder_data_t *data = _hb_face_builder_data_create (); if (unlikely (!data)) return hb_face_get_empty (); diff --git a/src/hb-face.hh b/src/hb-face.hh index 014ab3b..68834ba 100644 --- a/src/hb-face.hh +++ b/src/hb-face.hh @@ -81,7 +81,7 @@ struct hb_face_t return blob; } - HB_PURE_FUNC unsigned int get_upem (void) const + HB_PURE_FUNC unsigned int get_upem () const { unsigned int ret = upem.get_relaxed (); if (unlikely (!ret)) @@ -91,7 +91,7 @@ struct hb_face_t return ret; } - unsigned int get_num_glyphs (void) const + unsigned int get_num_glyphs () const { unsigned int ret = num_glyphs.get_relaxed (); if (unlikely (ret == (unsigned int) -1)) @@ -100,8 +100,8 @@ struct hb_face_t } private: - HB_INTERNAL unsigned int load_upem (void) const; - HB_INTERNAL unsigned int load_num_glyphs (void) const; + HB_INTERNAL unsigned int load_upem () const; + HB_INTERNAL unsigned int load_num_glyphs () const; }; DECLARE_NULL_INSTANCE (hb_face_t); diff --git a/src/hb-font.cc b/src/hb-font.cc index 237b2a5..0f0bcad 100644 --- a/src/hb-font.cc +++ b/src/hb-font.cc @@ -523,7 +523,7 @@ static const hb_font_funcs_t _hb_font_funcs_default = { * Since: 0.9.2 **/ hb_font_funcs_t * -hb_font_funcs_create (void) +hb_font_funcs_create () { hb_font_funcs_t *ffuncs; @@ -545,7 +545,7 @@ hb_font_funcs_create (void) * Since: 0.9.2 **/ hb_font_funcs_t * -hb_font_funcs_get_empty (void) +hb_font_funcs_get_empty () { return const_cast (&_hb_font_funcs_default); } @@ -1408,7 +1408,7 @@ hb_font_create_sub_font (hb_font_t *parent) * Since: 0.9.2 **/ hb_font_t * -hb_font_get_empty (void) +hb_font_get_empty () { return const_cast (&Null(hb_font_t)); } diff --git a/src/hb-font.hh b/src/hb-font.hh index 5ae6cae..aaa0fd9 100644 --- a/src/hb-font.hh +++ b/src/hb-font.hh @@ -86,7 +86,7 @@ struct hb_font_funcs_t #define HB_FONT_FUNC_IMPLEMENT(name) +1 HB_FONT_FUNCS_IMPLEMENT_CALLBACKS #undef HB_FONT_FUNC_IMPLEMENT - ]) (void); + ]) (); } get; }; DECLARE_NULL_INSTANCE (hb_font_funcs_t); @@ -176,14 +176,14 @@ struct hb_font_t /* has_* ... */ #define HB_FONT_FUNC_IMPLEMENT(name) \ bool \ - has_##name##_func (void) \ + has_##name##_func () \ { \ hb_font_funcs_t *funcs = this->klass; \ unsigned int i = offsetof (hb_font_funcs_t::get_t::get_funcs_t, name) / sizeof (funcs->get.array[0]); \ return has_func (i); \ } \ bool \ - has_##name##_func_set (void) \ + has_##name##_func_set () \ { \ hb_font_funcs_t *funcs = this->klass; \ unsigned int i = offsetof (hb_font_funcs_t::get_t::get_funcs_t, name) / sizeof (funcs->get.array[0]); \ diff --git a/src/hb-ft.cc b/src/hb-ft.cc index 1aeaa4a..5f6e380 100644 --- a/src/hb-ft.cc +++ b/src/hb-ft.cc @@ -479,12 +479,12 @@ hb_ft_get_font_h_extents (hb_font_t *font HB_UNUSED, } #if HB_USE_ATEXIT -static void free_static_ft_funcs (void); +static void free_static_ft_funcs (); #endif static struct hb_ft_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t { - static hb_font_funcs_t *create (void) + static hb_font_funcs_t *create () { hb_font_funcs_t *funcs = hb_font_funcs_create (); @@ -514,14 +514,14 @@ static struct hb_ft_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t { - static FT_Library create (void) + static FT_Library create () { FT_Library l; if (FT_Init_FreeType (&l)) @@ -767,7 +767,7 @@ static struct hb_ft_library_lazy_loader_t : hb_lazy_loader_t { - static hb_unicode_funcs_t *create (void) + static hb_unicode_funcs_t *create () { hb_unicode_funcs_t *funcs = hb_unicode_funcs_create (nullptr); @@ -365,14 +365,14 @@ static struct hb_glib_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader #if HB_USE_ATEXIT static -void free_static_glib_funcs (void) +void free_static_glib_funcs () { static_glib_funcs.free_instance (); } #endif hb_unicode_funcs_t * -hb_glib_get_unicode_funcs (void) +hb_glib_get_unicode_funcs () { return static_glib_funcs.get_unconst (); } diff --git a/src/hb-gobject-enums.cc.tmpl b/src/hb-gobject-enums.cc.tmpl index e056df4..e3a9a6b 100644 --- a/src/hb-gobject-enums.cc.tmpl +++ b/src/hb-gobject-enums.cc.tmpl @@ -46,7 +46,7 @@ /*** BEGIN value-header ***/ GType -@enum_name@_get_type (void) +@enum_name@_get_type () { static gsize type_id = 0; diff --git a/src/hb-gobject-enums.h.tmpl b/src/hb-gobject-enums.h.tmpl index 606727c..7ef9dfc 100644 --- a/src/hb-gobject-enums.h.tmpl +++ b/src/hb-gobject-enums.h.tmpl @@ -43,7 +43,7 @@ HB_BEGIN_DECLS /*** BEGIN value-header ***/ HB_EXTERN GType -@enum_name@_get_type (void) G_GNUC_CONST; +@enum_name@_get_type () G_GNUC_CONST; #define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ()) /*** END value-header ***/ diff --git a/src/hb-gobject-structs.cc b/src/hb-gobject-structs.cc index 23ca436..846240e 100644 --- a/src/hb-gobject-structs.cc +++ b/src/hb-gobject-structs.cc @@ -51,7 +51,7 @@ #define HB_DEFINE_BOXED_TYPE(name,copy_func,free_func) \ GType \ -hb_gobject_##name##_get_type (void) \ +hb_gobject_##name##_get_type () \ { \ static gsize type_id = 0; \ if (g_once_init_enter (&type_id)) { \ diff --git a/src/hb-icu.cc b/src/hb-icu.cc index ea44d65..c26c91d 100644 --- a/src/hb-icu.cc +++ b/src/hb-icu.cc @@ -302,12 +302,12 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED, #if HB_USE_ATEXIT -static void free_static_icu_funcs (void); +static void free_static_icu_funcs (); #endif static struct hb_icu_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader_t { - static hb_unicode_funcs_t *create (void) + static hb_unicode_funcs_t *create () { void *user_data = nullptr; #if U_ICU_VERSION_MAJOR_NUM >= 49 @@ -337,14 +337,14 @@ static struct hb_icu_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader_ #if HB_USE_ATEXIT static -void free_static_icu_funcs (void) +void free_static_icu_funcs () { static_icu_funcs.free_instance (); } #endif hb_unicode_funcs_t * -hb_icu_get_unicode_funcs (void) +hb_icu_get_unicode_funcs () { return static_icu_funcs.get_unconst (); } diff --git a/src/hb-iter.hh b/src/hb-iter.hh index 5bf770e..a269968 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -72,21 +72,18 @@ struct Iter array (array_), length (length_) {} /* Emptiness. */ - explicit_operator bool (void) const { return length; } + explicit_operator bool () const { return length; } /* Current item. */ - T &operator * (void) + T &operator * () { if (unlikely (!length)) return CrapOrNull(T); return *array; } - T &operator -> (void) - { - return (operator *); - } + T &operator -> () { return (operator *); } /* Next. */ - Iter & operator ++ (void) + Iter & operator ++ () { if (unlikely (!length)) return *this; array++; @@ -102,7 +99,7 @@ struct Iter } /* Some iterators might implement len(). */ - unsigned int len (void) const { return length; } + unsigned int len () const { return length; } /* Some iterators might implement fast-forward. * Only implement it if it's constant-time. */ @@ -129,7 +126,7 @@ struct Iter /* XXX Remove * Just to test these compile. */ static inline void -m (void) +m () { const int src[10] = {}; int dst[20]; diff --git a/src/hb-machinery.hh b/src/hb-machinery.hh index 82144db..2e0a074 100644 --- a/src/hb-machinery.hh +++ b/src/hb-machinery.hh @@ -82,14 +82,14 @@ static inline Type& StructAfter(TObject &X) /* Check _assertion in a method environment */ #define _DEFINE_INSTANCE_ASSERTION1(_line, _assertion) \ - void _instance_assertion_on_line_##_line (void) const \ + void _instance_assertion_on_line_##_line () const \ { static_assert ((_assertion), ""); } # define _DEFINE_INSTANCE_ASSERTION0(_line, _assertion) _DEFINE_INSTANCE_ASSERTION1 (_line, _assertion) # define DEFINE_INSTANCE_ASSERTION(_assertion) _DEFINE_INSTANCE_ASSERTION0 (__LINE__, _assertion) /* Check that _code compiles in a method environment */ #define _DEFINE_COMPILES_ASSERTION1(_line, _code) \ - void _compiles_assertion_on_line_##_line (void) const \ + void _compiles_assertion_on_line_##_line () const \ { _code; } # define _DEFINE_COMPILES_ASSERTION0(_line, _code) _DEFINE_COMPILES_ASSERTION1 (_line, _code) # define DEFINE_COMPILES_ASSERTION(_code) _DEFINE_COMPILES_ASSERTION0 (__LINE__, _code) @@ -97,7 +97,7 @@ static inline Type& StructAfter(TObject &X) #define DEFINE_SIZE_STATIC(size) \ DEFINE_INSTANCE_ASSERTION (sizeof (*this) == (size)) \ - unsigned int get_size (void) const { return (size); } \ + unsigned int get_size () const { return (size); } \ enum { null_size = (size) }; \ enum { min_size = (size) }; \ enum { static_size = (size) } @@ -124,7 +124,7 @@ static inline Type& StructAfter(TObject &X) enum { min_size = (size) } #define DEFINE_SIZE_ARRAY_SIZED(size, array) \ - unsigned int get_size (void) const { return (size - (array).min_size + (array).get_size ()); } \ + unsigned int get_size () const { return (size - (array).min_size + (array).get_size ()); } \ DEFINE_SIZE_ARRAY(size, array) @@ -139,7 +139,7 @@ struct hb_dispatch_context_t typedef Return return_t; template bool may_dispatch (const T *obj HB_UNUSED, const F *format HB_UNUSED) { return true; } - static return_t no_dispatch_return_value (void) { return Context::default_return_value (); } + static return_t no_dispatch_return_value () { return Context::default_return_value (); } static bool stop_sublookup_iteration (const return_t r HB_UNUSED) { return false; } }; @@ -227,7 +227,7 @@ struct hb_dispatch_context_t struct hb_sanitize_context_t : hb_dispatch_context_t { - hb_sanitize_context_t (void) : + hb_sanitize_context_t () : debug_depth (0), start (nullptr), end (nullptr), max_ops (0), @@ -236,14 +236,14 @@ struct hb_sanitize_context_t : num_glyphs (65536), num_glyphs_set (false) {} - const char *get_name (void) { return "SANITIZE"; } + const char *get_name () { return "SANITIZE"; } template bool may_dispatch (const T *obj HB_UNUSED, const F *format) { return format->sanitize (this); } template return_t dispatch (const T &obj) { return obj.sanitize (this); } - static return_t default_return_value (void) { return true; } - static return_t no_dispatch_return_value (void) { return false; } + static return_t default_return_value () { return true; } + static return_t no_dispatch_return_value () { return false; } bool stop_sublookup_iteration (const return_t r) const { return !r; } void init (hb_blob_t *b) @@ -257,7 +257,7 @@ struct hb_sanitize_context_t : num_glyphs = num_glyphs_; num_glyphs_set = true; } - unsigned int get_num_glyphs (void) { return num_glyphs; } + unsigned int get_num_glyphs () { return num_glyphs; } void set_max_ops (int max_ops_) { max_ops = max_ops_; } @@ -281,14 +281,14 @@ struct hb_sanitize_context_t : } } - void reset_object (void) + void reset_object () { this->start = this->blob->data; this->end = this->start + this->blob->length; assert (this->start <= this->end); /* Must not overflow. */ } - void start_processing (void) + void start_processing () { reset_object (); this->max_ops = MAX ((unsigned int) (this->end - this->start) * HB_SANITIZE_MAX_OPS_FACTOR, @@ -302,7 +302,7 @@ struct hb_sanitize_context_t : (unsigned long) (this->end - this->start)); } - void end_processing (void) + void end_processing () { DEBUG_MSG_LEVEL (SANITIZE, this->start, 0, -1, "end [%p..%p] %u edit requests", @@ -488,7 +488,7 @@ struct hb_sanitize_with_object_t hb_sanitize_with_object_t (hb_sanitize_context_t *c, const T& obj) : c (c) { c->set_object (obj); } - ~hb_sanitize_with_object_t (void) + ~hb_sanitize_with_object_t () { c->reset_object (); } private: @@ -509,7 +509,7 @@ struct hb_serialize_context_t reset (); } - void reset (void) + void reset () { this->ran_out_of_room = false; this->head = this->start; @@ -520,7 +520,7 @@ struct hb_serialize_context_t /* To be called around main operation. */ template - Type *start_serialize (void) + Type *start_serialize () { DEBUG_MSG_LEVEL (SERIALIZE, this->start, 0, +1, "start [%p..%p] (%lu bytes)", @@ -529,7 +529,7 @@ struct hb_serialize_context_t return start_embed (); } - void end_serialize (void) + void end_serialize () { DEBUG_MSG_LEVEL (SERIALIZE, this->start, 0, -1, "end [%p..%p] serialized %d bytes; %s", @@ -538,7 +538,7 @@ struct hb_serialize_context_t this->ran_out_of_room ? "RAN OUT OF ROOM" : "did not ran out of room"); } - unsigned int length (void) const { return this->head - this->start; } + unsigned int length () const { return this->head - this->start; } void align (unsigned int alignment) { @@ -568,7 +568,7 @@ struct hb_serialize_context_t } template - Type *allocate_min (void) + Type *allocate_min () { return this->allocate_size (Type::min_size); } @@ -601,7 +601,7 @@ struct hb_serialize_context_t /* Output routines. */ template - Type *copy (void) const + Type *copy () const { assert (!this->ran_out_of_room); unsigned int len = this->head - this->start; @@ -610,7 +610,7 @@ struct hb_serialize_context_t memcpy (p, this->start, len); return reinterpret_cast (p); } - hb_bytes_t copy_bytes (void) const + hb_bytes_t copy_bytes () const { assert (!this->ran_out_of_room); unsigned int len = this->head - this->start; @@ -621,7 +621,7 @@ struct hb_serialize_context_t return hb_bytes_t (); return hb_bytes_t ((char *) p, len); } - hb_blob_t *copy_blob (void) const + hb_blob_t *copy_blob () const { assert (!this->ran_out_of_room); return hb_blob_create (this->start, @@ -649,10 +649,8 @@ struct BEInt { public: typedef Type type; - void set (Type V) - { v = V; } - operator Type (void) const - { return v; } + void set (Type V) { v = V; } + operator Type () const { return v; } private: uint8_t v; }; template @@ -665,7 +663,7 @@ struct BEInt v[0] = (V >> 8) & 0xFF; v[1] = (V ) & 0xFF; } - operator Type (void) const + operator Type () const { #if (defined(__GNUC__) && __GNUC__ >= 5) || defined(__clang__) /* Spoon-feed the compiler a big-endian integer with alignment 1. @@ -689,7 +687,7 @@ struct BEInt v[1] = (V >> 8) & 0xFF; v[2] = (V ) & 0xFF; } - operator Type (void) const + operator Type () const { return (v[0] << 16) + (v[1] << 8) @@ -709,7 +707,7 @@ struct BEInt v[2] = (V >> 8) & 0xFF; v[3] = (V ) & 0xFF; } - operator Type (void) const + operator Type () const { return (v[0] << 24) + (v[1] << 16) @@ -729,23 +727,21 @@ struct hb_data_wrapper_t { static_assert (WheresData > 0, ""); - Data * get_data (void) const - { - return *(((Data **) (void *) this) - WheresData); - } + Data * get_data () const + { return *(((Data **) (void *) this) - WheresData); } - bool is_inert (void) const { return !get_data (); } + bool is_inert () const { return !get_data (); } template - Stored * call_create (void) const { return Subclass::create (get_data ()); } + Stored * call_create () const { return Subclass::create (get_data ()); } }; template <> struct hb_data_wrapper_t { - bool is_inert (void) const { return false; } + bool is_inert () const { return false; } template - Stored * call_create (void) const { return Funcs::create (); } + Stored * call_create () const { return Funcs::create (); } }; template struct hb_non_void_t { typedef T1 value; }; @@ -762,13 +758,11 @@ struct hb_lazy_loader_t : hb_data_wrapper_t hb_lazy_loader_t >::value Funcs; - void init0 (void) {} /* Init, when memory is already set to 0. No-op for us. */ - void init (void) { instance.set_relaxed (nullptr); } - void fini (void) - { - do_destroy (instance.get ()); - } - void free_instance (void) + void init0 () {} /* Init, when memory is already set to 0. No-op for us. */ + void init () { instance.set_relaxed (nullptr); } + void fini () { do_destroy (instance.get ()); } + + void free_instance () { retry: Stored *p = instance.get (); @@ -783,13 +777,13 @@ struct hb_lazy_loader_t : hb_data_wrapper_t Funcs::destroy (p); } - const Returned * operator -> (void) const { return get (); } - const Returned & operator * (void) const { return *get (); } - explicit_operator bool (void) const + const Returned * operator -> () const { return get (); } + const Returned & operator * () const { return *get (); } + explicit_operator bool () const { return get_stored () != Funcs::get_null (); } - template operator const C * (void) const { return get (); } + template operator const C * () const { return get (); } - Stored * get_stored (void) const + Stored * get_stored () const { retry: Stored *p = this->instance.get (); @@ -810,7 +804,7 @@ struct hb_lazy_loader_t : hb_data_wrapper_t } return p; } - Stored * get_stored_relaxed (void) const + Stored * get_stored_relaxed () const { return this->instance.get_relaxed (); } @@ -821,15 +815,15 @@ struct hb_lazy_loader_t : hb_data_wrapper_t return this->instance.cmpexch (current, value); } - const Returned * get (void) const { return Funcs::convert (get_stored ()); } - const Returned * get_relaxed (void) const { return Funcs::convert (get_stored_relaxed ()); } - Returned * get_unconst (void) const { return const_cast (Funcs::convert (get_stored ())); } + const Returned * get () const { return Funcs::convert (get_stored ()); } + const Returned * get_relaxed () const { return Funcs::convert (get_stored_relaxed ()); } + Returned * get_unconst () const { return const_cast (Funcs::convert (get_stored ())); } /* To be possibly overloaded by subclasses. */ static Returned* convert (Stored *p) { return p; } /* By default null/init/fini the object. */ - static const Stored* get_null (void) { return &Null(Stored); } + static const Stored* get_null () { return &Null(Stored); } static Stored *create (Data *data) { Stored *p = (Stored *) calloc (1, sizeof (Stored)); @@ -837,7 +831,7 @@ struct hb_lazy_loader_t : hb_data_wrapper_t p->init (data); return p; } - static Stored *create (void) + static Stored *create () { Stored *p = (Stored *) calloc (1, sizeof (Stored)); if (likely (p)) @@ -869,51 +863,33 @@ struct hb_table_lazy_loader_t : hb_lazy_loader_t { static hb_blob_t *create (hb_face_t *face) - { - return hb_sanitize_context_t ().reference_table (face); - } - static void destroy (hb_blob_t *p) - { - hb_blob_destroy (p); - } - static const hb_blob_t *get_null (void) - { - return hb_blob_get_empty (); - } + { return hb_sanitize_context_t ().reference_table (face); } + static void destroy (hb_blob_t *p) { hb_blob_destroy (p); } + + static const hb_blob_t *get_null () + { return hb_blob_get_empty (); } + static const T* convert (const hb_blob_t *blob) - { - return blob->as (); - } + { return blob->as (); } - hb_blob_t* get_blob (void) const - { - return this->get_stored (); - } + hb_blob_t* get_blob () const { return this->get_stored (); } }; template struct hb_font_funcs_lazy_loader_t : hb_lazy_loader_t { static void destroy (hb_font_funcs_t *p) - { - hb_font_funcs_destroy (p); - } - static const hb_font_funcs_t *get_null (void) - { - return hb_font_funcs_get_empty (); - } + { hb_font_funcs_destroy (p); } + static const hb_font_funcs_t *get_null () + { return hb_font_funcs_get_empty (); } }; template struct hb_unicode_funcs_lazy_loader_t : hb_lazy_loader_t { static void destroy (hb_unicode_funcs_t *p) - { - hb_unicode_funcs_destroy (p); - } - static const hb_unicode_funcs_t *get_null (void) - { - return hb_unicode_funcs_get_empty (); - } + { hb_unicode_funcs_destroy (p); } + static const hb_unicode_funcs_t *get_null () + { return hb_unicode_funcs_get_empty (); } }; diff --git a/src/hb-map.cc b/src/hb-map.cc index 067a2b3..a2c770c 100644 --- a/src/hb-map.cc +++ b/src/hb-map.cc @@ -47,7 +47,7 @@ * Since: 1.7.7 **/ hb_map_t * -hb_map_create (void) +hb_map_create () { hb_map_t *map; @@ -67,7 +67,7 @@ hb_map_create (void) * Since: 1.7.7 **/ hb_map_t * -hb_map_get_empty (void) +hb_map_get_empty () { return const_cast (&Null(hb_map_t)); } diff --git a/src/hb-map.hh b/src/hb-map.hh index 9415a30..ec8de2a 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -45,16 +45,16 @@ inline uint32_t Hash (const T &v) struct hb_map_t { HB_NO_COPY_ASSIGN (hb_map_t); - hb_map_t (void) { init (); } - ~hb_map_t (void) { fini (); } + hb_map_t () { init (); } + ~hb_map_t () { fini (); } struct item_t { hb_codepoint_t key; hb_codepoint_t value; - bool is_unused (void) const { return key == INVALID; } - bool is_tombstone (void) const { return key != INVALID && value == INVALID; } + bool is_unused () const { return key == INVALID; } + bool is_tombstone () const { return key != INVALID && value == INVALID; } }; hb_object_header_t header; @@ -65,7 +65,7 @@ struct hb_map_t unsigned int prime; item_t *items; - void init_shallow (void) + void init_shallow () { successful = true; population = occupancy = 0; @@ -73,24 +73,24 @@ struct hb_map_t prime = 0; items = nullptr; } - void init (void) + void init () { hb_object_init (this); init_shallow (); } - void fini_shallow (void) + void fini_shallow () { free (items); items = nullptr; } - void fini (void) + void fini () { population = occupancy = 0; hb_object_fini (this); fini_shallow (); } - bool resize (void) + bool resize () { if (unlikely (!successful)) return false; @@ -166,15 +166,15 @@ struct hb_map_t enum { INVALID = HB_MAP_VALUE_INVALID }; - void clear (void) + void clear () { memset (items, 0xFF, ((size_t) mask + 1) * sizeof (item_t)); population = occupancy = 0; } - bool is_empty (void) const { return population == 0; } + bool is_empty () const { return population == 0; } - unsigned int get_population (void) const { return population; } + unsigned int get_population () const { return population; } protected: diff --git a/src/hb-mutex.hh b/src/hb-mutex.hh index 45ef676..35f1fde 100644 --- a/src/hb-mutex.hh +++ b/src/hb-mutex.hh @@ -131,16 +131,16 @@ struct hb_mutex_t hb_mutex_impl_t m; - void init (void) { hb_mutex_impl_init (&m); } - void lock (void) { hb_mutex_impl_lock (&m); } - void unlock (void) { hb_mutex_impl_unlock (&m); } - void fini (void) { hb_mutex_impl_finish (&m); } + void init () { hb_mutex_impl_init (&m); } + void lock () { hb_mutex_impl_lock (&m); } + void unlock () { hb_mutex_impl_unlock (&m); } + void fini () { hb_mutex_impl_finish (&m); } }; struct hb_lock_t { hb_lock_t (hb_mutex_t &mutex_) : mutex (mutex_) { mutex.lock (); } - ~hb_lock_t (void) { mutex.unlock (); } + ~hb_lock_t () { mutex.unlock (); } private: hb_mutex_t &mutex; }; diff --git a/src/hb-null.hh b/src/hb-null.hh index f7b3f7c..7ea2bab 100644 --- a/src/hb-null.hh +++ b/src/hb-null.hh @@ -83,7 +83,7 @@ hb_vector_size_impl_t const _hb_NullPool[(HB_NULL_POOL_SIZE + sizeof (hb_vector_ /* Generic nul-content Null objects. */ template -static inline Type const & Null (void) { +static inline Type const & Null () { static_assert (hb_null_size (Type) <= HB_NULL_POOL_SIZE, "Increase HB_NULL_POOL_SIZE."); return *reinterpret_cast (_hb_NullPool); } @@ -91,7 +91,7 @@ template struct NullHelper { typedef typename hb_remove_const (typename hb_remove_reference (QType)) Type; - static const Type & get_null (void) { return Null (); } + static const Type & get_null () { return Null (); } }; #define Null(Type) NullHelper::get_null () @@ -100,7 +100,7 @@ struct NullHelper } /* Close namespace. */ \ extern HB_INTERNAL const unsigned char _hb_Null_##Namespace##_##Type[Namespace::Type::null_size]; \ template <> \ - /*static*/ inline const Namespace::Type& Null (void) { \ + /*static*/ inline const Namespace::Type& Null () { \ return *reinterpret_cast (_hb_Null_##Namespace##_##Type); \ } \ namespace Namespace { \ @@ -112,7 +112,7 @@ struct NullHelper #define DECLARE_NULL_INSTANCE(Type) \ extern HB_INTERNAL const Type _hb_Null_##Type; \ template <> \ - /*static*/ inline const Type& Null (void) { \ + /*static*/ inline const Type& Null () { \ return _hb_Null_##Type; \ } \ static_assert (true, "Just so we take semicolon after.") @@ -130,7 +130,7 @@ extern HB_INTERNAL /* CRAP pool: Common Region for Access Protection. */ template -static inline Type& Crap (void) { +static inline Type& Crap () { static_assert (hb_null_size (Type) <= HB_NULL_POOL_SIZE, "Increase HB_NULL_POOL_SIZE."); Type *obj = reinterpret_cast (_hb_CrapPool); memcpy (obj, &Null(Type), sizeof (*obj)); @@ -140,17 +140,17 @@ template struct CrapHelper { typedef typename hb_remove_const (typename hb_remove_reference (QType)) Type; - static Type & get_crap (void) { return Crap (); } + static Type & get_crap () { return Crap (); } }; #define Crap(Type) CrapHelper::get_crap () template struct CrapOrNullHelper { - static Type & get (void) { return Crap(Type); } + static Type & get () { return Crap(Type); } }; template struct CrapOrNullHelper { - static const Type & get (void) { return Null(Type); } + static const Type & get () { return Null(Type); } }; #define CrapOrNull(Type) CrapOrNullHelper::get () @@ -165,15 +165,15 @@ struct hb_nonnull_ptr_t typedef typename hb_remove_pointer (P) T; hb_nonnull_ptr_t (T *v_ = nullptr) : v (v_) {} - T * operator = (T *v_) { return v = v_; } - T * operator -> (void) const { return get (); } - T & operator * (void) const { return *get (); } - T ** operator & (void) const { return &v; } + T * operator = (T *v_) { return v = v_; } + T * operator -> () const { return get (); } + T & operator * () const { return *get (); } + T ** operator & () const { return &v; } /* Only auto-cast to const types. */ - template operator const C * (void) const { return get (); } - operator const char * (void) const { return (const char *) get (); } - T * get (void) const { return v ? v : const_cast (&Null(T)); } - T * get_raw (void) const { return v; } + template operator const C * () const { return get (); } + operator const char * () const { return (const char *) get (); } + T * get () const { return v ? v : const_cast (&Null(T)); } + T * get_raw () const { return v; } T *v; }; diff --git a/src/hb-object.hh b/src/hb-object.hh index 96d686f..6eb1173 100644 --- a/src/hb-object.hh +++ b/src/hb-object.hh @@ -47,7 +47,7 @@ struct hb_lockable_set_t { hb_vector_t items; - void init (void) { items.init (); } + void init () { items.init (); } template item_t *replace_or_insert (T v, lock_t &l, bool replace) @@ -146,13 +146,13 @@ struct hb_reference_count_t mutable hb_atomic_int_t ref_count; void init (int v = 1) { ref_count.set_relaxed (v); } - int get_relaxed (void) const { return ref_count.get_relaxed (); } - int inc (void) const { return ref_count.inc (); } - int dec (void) const { return ref_count.dec (); } - void fini (void) { ref_count.set_relaxed (HB_REFERENCE_COUNT_POISON_VALUE); } + int get_relaxed () const { return ref_count.get_relaxed (); } + int inc () const { return ref_count.inc (); } + int dec () const { return ref_count.dec (); } + void fini () { ref_count.set_relaxed (HB_REFERENCE_COUNT_POISON_VALUE); } - bool is_inert (void) const { return ref_count.get_relaxed () == HB_REFERENCE_COUNT_INERT_VALUE; } - bool is_valid (void) const { return ref_count.get_relaxed () > 0; } + bool is_inert () const { return ref_count.get_relaxed () == HB_REFERENCE_COUNT_INERT_VALUE; } + bool is_valid () const { return ref_count.get_relaxed () > 0; } }; @@ -168,13 +168,13 @@ struct hb_user_data_array_t bool operator == (hb_user_data_key_t *other_key) const { return key == other_key; } bool operator == (hb_user_data_item_t &other) const { return key == other.key; } - void fini (void) { if (destroy) destroy (data); } + void fini () { if (destroy) destroy (data); } }; hb_mutex_t lock; hb_lockable_set_t items; - void init (void) { lock.init (); items.init (); } + void init () { lock.init (); items.init (); } HB_INTERNAL bool set (hb_user_data_key_t *key, void * data, @@ -183,7 +183,7 @@ struct hb_user_data_array_t HB_INTERNAL void *get (hb_user_data_key_t *key); - void fini (void) { items.fini (lock); lock.fini (); } + void fini () { items.fini (lock); lock.fini (); } }; @@ -219,7 +219,7 @@ static inline void hb_object_trace (const Type *obj, const char *function) } template -static inline Type *hb_object_create (void) +static inline Type *hb_object_create () { Type *obj = (Type *) calloc (1, sizeof (Type)); diff --git a/src/hb-open-file.hh b/src/hb-open-file.hh index 3847cc3..2d0ee9e 100644 --- a/src/hb-open-file.hh +++ b/src/hb-open-file.hh @@ -54,8 +54,7 @@ struct TTCHeader; typedef struct TableRecord { - int cmp (Tag t) const - { return -t.cmp (tag); } + int cmp (Tag t) const { return -t.cmp (tag); } static int cmp (const void *pa, const void *pb) { @@ -83,12 +82,9 @@ typedef struct OffsetTable { friend struct OpenTypeFontFile; - unsigned int get_table_count (void) const - { return tables.len; } + unsigned int get_table_count () const { return tables.len; } const TableRecord& get_table (unsigned int i) const - { - return tables[i]; - } + { return tables[i]; } unsigned int get_table_tags (unsigned int start_offset, unsigned int *table_count, /* IN/OUT */ hb_tag_t *table_tags /* OUT */) const @@ -214,7 +210,7 @@ struct TTCHeaderVersion1 { friend struct TTCHeader; - unsigned int get_face_count (void) const { return table.len; } + unsigned int get_face_count () const { return table.len; } const OpenTypeFontFace& get_face (unsigned int i) const { return this+table[i]; } bool sanitize (hb_sanitize_context_t *c) const @@ -240,7 +236,7 @@ struct TTCHeader private: - unsigned int get_face_count (void) const + unsigned int get_face_count () const { switch (u.header.version.major) { case 2: /* version 2 is compatible with version 1 */ @@ -316,16 +312,14 @@ struct ResourceRecord struct ResourceTypeRecord { - unsigned int get_resource_count (void) const + unsigned int get_resource_count () const { return tag == HB_TAG_sfnt ? resCountM1 + 1 : 0; } - bool is_sfnt (void) const { return tag == HB_TAG_sfnt; } + bool is_sfnt () const { return tag == HB_TAG_sfnt; } const ResourceRecord& get_resource_record (unsigned int i, const void *type_base) const - { - return (type_base+resourcesZ).as_array (get_resource_count ())[i]; - } + { return (type_base+resourcesZ).as_array (get_resource_count ())[i]; } bool sanitize (hb_sanitize_context_t *c, const void *type_base, @@ -350,7 +344,7 @@ struct ResourceTypeRecord struct ResourceMap { - unsigned int get_face_count (void) const + unsigned int get_face_count () const { unsigned int count = get_type_count (); for (unsigned int i = 0; i < count; i++) @@ -387,7 +381,7 @@ struct ResourceMap } private: - unsigned int get_type_count (void) const { return (this+typeList).lenM1 + 1; } + unsigned int get_type_count () const { return (this+typeList).lenM1 + 1; } const ResourceTypeRecord& get_type_record (unsigned int i) const { return (this+typeList)[i]; } @@ -408,7 +402,7 @@ struct ResourceMap struct ResourceForkHeader { - unsigned int get_face_count (void) const + unsigned int get_face_count () const { return (this+map).get_face_count (); } const OpenTypeFontFace& get_face (unsigned int idx, @@ -456,9 +450,9 @@ struct OpenTypeFontFile Typ1Tag = HB_TAG ('t','y','p','1') /* Obsolete Apple Type1 font in SFNT container */ }; - hb_tag_t get_tag (void) const { return u.tag; } + hb_tag_t get_tag () const { return u.tag; } - unsigned int get_face_count (void) const + unsigned int get_face_count () const { switch (u.tag) { case CFFTag: /* All the non-collection tags */ diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh index 0d57e45..d46df01 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh @@ -64,7 +64,7 @@ struct IntType typedef typename hb_signedness_int::value>::value wide_type; void set (wide_type i) { v.set (i); } - operator wide_type (void) const { return v; } + operator wide_type () const { return v; } bool operator == (const IntType &o) const { return (Type) v == (Type) o.v; } bool operator != (const IntType &o) const { return !(*this == o); } static int cmp (const IntType *a, const IntType *b) { return b->cmp (*a); } @@ -111,7 +111,7 @@ typedef HBUINT16 UFWORD; struct F2DOT14 : HBINT16 { // 16384 means 1<<14 - float to_float (void) const { return ((int32_t) v) / 16384.f; } + float to_float () const { return ((int32_t) v) / 16384.f; } void set_float (float f) { v.set (round (f * 16384.f)); } public: DEFINE_SIZE_STATIC (2); @@ -121,7 +121,7 @@ struct F2DOT14 : HBINT16 struct Fixed : HBINT32 { // 65536 means 1<<16 - float to_float (void) const { return ((int32_t) v) / 65536.f; } + float to_float () const { return ((int32_t) v) / 65536.f; } void set_float (float f) { v.set (round (f * 65536.f)); } public: DEFINE_SIZE_STATIC (4); @@ -148,8 +148,8 @@ struct LONGDATETIME struct Tag : HBUINT32 { /* What the char* converters return is NOT nul-terminated. Print using "%.4s" */ - operator const char* (void) const { return reinterpret_cast (&this->v); } - operator char* (void) { return reinterpret_cast (&this->v); } + operator const char* () const { return reinterpret_cast (&this->v); } + operator char* () { return reinterpret_cast (&this->v); } public: DEFINE_SIZE_STATIC (4); }; @@ -171,7 +171,7 @@ struct Offset : Type { typedef Type type; - bool is_null (void) const { return has_null && 0 == *this; } + bool is_null () const { return has_null && 0 == *this; } void *serialize (hb_serialize_context_t *c, const void *base) { @@ -219,7 +219,7 @@ struct CheckSum : HBUINT32 template struct FixedVersion { - uint32_t to_int (void) const { return (major << (sizeof (FixedType) * 8)) + minor; } + uint32_t to_int () const { return (major << (sizeof (FixedType) * 8)) + minor; } bool sanitize (hb_sanitize_context_t *c) const { @@ -242,14 +242,14 @@ struct FixedVersion template struct _hb_has_null { - static const Type *get_null (void) { return nullptr; } - static Type *get_crap (void) { return nullptr; } + static const Type *get_null () { return nullptr; } + static Type *get_crap () { return nullptr; } }; template struct _hb_has_null { - static const Type *get_null (void) { return &Null(Type); } - static Type *get_crap (void) { return &Crap(Type); } + static const Type *get_null () { return &Null(Type); } + static Type *get_crap () { return &Crap(Type); } }; template @@ -375,14 +375,14 @@ struct UnsizedArrayOf unsigned int get_size (unsigned int len) const { return len * Type::static_size; } - template operator T * (void) { return arrayZ; } - template operator const T * (void) const { return arrayZ; } + template operator T * () { return arrayZ; } + template operator const T * () const { return arrayZ; } hb_array_t as_array (unsigned int len) { return hb_array (arrayZ, len); } hb_array_t as_array (unsigned int len) const { return hb_array (arrayZ, len); } - operator hb_array_t (void) { return as_array (); } - operator hb_array_t (void) const { return as_array (); } + operator hb_array_t () { return as_array (); } + operator hb_array_t () const { return as_array (); } template Type &lsearch (unsigned int len, const T &x, Type ¬_found = Crap (Type)) @@ -487,8 +487,8 @@ struct SortedUnsizedArrayOf : UnsizedArrayOf { return hb_sorted_array (this->arrayZ, len); } hb_sorted_array_t as_array (unsigned int len) const { return hb_sorted_array (this->arrayZ, len); } - operator hb_sorted_array_t (void) { return as_array (); } - operator hb_sorted_array_t (void) const { return as_array (); } + operator hb_sorted_array_t () { return as_array (); } + operator hb_sorted_array_t () const { return as_array (); } template Type &bsearch (unsigned int len, const T &x, Type ¬_found = Crap (Type)) @@ -526,14 +526,14 @@ struct ArrayOf return arrayZ[i]; } - unsigned int get_size (void) const + unsigned int get_size () const { return len.static_size + len * Type::static_size; } - hb_array_t as_array (void) + hb_array_t as_array () { return hb_array (arrayZ, len); } - hb_array_t as_array (void) const + hb_array_t as_array () const { return hb_array (arrayZ, len); } - operator hb_array_t (void) { return as_array (); } + operator hb_array_t (void) { return as_array (); } operator hb_array_t (void) const { return as_array (); } hb_array_t sub_array (unsigned int start_offset, unsigned int count) const @@ -697,7 +697,7 @@ struct HeadlessArrayOf if (unlikely (i >= lenP1 || !i)) return Crap (Type); return arrayZ[i-1]; } - unsigned int get_size (void) const + unsigned int get_size () const { return lenP1.static_size + (lenP1 ? lenP1 - 1 : 0) * Type::static_size; } bool serialize (hb_serialize_context_t *c, @@ -765,7 +765,7 @@ struct ArrayOfM1 if (unlikely (i > lenM1)) return Crap (Type); return arrayZ[i]; } - unsigned int get_size (void) const + unsigned int get_size () const { return lenM1.static_size + (lenM1 + 1) * Type::static_size; } template @@ -799,12 +799,12 @@ struct ArrayOfM1 template struct SortedArrayOf : ArrayOf { - hb_sorted_array_t as_array (void) + hb_sorted_array_t as_array () { return hb_sorted_array (this->arrayZ, this->len); } - hb_sorted_array_t as_array (void) const + hb_sorted_array_t as_array () const { return hb_sorted_array (this->arrayZ, this->len); } - operator hb_sorted_array_t (void) { return as_array (); } - operator hb_sorted_array_t (void) const { return as_array (); } + operator hb_sorted_array_t () { return as_array (); } + operator hb_sorted_array_t () const { return as_array (); } hb_array_t sub_array (unsigned int start_offset, unsigned int count) const { return as_array ().sub_array (start_offset, count);} @@ -835,7 +835,7 @@ struct SortedArrayOf : ArrayOf template struct BinSearchHeader { - operator uint32_t (void) const { return len; } + operator uint32_t () const { return len; } bool sanitize (hb_sanitize_context_t *c) const { @@ -897,7 +897,7 @@ struct VarSizedBinSearchArrayOf HB_NO_CREATE_COPY_ASSIGN_TEMPLATE (VarSizedBinSearchArrayOf, Type); - bool last_is_terminator (void) const + bool last_is_terminator () const { if (unlikely (!header.nUnits)) return false; @@ -925,11 +925,9 @@ struct VarSizedBinSearchArrayOf if (unlikely (i >= get_length ())) return Crap (Type); return StructAtOffset (&bytesZ, i * header.unitSize); } - unsigned int get_length (void) const - { - return header.nUnits - last_is_terminator (); - } - unsigned int get_size (void) const + unsigned int get_length () const + { return header.nUnits - last_is_terminator (); } + unsigned int get_size () const { return header.static_size + header.nUnits * header.unitSize; } bool sanitize (hb_sanitize_context_t *c) const diff --git a/src/hb-ot-cff-common.hh b/src/hb-ot-cff-common.hh index 6b51738..db04b3e 100644 --- a/src/hb-ot-cff-common.hh +++ b/src/hb-ot-cff-common.hh @@ -64,9 +64,9 @@ struct code_pair typedef hb_vector_t StrBuff; struct StrBuffArray : hb_vector_t { - void fini (void) { SUPER::fini_deep (); } + void fini () { SUPER::fini_deep (); } - unsigned int total_size (void) const + unsigned int total_size () const { unsigned int size = 0; for (unsigned int i = 0; i < len; i++) @@ -94,7 +94,7 @@ struct CFFIndex static unsigned int calculate_offset_array_size (unsigned int offSize, unsigned int count) { return offSize * (count + 1); } - unsigned int offset_array_size (void) const + unsigned int offset_array_size () const { return calculate_offset_array_size (offSize, count); } static unsigned int calculate_serialized_size (unsigned int offSize, unsigned int count, unsigned int dataSize) @@ -205,11 +205,10 @@ struct CFFIndex return 0; } - const char *data_base (void) const + const char *data_base () const { return (const char *)this + min_size + offset_array_size (); } - unsigned int data_size (void) const - { return HBINT8::static_size; } + unsigned int data_size () const { return HBINT8::static_size; } ByteStr operator [] (unsigned int index) const { @@ -219,7 +218,7 @@ struct CFFIndex return Null(ByteStr); } - unsigned int get_size (void) const + unsigned int get_size () const { if (this != &Null(CFFIndex)) { @@ -233,7 +232,7 @@ struct CFFIndex } protected: - unsigned int max_offset (void) const + unsigned int max_offset () const { unsigned int max = 0; for (unsigned int i = 0; i < count + 1u; i++) @@ -407,7 +406,7 @@ struct PrivateDict : Dict {}; struct TableInfo { - void init (void) { offSize = offset = size = 0; } + void init () { offSize = offset = size = 0; } unsigned int offset; unsigned int size; @@ -418,9 +417,9 @@ struct TableInfo * set to CFF_UNDEF_CODE if excluded from subset */ struct Remap : hb_vector_t { - void init (void) { SUPER::init (); } + void init () { SUPER::init (); } - void fini (void) { SUPER::fini (); } + void fini () { SUPER::fini (); } bool reset (unsigned int size) { @@ -456,8 +455,7 @@ struct Remap : hb_vector_t return (*this)[i]; } - hb_codepoint_t get_count (void) const - { return count; } + hb_codepoint_t get_count () const { return count; } protected: hb_codepoint_t count; @@ -603,7 +601,7 @@ struct FDSelect3_4_Range { template struct FDSelect3_4 { - unsigned int get_size (void) const + unsigned int get_size () const { return GID_TYPE::static_size * 2 + FDSelect3_4_Range::static_size * nRanges; } bool sanitize (hb_sanitize_context_t *c, unsigned int fdcount) const @@ -635,8 +633,8 @@ struct FDSelect3_4 { return (hb_codepoint_t)ranges[i - 1].fd; } - GID_TYPE &sentinel (void) { return StructAfter (ranges[nRanges - 1]); } - const GID_TYPE &sentinel (void) const { return StructAfter (ranges[nRanges - 1]); } + GID_TYPE &sentinel () { return StructAfter (ranges[nRanges - 1]); } + const GID_TYPE &sentinel () const { return StructAfter (ranges[nRanges - 1]); } GID_TYPE nRanges; FDSelect3_4_Range ranges[VAR]; diff --git a/src/hb-ot-cff1-table.cc b/src/hb-ot-cff1-table.cc index b1c78bc..51cecb6 100644 --- a/src/hb-ot-cff1-table.cc +++ b/src/hb-ot-cff1-table.cc @@ -163,7 +163,7 @@ hb_codepoint_t OT::cff1::lookup_standard_encoding_for_sid (hb_codepoint_t code) struct Bounds { - void init (void) + void init () { min.set_int (0x7FFFFFFF, 0x7FFFFFFF); max.set_int (-0x80000000, -0x80000000); @@ -199,10 +199,8 @@ struct Bounds } } - bool empty (void) const - { - return (min.x >= max.x) || (min.y >= max.y); - } + bool empty () const + { return (min.x >= max.x) || (min.y >= max.y); } Point min; Point max; @@ -217,9 +215,9 @@ struct ExtentsParam bounds.init (); } - void start_path (void) { path_open = true; } - void end_path (void) { path_open = false; } - bool is_path_open (void) const { return path_open; } + void start_path () { path_open = true; } + void end_path () { path_open = false; } + bool is_path_open () const { return path_open; } bool path_open; Bounds bounds; @@ -345,8 +343,7 @@ struct GetSeacParam accent = 0; } - bool has_seac (void) const - { return base && accent; } + bool has_seac () const { return base && accent; } const OT::cff1::accelerator_t *cff; hb_codepoint_t base; diff --git a/src/hb-ot-cff1-table.hh b/src/hb-ot-cff1-table.hh index 7977793..72dc0ef 100644 --- a/src/hb-ot-cff1-table.hh +++ b/src/hb-ot-cff1-table.hh @@ -74,7 +74,7 @@ struct Encoding0 { return CFF_UNDEF_CODE; } - unsigned int get_size (void) const + unsigned int get_size () const { return HBUINT8::static_size * (nCodes + 1); } HBUINT8 nCodes; @@ -97,7 +97,7 @@ struct Encoding1_Range { }; struct Encoding1 { - unsigned int get_size (void) const + unsigned int get_size () const { return HBUINT8::static_size + Encoding1_Range::static_size * nRanges; } bool sanitize (hb_sanitize_context_t *c) const @@ -154,7 +154,7 @@ struct CFF1SuppEncData { codes.push (supps[i].code); } - unsigned int get_size (void) const + unsigned int get_size () const { return HBUINT8::static_size + SuppEncoding::static_size * nSups; } HBUINT8 nSups; @@ -257,7 +257,7 @@ struct Encoding { return size; } - unsigned int get_size (void) const + unsigned int get_size () const { unsigned int size = min_size; if (table_format () == 0) @@ -277,8 +277,8 @@ struct Encoding { return u.format1.get_code (glyph); } - uint8_t table_format (void) const { return (format & 0x7F); } - bool has_supplement (void) const { return (format & 0x80) != 0; } + uint8_t table_format () const { return (format & 0x7F); } + bool has_supplement () const { return (format & 0x80) != 0; } void get_supplement_codes (hb_codepoint_t sid, hb_vector_t &codes) const { @@ -288,7 +288,7 @@ struct Encoding { } protected: - const CFF1SuppEncData &suppEncData (void) const + const CFF1SuppEncData &suppEncData () const { if ((format & 0x7F) == 0) return StructAfter (u.format0.codes[u.format0.nCodes-1]); @@ -619,7 +619,7 @@ struct CFF1StringIndex : CFF1Index struct CFF1TopDictInterpEnv : NumInterpEnv { - CFF1TopDictInterpEnv (void) + CFF1TopDictInterpEnv () : NumInterpEnv(), prev_offset(0), last_offset(0) {} unsigned int prev_offset; @@ -645,7 +645,7 @@ struct NameDictValues ValCount }; - void init (void) + void init () { for (unsigned int i = 0; i < ValCount; i++) values[i] = CFF_UNDEF_SID; @@ -692,7 +692,7 @@ struct CFF1TopDictVal : OpStr struct CFF1TopDictValues : TopDictValues { - void init (void) + void init () { TopDictValues::init (); @@ -704,9 +704,9 @@ struct CFF1TopDictValues : TopDictValues FDSelectOffset = 0; privateDictInfo.init (); } - void fini (void) { TopDictValues::fini (); } + void fini () { TopDictValues::fini (); } - bool is_CID (void) const + bool is_CID () const { return nameSIDs[NameDictValues::registry] != CFF_UNDEF_SID; } NameDictValues nameSIDs; @@ -809,17 +809,13 @@ struct CFF1TopDictOpSet : TopDictOpSet struct CFF1FontDictValues : DictValues { - void init (void) + void init () { DictValues::init (); privateDictInfo.init (); fontName = CFF_UNDEF_SID; } - - void fini (void) - { - DictValues::fini (); - } + void fini () { DictValues::fini (); } TableInfo privateDictInfo; unsigned int fontName; @@ -859,19 +855,15 @@ struct CFF1FontDictOpSet : DictOpSet template struct CFF1PrivateDictValues_Base : DictValues { - void init (void) + void init () { DictValues::init (); subrsOffset = 0; localSubrs = &Null(CFF1Subrs); } + void fini () { DictValues::fini (); } - void fini (void) - { - DictValues::fini (); - } - - unsigned int calculate_serialized_size (void) const + unsigned int calculate_serialized_size () const { unsigned int size = 0; for (unsigned int i = 0; i < DictValues::get_count; i++) @@ -1132,7 +1124,7 @@ struct cff1 } } - void fini (void) + void fini () { sc.end_processing (); topDict.fini (); @@ -1142,10 +1134,10 @@ struct cff1 blob = nullptr; } - bool is_valid (void) const { return blob != nullptr; } - bool is_CID (void) const { return topDict.is_CID (); } + bool is_valid () const { return blob != nullptr; } + bool is_CID () const { return topDict.is_CID (); } - bool is_predef_charset (void) const { return topDict.CharsetOffset <= ExpertSubsetCharset; } + bool is_predef_charset () const { return topDict.CharsetOffset <= ExpertSubsetCharset; } unsigned int std_code_to_glyph (hb_codepoint_t code) const { @@ -1211,7 +1203,7 @@ struct cff1 } } - bool is_predef_encoding (void) const { return topDict.EncodingOffset <= ExpertEncoding; } + bool is_predef_encoding () const { return topDict.EncodingOffset <= ExpertEncoding; } hb_codepoint_t glyph_to_code (hb_codepoint_t glyph) const { diff --git a/src/hb-ot-cff2-table.cc b/src/hb-ot-cff2-table.cc index 8885e0a..7188a3b 100644 --- a/src/hb-ot-cff2-table.cc +++ b/src/hb-ot-cff2-table.cc @@ -31,7 +31,7 @@ using namespace CFF; struct ExtentsParam { - void init (void) + void init () { path_open = false; min_x.set_int (0x7FFFFFFF); @@ -40,9 +40,9 @@ struct ExtentsParam max_y.set_int (-0x80000000); } - void start_path (void) { path_open = true; } - void end_path (void) { path_open = false; } - bool is_path_open (void) const { return path_open; } + void start_path () { path_open = true; } + void end_path () { path_open = false; } + bool is_path_open () const { return path_open; } void update_bounds (const Point &pt) { diff --git a/src/hb-ot-cff2-table.hh b/src/hb-ot-cff2-table.hh index 4aff933..25c41ef 100644 --- a/src/hb-ot-cff2-table.hh +++ b/src/hb-ot-cff2-table.hh @@ -128,7 +128,7 @@ struct CFF2VariationStore return_trace (true); } - unsigned int get_size (void) const { return HBUINT16::static_size + size; } + unsigned int get_size () const { return HBUINT16::static_size + size; } HBUINT16 size; VariationStore varStore; @@ -138,15 +138,15 @@ struct CFF2VariationStore struct CFF2TopDictValues : TopDictValues<> { - void init (void) + void init () { TopDictValues<>::init (); vstoreOffset = 0; FDSelectOffset = 0; } - void fini (void) { TopDictValues<>::fini (); } + void fini () { TopDictValues<>::fini (); } - unsigned int calculate_serialized_size (void) const + unsigned int calculate_serialized_size () const { unsigned int size = 0; for (unsigned int i = 0; i < get_count (); i++) @@ -209,16 +209,12 @@ struct CFF2TopDictOpSet : TopDictOpSet<> struct CFF2FontDictValues : DictValues { - void init (void) + void init () { DictValues::init (); privateDictInfo.init (); } - - void fini (void) - { - DictValues::fini (); - } + void fini () { DictValues::fini (); } TableInfo privateDictInfo; }; @@ -252,20 +248,16 @@ struct CFF2FontDictOpSet : DictOpSet template struct CFF2PrivateDictValues_Base : DictValues { - void init (void) + void init () { DictValues::init (); subrsOffset = 0; localSubrs = &Null(CFF2Subrs); ivs = 0; } + void fini () { DictValues::fini (); } - void fini (void) - { - DictValues::fini (); - } - - unsigned int calculate_serialized_size (void) const + unsigned int calculate_serialized_size () const { unsigned int size = 0; for (unsigned int i = 0; i < DictValues::get_count; i++) @@ -293,7 +285,7 @@ struct CFF2PrivDictInterpEnv : NumInterpEnv seen_vsindex = false; } - void process_vsindex (void) + void process_vsindex () { if (likely (!seen_vsindex)) { @@ -302,7 +294,7 @@ struct CFF2PrivDictInterpEnv : NumInterpEnv seen_vsindex = true; } - unsigned int get_ivs (void) const { return ivs; } + unsigned int get_ivs () const { return ivs; } void set_ivs (unsigned int ivs_) { ivs = ivs_; } protected: @@ -501,7 +493,7 @@ struct cff2 } } - void fini (void) + void fini () { sc.end_processing (); fontDicts.fini_deep (); @@ -510,7 +502,7 @@ struct cff2 blob = nullptr; } - bool is_valid (void) const { return blob != nullptr; } + bool is_valid () const { return blob != nullptr; } protected: hb_blob_t *blob; diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh index 2efb45f..0ea5daa 100644 --- a/src/hb-ot-cmap-table.hh +++ b/src/hb-ot-cmap-table.hh @@ -226,9 +226,9 @@ struct CmapSubtableFormat4 struct accelerator_t { - accelerator_t (void) {} + accelerator_t () {} accelerator_t (const CmapSubtableFormat4 *subtable) { init (subtable); } - ~accelerator_t (void) { fini (); } + ~accelerator_t () { fini (); } void init (const CmapSubtableFormat4 *subtable) { @@ -240,7 +240,7 @@ struct CmapSubtableFormat4 glyphIdArray = idRangeOffset + segCount; glyphIdArrayLength = (subtable->length - 16 - 8 * segCount) / 2; } - void fini (void) {} + void fini () {} bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const { @@ -846,7 +846,7 @@ struct cmap struct subset_plan { - size_t final_size (void) const + size_t final_size () const { return 4 // header + 8 * 3 // 3 EncodingRecord @@ -1031,7 +1031,7 @@ struct cmap } } - void fini (void) { this->table.destroy (); } + void fini () { this->table.destroy (); } bool get_nominal_glyph (hb_codepoint_t unicode, hb_codepoint_t *glyph) const diff --git a/src/hb-ot-color-cbdt-table.hh b/src/hb-ot-color-cbdt-table.hh index 8fa0ca2..b1971a7 100644 --- a/src/hb-ot-color-cbdt-table.hh +++ b/src/hb-ot-color-cbdt-table.hh @@ -390,7 +390,7 @@ struct CBDT upem = hb_face_get_upem (face); } - void fini (void) + void fini () { this->cblc.destroy (); this->cbdt.destroy (); @@ -505,7 +505,7 @@ struct CBDT return hb_blob_get_empty (); } - bool has_data (void) const { return cbdt.get_length (); } + bool has_data () const { return cbdt.get_length (); } private: hb_blob_ptr_t cblc; diff --git a/src/hb-ot-color-colr-table.hh b/src/hb-ot-color-colr-table.hh index 8213f9d..3883604 100644 --- a/src/hb-ot-color-colr-table.hh +++ b/src/hb-ot-color-colr-table.hh @@ -89,7 +89,7 @@ struct COLR { enum { tableTag = HB_OT_TAG_COLR }; - bool has_data (void) const { return numBaseGlyphs; } + bool has_data () const { return numBaseGlyphs; } unsigned int get_glyph_layers (hb_codepoint_t glyph, unsigned int start_offset, diff --git a/src/hb-ot-color-cpal-table.hh b/src/hb-ot-color-cpal-table.hh index 31e0648..bd57d8a 100644 --- a/src/hb-ot-color-cpal-table.hh +++ b/src/hb-ot-color-cpal-table.hh @@ -109,13 +109,13 @@ struct CPAL { enum { tableTag = HB_OT_TAG_CPAL }; - bool has_data (void) const { return numPalettes; } + bool has_data () const { return numPalettes; } - unsigned int get_size (void) const + unsigned int get_size () const { return min_size + numPalettes * sizeof (colorRecordIndicesZ[0]); } - unsigned int get_palette_count (void) const { return numPalettes; } - unsigned int get_color_count (void) const { return numColors; } + unsigned int get_palette_count () const { return numPalettes; } + unsigned int get_color_count () const { return numColors; } hb_ot_color_palette_flags_t get_palette_flags (unsigned int palette_index) const { return v1 ().get_palette_flags (this, palette_index, numPalettes); } @@ -153,7 +153,7 @@ struct CPAL } private: - const CPALV1Tail& v1 (void) const + const CPALV1Tail& v1 () const { if (version == 0) return Null(CPALV1Tail); return StructAfter (*this); diff --git a/src/hb-ot-color-sbix-table.hh b/src/hb-ot-color-sbix-table.hh index bbfd9c0..ed93d65 100644 --- a/src/hb-ot-color-sbix-table.hh +++ b/src/hb-ot-color-sbix-table.hh @@ -132,7 +132,7 @@ struct sbix { enum { tableTag = HB_OT_TAG_sbix }; - bool has_data (void) const { return version; } + bool has_data () const { return version; } const SBIXStrike &get_strike (unsigned int i) const { return this+strikes[i]; } @@ -143,14 +143,13 @@ struct sbix table = hb_sanitize_context_t().reference_table (face); num_glyphs = face->get_num_glyphs (); } + void fini () { table.destroy (); } - void fini (void) { table.destroy (); } - - bool has_data (void) const { return table->has_data (); } + bool has_data () const { return table->has_data (); } bool get_extents (hb_font_t *font, - hb_codepoint_t glyph, - hb_glyph_extents_t *extents) const + hb_codepoint_t glyph, + hb_glyph_extents_t *extents) const { /* We only support PNG right now, and following function checks type. */ return get_png_extents (font, glyph, extents); diff --git a/src/hb-ot-color-svg-table.hh b/src/hb-ot-color-svg-table.hh index b636e44..554453f 100644 --- a/src/hb-ot-color-svg-table.hh +++ b/src/hb-ot-color-svg-table.hh @@ -75,14 +75,13 @@ struct SVG { enum { tableTag = HB_OT_TAG_SVG }; - bool has_data (void) const { return svgDocEntries; } + bool has_data () const { return svgDocEntries; } struct accelerator_t { void init (hb_face_t *face) { table = hb_sanitize_context_t().reference_table (face); } - - void fini (void) { table.destroy (); } + void fini () { table.destroy (); } hb_blob_t *reference_blob_for_glyph (hb_codepoint_t glyph_id) const { @@ -90,7 +89,7 @@ struct SVG table->svgDocEntries); } - bool has_data (void) const { return table->has_data (); } + bool has_data () const { return table->has_data (); } private: hb_blob_ptr_t table; diff --git a/src/hb-ot-face.cc b/src/hb-ot-face.cc index 9188f53..9b17526 100644 --- a/src/hb-ot-face.cc +++ b/src/hb-ot-face.cc @@ -51,7 +51,7 @@ void hb_ot_face_t::init0 (hb_face_t *face) #undef HB_OT_ACCELERATOR #undef HB_OT_TABLE } -void hb_ot_face_t::fini (void) +void hb_ot_face_t::fini () { #define HB_OT_TABLE(Namespace, Type) Type.fini (); #define HB_OT_ACCELERATOR(Namespace, Type) HB_OT_TABLE (Namespace, Type) diff --git a/src/hb-ot-face.hh b/src/hb-ot-face.hh index 27042c1..7f47ba6 100644 --- a/src/hb-ot-face.hh +++ b/src/hb-ot-face.hh @@ -92,7 +92,7 @@ HB_OT_TABLES struct hb_ot_face_t { HB_INTERNAL void init0 (hb_face_t *face); - HB_INTERNAL void fini (void); + HB_INTERNAL void fini (); #define HB_OT_TABLE_ORDER(Namespace, Type) \ HB_PASTE (ORDER_, HB_PASTE (Namespace, HB_PASTE (_, Type))) diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc index 6b59cb5..c080f0f 100644 --- a/src/hb-ot-font.cc +++ b/src/hb-ot-font.cc @@ -250,12 +250,12 @@ hb_ot_get_font_v_extents (hb_font_t *font, } #if HB_USE_ATEXIT -static void free_static_ot_funcs (void); +static void free_static_ot_funcs (); #endif static struct hb_ot_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t { - static hb_font_funcs_t *create (void) + static hb_font_funcs_t *create () { hb_font_funcs_t *funcs = hb_font_funcs_create (); @@ -285,14 +285,14 @@ static struct hb_ot_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_tflags & CompositeGlyphHeader::MORE_COMPONENTS) { @@ -244,7 +244,7 @@ struct glyf num_glyphs = MAX (1u, loca_table.get_length () / (short_offset ? 2 : 4)) - 1; } - void fini (void) + void fini () { loca_table.destroy (); glyf_table.destroy (); diff --git a/src/hb-ot-hdmx-table.hh b/src/hb-ot-hdmx-table.hh index 1e9e27e..48421ee 100644 --- a/src/hb-ot-hdmx-table.hh +++ b/src/hb-ot-hdmx-table.hh @@ -56,7 +56,7 @@ struct DeviceRecord this->subset_plan = subset_plan; } - unsigned int len (void) const + unsigned int len () const { return this->subset_plan->glyphs.len; } const HBUINT8* operator [] (unsigned int i) const @@ -121,7 +121,7 @@ struct hdmx { enum { tableTag = HB_OT_TAG_hdmx }; - unsigned int get_size (void) const + unsigned int get_size () const { return min_size + numRecords * sizeDeviceRecord; } const DeviceRecord& operator [] (unsigned int i) const diff --git a/src/hb-ot-head-table.hh b/src/hb-ot-head-table.hh index 70aadba..41062ca 100644 --- a/src/hb-ot-head-table.hh +++ b/src/hb-ot-head-table.hh @@ -47,7 +47,7 @@ struct head enum { tableTag = HB_OT_TAG_head }; - unsigned int get_upem (void) const + unsigned int get_upem () const { unsigned int upem = unitsPerEm; /* If no valid head table found, assume 1000, which matches typical Type1 usage. */ @@ -63,9 +63,9 @@ struct head CONDENSED = 1u<<5 }; - bool is_bold (void) const { return macStyle & BOLD; } - bool is_italic (void) const { return macStyle & ITALIC; } - bool is_condensed (void) const { return macStyle & CONDENSED; } + bool is_bold () const { return macStyle & BOLD; } + bool is_italic () const { return macStyle & ITALIC; } + bool is_condensed () const { return macStyle & CONDENSED; } bool sanitize (hb_sanitize_context_t *c) const { diff --git a/src/hb-ot-hmtx-table.hh b/src/hb-ot-hmtx-table.hh index ba9f083..fa74a0e 100644 --- a/src/hb-ot-hmtx-table.hh +++ b/src/hb-ot-hmtx-table.hh @@ -234,7 +234,7 @@ struct hmtxvmtx var_table = hb_sanitize_context_t().reference_table (face, T::variationsTag); } - void fini (void) + void fini () { table.destroy (); var_table.destroy (); diff --git a/src/hb-ot-kern-table.hh b/src/hb-ot-kern-table.hh index 86b4eb6..5e75d08 100644 --- a/src/hb-ot-kern-table.hh +++ b/src/hb-ot-kern-table.hh @@ -109,8 +109,8 @@ struct KernSubTableFormat3 template struct KernSubTable { - unsigned int get_size (void) const { return u.header.length; } - unsigned int get_type (void) const { return u.header.format; } + unsigned int get_size () const { return u.header.length; } + unsigned int get_type () const { return u.header.format; } int get_kerning (hb_codepoint_t left, hb_codepoint_t right) const { @@ -163,8 +163,8 @@ struct KernOTSubTableHeader enum { apple = false }; typedef AAT::ObsoleteTypes Types; - unsigned int tuple_count (void) const { return 0; } - bool is_horizontal (void) const { return (coverage & Horizontal); } + unsigned int tuple_count () const { return 0; } + bool is_horizontal () const { return (coverage & Horizontal); } enum Coverage { @@ -218,8 +218,8 @@ struct KernAATSubTableHeader enum { apple = true }; typedef AAT::ObsoleteTypes Types; - unsigned int tuple_count (void) const { return 0; } - bool is_horizontal (void) const { return !(coverage & Vertical); } + unsigned int tuple_count () const { return 0; } + bool is_horizontal () const { return !(coverage & Vertical); } enum Coverage { @@ -271,10 +271,10 @@ struct kern { enum { tableTag = HB_OT_TAG_kern }; - bool has_data (void) const { return u.version32; } - unsigned int get_type (void) const { return u.major; } + bool has_data () const { return u.version32; } + unsigned int get_type () const { return u.major; } - bool has_state_machine (void) const + bool has_state_machine () const { switch (get_type ()) { case 0: return u.ot.has_state_machine (); @@ -283,7 +283,7 @@ struct kern } } - bool has_cross_stream (void) const + bool has_cross_stream () const { switch (get_type ()) { case 0: return u.ot.has_cross_stream (); diff --git a/src/hb-ot-layout-base-table.hh b/src/hb-ot-layout-base-table.hh index cc6c350..6c39932 100644 --- a/src/hb-ot-layout-base-table.hh +++ b/src/hb-ot-layout-base-table.hh @@ -44,7 +44,7 @@ namespace OT { struct BaseCoordFormat1 { - hb_position_t get_coord (void) const { return coordinate; } + hb_position_t get_coord () const { return coordinate; } bool sanitize (hb_sanitize_context_t *c) const { @@ -61,7 +61,7 @@ struct BaseCoordFormat1 struct BaseCoordFormat2 { - hb_position_t get_coord (void) const + hb_position_t get_coord () const { /* TODO */ return coordinate; @@ -280,7 +280,7 @@ struct BaseLangSysRecord 0; } - const MinMax &get_min_max (void) const + const MinMax &get_min_max () const { return this+minMax; } bool sanitize (hb_sanitize_context_t *c, const void *base) const @@ -315,7 +315,7 @@ struct BaseScript const BaseCoord &get_base_coord (int baseline_tag_index) const { return (this+baseValues).get_base_coord (baseline_tag_index); } - bool is_empty (void) const { return !baseValues; } + bool is_empty () const { return !baseValues; } bool sanitize (hb_sanitize_context_t *c) const { @@ -469,7 +469,7 @@ struct BASE const Axis &get_axis (hb_direction_t direction) const { return HB_DIRECTION_IS_VERTICAL (direction) ? this+vAxis : this+hAxis; } - const VariationStore &get_var_store (void) const + const VariationStore &get_var_store () const { return version.to_int () < 0x00010001u ? Null (VariationStore) : this+varStore; } bool get_baseline (hb_font_t *font, diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index d96e34c..97f5e97 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -211,7 +211,7 @@ struct Feature; struct LangSys { - unsigned int get_feature_count (void) const + unsigned int get_feature_count () const { return featureIndex.len; } hb_tag_t get_feature_index (unsigned int i) const { return featureIndex[i]; } @@ -222,8 +222,8 @@ struct LangSys void add_feature_indexes_to (hb_set_t *feature_indexes) const { featureIndex.add_indexes_to (feature_indexes); } - bool has_required_feature (void) const { return reqFeatureIndex != 0xFFFFu; } - unsigned int get_required_feature_index (void) const + bool has_required_feature () const { return reqFeatureIndex != 0xFFFFu; } + unsigned int get_required_feature_index () const { if (reqFeatureIndex == 0xFFFFu) return Index::NOT_FOUND_INDEX; @@ -256,7 +256,7 @@ DECLARE_NULL_NAMESPACE_BYTES (OT, LangSys); struct Script { - unsigned int get_lang_sys_count (void) const + unsigned int get_lang_sys_count () const { return langSys.len; } const Tag& get_lang_sys_tag (unsigned int i) const { return langSys.get_tag (i); } @@ -272,8 +272,8 @@ struct Script bool find_lang_sys_index (hb_tag_t tag, unsigned int *index) const { return langSys.find_index (tag, index); } - bool has_default_lang_sys (void) const { return defaultLangSys != 0; } - const LangSys& get_default_lang_sys (void) const { return this+defaultLangSys; } + bool has_default_lang_sys () const { return defaultLangSys != 0; } + const LangSys& get_default_lang_sys () const { return this+defaultLangSys; } bool subset (hb_subset_context_t *c) const { @@ -543,7 +543,7 @@ struct FeatureParams struct Feature { - unsigned int get_lookup_count (void) const + unsigned int get_lookup_count () const { return lookupIndex.len; } hb_tag_t get_lookup_index (unsigned int i) const { return lookupIndex[i]; } @@ -554,7 +554,7 @@ struct Feature void add_lookup_indexes_to (hb_set_t *lookup_indexes) const { lookupIndex.add_indexes_to (lookup_indexes); } - const FeatureParams &get_feature_params (void) const + const FeatureParams &get_feature_params () const { return this+featureParams; } bool subset (hb_subset_context_t *c) const @@ -646,20 +646,20 @@ namespace OT { struct Lookup { - unsigned int get_subtable_count (void) const { return subTable.len; } + unsigned int get_subtable_count () const { return subTable.len; } template const TSubTable& get_subtable (unsigned int i) const { return this+CastR > (subTable)[i]; } template - const OffsetArrayOf& get_subtables (void) const + const OffsetArrayOf& get_subtables () const { return CastR > (subTable); } template - OffsetArrayOf& get_subtables (void) + OffsetArrayOf& get_subtables () { return CastR > (subTable); } - unsigned int get_size (void) const + unsigned int get_size () const { const HBUINT16 &markFilteringSet = StructAfter (subTable); if (lookupFlag & LookupFlag::UseMarkFilteringSet) @@ -667,12 +667,12 @@ struct Lookup return (const char *) &markFilteringSet - (const char *) this; } - unsigned int get_type (void) const { return lookupType; } + unsigned int get_type () const { return lookupType; } /* lookup_props is a 32-bit integer where the lower 16-bit is LookupFlag and * higher 16-bit is mark-filtering-set if the lookup uses one. * Not to be confused with glyph_props which is very similar. */ - uint32_t get_props (void) const + uint32_t get_props () const { unsigned int flag = lookupFlag; if (unlikely (flag & LookupFlag::UseMarkFilteringSet)) @@ -868,11 +868,11 @@ struct CoverageFormat1 /* Older compilers need this to be public. */ struct Iter { void init (const struct CoverageFormat1 &c_) { c = &c_; i = 0; } - void fini (void) {} - bool more (void) { return i < c->glyphArray.len; } - void next (void) { i++; } - hb_codepoint_t get_glyph (void) { return c->glyphArray[i]; } - unsigned int get_coverage (void) { return i; } + void fini () {} + bool more () { return i < c->glyphArray.len; } + void next () { i++; } + hb_codepoint_t get_glyph () { return c->glyphArray[i]; } + unsigned int get_coverage () { return i; } private: const struct CoverageFormat1 *c; @@ -995,9 +995,9 @@ struct CoverageFormat2 i = c->rangeRecord.len; } } - void fini (void) {} - bool more (void) { return i < c->rangeRecord.len; } - void next (void) + void fini () {} + bool more () { return i < c->rangeRecord.len; } + void next () { if (j >= c->rangeRecord[i].end) { @@ -1019,8 +1019,8 @@ struct CoverageFormat2 coverage++; j++; } - hb_codepoint_t get_glyph (void) { return j; } - unsigned int get_coverage (void) { return coverage; } + hb_codepoint_t get_glyph () { return j; } + unsigned int get_coverage () { return coverage; } private: const struct CoverageFormat2 *c; @@ -1128,7 +1128,7 @@ struct Coverage default: return; } } - bool more (void) + bool more () { switch (format) { @@ -1137,7 +1137,7 @@ struct Coverage default:return false; } } - void next (void) + void next () { switch (format) { @@ -1146,7 +1146,7 @@ struct Coverage default: break; } } - hb_codepoint_t get_glyph (void) + hb_codepoint_t get_glyph () { switch (format) { @@ -1155,7 +1155,7 @@ struct Coverage default:return 0; } } - unsigned int get_coverage (void) + unsigned int get_coverage () { switch (format) { @@ -1696,8 +1696,7 @@ struct VarRegionList axesZ.sanitize (c, (unsigned int) axisCount * (unsigned int) regionCount)); } - unsigned int get_region_count (void) const - { return regionCount; } + unsigned int get_region_count () const { return regionCount; } protected: HBUINT16 axisCount; @@ -1710,13 +1709,13 @@ struct VarRegionList struct VarData { - unsigned int get_region_index_count (void) const + unsigned int get_region_index_count () const { return regionIndices.len; } - unsigned int get_row_size (void) const + unsigned int get_row_size () const { return shortCount + regionIndices.len; } - unsigned int get_size (void) const + unsigned int get_size () const { return itemCount * get_row_size (); } float get_delta (unsigned int inner, @@ -2049,7 +2048,7 @@ struct HintingDevice hb_position_t get_y_delta (hb_font_t *font) const { return get_delta (font->y_ppem, font->y_scale); } - unsigned int get_size (void) const + unsigned int get_size () const { unsigned int f = deltaFormat; if (unlikely (f < 1 || f > 3 || startSize > endSize)) return 3 * HBUINT16::static_size; diff --git a/src/hb-ot-layout-gdef-table.hh b/src/hb-ot-layout-gdef-table.hh index 7515f58..3099fb9 100644 --- a/src/hb-ot-layout-gdef-table.hh +++ b/src/hb-ot-layout-gdef-table.hh @@ -351,25 +351,25 @@ struct GDEF ComponentGlyph = 4 }; - bool has_data (void) const { return version.to_int (); } - bool has_glyph_classes (void) const { return glyphClassDef != 0; } + bool has_data () const { return version.to_int (); } + bool has_glyph_classes () const { return glyphClassDef != 0; } unsigned int get_glyph_class (hb_codepoint_t glyph) const { return (this+glyphClassDef).get_class (glyph); } void get_glyphs_in_class (unsigned int klass, hb_set_t *glyphs) const { (this+glyphClassDef).add_class (glyphs, klass); } - bool has_mark_attachment_types (void) const { return markAttachClassDef != 0; } + bool has_mark_attachment_types () const { return markAttachClassDef != 0; } unsigned int get_mark_attachment_type (hb_codepoint_t glyph) const { return (this+markAttachClassDef).get_class (glyph); } - bool has_attach_points (void) const { return attachList != 0; } + bool has_attach_points () const { return attachList != 0; } unsigned int get_attach_points (hb_codepoint_t glyph_id, unsigned int start_offset, unsigned int *point_count /* IN/OUT */, unsigned int *point_array /* OUT */) const { return (this+attachList).get_attach_points (glyph_id, start_offset, point_count, point_array); } - bool has_lig_carets (void) const { return ligCaretList != 0; } + bool has_lig_carets () const { return ligCaretList != 0; } unsigned int get_lig_carets (hb_font_t *font, hb_direction_t direction, hb_codepoint_t glyph_id, @@ -380,12 +380,12 @@ struct GDEF direction, glyph_id, get_var_store(), start_offset, caret_count, caret_array); } - bool has_mark_sets (void) const { return version.to_int () >= 0x00010002u && markGlyphSetsDef != 0; } + bool has_mark_sets () const { return version.to_int () >= 0x00010002u && markGlyphSetsDef != 0; } bool mark_set_covers (unsigned int set_index, hb_codepoint_t glyph_id) const { return version.to_int () >= 0x00010002u && (this+markGlyphSetsDef).covers (set_index, glyph_id); } - bool has_var_store (void) const { return version.to_int () >= 0x00010003u && varStore != 0; } - const VariationStore &get_var_store (void) const + bool has_var_store () const { return version.to_int () >= 0x00010003u && varStore != 0; } + const VariationStore &get_var_store () const { return version.to_int () >= 0x00010003u ? this+varStore : Null(VariationStore); } /* glyph_props is a 16-bit integer where the lower 8-bit have bits representing @@ -424,12 +424,12 @@ struct GDEF } } - void fini (void) { this->table.destroy (); } + void fini () { this->table.destroy (); } hb_blob_ptr_t table; }; - unsigned int get_size (void) const + unsigned int get_size () const { return min_size + (version.to_int () >= 0x00010002u ? markGlyphSetsDef.static_size : 0) + diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index 4066f67..b123336 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh @@ -98,10 +98,8 @@ struct ValueFormat : HBUINT16 * PosTable (may be NULL) */ #endif - unsigned int get_len (void) const - { return hb_popcount ((unsigned int) *this); } - unsigned int get_size (void) const - { return get_len () * Value::static_size; } + unsigned int get_len () const { return hb_popcount ((unsigned int) *this); } + unsigned int get_size () const { return get_len () * Value::static_size; } bool apply_value (hb_ot_apply_context_t *c, const void *base, @@ -191,7 +189,7 @@ struct ValueFormat : HBUINT16 public: - bool has_device (void) const + bool has_device () const { unsigned int format = *this; return (format & devices) != 0; @@ -479,8 +477,7 @@ struct SinglePosFormat1 if (unlikely (!(this+coverage).add_coverage (c->input))) return; } - const Coverage &get_coverage (void) const - { return this+coverage; } + const Coverage &get_coverage () const { return this+coverage; } bool apply (hb_ot_apply_context_t *c) const { @@ -535,8 +532,7 @@ struct SinglePosFormat2 if (unlikely (!(this+coverage).add_coverage (c->input))) return; } - const Coverage &get_coverage (void) const - { return this+coverage; } + const Coverage &get_coverage () const { return this+coverage; } bool apply (hb_ot_apply_context_t *c) const { @@ -754,8 +750,7 @@ struct PairPosFormat1 (this+pairSet[i]).collect_glyphs (c, valueFormat); } - const Coverage &get_coverage (void) const - { return this+coverage; } + const Coverage &get_coverage () const { return this+coverage; } bool apply (hb_ot_apply_context_t *c) const { @@ -830,8 +825,7 @@ struct PairPosFormat2 if (unlikely (!(this+classDef2).add_coverage (c->input))) return; } - const Coverage &get_coverage (void) const - { return this+coverage; } + const Coverage &get_coverage () const { return this+coverage; } bool apply (hb_ot_apply_context_t *c) const { @@ -982,8 +976,7 @@ struct CursivePosFormat1 if (unlikely (!(this+coverage).add_coverage (c->input))) return; } - const Coverage &get_coverage (void) const - { return this+coverage; } + const Coverage &get_coverage () const { return this+coverage; } bool apply (hb_ot_apply_context_t *c) const { @@ -1150,8 +1143,7 @@ struct MarkBasePosFormat1 if (unlikely (!(this+baseCoverage).add_coverage (c->input))) return; } - const Coverage &get_coverage (void) const - { return this+markCoverage; } + const Coverage &get_coverage () const { return this+markCoverage; } bool apply (hb_ot_apply_context_t *c) const { @@ -1273,8 +1265,7 @@ struct MarkLigPosFormat1 if (unlikely (!(this+ligatureCoverage).add_coverage (c->input))) return; } - const Coverage &get_coverage (void) const - { return this+markCoverage; } + const Coverage &get_coverage () const { return this+markCoverage; } bool apply (hb_ot_apply_context_t *c) const { @@ -1395,8 +1386,7 @@ struct MarkMarkPosFormat1 if (unlikely (!(this+mark2Coverage).add_coverage (c->input))) return; } - const Coverage &get_coverage (void) const - { return this+mark1Coverage; } + const Coverage &get_coverage () const { return this+mark1Coverage; } bool apply (hb_ot_apply_context_t *c) const { @@ -1576,7 +1566,7 @@ struct PosLookup : Lookup const SubTable& get_subtable (unsigned int i) const { return Lookup::get_subtable (i); } - bool is_reverse (void) const + bool is_reverse () const { return false; } diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index f652491..1a47fa6 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -71,8 +71,7 @@ struct SingleSubstFormat1 } } - const Coverage &get_coverage (void) const - { return this+coverage; } + const Coverage &get_coverage () const { return this+coverage; } bool would_apply (hb_would_apply_context_t *c) const { @@ -180,8 +179,7 @@ struct SingleSubstFormat2 } } - const Coverage &get_coverage (void) const - { return this+coverage; } + const Coverage &get_coverage () const { return this+coverage; } bool would_apply (hb_would_apply_context_t *c) const { @@ -415,8 +413,7 @@ struct MultipleSubstFormat1 (this+sequence[i]).collect_glyphs (c); } - const Coverage &get_coverage (void) const - { return this+coverage; } + const Coverage &get_coverage () const { return this+coverage; } bool would_apply (hb_would_apply_context_t *c) const { @@ -609,8 +606,7 @@ struct AlternateSubstFormat1 } } - const Coverage &get_coverage (void) const - { return this+coverage; } + const Coverage &get_coverage () const { return this+coverage; } bool would_apply (hb_would_apply_context_t *c) const { @@ -945,8 +941,7 @@ struct LigatureSubstFormat1 } } - const Coverage &get_coverage (void) const - { return this+coverage; } + const Coverage &get_coverage () const { return this+coverage; } bool would_apply (hb_would_apply_context_t *c) const { @@ -1069,7 +1064,7 @@ struct ExtensionSubst : Extension { typedef struct SubstLookupSubTable SubTable; - bool is_reverse (void) const; + bool is_reverse () const; }; @@ -1146,8 +1141,7 @@ struct ReverseChainSingleSubstFormat1 c->output->add_array (substitute.arrayZ, substitute.len); } - const Coverage &get_coverage (void) const - { return this+coverage; } + const Coverage &get_coverage () const { return this+coverage; } bool would_apply (hb_would_apply_context_t *c) const { @@ -1312,7 +1306,7 @@ struct SubstLookup : Lookup static bool lookup_type_is_reverse (unsigned int lookup_type) { return lookup_type == SubTable::ReverseChainSingle; } - bool is_reverse (void) const + bool is_reverse () const { unsigned int type = get_type (); if (unlikely (type == SubTable::Extension)) @@ -1498,7 +1492,7 @@ struct GSUB_accelerator_t : GSUB::accelerator_t {}; /* Out-of-class implementation for methods recursing */ -/*static*/ inline bool ExtensionSubst::is_reverse (void) const +/*static*/ inline bool ExtensionSubst::is_reverse () const { unsigned int type = get_type (); if (unlikely (type == SubTable::Extension)) diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index 065554f..ac6e646 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -44,10 +44,10 @@ namespace OT { struct hb_intersects_context_t : hb_dispatch_context_t { - const char *get_name (void) { return "INTERSECTS"; } + const char *get_name () { return "INTERSECTS"; } template return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); } - static return_t default_return_value (void) { return false; } + static return_t default_return_value () { return false; } bool stop_sublookup_iteration (return_t r) const { return r; } const hb_set_t *glyphs; @@ -61,11 +61,11 @@ struct hb_intersects_context_t : struct hb_closure_context_t : hb_dispatch_context_t { - const char *get_name (void) { return "CLOSURE"; } + const char *get_name () { return "CLOSURE"; } typedef return_t (*recurse_func_t) (hb_closure_context_t *c, unsigned int lookup_index); template return_t dispatch (const T &obj) { obj.closure (this); return HB_VOID; } - static return_t default_return_value (void) { return HB_VOID; } + static return_t default_return_value () { return HB_VOID; } void recurse (unsigned int lookup_index) { if (unlikely (nesting_level_left == 0 || !recurse_func)) @@ -108,14 +108,11 @@ struct hb_closure_context_t : debug_depth (0), done_lookups (done_lookups_) {} - ~hb_closure_context_t (void) - { - flush (); - } + ~hb_closure_context_t () { flush (); } void set_recurse_func (recurse_func_t func) { recurse_func = func; } - void flush (void) + void flush () { hb_set_union (glyphs, out); hb_set_clear (out); @@ -129,10 +126,10 @@ struct hb_closure_context_t : struct hb_would_apply_context_t : hb_dispatch_context_t { - const char *get_name (void) { return "WOULD_APPLY"; } + const char *get_name () { return "WOULD_APPLY"; } template return_t dispatch (const T &obj) { return obj.would_apply (this); } - static return_t default_return_value (void) { return false; } + static return_t default_return_value () { return false; } bool stop_sublookup_iteration (return_t r) const { return r; } hb_face_t *face; @@ -156,11 +153,11 @@ struct hb_would_apply_context_t : struct hb_collect_glyphs_context_t : hb_dispatch_context_t { - const char *get_name (void) { return "COLLECT_GLYPHS"; } + const char *get_name () { return "COLLECT_GLYPHS"; } typedef return_t (*recurse_func_t) (hb_collect_glyphs_context_t *c, unsigned int lookup_index); template return_t dispatch (const T &obj) { obj.collect_glyphs (this); return HB_VOID; } - static return_t default_return_value (void) { return HB_VOID; } + static return_t default_return_value () { return HB_VOID; } void recurse (unsigned int lookup_index) { if (unlikely (nesting_level_left == 0 || !recurse_func)) @@ -224,7 +221,7 @@ struct hb_collect_glyphs_context_t : recursed_lookups (hb_set_create ()), nesting_level_left (nesting_level_left_), debug_depth (0) {} - ~hb_collect_glyphs_context_t (void) { hb_set_destroy (recursed_lookups); } + ~hb_collect_glyphs_context_t () { hb_set_destroy (recursed_lookups); } void set_recurse_func (recurse_func_t func) { recurse_func = func; } }; @@ -235,11 +232,11 @@ template struct hb_add_coverage_context_t : hb_dispatch_context_t, const Coverage &, HB_DEBUG_GET_COVERAGE> { - const char *get_name (void) { return "GET_COVERAGE"; } + const char *get_name () { return "GET_COVERAGE"; } typedef const Coverage &return_t; template return_t dispatch (const T &obj) { return obj.get_coverage (); } - static return_t default_return_value (void) { return Null(Coverage); } + static return_t default_return_value () { return Null(Coverage); } bool stop_sublookup_iteration (return_t r) const { r.add_coverage (set); @@ -260,7 +257,7 @@ struct hb_ot_apply_context_t : { struct matcher_t { - matcher_t (void) : + matcher_t () : lookup_props (0), ignore_zwnj (false), ignore_zwj (false), @@ -366,15 +363,13 @@ struct hb_ot_apply_context_t : matcher.set_syllable (start_index_ == c->buffer->idx ? c->buffer->cur().syllable () : 0); } - void reject (void) { num_items++; match_glyph_data--; } + void reject () { num_items++; match_glyph_data--; } matcher_t::may_skip_t may_skip (const hb_glyph_info_t &info) const - { - return matcher.may_skip (c, info); - } + { return matcher.may_skip (c, info); } - bool next (void) + bool next () { assert (num_items > 0); while (idx + num_items < end) @@ -401,7 +396,7 @@ struct hb_ot_apply_context_t : } return false; } - bool prev (void) + bool prev () { assert (num_items > 0); while (idx > num_items - 1) @@ -440,11 +435,11 @@ struct hb_ot_apply_context_t : }; - const char *get_name (void) { return "APPLY"; } + const char *get_name () { return "APPLY"; } typedef return_t (*recurse_func_t) (hb_ot_apply_context_t *c, unsigned int lookup_index); template return_t dispatch (const T &obj) { return obj.apply (this); } - static return_t default_return_value (void) { return false; } + static return_t default_return_value () { return false; } bool stop_sublookup_iteration (return_t r) const { return r; } return_t recurse (unsigned int sub_lookup_index) { @@ -503,7 +498,7 @@ struct hb_ot_apply_context_t : random (false), random_state (1) { init_iters (); } - void init_iters (void) + void init_iters () { iter_input.init (this, false); iter_context.init (this, true); @@ -517,7 +512,7 @@ struct hb_ot_apply_context_t : void set_lookup_index (unsigned int lookup_index_) { lookup_index = lookup_index_; } void set_lookup_props (unsigned int lookup_props_) { lookup_props = lookup_props_; init_iters (); } - uint32_t random_number (void) + uint32_t random_number () { /* http://www.cplusplus.com/reference/random/minstd_rand/ */ random_state = random_state * 48271 % 2147483647; @@ -651,7 +646,7 @@ struct hb_get_subtables_context_t : typedef hb_vector_t array_t; /* Dispatch interface. */ - const char *get_name (void) { return "GET_SUBTABLES"; } + const char *get_name () { return "GET_SUBTABLES"; } template return_t dispatch (const T &obj) { @@ -659,7 +654,7 @@ struct hb_get_subtables_context_t : entry->init (obj, apply_to); return HB_VOID; } - static return_t default_return_value (void) { return HB_VOID; } + static return_t default_return_value () { return HB_VOID; } hb_get_subtables_context_t (array_t &array_) : array (array_), @@ -1504,8 +1499,7 @@ struct ContextFormat1 return_trace (rule_set.would_apply (c, lookup_context)); } - const Coverage &get_coverage (void) const - { return this+coverage; } + const Coverage &get_coverage () const { return this+coverage; } bool apply (hb_ot_apply_context_t *c) const { @@ -1622,8 +1616,7 @@ struct ContextFormat2 return_trace (rule_set.would_apply (c, lookup_context)); } - const Coverage &get_coverage (void) const - { return this+coverage; } + const Coverage &get_coverage () const { return this+coverage; } bool apply (hb_ot_apply_context_t *c) const { @@ -1732,8 +1725,7 @@ struct ContextFormat3 return_trace (context_would_apply_lookup (c, glyphCount, (const HBUINT16 *) (coverageZ.arrayZ + 1), lookupCount, lookupRecord, lookup_context)); } - const Coverage &get_coverage (void) const - { return this+coverageZ[0]; } + const Coverage &get_coverage () const { return this+coverageZ[0]; } bool apply (hb_ot_apply_context_t *c) const { @@ -2171,8 +2163,7 @@ struct ChainContextFormat1 return_trace (rule_set.would_apply (c, lookup_context)); } - const Coverage &get_coverage (void) const - { return this+coverage; } + const Coverage &get_coverage () const { return this+coverage; } bool apply (hb_ot_apply_context_t *c) const { @@ -2304,8 +2295,7 @@ struct ChainContextFormat2 return_trace (rule_set.would_apply (c, lookup_context)); } - const Coverage &get_coverage (void) const - { return this+coverage; } + const Coverage &get_coverage () const { return this+coverage; } bool apply (hb_ot_apply_context_t *c) const { @@ -2451,7 +2441,7 @@ struct ChainContextFormat3 lookup.len, lookup.arrayZ, lookup_context)); } - const Coverage &get_coverage (void) const + const Coverage &get_coverage () const { const OffsetArrayOf &input = StructAfter > (backtrack); return this+input[0]; @@ -2547,10 +2537,10 @@ struct ChainContext template struct ExtensionFormat1 { - unsigned int get_type (void) const { return extensionLookupType; } + unsigned int get_type () const { return extensionLookupType; } template - const X& get_subtable (void) const + const X& get_subtable () const { unsigned int offset = extensionOffset; if (unlikely (!offset)) return Null(typename T::SubTable); @@ -2588,7 +2578,7 @@ struct ExtensionFormat1 template struct Extension { - unsigned int get_type (void) const + unsigned int get_type () const { switch (u.format) { case 1: return u.format1.get_type (); @@ -2596,7 +2586,7 @@ struct Extension } } template - const X& get_subtable (void) const + const X& get_subtable () const { switch (u.format) { case 1: return u.format1.template get_subtable (); @@ -2639,7 +2629,7 @@ struct hb_ot_layout_lookup_accelerator_t OT::hb_get_subtables_context_t c_get_subtables (subtables); lookup.dispatch (&c_get_subtables); } - void fini (void) { subtables.fini (); } + void fini () { subtables.fini (); } bool may_have (hb_codepoint_t g) const { return digest.may_have (g); } @@ -2659,8 +2649,8 @@ struct hb_ot_layout_lookup_accelerator_t struct GSUBGPOS { - bool has_data (void) const { return version.to_int (); } - unsigned int get_script_count (void) const + bool has_data () const { return version.to_int (); } + unsigned int get_script_count () const { return (this+scriptList).len; } const Tag& get_script_tag (unsigned int i) const { return (this+scriptList).get_tag (i); } @@ -2673,7 +2663,7 @@ struct GSUBGPOS bool find_script_index (hb_tag_t tag, unsigned int *index) const { return (this+scriptList).find_index (tag, index); } - unsigned int get_feature_count (void) const + unsigned int get_feature_count () const { return (this+featureList).len; } hb_tag_t get_feature_tag (unsigned int i) const { return i == Index::NOT_FOUND_INDEX ? HB_TAG_NONE : (this+featureList).get_tag (i); } @@ -2686,7 +2676,7 @@ struct GSUBGPOS bool find_feature_index (hb_tag_t tag, unsigned int *index) const { return (this+featureList).find_index (tag, index); } - unsigned int get_lookup_count (void) const + unsigned int get_lookup_count () const { return (this+lookupList).len; } const Lookup& get_lookup (unsigned int i) const { return (this+lookupList)[i]; } @@ -2732,7 +2722,7 @@ struct GSUBGPOS return_trace (true); } - unsigned int get_size (void) const + unsigned int get_size () const { return min_size + (version.to_int () >= 0x00010001u ? featureVars.static_size : 0); @@ -2773,7 +2763,7 @@ struct GSUBGPOS this->accels[i].init (table->get_lookup (i)); } - void fini (void) + void fini () { for (unsigned int i = 0; i < this->lookup_count; i++) this->accels[i].fini (); diff --git a/src/hb-ot-layout-jstf-table.hh b/src/hb-ot-layout-jstf-table.hh index af0519b..3beedc4 100644 --- a/src/hb-ot-layout-jstf-table.hh +++ b/src/hb-ot-layout-jstf-table.hh @@ -145,7 +145,7 @@ typedef SortedArrayOf ExtenderGlyphs; struct JstfScript { - unsigned int get_lang_sys_count (void) const + unsigned int get_lang_sys_count () const { return langSys.len; } const Tag& get_lang_sys_tag (unsigned int i) const { return langSys.get_tag (i); } @@ -161,8 +161,8 @@ struct JstfScript bool find_lang_sys_index (hb_tag_t tag, unsigned int *index) const { return langSys.find_index (tag, index); } - bool has_default_lang_sys (void) const { return defaultLangSys != 0; } - const JstfLangSys& get_default_lang_sys (void) const { return this+defaultLangSys; } + bool has_default_lang_sys () const { return defaultLangSys != 0; } + const JstfLangSys& get_default_lang_sys () const { return this+defaultLangSys; } bool sanitize (hb_sanitize_context_t *c, const Record_sanitize_closure_t * = nullptr) const @@ -197,7 +197,7 @@ struct JSTF { enum { tableTag = HB_OT_TAG_JSTF }; - unsigned int get_script_count (void) const + unsigned int get_script_count () const { return scriptList.len; } const Tag& get_script_tag (unsigned int i) const { return scriptList.get_tag (i); } diff --git a/src/hb-ot-map.cc b/src/hb-ot-map.cc index 95f794a..884202c 100644 --- a/src/hb-ot-map.cc +++ b/src/hb-ot-map.cc @@ -68,7 +68,7 @@ hb_ot_map_builder_t::hb_ot_map_builder_t (hb_face_t *face_, } } -hb_ot_map_builder_t::~hb_ot_map_builder_t (void) +hb_ot_map_builder_t::~hb_ot_map_builder_t () { feature_infos.fini (); for (unsigned int table_index = 0; table_index < 2; table_index++) diff --git a/src/hb-ot-map.hh b/src/hb-ot-map.hh index 68f32f1..35e9493 100644 --- a/src/hb-ot-map.hh +++ b/src/hb-ot-map.hh @@ -83,7 +83,7 @@ struct hb_ot_map_t pause_func_t pause_func; }; - void init (void) + void init () { memset (this, 0, sizeof (*this)); @@ -94,7 +94,7 @@ struct hb_ot_map_t stages[table_index].init (); } } - void fini (void) + void fini () { features.fini (); for (unsigned int table_index = 0; table_index < 2; table_index++) @@ -104,7 +104,7 @@ struct hb_ot_map_t } } - hb_mask_t get_global_mask (void) const { return global_mask; } + hb_mask_t get_global_mask () const { return global_mask; } hb_mask_t get_mask (hb_tag_t feature_tag, unsigned int *shift = nullptr) const { @@ -203,7 +203,7 @@ struct hb_ot_map_builder_t HB_INTERNAL hb_ot_map_builder_t (hb_face_t *face_, const hb_segment_properties_t *props_); - HB_INTERNAL ~hb_ot_map_builder_t (void); + HB_INTERNAL ~hb_ot_map_builder_t (); HB_INTERNAL void add_feature (hb_tag_t tag, hb_ot_map_feature_flags_t flags=F_NONE, diff --git a/src/hb-ot-math-table.hh b/src/hb-ot-math-table.hh index c5043f8..120ab06 100644 --- a/src/hb-ot-math-table.hh +++ b/src/hb-ot-math-table.hh @@ -543,8 +543,7 @@ struct MathGlyphConstruction mathGlyphVariantRecord.sanitize (c)); } - const MathGlyphAssembly &get_assembly (void) const - { return this+glyphAssembly; } + const MathGlyphAssembly &get_assembly () const { return this+glyphAssembly; } unsigned int get_variants (hb_direction_t direction, hb_font_t *font, @@ -682,7 +681,7 @@ struct MATH { enum { tableTag = HB_OT_TAG_MATH }; - bool has_data (void) const { return version.to_int (); } + bool has_data () const { return version.to_int (); } bool sanitize (hb_sanitize_context_t *c) const { @@ -698,11 +697,9 @@ struct MATH hb_font_t *font) const { return (this+mathConstants).get_value (constant, font); } - const MathGlyphInfo &get_glyph_info (void) const - { return this+mathGlyphInfo; } + const MathGlyphInfo &get_glyph_info () const { return this+mathGlyphInfo; } - const MathVariants &get_variants (void) const - { return this+mathVariants; } + const MathVariants &get_variants () const { return this+mathVariants; } protected: FixedVersion<>version; /* Version of the MATH table diff --git a/src/hb-ot-maxp-table.hh b/src/hb-ot-maxp-table.hh index 50bed97..ba474fd 100644 --- a/src/hb-ot-maxp-table.hh +++ b/src/hb-ot-maxp-table.hh @@ -73,10 +73,7 @@ struct maxp { enum { tableTag = HB_OT_TAG_maxp }; - unsigned int get_num_glyphs (void) const - { - return numGlyphs; - } + unsigned int get_num_glyphs () const { return numGlyphs; } void set_num_glyphs (unsigned int count) { diff --git a/src/hb-ot-name-table.hh b/src/hb-ot-name-table.hh index ed51d78..705ae0e 100644 --- a/src/hb-ot-name-table.hh +++ b/src/hb-ot-name-table.hh @@ -66,7 +66,7 @@ struct NameRecord return HB_LANGUAGE_INVALID; } - uint16_t score (void) const + uint16_t score () const { /* Same order as in cmap::find_best_subtable(). */ unsigned int p = platformID; @@ -153,7 +153,7 @@ struct name { enum { tableTag = HB_OT_TAG_name }; - unsigned int get_size (void) const + unsigned int get_size () const { return min_size + count * nameRecordZ.item_size; } bool sanitize_records (hb_sanitize_context_t *c) const @@ -218,7 +218,7 @@ struct name this->names.resize (j); } - void fini (void) + void fini () { this->names.fini (); this->table.destroy (); diff --git a/src/hb-ot-os2-table.hh b/src/hb-ot-os2-table.hh index 510397b..4c1812c 100644 --- a/src/hb-ot-os2-table.hh +++ b/src/hb-ot-os2-table.hh @@ -94,11 +94,11 @@ struct OS2 { enum { tableTag = HB_OT_TAG_OS2 }; - bool has_data (void) const { return this != &Null (OS2); } + bool has_data () const { return this != &Null (OS2); } - const OS2V1Tail &v1 (void) const { return version >= 1 ? v1X : Null (OS2V1Tail); } - const OS2V2Tail &v2 (void) const { return version >= 2 ? v2X : Null (OS2V2Tail); } - const OS2V5Tail &v5 (void) const { return version >= 5 ? v5X : Null (OS2V5Tail); } + const OS2V1Tail &v1 () const { return version >= 1 ? v1X : Null (OS2V1Tail); } + const OS2V2Tail &v2 () const { return version >= 2 ? v2X : Null (OS2V2Tail); } + const OS2V5Tail &v5 () const { return version >= 5 ? v5X : Null (OS2V5Tail); } enum selection_flag_t { ITALIC = 1u<<0, @@ -113,9 +113,9 @@ struct OS2 OBLIQUE = 1u<<9 }; - bool is_italic (void) const { return fsSelection & ITALIC; } - bool is_oblique (void) const { return fsSelection & OBLIQUE; } - bool is_typo_metrics (void) const { return fsSelection & USE_TYPO_METRICS; } + bool is_italic () const { return fsSelection & ITALIC; } + bool is_oblique () const { return fsSelection & OBLIQUE; } + bool is_typo_metrics () const { return fsSelection & USE_TYPO_METRICS; } enum width_class_t { FWIDTH_ULTRA_CONDENSED = 1, /* 50% */ @@ -129,7 +129,7 @@ struct OS2 FWIDTH_ULTRA_EXPANDED = 9 /* 200% */ }; - float get_width (void) const + float get_width () const { switch (usWidthClass) { case FWIDTH_ULTRA_CONDENSED:return 50.f; @@ -215,7 +215,7 @@ struct OS2 }; // https://github.com/Microsoft/Font-Validator/blob/520aaae/OTFontFileVal/val_OS2.cs#L644-L681 - font_page_t get_font_page (void) const + font_page_t get_font_page () const { return (font_page_t) (version == 0 ? fsSelection & 0xFF00 : 0); } 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 3fcad6c..4adad60 100644 --- a/src/hb-ot-post-table.hh +++ b/src/hb-ot-post-table.hh @@ -118,7 +118,7 @@ struct post data += 1 + *data) index_to_offset.push (data - pool); } - void fini (void) + void fini () { index_to_offset.fini (); free (gids_sorted_by_name.get ()); @@ -180,7 +180,7 @@ struct post protected: - unsigned int get_glyph_count (void) const + unsigned int get_glyph_count () const { if (version == 0x00010000) return NUM_FORMAT1_NAMES; diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index e0074d5..6e5ce15 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -189,7 +189,7 @@ hb_ot_shape_plan_t::init0 (hb_face_t *face, } void -hb_ot_shape_plan_t::fini (void) +hb_ot_shape_plan_t::fini () { if (shaper->data_destroy) shaper->data_destroy (const_cast (data)); diff --git a/src/hb-ot-shape.hh b/src/hb-ot-shape.hh index b5a4d8e..73a11e1 100644 --- a/src/hb-ot-shape.hh +++ b/src/hb-ot-shape.hh @@ -98,7 +98,7 @@ struct hb_ot_shape_plan_t HB_INTERNAL bool init0 (hb_face_t *face, const hb_shape_plan_key_t *key); - HB_INTERNAL void fini (void); + HB_INTERNAL void fini (); HB_INTERNAL void substitute (hb_font_t *font, hb_buffer_t *buffer) const; HB_INTERNAL void position (hb_font_t *font, hb_buffer_t *buffer) const; diff --git a/src/hb-ot-tag.cc b/src/hb-ot-tag.cc index a569b8c..d04e532 100644 --- a/src/hb-ot-tag.cc +++ b/src/hb-ot-tag.cc @@ -503,7 +503,7 @@ hb_ot_tags_to_script_and_language (hb_tag_t script_tag, #ifdef MAIN static inline void -test_langs_sorted (void) +test_langs_sorted () { for (unsigned int i = 1; i < ARRAY_LENGTH (ot_languages); i++) { @@ -518,7 +518,7 @@ test_langs_sorted (void) } int -main (void) +main () { test_langs_sorted (); return 0; diff --git a/src/hb-ot-var-fvar-table.hh b/src/hb-ot-var-fvar-table.hh index 9d4c7a4..76c9eb2 100644 --- a/src/hb-ot-var-fvar-table.hh +++ b/src/hb-ot-var-fvar-table.hh @@ -98,7 +98,7 @@ struct fvar { enum { tableTag = HB_OT_TAG_fvar }; - bool has_data (void) const { return version.to_int (); } + bool has_data () const { return version.to_int (); } bool sanitize (hb_sanitize_context_t *c) const { @@ -112,7 +112,7 @@ struct fvar c->check_range (get_instance (0), instanceCount, instanceSize)); } - unsigned int get_axis_count (void) const { return axisCount; } + unsigned int get_axis_count () const { return axisCount; } void get_axis_deprecated (unsigned int axis_index, hb_ot_var_axis_t *info) const @@ -234,8 +234,7 @@ struct fvar return (int) (v * 16384.f + (v >= 0.f ? .5f : -.5f)); } - unsigned int get_instance_count (void) const - { return instanceCount; } + unsigned int get_instance_count () const { return instanceCount; } hb_ot_name_id_t get_instance_subfamily_name_id (unsigned int instance_index) const { @@ -276,7 +275,7 @@ struct fvar } protected: - hb_array_t get_axes (void) const + hb_array_t get_axes () const { return hb_array (&(this+firstAxis), axisCount); } const InstanceRecord *get_instance (unsigned int i) const diff --git a/src/hb-ot-var-hvar-table.hh b/src/hb-ot-var-hvar-table.hh index cfe7f9a..2640f07 100644 --- a/src/hb-ot-var-hvar-table.hh +++ b/src/hb-ot-var-hvar-table.hh @@ -73,11 +73,9 @@ struct DeltaSetIndexMap } protected: - unsigned int get_width (void) const - { return ((format >> 4) & 3) + 1; } + unsigned int get_width () const { return ((format >> 4) & 3) + 1; } - unsigned int get_inner_bitcount (void) const - { return (format & 0xF) + 1; } + unsigned int get_inner_bitcount () const { return (format & 0xF) + 1; } protected: HBUINT16 format; /* A packed field that describes the compressed @@ -123,8 +121,7 @@ struct HVARVVAR return (this+varStore).get_delta (varidx, coords, coord_count); } - bool has_sidebearing_deltas (void) const - { return lsbMap && rsbMap; } + bool has_sidebearing_deltas () const { return lsbMap && rsbMap; } protected: FixedVersion<>version; /* Version of the metrics variation table diff --git a/src/hb-ot-vorg-table.hh b/src/hb-ot-vorg-table.hh index e120328..884d043 100644 --- a/src/hb-ot-vorg-table.hh +++ b/src/hb-ot-vorg-table.hh @@ -59,7 +59,7 @@ struct VORG { enum { tableTag = HB_OT_TAG_VORG }; - bool has_data (void) const { return version.to_int (); } + bool has_data () const { return version.to_int (); } int get_y_origin (hb_codepoint_t glyph) const { diff --git a/src/hb-set-digest.hh b/src/hb-set-digest.hh index 87f82da..9f49af1 100644 --- a/src/hb-set-digest.hh +++ b/src/hb-set-digest.hh @@ -61,7 +61,7 @@ struct hb_set_digest_lowest_bits_t static_assert ((shift < sizeof (hb_codepoint_t) * 8), ""); static_assert ((shift + num_bits <= sizeof (hb_codepoint_t) * 8), ""); - void init (void) { mask = 0; } + void init () { mask = 0; } void add (hb_codepoint_t g) { mask |= mask_for (g); } @@ -110,7 +110,7 @@ struct hb_set_digest_lowest_bits_t template struct hb_set_digest_combiner_t { - void init (void) + void init () { head.init (); tail.init (); diff --git a/src/hb-set.cc b/src/hb-set.cc index 67ec561..0682362 100644 --- a/src/hb-set.cc +++ b/src/hb-set.cc @@ -47,7 +47,7 @@ * Since: 0.9.2 **/ hb_set_t * -hb_set_create (void) +hb_set_create () { hb_set_t *set; @@ -67,7 +67,7 @@ hb_set_create (void) * Since: 0.9.2 **/ hb_set_t * -hb_set_get_empty (void) +hb_set_get_empty () { return const_cast (&Null(hb_set_t)); } diff --git a/src/hb-set.hh b/src/hb-set.hh index 99edcd1..eb325a6 100644 --- a/src/hb-set.hh +++ b/src/hb-set.hh @@ -40,8 +40,8 @@ struct hb_set_t { HB_NO_COPY_ASSIGN (hb_set_t); - hb_set_t (void) { init (); } - ~hb_set_t (void) { fini (); } + hb_set_t () { init (); } + ~hb_set_t () { fini (); } struct page_map_t { @@ -53,13 +53,13 @@ struct hb_set_t struct page_t { - void init0 (void) { v.clear (); } - void init1 (void) { v.clear (0xFF); } + void init0 () { v.clear (); } + void init1 () { v.clear (0xFF); } - unsigned int len (void) const + unsigned int len () const { return ARRAY_LENGTH_CONST (v); } - bool is_empty (void) const + bool is_empty () const { for (unsigned int i = 0; i < len (); i++) if (v[i]) @@ -93,7 +93,7 @@ struct hb_set_t return 0 == hb_memcmp (&v, &other->v, sizeof (v)); } - unsigned int get_population (void) const + unsigned int get_population () const { unsigned int pop = 0; for (unsigned int i = 0; i < len (); i++) @@ -145,14 +145,14 @@ struct hb_set_t *codepoint = INVALID; return false; } - hb_codepoint_t get_min (void) const + hb_codepoint_t get_min () const { for (unsigned int i = 0; i < len (); i++) if (v[i]) return i * ELT_BITS + elt_get_min (v[i]); return INVALID; } - hb_codepoint_t get_max (void) const + hb_codepoint_t get_max () const { for (int i = len () - 1; i >= 0; i--) if (v[i]) @@ -189,25 +189,25 @@ struct hb_set_t hb_vector_t page_map; hb_vector_t pages; - void init_shallow (void) + void init_shallow () { successful = true; population = 0; page_map.init (); pages.init (); } - void init (void) + void init () { hb_object_init (this); init_shallow (); } - void fini_shallow (void) + void fini_shallow () { population = 0; page_map.fini (); pages.fini (); } - void fini (void) + void fini () { hb_object_fini (this); fini_shallow (); @@ -225,7 +225,7 @@ struct hb_set_t return true; } - void clear (void) + void clear () { if (unlikely (hb_object_is_immutable (this))) return; @@ -234,7 +234,7 @@ struct hb_set_t page_map.resize (0); pages.resize (0); } - bool is_empty (void) const + bool is_empty () const { unsigned int count = pages.len; for (unsigned int i = 0; i < count; i++) @@ -243,7 +243,7 @@ struct hb_set_t return true; } - void dirty (void) { population = (unsigned int) -1; } + void dirty () { population = (unsigned int) -1; } void add (hb_codepoint_t g) { @@ -634,7 +634,7 @@ struct hb_set_t return true; } - unsigned int get_population (void) const + unsigned int get_population () const { if (population != (unsigned int) -1) return population; @@ -647,7 +647,7 @@ struct hb_set_t population = pop; return pop; } - hb_codepoint_t get_min (void) const + hb_codepoint_t get_min () const { unsigned int count = pages.len; for (unsigned int i = 0; i < count; i++) @@ -655,7 +655,7 @@ struct hb_set_t return page_map[i].major * page_t::PAGE_BITS + page_at (i).get_min (); return INVALID; } - hb_codepoint_t get_max (void) const + hb_codepoint_t get_max () const { unsigned int count = pages.len; for (int i = count - 1; i >= 0; i++) diff --git a/src/hb-shape-plan.cc b/src/hb-shape-plan.cc index bc3d816..61ea8d0 100644 --- a/src/hb-shape-plan.cc +++ b/src/hb-shape-plan.cc @@ -247,7 +247,7 @@ bail: * Since: 0.9.7 **/ hb_shape_plan_t * -hb_shape_plan_get_empty (void) +hb_shape_plan_get_empty () { return const_cast (&Null(hb_shape_plan_t)); } diff --git a/src/hb-shape-plan.hh b/src/hb-shape-plan.hh index d9aa3ee..3a057fd 100644 --- a/src/hb-shape-plan.hh +++ b/src/hb-shape-plan.hh @@ -53,10 +53,7 @@ struct hb_shape_plan_key_t unsigned int num_coords, const char * const *shaper_list); - HB_INTERNAL inline void free (void) - { - ::free ((void *) user_features); - } + HB_INTERNAL inline void free () { ::free ((void *) user_features); } HB_INTERNAL bool user_features_match (const hb_shape_plan_key_t *other); diff --git a/src/hb-shape.cc b/src/hb-shape.cc index 7f4f612..deff77b 100644 --- a/src/hb-shape.cc +++ b/src/hb-shape.cc @@ -49,7 +49,7 @@ #if HB_USE_ATEXIT -static void free_static_shaper_list (void); +static void free_static_shaper_list (); #endif static const char *nil_shaper_list[] = {nullptr}; @@ -57,7 +57,7 @@ static const char *nil_shaper_list[] = {nullptr}; static struct hb_shaper_list_lazy_loader_t : hb_lazy_loader_t { - static const char ** create (void) + static const char ** create () { const char **shaper_list = (const char **) calloc (1 + HB_SHAPERS_COUNT, sizeof (const char *)); if (unlikely (!shaper_list)) @@ -77,13 +77,13 @@ static struct hb_shaper_list_lazy_loader_t : hb_lazy_loader_t { - static hb_shaper_entry_t *create (void) + static hb_shaper_entry_t *create () { char *env = getenv ("HB_SHAPER_LIST"); if (!env || !*env) @@ -86,22 +86,20 @@ static struct hb_shapers_lazy_loader_t : hb_lazy_loader_t @@ -98,7 +98,7 @@ template struct hb_shaper_object typedef HB_SHAPER_DATA_TYPE(shaper, object) Type; \ static Type* create (hb_##object##_t *data) \ { return HB_SHAPER_DATA_CREATE_FUNC (shaper, object) (data); } \ - static Type *get_null (void) { return nullptr; } \ + static Type *get_null () { return nullptr; } \ static void destroy (Type *p) { HB_SHAPER_DATA_DESTROY_FUNC (shaper, object) (p); } \ }; \ \ @@ -115,7 +115,7 @@ struct hb_shaper_object_dataset_t #include "hb-shaper-list.hh" #undef HB_SHAPER_IMPLEMENT } - void fini (void) + void fini () { #define HB_SHAPER_IMPLEMENT(shaper) shaper.fini (); #include "hb-shaper-list.hh" diff --git a/src/hb-static.cc b/src/hb-static.cc index a22f729..4c51588 100644 --- a/src/hb-static.cc +++ b/src/hb-static.cc @@ -51,7 +51,7 @@ const unsigned char _hb_Null_AAT_Lookup[2] = {0xFF, 0xFF}; unsigned int -hb_face_t::load_num_glyphs (void) const +hb_face_t::load_num_glyphs () const { hb_sanitize_context_t c = hb_sanitize_context_t (); c.set_num_glyphs (0); /* So we don't recurse ad infinitum. */ @@ -65,7 +65,7 @@ hb_face_t::load_num_glyphs (void) const } unsigned int -hb_face_t::load_upem (void) const +hb_face_t::load_upem () const { unsigned int ret = table.head->get_upem (); upem.set_relaxed (ret); diff --git a/src/hb-subset-cff-common.hh b/src/hb-subset-cff-common.hh index b861c06..820a090 100644 --- a/src/hb-subset-cff-common.hh +++ b/src/hb-subset-cff-common.hh @@ -38,13 +38,9 @@ namespace CFF { struct StrEncoder { StrEncoder (StrBuff &buff_) - : buff (buff_), error (false) - {} + : buff (buff_), error (false) {} - void reset (void) - { - buff.resize (0); - } + void reset () { buff.resize (0); } void encode_byte (unsigned char b) { @@ -123,19 +119,17 @@ struct StrEncoder memcpy (&buff[offset], &str.str[0], str.len); } - bool is_error (void) const { return error; } + bool is_error () const { return error; } protected: - void set_error (void) { error = true; } + void set_error () { error = true; } StrBuff &buff; bool error; }; struct CFFSubTableOffsets { - CFFSubTableOffsets (void) - : privateDictsOffset (0) - + CFFSubTableOffsets () : privateDictsOffset (0) { topDictInfo.init (); FDSelectInfo.init (); @@ -145,10 +139,7 @@ struct CFFSubTableOffsets { localSubrsInfos.init (); } - ~CFFSubTableOffsets (void) - { - localSubrsInfos.fini (); - } + ~CFFSubTableOffsets () { localSubrsInfos.fini (); } TableInfo topDictInfo; TableInfo FDSelectInfo; @@ -331,12 +322,8 @@ struct SubrFlattener struct SubrClosures { - SubrClosures (void) - : valid (false), - global_closure (nullptr) - { - local_closures.init (); - } + SubrClosures () : valid (false), global_closure (nullptr) + { local_closures.init (); } void init (unsigned int fd_count) { @@ -355,7 +342,7 @@ struct SubrClosures } } - void fini (void) + void fini () { hb_set_destroy (global_closure); for (unsigned int i = 0; i < local_closures.len; i++) @@ -363,14 +350,14 @@ struct SubrClosures local_closures.fini (); } - void reset (void) + void reset () { hb_set_clear (global_closure); for (unsigned int i = 0; i < local_closures.len; i++) hb_set_clear (local_closures[i]); } - bool is_valid (void) const { return valid; } + bool is_valid () const { return valid; } bool valid; hb_set_t *global_closure; hb_vector_t local_closures; @@ -387,17 +374,16 @@ struct ParsedCSOp : OpStr skip_flag = false; } - void fini (void) - { - OpStr::fini (); - } + void fini () { OpStr::fini (); } + + bool for_drop () const { return drop_flag; } + void set_drop () { if (!for_keep ()) drop_flag = true; } + + bool for_keep () const { return keep_flag; } + void set_keep () { keep_flag = true; } - bool for_drop (void) const { return drop_flag; } - void set_drop (void) { if (!for_keep ()) drop_flag = true; } - bool for_keep (void) const { return keep_flag; } - void set_keep (void) { keep_flag = true; } - bool for_skip (void) const { return skip_flag; } - void set_skip (void) { skip_flag = true; } + bool for_skip () const { return skip_flag; } + void set_skip () { skip_flag = true; } unsigned int subr_num; @@ -409,7 +395,7 @@ struct ParsedCSOp : OpStr struct ParsedCStr : ParsedValues { - void init (void) + void init () { SUPER::init (); parsed = false; @@ -450,15 +436,18 @@ struct ParsedCStr : ParsedValues || (values[pos + 1].op == OpCode_return)); } - bool is_parsed (void) const { return parsed; } - void set_parsed (void) { parsed = true; } - bool is_hint_dropped (void) const { return hint_dropped; } - void set_hint_dropped (void) { hint_dropped = true; } - bool is_vsindex_dropped (void) const { return vsindex_dropped; } - void set_vsindex_dropped (void) { vsindex_dropped = true; } - bool has_prefix (void) const { return has_prefix_; } - OpCode prefix_op (void) const { return prefix_op_; } - const Number &prefix_num (void) const { return prefix_num_; } + bool is_parsed () const { return parsed; } + void set_parsed () { parsed = true; } + + bool is_hint_dropped () const { return hint_dropped; } + void set_hint_dropped () { hint_dropped = true; } + + bool is_vsindex_dropped () const { return vsindex_dropped; } + void set_vsindex_dropped () { vsindex_dropped = true; } + + bool has_prefix () const { return has_prefix_; } + OpCode prefix_op () const { return prefix_op_; } + const Number &prefix_num () const { return prefix_num_; } protected: bool parsed; @@ -481,7 +470,7 @@ struct ParsedCStrs : hb_vector_t for (unsigned int i = 0; i < len; i++) (*this)[i].init (); } - void fini (void) { SUPER::fini_deep (); } + void fini () { SUPER::fini_deep (); } private: typedef hb_vector_t SUPER; @@ -593,13 +582,13 @@ struct SubrRemap : Remap struct SubrRemaps { - SubrRemaps (void) + SubrRemaps () { global_remap.init (); local_remaps.init (); } - ~SubrRemaps (void) { fini (); } + ~SubrRemaps () { fini (); } void init (unsigned int fdCount) { @@ -615,7 +604,7 @@ struct SubrRemaps local_remaps[i].create (closures.local_closures[i]); } - void fini (void) + void fini () { global_remap.fini (); local_remaps.fini_deep (); @@ -628,14 +617,14 @@ struct SubrRemaps template struct SubrSubsetter { - SubrSubsetter (void) + SubrSubsetter () { parsed_charstrings.init (); parsed_global_subrs.init (); parsed_local_subrs.init (); } - ~SubrSubsetter (void) + ~SubrSubsetter () { closures.fini (); remaps.fini (); @@ -788,7 +777,7 @@ struct SubrSubsetter protected: struct DropHintsParam { - DropHintsParam (void) + DropHintsParam () : seen_moveto (false), ends_in_hint (false), vsindex_dropped (false) {} diff --git a/src/hb-subset-cff1.cc b/src/hb-subset-cff1.cc index 61ac915..09364a2 100644 --- a/src/hb-subset-cff1.cc +++ b/src/hb-subset-cff1.cc @@ -61,7 +61,7 @@ struct RemapSID : Remap struct CFF1SubTableOffsets : CFFSubTableOffsets { - CFF1SubTableOffsets (void) + CFF1SubTableOffsets () : CFFSubTableOffsets (), nameIndexOffset (0), encodingOffset (0) @@ -87,12 +87,9 @@ struct CFF1TopDictValuesMod : CFF1TopDictValues base = base_; } - void fini (void) { SUPER::fini (); } + void fini () { SUPER::fini (); } - unsigned get_count (void) const - { - return base->get_count () + SUPER::get_count (); - } + unsigned get_count () const { return base->get_count () + SUPER::get_count (); } const CFF1TopDictVal &get_value (unsigned int i) const { if (i < base->get_count ()) @@ -228,10 +225,7 @@ struct FontDictValuesMod privateDictInfo = privateDictInfo_; } - unsigned get_count (void) const - { - return base->get_count (); - } + unsigned get_count () const { return base->get_count (); } const OpStr &operator [] (unsigned int i) const { return (*base)[i]; } @@ -423,7 +417,7 @@ struct CFF1SubrSubsetter : SubrSubsetter topdict_sizes; diff --git a/src/hb-subset-cff2.cc b/src/hb-subset-cff2.cc index 602794d..5a5f29d 100644 --- a/src/hb-subset-cff2.cc +++ b/src/hb-subset-cff2.cc @@ -36,7 +36,7 @@ using namespace CFF; struct CFF2SubTableOffsets : CFFSubTableOffsets { - CFF2SubTableOffsets (void) + CFF2SubTableOffsets () : CFFSubTableOffsets (), varStoreOffset (0) {} @@ -238,7 +238,7 @@ struct CFF2SubrSubsetter : SubrSubsetter(); diff --git a/src/hb-subset.hh b/src/hb-subset.hh index 020208f..45cb763 100644 --- a/src/hb-subset.hh +++ b/src/hb-subset.hh @@ -39,10 +39,10 @@ struct hb_subset_context_t : hb_dispatch_context_t { - const char *get_name (void) { return "SUBSET"; } + const char *get_name () { return "SUBSET"; } template bool dispatch (const T &obj) { return obj.subset (this); } - static bool default_return_value (void) { return true; } + static bool default_return_value () { return true; } hb_subset_plan_t *plan; hb_serialize_context_t *serializer; diff --git a/src/hb-ucdn.cc b/src/hb-ucdn.cc index 5a63e5a..534935f 100644 --- a/src/hb-ucdn.cc +++ b/src/hb-ucdn.cc @@ -223,12 +223,12 @@ hb_ucdn_decompose(hb_unicode_funcs_t *ufuncs HB_UNUSED, #if HB_USE_ATEXIT -static void free_static_ucdn_funcs (void); +static void free_static_ucdn_funcs (); #endif static struct hb_ucdn_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader_t { - static hb_unicode_funcs_t *create (void) + static hb_unicode_funcs_t *create () { hb_unicode_funcs_t *funcs = hb_unicode_funcs_create (nullptr); @@ -251,7 +251,7 @@ static struct hb_ucdn_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader #if HB_USE_ATEXIT static -void free_static_ucdn_funcs (void) +void free_static_ucdn_funcs () { static_ucdn_funcs.free_instance (); } @@ -259,10 +259,10 @@ void free_static_ucdn_funcs (void) extern "C" HB_INTERNAL hb_unicode_funcs_t * -hb_ucdn_get_unicode_funcs (void); +hb_ucdn_get_unicode_funcs (); hb_unicode_funcs_t * -hb_ucdn_get_unicode_funcs (void) +hb_ucdn_get_unicode_funcs () { return static_ucdn_funcs.get_unconst (); } diff --git a/src/hb-unicode.cc b/src/hb-unicode.cc index 5accf36..4ac521d 100644 --- a/src/hb-unicode.cc +++ b/src/hb-unicode.cc @@ -123,12 +123,12 @@ hb_unicode_decompose_compatibility_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED } -extern "C" hb_unicode_funcs_t *hb_glib_get_unicode_funcs (void); -extern "C" hb_unicode_funcs_t *hb_icu_get_unicode_funcs (void); -extern "C" hb_unicode_funcs_t *hb_ucdn_get_unicode_funcs (void); +extern "C" hb_unicode_funcs_t *hb_glib_get_unicode_funcs (); +extern "C" hb_unicode_funcs_t *hb_icu_get_unicode_funcs (); +extern "C" hb_unicode_funcs_t *hb_ucdn_get_unicode_funcs (); hb_unicode_funcs_t * -hb_unicode_funcs_get_default (void) +hb_unicode_funcs_get_default () { #if defined(HAVE_UCDN) return hb_ucdn_get_unicode_funcs (); @@ -151,7 +151,7 @@ hb_unicode_funcs_get_default (void) * hb_unicode_funcs_create: (Xconstructor) * @parent: (nullable): * - * + * * * Return value: (transfer full): * @@ -197,14 +197,14 @@ DEFINE_NULL_INSTANCE (hb_unicode_funcs_t) = /** * hb_unicode_funcs_get_empty: * - * + * * * Return value: (transfer full): * * Since: 0.9.2 **/ hb_unicode_funcs_t * -hb_unicode_funcs_get_empty (void) +hb_unicode_funcs_get_empty () { return const_cast (&Null(hb_unicode_funcs_t)); } @@ -213,7 +213,7 @@ hb_unicode_funcs_get_empty (void) * hb_unicode_funcs_reference: (skip) * @ufuncs: Unicode functions. * - * + * * * Return value: (transfer full): * @@ -229,7 +229,7 @@ hb_unicode_funcs_reference (hb_unicode_funcs_t *ufuncs) * hb_unicode_funcs_destroy: (skip) * @ufuncs: Unicode functions. * - * + * * * Since: 0.9.2 **/ @@ -251,14 +251,14 @@ hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs) /** * hb_unicode_funcs_set_user_data: (skip) * @ufuncs: Unicode functions. - * @key: - * @data: - * @destroy: - * @replace: + * @key: + * @data: + * @destroy: + * @replace: + * * - * * - * Return value: + * Return value: * * Since: 0.9.2 **/ @@ -275,9 +275,9 @@ hb_unicode_funcs_set_user_data (hb_unicode_funcs_t *ufuncs, /** * hb_unicode_funcs_get_user_data: (skip) * @ufuncs: Unicode functions. - * @key: + * @key: + * * - * * * Return value: (transfer none): * @@ -295,7 +295,7 @@ hb_unicode_funcs_get_user_data (hb_unicode_funcs_t *ufuncs, * hb_unicode_funcs_make_immutable: * @ufuncs: Unicode functions. * - * + * * * Since: 0.9.2 **/ @@ -312,9 +312,9 @@ hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs) * hb_unicode_funcs_is_immutable: * @ufuncs: Unicode functions. * - * * - * Return value: + * + * Return value: * * Since: 0.9.2 **/ @@ -328,9 +328,9 @@ hb_unicode_funcs_is_immutable (hb_unicode_funcs_t *ufuncs) * hb_unicode_funcs_get_parent: * @ufuncs: Unicode functions. * - * * - * Return value: + * + * Return value: * * Since: 0.9.2 **/ @@ -384,13 +384,13 @@ HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE /** * hb_unicode_compose: * @ufuncs: Unicode functions. - * @a: - * @b: + * @a: + * @b: * @ab: (out): * - * * - * Return value: + * + * Return value: * * Since: 0.9.2 **/ @@ -406,13 +406,13 @@ hb_unicode_compose (hb_unicode_funcs_t *ufuncs, /** * hb_unicode_decompose: * @ufuncs: Unicode functions. - * @ab: + * @ab: * @a: (out): * @b: (out): * - * * - * Return value: + * + * Return value: * * Since: 0.9.2 **/ @@ -428,12 +428,12 @@ hb_unicode_decompose (hb_unicode_funcs_t *ufuncs, /** * hb_unicode_decompose_compatibility: * @ufuncs: Unicode functions. - * @u: + * @u: * @decomposed: (out): * - * * - * Return value: + * + * Return value: * * Since: 0.9.2 * Deprecated: 2.0.0 diff --git a/src/hb-uniscribe.cc b/src/hb-uniscribe.cc index 4000cd8..8d0473d 100644 --- a/src/hb-uniscribe.cc +++ b/src/hb-uniscribe.cc @@ -205,7 +205,7 @@ struct hb_uniscribe_shaper_funcs_t SSOT ScriptShapeOpenType; SPOT ScriptPlaceOpenType; - void init (void) + void init () { HMODULE hinstLib; this->ScriptItemizeOpenType = nullptr; @@ -232,12 +232,12 @@ struct hb_uniscribe_shaper_funcs_t }; -static void free_static_uniscribe_shaper_funcs (void); +static void free_static_uniscribe_shaper_funcs (); static struct hb_uniscribe_shaper_funcs_lazy_loader_t : hb_lazy_loader_t { - static hb_uniscribe_shaper_funcs_t *create (void) + static hb_uniscribe_shaper_funcs_t *create () { hb_uniscribe_shaper_funcs_t *funcs = (hb_uniscribe_shaper_funcs_t *) calloc (1, sizeof (hb_uniscribe_shaper_funcs_t)); if (unlikely (!funcs)) @@ -255,7 +255,7 @@ static struct hb_uniscribe_shaper_funcs_lazy_loader_t : hb_lazy_loader_t as_array (void) + hb_array_t as_array () { return hb_array (arrayZ(), len); } - hb_array_t as_array (void) const + hb_array_t as_array () const { return hb_array (arrayZ(), len); } hb_array_t sub_array (unsigned int start_offset, unsigned int count) const @@ -105,9 +103,9 @@ struct hb_vector_t hb_array_t sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) { return as_array ().sub_array (start_offset, count);} - hb_sorted_array_t as_sorted_array (void) + hb_sorted_array_t as_sorted_array () { return hb_sorted_array (arrayZ(), len); } - hb_sorted_array_t as_sorted_array (void) const + hb_sorted_array_t as_sorted_array () const { return hb_sorted_array (arrayZ(), len); } hb_array_t sorted_sub_array (unsigned int start_offset, unsigned int count) const @@ -119,15 +117,15 @@ struct hb_vector_t hb_array_t sorted_sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) { return as_sorted_array ().sorted_sub_array (start_offset, count);} - template explicit_operator T * (void) { return arrayZ(); } - template explicit_operator const T * (void) const { return arrayZ(); } - operator hb_array_t (void) { return as_array (); } - operator hb_array_t (void) const { return as_array (); } + template explicit_operator T * () { return arrayZ(); } + template explicit_operator const T * () const { return arrayZ(); } + operator hb_array_t () { return as_array (); } + operator hb_array_t () const { return as_array (); } Type * operator + (unsigned int i) { return arrayZ() + i; } const Type * operator + (unsigned int i) const { return arrayZ() + i; } - Type *push (void) + Type *push () { if (unlikely (!resize (len + 1))) return &Crap(Type); @@ -140,7 +138,7 @@ struct hb_vector_t return p; } - bool in_error (void) const { return allocated == 0; } + bool in_error () const { return allocated == 0; } /* Allocate for size but don't adjust len. */ bool alloc (unsigned int size) @@ -197,7 +195,7 @@ struct hb_vector_t return true; } - void pop (void) + void pop () { if (!len) return; len--; diff --git a/src/hb.hh b/src/hb.hh index e4b9a81..29501e7 100644 --- a/src/hb.hh +++ b/src/hb.hh @@ -357,15 +357,15 @@ static_assert ((sizeof (hb_var_int_t) == 4), ""); TypeName(const TypeName&); \ void operator=(const TypeName&) #define HB_NO_CREATE_COPY_ASSIGN(TypeName) \ - TypeName(void); \ + TypeName(); \ TypeName(const TypeName&); \ void operator=(const TypeName&) #define HB_NO_CREATE_COPY_ASSIGN_TEMPLATE(TypeName, T) \ - TypeName(void); \ + TypeName(); \ TypeName(const TypeName&); \ void operator=(const TypeName&) #define HB_NO_CREATE_COPY_ASSIGN_TEMPLATE2(TypeName, T1, T2) \ - TypeName(void); \ + TypeName(); \ TypeName(const TypeName&); \ void operator=(const TypeName&) diff --git a/src/test-unicode-ranges.cc b/src/test-unicode-ranges.cc index d9342d7..ec9d17a 100644 --- a/src/test-unicode-ranges.cc +++ b/src/test-unicode-ranges.cc @@ -42,7 +42,7 @@ test (hb_codepoint_t cp, unsigned int bit) } static void -test_get_unicode_range_bit (void) +test_get_unicode_range_bit () { test (0x0000, 0); test (0x0042, 0); @@ -60,7 +60,7 @@ test_get_unicode_range_bit (void) } int -main (void) +main () { test_get_unicode_range_bit (); return 0; diff --git a/util/ansi-print.cc b/util/ansi-print.cc index 5e2845c..49a0477 100644 --- a/util/ansi-print.cc +++ b/util/ansi-print.cc @@ -74,7 +74,7 @@ struct color_t color_t c = {(0xFFu<<24) | ((0xFFu*(x&1))<<16) | ((0xFFu*((x >> 1)&1))<<8) | (0xFFu*((x >> 2)&1))}; return c; } - unsigned int to_ansi (void) + unsigned int to_ansi () { return ((v >> 23) & 1) | ((v >> 14)&2) | ((v >> 5)&4); } @@ -110,7 +110,7 @@ struct image_t own_data (true), data ((color_t *) malloc (sizeof (data[0]) * width * height)), stride (width) {} - ~image_t (void) + ~image_t () { if (own_data) free (data); } color_t &operator () (unsigned int x, unsigned int y) @@ -161,7 +161,7 @@ struct biimage_t height (height), bg (0), fg (0), unicolor (true), data ((uint8_t *) malloc (sizeof (data[0]) * width * height)) {} - ~biimage_t (void) + ~biimage_t () { free (data); } void set (const image_t &image) diff --git a/util/hb-fc.cc b/util/hb-fc.cc index cb89991..2fe0146 100644 --- a/util/hb-fc.cc +++ b/util/hb-fc.cc @@ -72,7 +72,7 @@ hb_fc_get_glyph (hb_font_t *font /*HB_UNUSED*/, } static hb_font_funcs_t * -_hb_fc_get_font_funcs (void) +_hb_fc_get_font_funcs () { static const hb_font_funcs_t *fc_ffuncs; diff --git a/util/hb-shape.cc b/util/hb-shape.cc index 1a67123..3ae3fa1 100644 --- a/util/hb-shape.cc +++ b/util/hb-shape.cc @@ -83,10 +83,7 @@ struct output_buffer_t if (format.trace) hb_buffer_set_message_func (buffer, message_func, this, nullptr); } - void new_line (void) - { - line_no++; - } + void new_line () { line_no++; } void consume_text (hb_buffer_t *buffer, const char *text, unsigned int text_len, diff --git a/util/helper-cairo.cc b/util/helper-cairo.cc index 7a698f3..b4f94a9 100644 --- a/util/helper-cairo.cc +++ b/util/helper-cairo.cc @@ -66,7 +66,7 @@ static FT_Library ft_library; #ifdef HAVE_ATEXIT static inline -void free_ft_library (void) +void free_ft_library () { FT_Done_FreeType (ft_library); } diff --git a/util/helper-cairo.hh b/util/helper-cairo.hh index 1613ce4..5bfbf7b 100644 --- a/util/helper-cairo.hh +++ b/util/helper-cairo.hh @@ -60,7 +60,7 @@ struct helper_cairo_line_t { unsigned int num_clusters; cairo_text_cluster_flags_t cluster_flags; - void finish (void) { + void finish () { if (glyphs) cairo_glyph_free (glyphs); if (clusters) diff --git a/util/main-font-text.hh b/util/main-font-text.hh index 01bd2d4..36b654b 100644 --- a/util/main-font-text.hh +++ b/util/main-font-text.hh @@ -50,7 +50,7 @@ locale_to_utf8 (char *s) template struct main_font_text_t { - main_font_text_t (void) + main_font_text_t () : options ("[FONT-FILE] [TEXT]"), font_opts (&options, default_font_size, subpixel_bits), input (&options), diff --git a/util/options.cc b/util/options.cc index 4e6e29b..04ddcf6 100644 --- a/util/options.cc +++ b/util/options.cc @@ -62,7 +62,7 @@ fail (hb_bool_t suggest_help, const char *format, ...) static gchar * -shapers_to_string (void) +shapers_to_string () { GString *shapers = g_string_new (nullptr); const char **shaper_list = hb_shape_list_shapers (); @@ -95,7 +95,7 @@ show_version (const char *name G_GNUC_UNUSED, void -option_parser_t::add_main_options (void) +option_parser_t::add_main_options () { GOptionEntry entries[] = { @@ -638,7 +638,7 @@ output_options_t::add_options (option_parser_t *parser) hb_font_t * -font_options_t::get_font (void) const +font_options_t::get_font () const { if (font) return font; @@ -795,7 +795,7 @@ text_options_t::get_line (unsigned int *len) FILE * -output_options_t::get_file_handle (void) +output_options_t::get_file_handle () { if (fp) return fp; diff --git a/util/options.hh b/util/options.hh index a4210c2..d704519 100644 --- a/util/options.hh +++ b/util/options.hh @@ -54,7 +54,7 @@ void fail (hb_bool_t suggest_help, const char *format, ...) G_GNUC_NORETURN G_GN struct option_group_t { - virtual ~option_group_t (void) {} + virtual ~option_group_t () {} virtual void add_options (struct option_parser_t *parser) = 0; @@ -74,14 +74,14 @@ struct option_parser_t add_main_options (); } - ~option_parser_t (void) + ~option_parser_t () { g_option_context_free (context); g_ptr_array_foreach (to_free, (GFunc) g_free, nullptr); g_ptr_array_free (to_free, TRUE); } - void add_main_options (void); + void add_main_options (); void add_group (GOptionEntry *entries, const gchar *name, @@ -95,7 +95,7 @@ struct option_parser_t void parse (int *argc, char ***argv); - G_GNUC_NORETURN void usage (void) { + G_GNUC_NORETURN void usage () { g_printerr ("Usage: %s [OPTION...] %s\n", g_get_prgname (), usage_str); exit (1); } @@ -125,7 +125,7 @@ struct view_options_t : option_group_t add_options (parser); } - virtual ~view_options_t (void) + virtual ~view_options_t () { g_free (fore); g_free (back); @@ -161,7 +161,7 @@ struct shape_options_t : option_group_t add_options (parser); } - virtual ~shape_options_t (void) + virtual ~shape_options_t () { g_free (direction); g_free (language); @@ -467,7 +467,7 @@ struct font_options_t : option_group_t add_options (parser); } - virtual ~font_options_t (void) + virtual ~font_options_t () { g_free (font_file); free (variations); @@ -477,7 +477,7 @@ struct font_options_t : option_group_t void add_options (option_parser_t *parser); - hb_font_t *get_font (void) const; + hb_font_t *get_font () const; char *font_file; mutable hb_blob_t *blob; @@ -517,7 +517,7 @@ struct text_options_t : option_group_t add_options (parser); } - virtual ~text_options_t (void) + virtual ~text_options_t () { g_free (text_before); g_free (text_after); @@ -568,7 +568,7 @@ struct output_options_t : option_group_t add_options (parser); } - virtual ~output_options_t (void) + virtual ~output_options_t () { g_free (output_file); g_free (output_format); @@ -596,7 +596,7 @@ struct output_options_t : option_group_t output_file = nullptr; /* STDOUT */ } - FILE *get_file_handle (void); + FILE *get_file_handle (); char *output_file; char *output_format; diff --git a/util/view-cairo.hh b/util/view-cairo.hh index 5be3523..1f51f0e 100644 --- a/util/view-cairo.hh +++ b/util/view-cairo.hh @@ -39,7 +39,7 @@ struct view_cairo_t view_options (parser), direction (HB_DIRECTION_INVALID), lines (0), scale_bits (0) {} - ~view_cairo_t (void) { + ~view_cairo_t () { cairo_debug_reset_static_data (); } @@ -48,19 +48,13 @@ struct view_cairo_t lines = g_array_new (false, false, sizeof (helper_cairo_line_t)); scale_bits = - (int) font_opts->subpixel_bits; } - void new_line (void) - { - } + void new_line () {} void consume_text (hb_buffer_t *buffer, const char *text, unsigned int text_len, - hb_bool_t utf8_clusters) - { - } + hb_bool_t utf8_clusters) {} void error (const char *message) - { - g_printerr ("%s: %s\n", g_get_prgname (), message); - } + { g_printerr ("%s: %s\n", g_get_prgname (), message); } void consume_glyphs (hb_buffer_t *buffer, const char *text, unsigned int text_len, -- 2.7.4