PostGIS  3.1.6dev-r@@SVN_REVISION@@

◆ SHPReallocObjectBufIfNecessary()

static unsigned char* SHPReallocObjectBufIfNecessary ( SHPHandle  psSHP,
int  nObjectBufSize 
)
static

Definition at line 1803 of file shpopen.c.

1805 {
1806  unsigned char* pBuffer;
1807  if( nObjectBufSize == 0 )
1808  {
1809  nObjectBufSize = 4 * sizeof(double);
1810  }
1811  if( nObjectBufSize > psSHP->nObjectBufSize )
1812  {
1813  pBuffer = STATIC_CAST(unsigned char*, realloc( psSHP->pabyObjectBuf, nObjectBufSize ));
1814  if( pBuffer != SHPLIB_NULLPTR )
1815  {
1816  psSHP->pabyObjectBuf = pBuffer;
1817  psSHP->nObjectBufSize = nObjectBufSize;
1818  }
1819  }
1820  else
1821  pBuffer = psSHP->pabyObjectBuf;
1822  return pBuffer;
1823 }
#define STATIC_CAST(type, x)
Definition: shpopen.c:100
#define SHPLIB_NULLPTR
Definition: shpopen.c:101
unsigned char * pabyObjectBuf
Definition: shapefil.h:338
int nObjectBufSize
Definition: shapefil.h:339

References SHPInfo::nObjectBufSize, SHPInfo::pabyObjectBuf, SHPLIB_NULLPTR, and STATIC_CAST.

Referenced by if().

Here is the caller graph for this function: