#include "hb-ot-shape-complex-indic.hh"
int
-main (void)
+main ()
{
for (hb_codepoint_t u = 0; u <= 0x10FFFF; u++)
{
#include "hb-ot-shape-complex-khmer.hh"
int
-main (void)
+main ()
{
for (hb_codepoint_t u = 0; u <= 0x10FFFF; u++)
{
#include "hb-ot-shape-complex-myanmar.hh"
int
-main (void)
+main ()
{
for (hb_codepoint_t u = 0; u <= 0x10FFFF; u++)
{
#include "hb-ot-shape-complex-use.hh"
int
-main (void)
+main ()
{
for (hb_codepoint_t u = 0; u <= 0x10FFFF; u++)
{
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,
/* 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<OT::HBUINT16>& Null<AAT::Lookup<OT::HBUINT16> > (void) {
- return *reinterpret_cast<const AAT::Lookup<OT::HBUINT16> *> (_hb_Null_AAT_Lookup);
-}
+/*static*/ inline const AAT::Lookup<OT::HBUINT16>& Null<AAT::Lookup<OT::HBUINT16> > ()
+{ return *reinterpret_cast<const AAT::Lookup<OT::HBUINT16> *> (_hb_Null_AAT_Lookup); }
template <>
-/*static*/ inline const AAT::Lookup<OT::HBUINT32>& Null<AAT::Lookup<OT::HBUINT32> > (void) {
- return *reinterpret_cast<const AAT::Lookup<OT::HBUINT32> *> (_hb_Null_AAT_Lookup);
-}
+/*static*/ inline const AAT::Lookup<OT::HBUINT32>& Null<AAT::Lookup<OT::HBUINT32> > ()
+{ return *reinterpret_cast<const AAT::Lookup<OT::HBUINT32> *> (_hb_Null_AAT_Lookup); }
template <>
-/*static*/ inline const AAT::Lookup<OT::Offset<OT::HBUINT16, false> >& Null<AAT::Lookup<OT::Offset<OT::HBUINT16, false> > > (void) {
- return *reinterpret_cast<const AAT::Lookup<OT::Offset<OT::HBUINT16, false> > *> (_hb_Null_AAT_Lookup);
-}
+/*static*/ inline const AAT::Lookup<OT::Offset<OT::HBUINT16, false> >& Null<AAT::Lookup<OT::Offset<OT::HBUINT16, false> > > ()
+{ return *reinterpret_cast<const AAT::Lookup<OT::Offset<OT::HBUINT16, false> > *> (_hb_Null_AAT_Lookup); }
namespace AAT {
enum { DELETED_GLYPH = 0xFFFF };
return (this+classTable).get_class (glyph_id, num_glyphs, 1);
}
- const Entry<Extra> *get_entries (void) const
+ const Entry<Extra> *get_entries () const
{ return (this+entryTable).arrayZ; }
const Entry<Extra> *get_entryZ (int state, unsigned int klass) const
struct hb_aat_apply_context_t :
hb_dispatch_context_t<hb_aat_apply_context_t, bool, HB_DEBUG_APPLY>
{
- const char *get_name (void) { return "APPLY"; }
+ const char *get_name () { return "APPLY"; }
template <typename T>
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;
hb_buffer_t *buffer_,
hb_blob_t *blob = const_cast<hb_blob_t *> (&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_);
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,
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
{
{
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,
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
{
struct KernPair
{
- int get_kerning (void) const
- { return value; }
+ int get_kerning () const { return value; }
int cmp (const hb_glyph_pair_t &o) const
{
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
{
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
{
{
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>
typename context_t::return_t dispatch (context_t *c) const
struct KerxTable
{
/* https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern */
- const T* thiz (void) const { return static_cast<const T *> (this); }
+ const T* thiz () const { return static_cast<const T *> (this); }
- bool has_state_machine (void) const
+ bool has_state_machine () const
{
typedef typename T::SubTable SubTable;
return false;
}
- bool has_cross_stream (void) const
+ bool has_cross_stream () const
{
typedef typename T::SubTable SubTable;
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
template <typename T>
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
{
}
}
- 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
{
{
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
{
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
{
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
{
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_,
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<hb_mask_t, 1> chain_flags;
/*
* 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 <unsigned int len_> hb_array_t (Type (&array_)[len_]) : arrayZ (array_), len (len_) {}
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<const Type> (void) { return hb_array_t<const Type> (arrayZ, len); }
- template <typename T> 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<const Type> () { return hb_array_t<const Type> (arrayZ, len); }
+ template <typename T> operator T * () const { return arrayZ; }
hb_array_t<Type> & operator += (unsigned int count)
{
len -= count;
return *this;
}
- hb_array_t<Type> & operator ++ (void) { *this += 1; }
- hb_array_t<Type> & operator -- (void) { *this -= 1; }
+ hb_array_t<Type> & operator ++ () { *this += 1; }
+ hb_array_t<Type> & operator -- () { *this -= 1; }
hb_array_t<Type> operator + (unsigned int count)
{ hb_array_t<Type> copy (*this); *this += count; return copy; }
hb_array_t<Type> operator - (unsigned int count)
::qsort (arrayZ, len, item_size, cmp_);
return hb_sorted_array_t<Type> (*this);
}
- hb_sorted_array_t<Type> qsort (void)
+ hb_sorted_array_t<Type> qsort ()
{
::qsort (arrayZ, len, item_size, Type::cmp);
return hb_sorted_array_t<Type> (*this);
* Other methods.
*/
- unsigned int get_size (void) const { return len * item_size; }
+ unsigned int get_size () const { return len * item_size; }
hb_array_t<Type> sub_array (unsigned int start_offset = 0, unsigned int *seg_count = nullptr /* IN/OUT */) const
{
{ 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 <typename hb_sanitize_context_t>
template <typename Type>
struct hb_sorted_array_t : hb_array_t<Type>
{
- hb_sorted_array_t (void) : hb_array_t<Type> () {}
+ hb_sorted_array_t () : hb_array_t<Type> () {}
hb_sorted_array_t (const hb_array_t<Type> &o) : hb_array_t<Type> (o) {}
hb_sorted_array_t (Type *array_, unsigned int len_) : hb_array_t<Type> (array_, len_) {}
#include <windows.h>
-static inline void _hb_memory_barrier (void)
+static inline void _hb_memory_barrier ()
{
#if !defined(MemoryBarrier)
/* MinGW has a convoluted history of supporting MemoryBarrier. */
{
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;
};
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 <typename C> operator C * (void) const { return get (); }
+ T * operator -> () const { return get (); }
+ template <typename C> operator C * () const { return get (); }
T *v;
};
* Since: 0.9.2
**/
hb_blob_t *
-hb_blob_get_empty (void)
+hb_blob_get_empty ()
{
return const_cast<hb_blob_t *> (&Null(hb_blob_t));
}
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;
}
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");
}
bool
-hb_blob_t::try_make_writable (void)
+hb_blob_t::try_make_writable ()
{
if (hb_object_is_immutable (this))
return false;
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)
{
}
}
- 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 <typename Type>
- const Type* as (void) const
+ const Type* as () const
{
return length < hb_null_size (Type) ? &Null(Type) : reinterpret_cast<const Type *> (data);
}
- hb_bytes_t as_bytes (void) const
+ hb_bytes_t as_bytes () const
{ return hb_bytes_t (data, length); }
public:
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 <typename C> operator const C * (void) const { return get (); }
- operator const char * (void) const { return (const char *) get (); }
- const T * get (void) const { return b->as<T> (); }
- 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 <typename C> operator const C * () const { return get (); }
+ operator const char * () const { return (const char *) get (); }
+ const T * get () const { return b->as<T> (); }
+ 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<hb_blob_t> b;
};
* Since: 0.9.7
**/
const char **
-hb_buffer_serialize_list_formats (void)
+hb_buffer_serialize_list_formats ()
{
return serialize_formats;
}
/* HarfBuzz-Internal API */
void
-hb_buffer_t::reset (void)
+hb_buffer_t::reset ()
{
if (unlikely (hb_object_is_immutable (this)))
return;
}
void
-hb_buffer_t::clear (void)
+hb_buffer_t::clear ()
{
if (unlikely (hb_object_is_immutable (this)))
return;
void
-hb_buffer_t::remove_output (void)
+hb_buffer_t::remove_output ()
{
if (unlikely (hb_object_is_immutable (this)))
return;
}
void
-hb_buffer_t::clear_output (void)
+hb_buffer_t::clear_output ()
{
if (unlikely (hb_object_is_immutable (this)))
return;
}
void
-hb_buffer_t::clear_positions (void)
+hb_buffer_t::clear_positions ()
{
if (unlikely (hb_object_is_immutable (this)))
return;
}
void
-hb_buffer_t::swap_buffers (void)
+hb_buffer_t::swap_buffers ()
{
if (unlikely (!successful)) return;
}
void
-hb_buffer_t::reverse (void)
+hb_buffer_t::reverse ()
{
if (unlikely (!len))
return;
}
void
-hb_buffer_t::reverse_clusters (void)
+hb_buffer_t::reverse_clusters ()
{
unsigned int i, start, count, last_cluster;
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(). */
}
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));
* Since: 0.9.2
**/
hb_buffer_t *
-hb_buffer_create (void)
+hb_buffer_create ()
{
hb_buffer_t *buffer;
* Since: 0.9.2
**/
hb_buffer_t *
-hb_buffer_get_empty (void)
+hb_buffer_get_empty ()
{
return const_cast<hb_buffer_t *> (&Null(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;
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,
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;
/* 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)
{
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++)
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)
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 ())
}
}
- 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;
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);
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
struct ByteStr
{
- ByteStr (void)
+ ByteStr ()
: str (&Null(UnsizedByteStr)), len (0) {}
ByteStr (const UnsizedByteStr& s, unsigned int l)
: str (&s), len (l) {}
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); }
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) {}
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
{
}
}
- 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 */
template <typename ELEM, int LIMIT>
struct Stack
{
- void init (void)
+ void init ()
{
error = false;
count = 0;
elements[i].init ();
}
- void fini (void)
+ void fini ()
{
elements.fini_deep ();
}
set_error ();
}
- ELEM &push (void)
+ ELEM &push ()
{
if (likely (count < elements.len))
return elements[count++];
}
}
- ELEM& pop (void)
+ ELEM& pop ()
{
if (likely (count > 0))
return elements[--count];
set_error ();
}
- const ELEM& peek (void)
+ const ELEM& peek ()
{
if (likely (count > 0))
return elements[count-1];
}
}
- void unpop (void)
+ void unpop ()
{
if (likely (count < elements.len))
count++;
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;
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;
/* 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;
template <typename VAL>
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 ())
{
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); }
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 ()))
return argStack[i];
}
- ARG& pop_arg (void)
+ ARG& pop_arg ()
{
return argStack.pop ();
}
argStack.pop (n);
}
- void clear_args (void)
+ void clear_args ()
{
pop_n_args (argStack.get_count ());
}
template <typename ENV>
struct Interpreter {
- ~Interpreter(void) { fini (); }
+ ~Interpreter() { fini (); }
- void fini (void) { env.fini (); }
+ void fini () { env.fini (); }
ENV env;
};
subr_num = subr_num_;
}
- void fini (void) {}
+ void fini () {}
SubByteStr substr;
CSType type;
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
{
struct Point
{
- void init (void)
+ void init ()
{
x.init ();
y.init ();
globalSubrs.init (globalSubrs_);
localSubrs.init (localSubrs_);
}
- void fini (void)
+ void fini ()
{
InterpEnv<ARG>::fini ();
localSubrs.fini ();
}
- bool in_error (void) const
+ bool in_error () const
{
return callStack.in_error () || SUPER::in_error ();
}
SUPER::substr = context.substr;
}
- void returnFromSubr (void)
+ void returnFromSubr ()
{
if (unlikely (SUPER::substr.in_error ()))
SUPER::set_error ();
SUPER::substr = context.substr;
}
- void determine_hintmask_size (void)
+ void determine_hintmask_size ()
{
if (!seen_hintmask)
{
}
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_; }
/* 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;
};
template <typename OPSTR=OpStr>
struct TopDictValues : DictValues<OPSTR>
{
- void init (void)
+ void init ()
{
DictValues<OPSTR>::init ();
charStringsOffset = 0;
FDArrayOffset = 0;
}
-
- void fini (void)
- {
- DictValues<OPSTR>::fini ();
- }
+ void fini () { DictValues<OPSTR>::fini (); }
unsigned int calculate_serialized_op_size (const OPSTR& opstr) const
{
in_seac = false;
}
- void fini (void) { SUPER::fini (); }
+ void fini () { SUPER::fini (); }
void set_width (bool has_width_)
{
processed_width = true;
}
- void clear_args (void)
+ void clear_args ()
{
arg_start = 0;
SUPER::clear_args ();
struct BlendArg : Number
{
- void init (void)
+ void init ()
{
Number::init ();
deltas.init ();
}
- void fini (void)
+ void fini ()
{
Number::fini ();
deltas.fini_deep ();
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);
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 ();
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)
{
}
}
- void process_vsindex (void)
+ void process_vsindex ()
{
unsigned int index = argStack.pop_uint ();
if (unlikely (seen_vsindex () || seen_blend))
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)
hb_atomic_int_t _hb_options;
void
-_hb_options_init (void)
+_hb_options_init ()
{
hb_options_union_t u;
u.i = 0;
return *this;
}
- void fini (void) { free ((void *) lang); }
+ void fini () { free ((void *) lang); }
};
#if HB_USE_ATEXIT
static void
-free_langs (void)
+free_langs ()
{
retry:
hb_language_item_t *first_lang = langs;
* Since: 0.9.2
**/
hb_language_t
-hb_language_get_default (void)
+hb_language_get_default ()
{
static hb_atomic_ptr_t <hb_language_t> default_language;
* Since: 0.9.2
**/
const char *
-hb_version_string (void)
+hb_version_string ()
{
return HB_VERSION_STRING;
}
#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<hb_remove_pointer (HB_LOCALE_T),
hb_C_locale_lazy_loader_t>
{
- static HB_LOCALE_T create (void)
+ static HB_LOCALE_T create ()
{
HB_LOCALE_T C_locale = HB_CREATE_LOCALE ("C");
{
HB_FREE_LOCALE (p);
}
- static HB_LOCALE_T get_null (void)
+ static HB_LOCALE_T get_null ()
{
return nullptr;
}
#if HB_USE_ATEXIT
static
-void free_static_C_locale (void)
+void free_static_C_locale ()
{
static_C_locale.free_instance ();
}
#endif
static HB_LOCALE_T
-get_C_locale (void)
+get_C_locale ()
{
return static_C_locale.get_unconst ();
}
static CTFontDescriptorRef
-get_last_resort_font_desc (void)
+get_last_resort_font_desc ()
{
// TODO Handle allocation failures?
CTFontDescriptorRef last_resort = CTFontDescriptorCreateWithNameAndSize (CFSTR("LastResort"), 0);
static_assert ((sizeof (hb_atomic_int_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;
_hb_debug_msg_va<max_level> (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<ret_t> (returned);
if (!returned) {
// 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
// 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
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.
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;)
}
IFACEMETHODIMP_ (DWRITE_READING_DIRECTION)
- GetParagraphReadingDirection (void) { return mReadingDirection; }
+ GetParagraphReadingDirection () { return mReadingDirection; }
IFACEMETHODIMP GetLocaleName (uint32_t textPosition, uint32_t* textLength,
wchar_t const** localeName)
{ return process<HbOpAnd> (o); }
hb_vector_size_t operator ^ (const hb_vector_size_t &o) const
{ return process<HbOpXor> (o); }
- hb_vector_size_t operator ~ (void) const
+ hb_vector_size_t operator ~ () const
{
hb_vector_size_t r;
#if HB_VECTOR_SIZE && 0
* Since: 0.9.2
**/
hb_face_t *
-hb_face_get_empty (void)
+hb_face_get_empty ()
{
return const_cast<hb_face_t *> (&Null(hb_face_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))
* 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 ();
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))
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))
}
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);
* Since: 0.9.2
**/
hb_font_funcs_t *
-hb_font_funcs_create (void)
+hb_font_funcs_create ()
{
hb_font_funcs_t *ffuncs;
* 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_t *> (&_hb_font_funcs_default);
}
* Since: 0.9.2
**/
hb_font_t *
-hb_font_get_empty (void)
+hb_font_get_empty ()
{
return const_cast<hb_font_t *> (&Null(hb_font_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);
/* 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]); \
}
#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<hb_ft_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 ();
#if HB_USE_ATEXIT
static
-void free_static_ft_funcs (void)
+void free_static_ft_funcs ()
{
static_ft_funcs.free_instance ();
}
#endif
static hb_font_funcs_t *
-_hb_ft_get_font_funcs (void)
+_hb_ft_get_font_funcs ()
{
return static_ft_funcs.get_unconst ();
}
}
#if HB_USE_ATEXIT
-static void free_static_ft_library (void);
+static void free_static_ft_library ();
#endif
static struct hb_ft_library_lazy_loader_t : hb_lazy_loader_t<hb_remove_pointer (FT_Library),
hb_ft_library_lazy_loader_t>
{
- static FT_Library create (void)
+ static FT_Library create ()
{
FT_Library l;
if (FT_Init_FreeType (&l))
{
FT_Done_FreeType (l);
}
- static FT_Library get_null (void)
+ static FT_Library get_null ()
{
return nullptr;
}
#if HB_USE_ATEXIT
static
-void free_static_ft_library (void)
+void free_static_ft_library ()
{
static_ft_library.free_instance ();
}
#endif
static FT_Library
-get_ft_library (void)
+get_ft_library ()
{
return static_ft_library.get_unconst ();
}
#if HB_USE_ATEXIT
-static void free_static_glib_funcs (void);
+static void free_static_glib_funcs ();
#endif
static struct hb_glib_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader_t<hb_glib_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);
#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 ();
}
/*** BEGIN value-header ***/
GType
-@enum_name@_get_type (void)
+@enum_name@_get_type ()
{
static gsize type_id = 0;
/*** 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 ***/
#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)) { \
#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<hb_icu_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
#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 ();
}
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<T *> & operator ++ (void)
+ Iter<T *> & operator ++ ()
{
if (unlikely (!length)) return *this;
array++;
}
/* 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. */
/* XXX Remove
* Just to test these compile. */
static inline void
-m (void)
+m ()
{
const int src[10] = {};
int dst[20];
/* 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)
#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) }
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)
typedef Return return_t;
template <typename T, typename F>
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; }
};
struct hb_sanitize_context_t :
hb_dispatch_context_t<hb_sanitize_context_t, bool, HB_DEBUG_SANITIZE>
{
- hb_sanitize_context_t (void) :
+ hb_sanitize_context_t () :
debug_depth (0),
start (nullptr), end (nullptr),
max_ops (0),
num_glyphs (65536),
num_glyphs_set (false) {}
- const char *get_name (void) { return "SANITIZE"; }
+ const char *get_name () { return "SANITIZE"; }
template <typename T, typename F>
bool may_dispatch (const T *obj HB_UNUSED, const F *format)
{ return format->sanitize (this); }
template <typename T>
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)
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_; }
}
}
- 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,
(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",
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:
reset ();
}
- void reset (void)
+ void reset ()
{
this->ran_out_of_room = false;
this->head = this->start;
/* To be called around main operation. */
template <typename Type>
- Type *start_serialize (void)
+ Type *start_serialize ()
{
DEBUG_MSG_LEVEL (SERIALIZE, this->start, 0, +1,
"start [%p..%p] (%lu bytes)",
return start_embed<Type> ();
}
- void end_serialize (void)
+ void end_serialize ()
{
DEBUG_MSG_LEVEL (SERIALIZE, this->start, 0, -1,
"end [%p..%p] serialized %d bytes; %s",
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)
{
}
template <typename Type>
- Type *allocate_min (void)
+ Type *allocate_min ()
{
return this->allocate_size<Type> (Type::min_size);
}
/* Output routines. */
template <typename Type>
- Type *copy (void) const
+ Type *copy () const
{
assert (!this->ran_out_of_room);
unsigned int len = this->head - this->start;
memcpy (p, this->start, len);
return reinterpret_cast<Type *> (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;
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,
{
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 <typename Type>
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.
v[1] = (V >> 8) & 0xFF;
v[2] = (V ) & 0xFF;
}
- operator Type (void) const
+ operator Type () const
{
return (v[0] << 16)
+ (v[1] << 8)
v[2] = (V >> 8) & 0xFF;
v[3] = (V ) & 0xFF;
}
- operator Type (void) const
+ operator Type () const
{
return (v[0] << 24)
+ (v[1] << 16)
{
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 <typename Stored, typename Subclass>
- 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<void, 0>
{
- bool is_inert (void) const { return false; }
+ bool is_inert () const { return false; }
template <typename Stored, typename Funcs>
- Stored * call_create (void) const { return Funcs::create (); }
+ Stored * call_create () const { return Funcs::create (); }
};
template <typename T1, typename T2> struct hb_non_void_t { typedef T1 value; };
hb_lazy_loader_t<Returned,Subclass,Data,WheresData,Stored>
>::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 ();
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 <typename C> operator const C * (void) const { return get (); }
+ template <typename C> operator const C * () const { return get (); }
- Stored * get_stored (void) const
+ Stored * get_stored () const
{
retry:
Stored *p = this->instance.get ();
}
return p;
}
- Stored * get_stored_relaxed (void) const
+ Stored * get_stored_relaxed () const
{
return this->instance.get_relaxed ();
}
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<Returned *> (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<Returned *> (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));
p->init (data);
return p;
}
- static Stored *create (void)
+ static Stored *create ()
{
Stored *p = (Stored *) calloc (1, sizeof (Stored));
if (likely (p))
hb_blob_t>
{
static hb_blob_t *create (hb_face_t *face)
- {
- return hb_sanitize_context_t ().reference_table<T> (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<T> (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<T> ();
- }
+ { return blob->as<T> (); }
- hb_blob_t* get_blob (void) const
- {
- return this->get_stored ();
- }
+ hb_blob_t* get_blob () const { return this->get_stored (); }
};
template <typename Subclass>
struct hb_font_funcs_lazy_loader_t : hb_lazy_loader_t<hb_font_funcs_t, Subclass>
{
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 <typename Subclass>
struct hb_unicode_funcs_lazy_loader_t : hb_lazy_loader_t<hb_unicode_funcs_t, Subclass>
{
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 (); }
};
* Since: 1.7.7
**/
hb_map_t *
-hb_map_create (void)
+hb_map_create ()
{
hb_map_t *map;
* Since: 1.7.7
**/
hb_map_t *
-hb_map_get_empty (void)
+hb_map_get_empty ()
{
return const_cast<hb_map_t *> (&Null(hb_map_t));
}
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;
unsigned int prime;
item_t *items;
- void init_shallow (void)
+ void init_shallow ()
{
successful = true;
population = occupancy = 0;
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;
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:
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;
};
/* Generic nul-content Null objects. */
template <typename Type>
-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<Type const *> (_hb_NullPool);
}
struct NullHelper
{
typedef typename hb_remove_const (typename hb_remove_reference (QType)) Type;
- static const Type & get_null (void) { return Null<Type> (); }
+ static const Type & get_null () { return Null<Type> (); }
};
#define Null(Type) NullHelper<Type>::get_null ()
} /* Close namespace. */ \
extern HB_INTERNAL const unsigned char _hb_Null_##Namespace##_##Type[Namespace::Type::null_size]; \
template <> \
- /*static*/ inline const Namespace::Type& Null<Namespace::Type> (void) { \
+ /*static*/ inline const Namespace::Type& Null<Namespace::Type> () { \
return *reinterpret_cast<const Namespace::Type *> (_hb_Null_##Namespace##_##Type); \
} \
namespace Namespace { \
#define DECLARE_NULL_INSTANCE(Type) \
extern HB_INTERNAL const Type _hb_Null_##Type; \
template <> \
- /*static*/ inline const Type& Null<Type> (void) { \
+ /*static*/ inline const Type& Null<Type> () { \
return _hb_Null_##Type; \
} \
static_assert (true, "Just so we take semicolon after.")
/* CRAP pool: Common Region for Access Protection. */
template <typename Type>
-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<Type *> (_hb_CrapPool);
memcpy (obj, &Null(Type), sizeof (*obj));
struct CrapHelper
{
typedef typename hb_remove_const (typename hb_remove_reference (QType)) Type;
- static Type & get_crap (void) { return Crap<Type> (); }
+ static Type & get_crap () { return Crap<Type> (); }
};
#define Crap(Type) CrapHelper<Type>::get_crap ()
template <typename Type>
struct CrapOrNullHelper {
- static Type & get (void) { return Crap(Type); }
+ static Type & get () { return Crap(Type); }
};
template <typename Type>
struct CrapOrNullHelper<const Type> {
- static const Type & get (void) { return Null(Type); }
+ static const Type & get () { return Null(Type); }
};
#define CrapOrNull(Type) CrapOrNullHelper<Type>::get ()
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 <typename C> 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<T *> (&Null(T)); }
- T * get_raw (void) const { return v; }
+ template <typename C> operator const C * () const { return get (); }
+ operator const char * () const { return (const char *) get (); }
+ T * get () const { return v ? v : const_cast<T *> (&Null(T)); }
+ T * get_raw () const { return v; }
T *v;
};
{
hb_vector_t <item_t, 1> items;
- void init (void) { items.init (); }
+ void init () { items.init (); }
template <typename T>
item_t *replace_or_insert (T v, lock_t &l, bool replace)
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; }
};
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<hb_user_data_item_t, hb_mutex_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,
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 (); }
};
}
template <typename Type>
-static inline Type *hb_object_create (void)
+static inline Type *hb_object_create ()
{
Type *obj = (Type *) calloc (1, sizeof (Type));
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)
{
{
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
{
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
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 */
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,
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++)
}
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]; }
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,
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 */
typedef typename hb_signedness_int<hb_is_signed<Type>::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<Type,Size> &o) const { return (Type) v == (Type) o.v; }
bool operator != (const IntType<Type,Size> &o) const { return !(*this == o); }
static int cmp (const IntType<Type,Size> *a, const IntType<Type,Size> *b) { return b->cmp (*a); }
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);
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);
struct Tag : HBUINT32
{
/* What the char* converters return is NOT nul-terminated. Print using "%.4s" */
- operator const char* (void) const { return reinterpret_cast<const char *> (&this->v); }
- operator char* (void) { return reinterpret_cast<char *> (&this->v); }
+ operator const char* () const { return reinterpret_cast<const char *> (&this->v); }
+ operator char* () { return reinterpret_cast<char *> (&this->v); }
public:
DEFINE_SIZE_STATIC (4);
};
{
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)
{
template <typename FixedType=HBUINT16>
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
{
template <typename Type, bool has_null>
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 <typename Type>
struct _hb_has_null<Type, true>
{
- 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 <typename Type, typename OffsetType=HBUINT16, bool has_null=true>
unsigned int get_size (unsigned int len) const
{ return len * Type::static_size; }
- template <typename T> operator T * (void) { return arrayZ; }
- template <typename T> operator const T * (void) const { return arrayZ; }
+ template <typename T> operator T * () { return arrayZ; }
+ template <typename T> operator const T * () const { return arrayZ; }
hb_array_t<Type> as_array (unsigned int len)
{ return hb_array (arrayZ, len); }
hb_array_t<const Type> as_array (unsigned int len) const
{ return hb_array (arrayZ, len); }
- operator hb_array_t<Type> (void) { return as_array (); }
- operator hb_array_t<const Type> (void) const { return as_array (); }
+ operator hb_array_t<Type> () { return as_array (); }
+ operator hb_array_t<const Type> () const { return as_array (); }
template <typename T>
Type &lsearch (unsigned int len, const T &x, Type ¬_found = Crap (Type))
{ return hb_sorted_array (this->arrayZ, len); }
hb_sorted_array_t<const Type> as_array (unsigned int len) const
{ return hb_sorted_array (this->arrayZ, len); }
- operator hb_sorted_array_t<Type> (void) { return as_array (); }
- operator hb_sorted_array_t<const Type> (void) const { return as_array (); }
+ operator hb_sorted_array_t<Type> () { return as_array (); }
+ operator hb_sorted_array_t<const Type> () const { return as_array (); }
template <typename T>
Type &bsearch (unsigned int len, const T &x, Type ¬_found = Crap (Type))
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<Type> as_array (void)
+ hb_array_t<Type> as_array ()
{ return hb_array (arrayZ, len); }
- hb_array_t<const Type> as_array (void) const
+ hb_array_t<const Type> as_array () const
{ return hb_array (arrayZ, len); }
- operator hb_array_t<Type> (void) { return as_array (); }
+ operator hb_array_t<Type> (void) { return as_array (); }
operator hb_array_t<const Type> (void) const { return as_array (); }
hb_array_t<const Type> sub_array (unsigned int start_offset, unsigned int count) const
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,
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 <typename T>
template <typename Type, typename LenType=HBUINT16>
struct SortedArrayOf : ArrayOf<Type, LenType>
{
- hb_sorted_array_t<Type> as_array (void)
+ hb_sorted_array_t<Type> as_array ()
{ return hb_sorted_array (this->arrayZ, this->len); }
- hb_sorted_array_t<const Type> as_array (void) const
+ hb_sorted_array_t<const Type> as_array () const
{ return hb_sorted_array (this->arrayZ, this->len); }
- operator hb_sorted_array_t<Type> (void) { return as_array (); }
- operator hb_sorted_array_t<const Type> (void) const { return as_array (); }
+ operator hb_sorted_array_t<Type> () { return as_array (); }
+ operator hb_sorted_array_t<const Type> () const { return as_array (); }
hb_array_t<const Type> sub_array (unsigned int start_offset, unsigned int count) const
{ return as_array ().sub_array (start_offset, count);}
template <typename LenType=HBUINT16>
struct BinSearchHeader
{
- operator uint32_t (void) const { return len; }
+ operator uint32_t () const { return len; }
bool sanitize (hb_sanitize_context_t *c) const
{
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;
if (unlikely (i >= get_length ())) return Crap (Type);
return StructAtOffset<Type> (&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
typedef hb_vector_t<char, 1> StrBuff;
struct StrBuffArray : hb_vector_t<StrBuff>
{
- 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++)
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)
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
{
return Null(ByteStr);
}
- unsigned int get_size (void) const
+ unsigned int get_size () const
{
if (this != &Null(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++)
struct TableInfo
{
- void init (void) { offSize = offset = size = 0; }
+ void init () { offSize = offset = size = 0; }
unsigned int offset;
unsigned int size;
* set to CFF_UNDEF_CODE if excluded from subset */
struct Remap : hb_vector_t<hb_codepoint_t>
{
- void init (void) { SUPER::init (); }
+ void init () { SUPER::init (); }
- void fini (void) { SUPER::fini (); }
+ void fini () { SUPER::fini (); }
bool reset (unsigned int size)
{
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;
template <typename GID_TYPE, typename FD_TYPE>
struct FDSelect3_4 {
- unsigned int get_size (void) const
+ unsigned int get_size () const
{ return GID_TYPE::static_size * 2 + FDSelect3_4_Range<GID_TYPE, FD_TYPE>::static_size * nRanges; }
bool sanitize (hb_sanitize_context_t *c, unsigned int fdcount) const
return (hb_codepoint_t)ranges[i - 1].fd;
}
- GID_TYPE &sentinel (void) { return StructAfter<GID_TYPE> (ranges[nRanges - 1]); }
- const GID_TYPE &sentinel (void) const { return StructAfter<GID_TYPE> (ranges[nRanges - 1]); }
+ GID_TYPE &sentinel () { return StructAfter<GID_TYPE> (ranges[nRanges - 1]); }
+ const GID_TYPE &sentinel () const { return StructAfter<GID_TYPE> (ranges[nRanges - 1]); }
GID_TYPE nRanges;
FDSelect3_4_Range<GID_TYPE, FD_TYPE> ranges[VAR];
struct Bounds
{
- void init (void)
+ void init ()
{
min.set_int (0x7FFFFFFF, 0x7FFFFFFF);
max.set_int (-0x80000000, -0x80000000);
}
}
- 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;
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;
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;
return CFF_UNDEF_CODE;
}
- unsigned int get_size (void) const
+ unsigned int get_size () const
{ return HBUINT8::static_size * (nCodes + 1); }
HBUINT8 nCodes;
};
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
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;
return size;
}
- unsigned int get_size (void) const
+ unsigned int get_size () const
{
unsigned int size = min_size;
if (table_format () == 0)
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<hb_codepoint_t> &codes) const
{
}
protected:
- const CFF1SuppEncData &suppEncData (void) const
+ const CFF1SuppEncData &suppEncData () const
{
if ((format & 0x7F) == 0)
return StructAfter<CFF1SuppEncData> (u.format0.codes[u.format0.nCodes-1]);
struct CFF1TopDictInterpEnv : NumInterpEnv
{
- CFF1TopDictInterpEnv (void)
+ CFF1TopDictInterpEnv ()
: NumInterpEnv(), prev_offset(0), last_offset(0) {}
unsigned int prev_offset;
ValCount
};
- void init (void)
+ void init ()
{
for (unsigned int i = 0; i < ValCount; i++)
values[i] = CFF_UNDEF_SID;
struct CFF1TopDictValues : TopDictValues<CFF1TopDictVal>
{
- void init (void)
+ void init ()
{
TopDictValues<CFF1TopDictVal>::init ();
FDSelectOffset = 0;
privateDictInfo.init ();
}
- void fini (void) { TopDictValues<CFF1TopDictVal>::fini (); }
+ void fini () { TopDictValues<CFF1TopDictVal>::fini (); }
- bool is_CID (void) const
+ bool is_CID () const
{ return nameSIDs[NameDictValues::registry] != CFF_UNDEF_SID; }
NameDictValues nameSIDs;
struct CFF1FontDictValues : DictValues<OpStr>
{
- void init (void)
+ void init ()
{
DictValues<OpStr>::init ();
privateDictInfo.init ();
fontName = CFF_UNDEF_SID;
}
-
- void fini (void)
- {
- DictValues<OpStr>::fini ();
- }
+ void fini () { DictValues<OpStr>::fini (); }
TableInfo privateDictInfo;
unsigned int fontName;
template <typename VAL>
struct CFF1PrivateDictValues_Base : DictValues<VAL>
{
- void init (void)
+ void init ()
{
DictValues<VAL>::init ();
subrsOffset = 0;
localSubrs = &Null(CFF1Subrs);
}
+ void fini () { DictValues<VAL>::fini (); }
- void fini (void)
- {
- DictValues<VAL>::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<VAL>::get_count; i++)
}
}
- void fini (void)
+ void fini ()
{
sc.end_processing ();
topDict.fini ();
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
{
}
}
- 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
{
struct ExtentsParam
{
- void init (void)
+ void init ()
{
path_open = false;
min_x.set_int (0x7FFFFFFF);
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)
{
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;
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++)
struct CFF2FontDictValues : DictValues<OpStr>
{
- void init (void)
+ void init ()
{
DictValues<OpStr>::init ();
privateDictInfo.init ();
}
-
- void fini (void)
- {
- DictValues<OpStr>::fini ();
- }
+ void fini () { DictValues<OpStr>::fini (); }
TableInfo privateDictInfo;
};
template <typename VAL>
struct CFF2PrivateDictValues_Base : DictValues<VAL>
{
- void init (void)
+ void init ()
{
DictValues<VAL>::init ();
subrsOffset = 0;
localSubrs = &Null(CFF2Subrs);
ivs = 0;
}
+ void fini () { DictValues<VAL>::fini (); }
- void fini (void)
- {
- DictValues<VAL>::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<VAL>::get_count; i++)
seen_vsindex = false;
}
- void process_vsindex (void)
+ void process_vsindex ()
{
if (likely (!seen_vsindex))
{
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:
}
}
- void fini (void)
+ void fini ()
{
sc.end_processing ();
fontDicts.fini_deep ();
blob = nullptr;
}
- bool is_valid (void) const { return blob != nullptr; }
+ bool is_valid () const { return blob != nullptr; }
protected:
hb_blob_t *blob;
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)
{
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
{
struct subset_plan
{
- size_t final_size (void) const
+ size_t final_size () const
{
return 4 // header
+ 8 * 3 // 3 EncodingRecord
}
}
- void fini (void) { this->table.destroy (); }
+ void fini () { this->table.destroy (); }
bool get_nominal_glyph (hb_codepoint_t unicode,
hb_codepoint_t *glyph) const
upem = hb_face_get_upem (face);
}
- void fini (void)
+ void fini ()
{
this->cblc.destroy ();
this->cbdt.destroy ();
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> cblc;
{
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,
{
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); }
}
private:
- const CPALV1Tail& v1 (void) const
+ const CPALV1Tail& v1 () const
{
if (version == 0) return Null(CPALV1Tail);
return StructAfter<CPALV1Tail> (*this);
{
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]; }
table = hb_sanitize_context_t().reference_table<sbix> (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);
{
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<SVG> (face); }
-
- void fini (void) { table.destroy (); }
+ void fini () { table.destroy (); }
hb_blob_t *reference_blob_for_glyph (hb_codepoint_t glyph_id) const
{
table->svgDocEntries);
}
- bool has_data (void) const { return table->has_data (); }
+ bool has_data () const { return table->has_data (); }
private:
hb_blob_ptr_t<SVG> table;
#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)
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)))
}
#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<hb_ot_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 ();
#if HB_USE_ATEXIT
static
-void free_static_ot_funcs (void)
+void free_static_ot_funcs ()
{
static_ot_funcs.free_instance ();
}
#endif
static hb_font_funcs_t *
-_hb_ot_get_font_funcs (void)
+_hb_ot_get_font_funcs ()
{
return static_ot_funcs.get_unconst ();
}
HBUINT16 flags;
GlyphID glyphIndex;
- unsigned int get_size (void) const
+ unsigned int get_size () const
{
unsigned int size = min_size;
// arg1 and 2 are int16
const char *glyph_end;
const CompositeGlyphHeader *current;
- bool move_to_next (void)
+ bool move_to_next ()
{
if (current->flags & CompositeGlyphHeader::MORE_COMPONENTS)
{
num_glyphs = MAX (1u, loca_table.get_length () / (short_offset ? 2 : 4)) - 1;
}
- void fini (void)
+ void fini ()
{
loca_table.destroy ();
glyf_table.destroy ();
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
{
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
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. */
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
{
var_table = hb_sanitize_context_t().reference_table<HVARVVAR> (face, T::variationsTag);
}
- void fini (void)
+ void fini ()
{
table.destroy ();
var_table.destroy ();
template <typename KernSubTableHeader>
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
{
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
{
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
{
{
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 ();
}
}
- bool has_cross_stream (void) const
+ bool has_cross_stream () const
{
switch (get_type ()) {
case 0: return u.ot.has_cross_stream ();
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
{
struct BaseCoordFormat2
{
- hb_position_t get_coord (void) const
+ hb_position_t get_coord () const
{
/* TODO */
return coordinate;
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
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
{
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,
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]; }
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;
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); }
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
{
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]; }
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
struct Lookup
{
- unsigned int get_subtable_count (void) const { return subTable.len; }
+ unsigned int get_subtable_count () const { return subTable.len; }
template <typename TSubTable>
const TSubTable& get_subtable (unsigned int i) const
{ return this+CastR<OffsetArrayOf<TSubTable> > (subTable)[i]; }
template <typename TSubTable>
- const OffsetArrayOf<TSubTable>& get_subtables (void) const
+ const OffsetArrayOf<TSubTable>& get_subtables () const
{ return CastR<OffsetArrayOf<TSubTable> > (subTable); }
template <typename TSubTable>
- OffsetArrayOf<TSubTable>& get_subtables (void)
+ OffsetArrayOf<TSubTable>& get_subtables ()
{ return CastR<OffsetArrayOf<TSubTable> > (subTable); }
- unsigned int get_size (void) const
+ unsigned int get_size () const
{
const HBUINT16 &markFilteringSet = StructAfter<const HBUINT16> (subTable);
if (lookupFlag & LookupFlag::UseMarkFilteringSet)
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))
/* 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;
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)
{
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;
default: return;
}
}
- bool more (void)
+ bool more ()
{
switch (format)
{
default:return false;
}
}
- void next (void)
+ void next ()
{
switch (format)
{
default: break;
}
}
- hb_codepoint_t get_glyph (void)
+ hb_codepoint_t get_glyph ()
{
switch (format)
{
default:return 0;
}
}
- unsigned int get_coverage (void)
+ unsigned int get_coverage ()
{
switch (format)
{
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;
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,
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;
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,
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
}
}
- void fini (void) { this->table.destroy (); }
+ void fini () { this->table.destroy (); }
hb_blob_ptr_t<GDEF> table;
};
- unsigned int get_size (void) const
+ unsigned int get_size () const
{
return min_size +
(version.to_int () >= 0x00010002u ? markGlyphSetsDef.static_size : 0) +
* 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,
public:
- bool has_device (void) const
+ bool has_device () const
{
unsigned int format = *this;
return (format & devices) != 0;
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
{
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
{
(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
{
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
{
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
{
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
{
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
{
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
{
const SubTable& get_subtable (unsigned int i) const
{ return Lookup::get_subtable<SubTable> (i); }
- bool is_reverse (void) const
+ bool is_reverse () const
{
return false;
}
}
}
- 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
{
}
}
- 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
{
(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
{
}
}
- 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
{
}
}
- 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
{
{
typedef struct SubstLookupSubTable SubTable;
- bool is_reverse (void) const;
+ bool is_reverse () const;
};
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
{
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))
/* 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))
struct hb_intersects_context_t :
hb_dispatch_context_t<hb_intersects_context_t, bool, 0>
{
- const char *get_name (void) { return "INTERSECTS"; }
+ const char *get_name () { return "INTERSECTS"; }
template <typename T>
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;
struct hb_closure_context_t :
hb_dispatch_context_t<hb_closure_context_t, hb_void_t, HB_DEBUG_CLOSURE>
{
- 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 <typename T>
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))
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);
struct hb_would_apply_context_t :
hb_dispatch_context_t<hb_would_apply_context_t, bool, HB_DEBUG_WOULD_APPLY>
{
- const char *get_name (void) { return "WOULD_APPLY"; }
+ const char *get_name () { return "WOULD_APPLY"; }
template <typename T>
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;
struct hb_collect_glyphs_context_t :
hb_dispatch_context_t<hb_collect_glyphs_context_t, hb_void_t, HB_DEBUG_COLLECT_GLYPHS>
{
- 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 <typename T>
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))
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; }
};
struct hb_add_coverage_context_t :
hb_dispatch_context_t<hb_add_coverage_context_t<set_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 <typename T>
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);
{
struct matcher_t
{
- matcher_t (void) :
+ matcher_t () :
lookup_props (0),
ignore_zwnj (false),
ignore_zwj (false),
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)
}
return false;
}
- bool prev (void)
+ bool prev ()
{
assert (num_items > 0);
while (idx > num_items - 1)
};
- 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 <typename T>
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)
{
random (false),
random_state (1) { init_iters (); }
- void init_iters (void)
+ void init_iters ()
{
iter_input.init (this, false);
iter_context.init (this, true);
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;
typedef hb_vector_t<hb_applicable_t, 2> array_t;
/* Dispatch interface. */
- const char *get_name (void) { return "GET_SUBTABLES"; }
+ const char *get_name () { return "GET_SUBTABLES"; }
template <typename T>
return_t dispatch (const T &obj)
{
entry->init (obj, apply_to<T>);
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_),
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
{
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
{
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
{
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
{
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
{
lookup.len, lookup.arrayZ, lookup_context));
}
- const Coverage &get_coverage (void) const
+ const Coverage &get_coverage () const
{
const OffsetArrayOf<Coverage> &input = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
return this+input[0];
template <typename T>
struct ExtensionFormat1
{
- unsigned int get_type (void) const { return extensionLookupType; }
+ unsigned int get_type () const { return extensionLookupType; }
template <typename X>
- const X& get_subtable (void) const
+ const X& get_subtable () const
{
unsigned int offset = extensionOffset;
if (unlikely (!offset)) return Null(typename T::SubTable);
template <typename T>
struct Extension
{
- unsigned int get_type (void) const
+ unsigned int get_type () const
{
switch (u.format) {
case 1: return u.format1.get_type ();
}
}
template <typename X>
- const X& get_subtable (void) const
+ const X& get_subtable () const
{
switch (u.format) {
case 1: return u.format1.template get_subtable<typename T::SubTable> ();
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); }
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); }
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); }
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]; }
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);
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 ();
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); }
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
{
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); }
}
}
-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++)
pause_func_t pause_func;
};
- void init (void)
+ void init ()
{
memset (this, 0, sizeof (*this));
stages[table_index].init ();
}
}
- void fini (void)
+ void fini ()
{
features.fini ();
for (unsigned int table_index = 0; table_index < 2; table_index++)
}
}
- 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
{
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,
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,
{
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
{
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
{
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)
{
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;
{
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
this->names.resize (j);
}
- void fini (void)
+ void fini ()
{
this->names.fini ();
this->table.destroy ();
{
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,
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% */
FWIDTH_ULTRA_EXPANDED = 9 /* 200% */
};
- float get_width (void) const
+ float get_width () const
{
switch (usWidthClass) {
case FWIDTH_ULTRA_CONDENSED:return 50.f;
};
// 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
data += 1 + *data)
index_to_offset.push (data - pool);
}
- void fini (void)
+ void fini ()
{
index_to_offset.fini ();
free (gids_sorted_by_name.get ());
protected:
- unsigned int get_glyph_count (void) const
+ unsigned int get_glyph_count () const
{
if (version == 0x00010000)
return NUM_FORMAT1_NAMES;
}
void
-hb_ot_shape_plan_t::fini (void)
+hb_ot_shape_plan_t::fini ()
{
if (shaper->data_destroy)
shaper->data_destroy (const_cast<void *> (data));
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;
#ifdef MAIN
static inline void
-test_langs_sorted (void)
+test_langs_sorted ()
{
for (unsigned int i = 1; i < ARRAY_LENGTH (ot_languages); i++)
{
}
int
-main (void)
+main ()
{
test_langs_sorted ();
return 0;
{
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
{
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
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
{
}
protected:
- hb_array_t<const AxisRecord> get_axes (void) const
+ hb_array_t<const AxisRecord> get_axes () const
{ return hb_array (&(this+firstAxis), axisCount); }
const InstanceRecord *get_instance (unsigned int i) const
}
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
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
{
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
{
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); }
template <typename head_t, typename tail_t>
struct hb_set_digest_combiner_t
{
- void init (void)
+ void init ()
{
head.init ();
tail.init ();
* Since: 0.9.2
**/
hb_set_t *
-hb_set_create (void)
+hb_set_create ()
{
hb_set_t *set;
* Since: 0.9.2
**/
hb_set_t *
-hb_set_get_empty (void)
+hb_set_get_empty ()
{
return const_cast<hb_set_t *> (&Null(hb_set_t));
}
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
{
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])
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++)
*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])
hb_vector_t<page_map_t, 1> page_map;
hb_vector_t<page_t, 1> 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 ();
return true;
}
- void clear (void)
+ void clear ()
{
if (unlikely (hb_object_is_immutable (this)))
return;
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++)
return true;
}
- void dirty (void) { population = (unsigned int) -1; }
+ void dirty () { population = (unsigned int) -1; }
void add (hb_codepoint_t g)
{
return true;
}
- unsigned int get_population (void) const
+ unsigned int get_population () const
{
if (population != (unsigned int) -1)
return population;
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++)
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++)
* Since: 0.9.7
**/
hb_shape_plan_t *
-hb_shape_plan_get_empty (void)
+hb_shape_plan_get_empty ()
{
return const_cast<hb_shape_plan_t *> (&Null(hb_shape_plan_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);
#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};
static struct hb_shaper_list_lazy_loader_t : hb_lazy_loader_t<const char *,
hb_shaper_list_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))
}
static void destroy (const char **l)
{ free (l); }
- static const char ** get_null (void)
+ static const char ** get_null ()
{ return nil_shaper_list; }
} static_shaper_list;
#if HB_USE_ATEXIT
static
-void free_static_shaper_list (void)
+void free_static_shaper_list ()
{
static_shaper_list.free_instance ();
}
* Since: 0.9.2
**/
const char **
-hb_shape_list_shapers (void)
+hb_shape_list_shapers ()
{
return static_shaper_list.get_unconst ();
}
};
#if HB_USE_ATEXIT
-static void free_static_shapers (void);
+static void free_static_shapers ();
#endif
static struct hb_shapers_lazy_loader_t : hb_lazy_loader_t<const hb_shaper_entry_t,
hb_shapers_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)
return shapers;
}
- static void destroy (const hb_shaper_entry_t *p)
- { free ((void *) p); }
- static const hb_shaper_entry_t *get_null (void)
- { return all_shapers; }
+ static void destroy (const hb_shaper_entry_t *p) { free ((void *) p); }
+ static const hb_shaper_entry_t *get_null () { return all_shapers; }
} static_shapers;
#if HB_USE_ATEXIT
static
-void free_static_shapers (void)
+void free_static_shapers ()
{
static_shapers.free_instance ();
}
#endif
const hb_shaper_entry_t *
-_hb_shapers_get (void)
+_hb_shapers_get ()
{
return static_shapers.get_unconst ();
}
};
HB_INTERNAL const hb_shaper_entry_t *
-_hb_shapers_get (void);
+_hb_shapers_get ();
template <typename Data, unsigned int WheresData, typename T>
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); } \
}; \
\
#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"
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. */
}
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);
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)
{
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 ();
localSubrsInfos.init ();
}
- ~CFFSubTableOffsets (void)
- {
- localSubrsInfos.fini ();
- }
+ ~CFFSubTableOffsets () { localSubrsInfos.fini (); }
TableInfo topDictInfo;
TableInfo FDSelectInfo;
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)
{
}
}
- void fini (void)
+ void fini ()
{
hb_set_destroy (global_closure);
for (unsigned int i = 0; i < local_closures.len; i++)
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<hb_set_t *> local_closures;
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;
struct ParsedCStr : ParsedValues<ParsedCSOp>
{
- void init (void)
+ void init ()
{
SUPER::init ();
parsed = false;
|| (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;
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<ParsedCStr> SUPER;
struct SubrRemaps
{
- SubrRemaps (void)
+ SubrRemaps ()
{
global_remap.init ();
local_remaps.init ();
}
- ~SubrRemaps (void) { fini (); }
+ ~SubrRemaps () { fini (); }
void init (unsigned int fdCount)
{
local_remaps[i].create (closures.local_closures[i]);
}
- void fini (void)
+ void fini ()
{
global_remap.fini ();
local_remaps.fini_deep ();
template <typename SUBSETTER, typename SUBRS, typename ACC, typename ENV, typename OPSET>
struct SubrSubsetter
{
- SubrSubsetter (void)
+ SubrSubsetter ()
{
parsed_charstrings.init ();
parsed_global_subrs.init ();
parsed_local_subrs.init ();
}
- ~SubrSubsetter (void)
+ ~SubrSubsetter ()
{
closures.fini ();
remaps.fini ();
protected:
struct DropHintsParam
{
- DropHintsParam (void)
+ DropHintsParam ()
: seen_moveto (false),
ends_in_hint (false),
vsindex_dropped (false) {}
struct CFF1SubTableOffsets : CFFSubTableOffsets
{
- CFF1SubTableOffsets (void)
+ CFF1SubTableOffsets ()
: CFFSubTableOffsets (),
nameIndexOffset (0),
encodingOffset (0)
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 ())
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]; }
};
struct cff_subset_plan {
- cff_subset_plan (void)
+ cff_subset_plan ()
: final_size (0),
offsets (),
orig_fdcount (0),
topDictModSIDs[i] = CFF_UNDEF_SID;
}
- ~cff_subset_plan (void)
+ ~cff_subset_plan ()
{
topdict_sizes.fini ();
topdict_mod.fini ();
&& (fontdicts_mod.len == subset_fdcount));
}
- unsigned int get_final_size (void) const { return final_size; }
+ unsigned int get_final_size () const { return final_size; }
unsigned int final_size;
hb_vector_t<unsigned int> topdict_sizes;
struct CFF2SubTableOffsets : CFFSubTableOffsets
{
- CFF2SubTableOffsets (void)
+ CFF2SubTableOffsets ()
: CFFSubTableOffsets (),
varStoreOffset (0)
{}
};
struct cff2_subset_plan {
- cff2_subset_plan (void)
+ cff2_subset_plan ()
: final_size (0),
orig_fdcount (0),
subset_fdcount(1),
privateDictInfos.init ();
}
- ~cff2_subset_plan (void)
+ ~cff2_subset_plan ()
{
subset_fdselect_ranges.fini ();
fdmap.fini ();
return true;
}
- unsigned int get_final_size (void) const { return final_size; }
+ unsigned int get_final_size () const { return final_size; }
unsigned int final_size;
CFF2SubTableOffsets offsets;
* Since: 1.8.0
**/
hb_subset_input_t *
-hb_subset_input_create_or_fail (void)
+hb_subset_input_create_or_fail ()
{
hb_subset_input_t *input = hb_object_create<hb_subset_input_t>();
struct hb_subset_context_t :
hb_dispatch_context_t<hb_subset_context_t, bool, HB_DEBUG_SUBSET>
{
- const char *get_name (void) { return "SUBSET"; }
+ const char *get_name () { return "SUBSET"; }
template <typename T>
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;
#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<hb_ucdn_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);
#if HB_USE_ATEXIT
static
-void free_static_ucdn_funcs (void)
+void free_static_ucdn_funcs ()
{
static_ucdn_funcs.free_instance ();
}
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 ();
}
}
-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 ();
* hb_unicode_funcs_create: (Xconstructor)
* @parent: (nullable):
*
- *
+ *
*
* Return value: (transfer full):
*
/**
* 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<hb_unicode_funcs_t *> (&Null(hb_unicode_funcs_t));
}
* hb_unicode_funcs_reference: (skip)
* @ufuncs: Unicode functions.
*
- *
+ *
*
* Return value: (transfer full):
*
* hb_unicode_funcs_destroy: (skip)
* @ufuncs: Unicode functions.
*
- *
+ *
*
* Since: 0.9.2
**/
/**
* 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
**/
/**
* hb_unicode_funcs_get_user_data: (skip)
* @ufuncs: Unicode functions.
- * @key:
+ * @key:
+ *
*
- *
*
* Return value: (transfer none):
*
* hb_unicode_funcs_make_immutable:
* @ufuncs: Unicode functions.
*
- *
+ *
*
* Since: 0.9.2
**/
* hb_unicode_funcs_is_immutable:
* @ufuncs: Unicode functions.
*
- *
*
- * Return value:
+ *
+ * Return value:
*
* Since: 0.9.2
**/
* hb_unicode_funcs_get_parent:
* @ufuncs: Unicode functions.
*
- *
*
- * Return value:
+ *
+ * Return value:
*
* Since: 0.9.2
**/
/**
* hb_unicode_compose:
* @ufuncs: Unicode functions.
- * @a:
- * @b:
+ * @a:
+ * @b:
* @ab: (out):
*
- *
*
- * Return value:
+ *
+ * Return value:
*
* Since: 0.9.2
**/
/**
* hb_unicode_decompose:
* @ufuncs: Unicode functions.
- * @ab:
+ * @ab:
* @a: (out):
* @b: (out):
*
- *
*
- * Return value:
+ *
+ * Return value:
*
* Since: 0.9.2
**/
/**
* hb_unicode_decompose_compatibility:
* @ufuncs: Unicode functions.
- * @u:
+ * @u:
* @decomposed: (out):
*
- *
*
- * Return value:
+ *
+ * Return value:
*
* Since: 0.9.2
* Deprecated: 2.0.0
SSOT ScriptShapeOpenType;
SPOT ScriptPlaceOpenType;
- void init (void)
+ void init ()
{
HMODULE hinstLib;
this->ScriptItemizeOpenType = nullptr;
};
-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<hb_uniscribe_shaper_funcs_t,
hb_uniscribe_shaper_funcs_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))
{
free ((void *) p);
}
- static hb_uniscribe_shaper_funcs_t *get_null (void)
+ static hb_uniscribe_shaper_funcs_t *get_null ()
{
return nullptr;
}
#if HB_USE_ATEXIT
static
-void free_static_uniscribe_shaper_funcs (void)
+void free_static_uniscribe_shaper_funcs ()
{
static_uniscribe_shaper_funcs.free_instance ();
}
#endif
static hb_uniscribe_shaper_funcs_t *
-hb_uniscribe_shaper_get_funcs (void)
+hb_uniscribe_shaper_get_funcs ()
{
return static_uniscribe_shaper_funcs.get_unconst ();
}
enum { item_size = hb_static_size (Type) };
HB_NO_COPY_ASSIGN_TEMPLATE2 (hb_vector_t, Type, PreallocedCount);
- hb_vector_t (void) { init (); }
- ~hb_vector_t (void) { fini (); }
+ hb_vector_t () { init (); }
+ ~hb_vector_t () { fini (); }
unsigned int len;
private:
Type static_array[PreallocedCount];
public:
- void init (void)
+ void init ()
{
len = 0;
allocated = ARRAY_LENGTH (static_array);
arrayZ_ = nullptr;
}
- void fini (void)
+ void fini ()
{
if (arrayZ_)
free (arrayZ_);
arrayZ_ = nullptr;
allocated = len = 0;
}
- void fini_deep (void)
+ void fini_deep ()
{
Type *array = arrayZ();
unsigned int count = len;
fini ();
}
- Type * arrayZ (void)
- { return arrayZ_ ? arrayZ_ : static_array; }
- const Type * arrayZ (void) const
- { return arrayZ_ ? arrayZ_ : static_array; }
+ Type * arrayZ () { return arrayZ_ ? arrayZ_ : static_array; }
+ const Type * arrayZ () const { return arrayZ_ ? arrayZ_ : static_array; }
Type& operator [] (int i_)
{
return arrayZ()[i];
}
- hb_array_t<Type> as_array (void)
+ hb_array_t<Type> as_array ()
{ return hb_array (arrayZ(), len); }
- hb_array_t<const Type> as_array (void) const
+ hb_array_t<const Type> as_array () const
{ return hb_array (arrayZ(), len); }
hb_array_t<const Type> sub_array (unsigned int start_offset, unsigned int count) const
hb_array_t<Type> sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */)
{ return as_array ().sub_array (start_offset, count);}
- hb_sorted_array_t<Type> as_sorted_array (void)
+ hb_sorted_array_t<Type> as_sorted_array ()
{ return hb_sorted_array (arrayZ(), len); }
- hb_sorted_array_t<const Type> as_sorted_array (void) const
+ hb_sorted_array_t<const Type> as_sorted_array () const
{ return hb_sorted_array (arrayZ(), len); }
hb_array_t<const Type> sorted_sub_array (unsigned int start_offset, unsigned int count) const
hb_array_t<Type> sorted_sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */)
{ return as_sorted_array ().sorted_sub_array (start_offset, count);}
- template <typename T> explicit_operator T * (void) { return arrayZ(); }
- template <typename T> explicit_operator const T * (void) const { return arrayZ(); }
- operator hb_array_t<Type> (void) { return as_array (); }
- operator hb_array_t<const Type> (void) const { return as_array (); }
+ template <typename T> explicit_operator T * () { return arrayZ(); }
+ template <typename T> explicit_operator const T * () const { return arrayZ(); }
+ operator hb_array_t<Type> () { return as_array (); }
+ operator hb_array_t<const Type> () 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);
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)
return true;
}
- void pop (void)
+ void pop ()
{
if (!len) return;
len--;
TypeName(const TypeName<T1, T2>&); \
void operator=(const TypeName<T1, T2>&)
#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<T>&); \
void operator=(const TypeName<T>&)
#define HB_NO_CREATE_COPY_ASSIGN_TEMPLATE2(TypeName, T1, T2) \
- TypeName(void); \
+ TypeName(); \
TypeName(const TypeName<T1, T2>&); \
void operator=(const TypeName<T1, T2>&)
}
static void
-test_get_unicode_range_bit (void)
+test_get_unicode_range_bit ()
{
test (0x0000, 0);
test (0x0042, 0);
}
int
-main (void)
+main ()
{
test_get_unicode_range_bit ();
return 0;
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);
}
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)
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)
}
static hb_font_funcs_t *
-_hb_fc_get_font_funcs (void)
+_hb_fc_get_font_funcs ()
{
static const hb_font_funcs_t *fc_ffuncs;
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,
#ifdef HAVE_ATEXIT
static inline
-void free_ft_library (void)
+void free_ft_library ()
{
FT_Done_FreeType (ft_library);
}
unsigned int num_clusters;
cairo_text_cluster_flags_t cluster_flags;
- void finish (void) {
+ void finish () {
if (glyphs)
cairo_glyph_free (glyphs);
if (clusters)
template <typename consumer_t, int default_font_size, int subpixel_bits>
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),
static gchar *
-shapers_to_string (void)
+shapers_to_string ()
{
GString *shapers = g_string_new (nullptr);
const char **shaper_list = hb_shape_list_shapers ();
void
-option_parser_t::add_main_options (void)
+option_parser_t::add_main_options ()
{
GOptionEntry entries[] =
{
hb_font_t *
-font_options_t::get_font (void) const
+font_options_t::get_font () const
{
if (font)
return font;
FILE *
-output_options_t::get_file_handle (void)
+output_options_t::get_file_handle ()
{
if (fp)
return fp;
struct option_group_t
{
- virtual ~option_group_t (void) {}
+ virtual ~option_group_t () {}
virtual void add_options (struct option_parser_t *parser) = 0;
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,
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);
}
add_options (parser);
}
- virtual ~view_options_t (void)
+ virtual ~view_options_t ()
{
g_free (fore);
g_free (back);
add_options (parser);
}
- virtual ~shape_options_t (void)
+ virtual ~shape_options_t ()
{
g_free (direction);
g_free (language);
add_options (parser);
}
- virtual ~font_options_t (void)
+ virtual ~font_options_t ()
{
g_free (font_file);
free (variations);
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;
add_options (parser);
}
- virtual ~text_options_t (void)
+ virtual ~text_options_t ()
{
g_free (text_before);
g_free (text_after);
add_options (parser);
}
- virtual ~output_options_t (void)
+ virtual ~output_options_t ()
{
g_free (output_file);
g_free (output_format);
output_file = nullptr; /* STDOUT */
}
- FILE *get_file_handle (void);
+ FILE *get_file_handle ();
char *output_file;
char *output_format;
view_options (parser),
direction (HB_DIRECTION_INVALID),
lines (0), scale_bits (0) {}
- ~view_cairo_t (void) {
+ ~view_cairo_t () {
cairo_debug_reset_static_data ();
}
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,