redo fixes

This commit is contained in:
Michiharu Ariza 2018-11-30 16:59:41 -08:00
parent 291da44823
commit 9483da145d
4 changed files with 8 additions and 8 deletions

View File

@ -136,7 +136,7 @@ struct CFF2CSInterpEnv : CSInterpEnv<BlendArg, CFF2Subrs>
scalars.resize (region_count); scalars.resize (region_count);
varStore->varStore.get_scalars (get_ivs (), varStore->varStore.get_scalars (get_ivs (),
(int *)coords, num_coords, (int *)coords, num_coords,
&scalars[static_cast<unsigned int>(0)], region_count); &scalars[0u], region_count);
} }
seen_blend = true; seen_blend = true;
} }

View File

@ -1028,7 +1028,7 @@ struct cff1
{ fini (); return; } { fini (); return; }
{ /* parse top dict */ { /* parse top dict */
const ByteStr topDictStr = (*topDictIndex)[static_cast<unsigned int>(0)]; const ByteStr topDictStr = (*topDictIndex)[0u];
if (unlikely (!topDictStr.sanitize (&sc))) { fini (); return; } if (unlikely (!topDictStr.sanitize (&sc))) { fini (); return; }
CFF1TopDict_Interpreter top_interp; CFF1TopDict_Interpreter top_interp;
top_interp.env.init (topDictStr); top_interp.env.init (topDictStr);
@ -1112,7 +1112,7 @@ struct cff1
else /* non-CID */ else /* non-CID */
{ {
CFF1TopDictValues *font = &topDict; CFF1TopDictValues *font = &topDict;
PRIVDICTVAL *priv = &privateDicts[static_cast<unsigned int>(0)]; PRIVDICTVAL *priv = &privateDicts[0u];
const ByteStr privDictStr (StructAtOffset<UnsizedByteStr> (cff, font->privateDictInfo.offset), font->privateDictInfo.size); const ByteStr privDictStr (StructAtOffset<UnsizedByteStr> (cff, font->privateDictInfo.offset), font->privateDictInfo.size);
if (unlikely (!privDictStr.sanitize (&sc))) { fini (); return; } if (unlikely (!privDictStr.sanitize (&sc))) { fini (); return; }

View File

@ -120,7 +120,7 @@ struct StrEncoder
set_error (); set_error ();
return; return;
} }
memcpy (&buff[offset], &str.str[static_cast<unsigned int>(0)], str.len); memcpy (&buff[offset], &str.str[0u], str.len);
} }
inline bool is_error (void) const { return error; } inline bool is_error (void) const { return error; }
@ -226,7 +226,7 @@ struct CFFFontDict_OpSerializer : OpSerializer
{ {
HBUINT8 *d = c->allocate_size<HBUINT8> (opstr.str.len); HBUINT8 *d = c->allocate_size<HBUINT8> (opstr.str.len);
if (unlikely (d == nullptr)) return_trace (false); if (unlikely (d == nullptr)) return_trace (false);
memcpy (d, &opstr.str.str[static_cast<unsigned int>(0)], opstr.str.len); memcpy (d, &opstr.str.str[0u], opstr.str.len);
} }
return_trace (true); return_trace (true);
} }
@ -869,7 +869,7 @@ struct SubrSubsetter
{ {
for (int i = pos - 1; i >= 0; i--) for (int i = pos - 1; i >= 0; i--)
{ {
ParsedCSOp &csop = str.values[static_cast<unsigned int>(i)]; ParsedCSOp &csop = str.values[(unsigned)i];
if (csop.for_drop ()) if (csop.for_drop ())
break; break;
csop.set_drop (); csop.set_drop ();

View File

@ -599,7 +599,7 @@ struct cff_subset_plan {
hb_subset_plan_t *plan) hb_subset_plan_t *plan)
{ {
/* make sure notdef is first */ /* make sure notdef is first */
if ((plan->glyphs.len == 0) || (plan->glyphs[static_cast<unsigned int>(0)] != 0)) return false; if ((plan->glyphs.len == 0) || (plan->glyphs[0u] != 0)) return false;
final_size = 0; final_size = 0;
num_glyphs = plan->glyphs.len; num_glyphs = plan->glyphs.len;
@ -813,7 +813,7 @@ struct cff_subset_plan {
} }
if (!acc.is_CID ()) if (!acc.is_CID ())
offsets.privateDictInfo = fontdicts_mod[static_cast<unsigned int>(0)].privateDictInfo; offsets.privateDictInfo = fontdicts_mod[0u].privateDictInfo;
return ((subset_charstrings.len == plan->glyphs.len) return ((subset_charstrings.len == plan->glyphs.len)
&& (fontdicts_mod.len == subset_fdcount)); && (fontdicts_mod.len == subset_fdcount));