uint32_t to unsigned in hb-set.hh
This commit is contained in:
parent
2a0d0b901f
commit
33368a12b7
|
@ -391,7 +391,7 @@ struct hb_set_t
|
||||||
{
|
{
|
||||||
// Pre-allocate the workspace that compact() will need so we can bail on allocation failure
|
// Pre-allocate the workspace that compact() will need so we can bail on allocation failure
|
||||||
// before attempting to rewrite the page map.
|
// before attempting to rewrite the page map.
|
||||||
hb_vector_t<uint32_t> compact_workspace;
|
hb_vector_t<unsigned> compact_workspace;
|
||||||
if (unlikely (!allocate_compact_workspace (compact_workspace))) return;
|
if (unlikely (!allocate_compact_workspace (compact_workspace))) return;
|
||||||
|
|
||||||
unsigned int write_index = 0;
|
unsigned int write_index = 0;
|
||||||
|
@ -518,7 +518,7 @@ struct hb_set_t
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool allocate_compact_workspace(hb_vector_t<uint32_t>& workspace)
|
bool allocate_compact_workspace(hb_vector_t<unsigned>& workspace)
|
||||||
{
|
{
|
||||||
if (unlikely(!workspace.resize (pages.length)))
|
if (unlikely(!workspace.resize (pages.length)))
|
||||||
{
|
{
|
||||||
|
@ -534,22 +534,22 @@ struct hb_set_t
|
||||||
* workspace should be a pre-sized vector allocated to hold at exactly pages.length
|
* workspace should be a pre-sized vector allocated to hold at exactly pages.length
|
||||||
* elements.
|
* elements.
|
||||||
*/
|
*/
|
||||||
void compact (hb_vector_t<uint32_t>& workspace,
|
void compact (hb_vector_t<unsigned>& workspace,
|
||||||
unsigned int length)
|
unsigned int length)
|
||||||
{
|
{
|
||||||
assert(workspace.length == pages.length);
|
assert(workspace.length == pages.length);
|
||||||
hb_vector_t<uint32_t>& old_index_to_page_map_index = workspace;
|
hb_vector_t<unsigned>& old_index_to_page_map_index = workspace;
|
||||||
|
|
||||||
for (uint32_t i = 0; i < old_index_to_page_map_index.length; i++)
|
for (unsigned i = 0; i < old_index_to_page_map_index.length; i++)
|
||||||
old_index_to_page_map_index[i] = 0xFFFFFFFF;
|
old_index_to_page_map_index[i] = 0xFFFFFFFF;
|
||||||
|
|
||||||
for (uint32_t i = 0; i < length; i++)
|
for (unsigned i = 0; i < length; i++)
|
||||||
old_index_to_page_map_index[page_map[i].index] = i;
|
old_index_to_page_map_index[page_map[i].index] = i;
|
||||||
|
|
||||||
compact_pages (old_index_to_page_map_index);
|
compact_pages (old_index_to_page_map_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void compact_pages (const hb_vector_t<uint32_t>& old_index_to_page_map_index)
|
void compact_pages (const hb_vector_t<unsigned>& old_index_to_page_map_index)
|
||||||
{
|
{
|
||||||
unsigned int write_index = 0;
|
unsigned int write_index = 0;
|
||||||
for (unsigned int i = 0; i < pages.length; i++)
|
for (unsigned int i = 0; i < pages.length; i++)
|
||||||
|
@ -581,7 +581,7 @@ struct hb_set_t
|
||||||
|
|
||||||
// Pre-allocate the workspace that compact() will need so we can bail on allocation failure
|
// Pre-allocate the workspace that compact() will need so we can bail on allocation failure
|
||||||
// before attempting to rewrite the page map.
|
// before attempting to rewrite the page map.
|
||||||
hb_vector_t<uint32_t> compact_workspace;
|
hb_vector_t<unsigned> compact_workspace;
|
||||||
if (!Op::passthru_left && unlikely (!allocate_compact_workspace (compact_workspace))) return;
|
if (!Op::passthru_left && unlikely (!allocate_compact_workspace (compact_workspace))) return;
|
||||||
|
|
||||||
for (; a < na && b < nb; )
|
for (; a < na && b < nb; )
|
||||||
|
|
Loading…
Reference in New Issue