Add default-value for second arg of sub_array()
This commit is contained in:
parent
6ad3fcddaf
commit
ca23b71935
|
@ -588,15 +588,14 @@ struct hb_array_t
|
||||||
|
|
||||||
inline unsigned int get_size (void) const { return len * sizeof (Type); }
|
inline unsigned int get_size (void) const { return len * sizeof (Type); }
|
||||||
|
|
||||||
inline hb_array_t<Type> sub_array (unsigned int start_offset, unsigned int *seg_count /* IN/OUT */) const
|
inline hb_array_t<Type> sub_array (unsigned int start_offset, unsigned int *seg_count = nullptr /* IN/OUT */) const
|
||||||
{
|
{
|
||||||
if (!seg_count) return hb_array_t<Type> ();
|
|
||||||
|
|
||||||
unsigned int count = len;
|
unsigned int count = len;
|
||||||
if (unlikely (start_offset > count))
|
if (unlikely (start_offset > count))
|
||||||
count = 0;
|
count = 0;
|
||||||
else
|
else
|
||||||
count -= start_offset;
|
count -= start_offset;
|
||||||
|
if (seg_count)
|
||||||
count = *seg_count = MIN (count, *seg_count);
|
count = *seg_count = MIN (count, *seg_count);
|
||||||
return hb_array_t<Type> (arrayZ + start_offset, count);
|
return hb_array_t<Type> (arrayZ + start_offset, count);
|
||||||
}
|
}
|
||||||
|
|
|
@ -541,11 +541,11 @@ struct ArrayOf
|
||||||
|
|
||||||
inline hb_array_t<const Type> sub_array (unsigned int start_offset, unsigned int count) const
|
inline hb_array_t<const Type> sub_array (unsigned int start_offset, unsigned int count) const
|
||||||
{ return as_array ().sub_array (start_offset, count);}
|
{ return as_array ().sub_array (start_offset, count);}
|
||||||
inline hb_array_t<const Type> sub_array (unsigned int start_offset, unsigned int *count /* IN/OUT */) const
|
inline hb_array_t<const Type> sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) const
|
||||||
{ return as_array ().sub_array (start_offset, count);}
|
{ return as_array ().sub_array (start_offset, count);}
|
||||||
inline hb_array_t<Type> sub_array (unsigned int start_offset, unsigned int count)
|
inline hb_array_t<Type> sub_array (unsigned int start_offset, unsigned int count)
|
||||||
{ return as_array ().sub_array (start_offset, count);}
|
{ return as_array ().sub_array (start_offset, count);}
|
||||||
inline hb_array_t<Type> sub_array (unsigned int start_offset, unsigned int *count /* IN/OUT */)
|
inline hb_array_t<Type> sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */)
|
||||||
{ return as_array ().sub_array (start_offset, count);}
|
{ return as_array ().sub_array (start_offset, count);}
|
||||||
|
|
||||||
inline bool serialize (hb_serialize_context_t *c,
|
inline bool serialize (hb_serialize_context_t *c,
|
||||||
|
@ -812,11 +812,11 @@ struct SortedArrayOf : ArrayOf<Type, LenType>
|
||||||
|
|
||||||
inline hb_array_t<const Type> sub_array (unsigned int start_offset, unsigned int count) const
|
inline hb_array_t<const Type> sub_array (unsigned int start_offset, unsigned int count) const
|
||||||
{ return as_array ().sub_array (start_offset, count);}
|
{ return as_array ().sub_array (start_offset, count);}
|
||||||
inline hb_array_t<const Type> sub_array (unsigned int start_offset, unsigned int *count /* IN/OUT */) const
|
inline hb_array_t<const Type> sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */) const
|
||||||
{ return as_array ().sub_array (start_offset, count);}
|
{ return as_array ().sub_array (start_offset, count);}
|
||||||
inline hb_array_t<Type> sub_array (unsigned int start_offset, unsigned int count)
|
inline hb_array_t<Type> sub_array (unsigned int start_offset, unsigned int count)
|
||||||
{ return as_array ().sub_array (start_offset, count);}
|
{ return as_array ().sub_array (start_offset, count);}
|
||||||
inline hb_array_t<Type> sub_array (unsigned int start_offset, unsigned int *count /* IN/OUT */)
|
inline hb_array_t<Type> sub_array (unsigned int start_offset, unsigned int *count = nullptr /* IN/OUT */)
|
||||||
{ return as_array ().sub_array (start_offset, count);}
|
{ return as_array ().sub_array (start_offset, count);}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
|
Loading…
Reference in New Issue