MCPcopy Create free account
hub / github.com/creatale/node-dv / boxaaExtendArrayToSize

Function boxaaExtendArrayToSize

deps/leptonica/src/boxbasic.c:1409–1426  ·  view source on GitHub ↗

! * \brief boxaaExtendArrayToSize() * * \param[in] baa * \param[in] size new size of boxa array * \return 0 if OK; 1 on error * * * Notes: * (1) If necessary, reallocs the boxa ptr array to %size. * */

Source from the content-addressed store, hash-verified

1407 * </pre>
1408 */
1409l_int32
1410boxaaExtendArrayToSize(BOXAA *baa,
1411 l_int32 size)
1412{
1413 PROCNAME("boxaaExtendArrayToSize");
1414
1415 if (!baa)
1416 return ERROR_INT("baa not defined", procName, 1);
1417
1418 if (size > baa->nalloc) {
1419 if ((baa->boxa = (BOXA **)reallocNew((void **)&baa->boxa,
1420 sizeof(BOXA *) * baa->nalloc,
1421 size * sizeof(BOXA *))) == NULL)
1422 return ERROR_INT("new ptr array not returned", procName, 1);
1423 baa->nalloc = size;
1424 }
1425 return 0;
1426}
1427
1428
1429/*----------------------------------------------------------------------*

Callers 1

boxaaExtendWithInitFunction · 0.85

Calls 1

reallocNewFunction · 0.85

Tested by

no test coverage detected