[cff-common] Indent
This commit is contained in:
parent
be7b2905cb
commit
c8a5f1e3c0
|
@ -86,40 +86,41 @@ struct CFFIndex
|
||||||
const byte_str_array_t &byteArray)
|
const byte_str_array_t &byteArray)
|
||||||
{
|
{
|
||||||
TRACE_SERIALIZE (this);
|
TRACE_SERIALIZE (this);
|
||||||
|
|
||||||
if (byteArray.length == 0)
|
if (byteArray.length == 0)
|
||||||
{
|
{
|
||||||
COUNT *dest = c->allocate_min<COUNT> ();
|
COUNT *dest = c->allocate_min<COUNT> ();
|
||||||
if (unlikely (!dest)) return_trace (false);
|
if (unlikely (!dest)) return_trace (false);
|
||||||
*dest = 0;
|
*dest = 0;
|
||||||
|
return_trace (true);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
/* serialize CFFIndex header */
|
||||||
|
if (unlikely (!c->extend_min (this))) return_trace (false);
|
||||||
|
this->count = byteArray.length;
|
||||||
|
this->offSize = offSize_;
|
||||||
|
if (unlikely (!c->allocate_size<HBUINT8> (offSize_ * (byteArray.length + 1))))
|
||||||
|
return_trace (false);
|
||||||
|
|
||||||
|
/* serialize indices */
|
||||||
|
unsigned int offset = 1;
|
||||||
|
unsigned int i = 0;
|
||||||
|
for (; i < byteArray.length; i++)
|
||||||
{
|
{
|
||||||
/* serialize CFFIndex header */
|
|
||||||
if (unlikely (!c->extend_min (this))) return_trace (false);
|
|
||||||
this->count = byteArray.length;
|
|
||||||
this->offSize = offSize_;
|
|
||||||
if (unlikely (!c->allocate_size<HBUINT8> (offSize_ * (byteArray.length + 1))))
|
|
||||||
return_trace (false);
|
|
||||||
|
|
||||||
/* serialize indices */
|
|
||||||
unsigned int offset = 1;
|
|
||||||
unsigned int i = 0;
|
|
||||||
for (; i < byteArray.length; i++)
|
|
||||||
{
|
|
||||||
set_offset_at (i, offset);
|
|
||||||
offset += byteArray[i].get_size ();
|
|
||||||
}
|
|
||||||
set_offset_at (i, offset);
|
set_offset_at (i, offset);
|
||||||
|
offset += byteArray[i].get_size ();
|
||||||
/* serialize data */
|
|
||||||
for (unsigned int i = 0; i < byteArray.length; i++)
|
|
||||||
{
|
|
||||||
const byte_str_t &bs = byteArray[i];
|
|
||||||
unsigned char *dest = c->allocate_size<unsigned char> (bs.length);
|
|
||||||
if (unlikely (!dest)) return_trace (false);
|
|
||||||
memcpy (dest, &bs[0], bs.length);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
set_offset_at (i, offset);
|
||||||
|
|
||||||
|
/* serialize data */
|
||||||
|
for (unsigned int i = 0; i < byteArray.length; i++)
|
||||||
|
{
|
||||||
|
const byte_str_t &bs = byteArray[i];
|
||||||
|
unsigned char *dest = c->allocate_size<unsigned char> (bs.length);
|
||||||
|
if (unlikely (!dest)) return_trace (false);
|
||||||
|
memcpy (dest, &bs[0], bs.length);
|
||||||
|
}
|
||||||
|
|
||||||
return_trace (true);
|
return_trace (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue