PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ SHPReallocObjectBufIfNecessary()

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

Definition at line 1801 of file shpopen.c.

1803 {
1804  unsigned char* pBuffer;
1805  if( nObjectBufSize == 0 )
1806  {
1807  nObjectBufSize = 4 * sizeof(double);
1808  }
1809  if( nObjectBufSize > psSHP->nObjectBufSize )
1810  {
1811  pBuffer = STATIC_CAST(unsigned char*, realloc( psSHP->pabyObjectBuf, nObjectBufSize ));
1812  if( pBuffer != SHPLIB_NULLPTR )
1813  {
1814  psSHP->pabyObjectBuf = pBuffer;
1815  psSHP->nObjectBufSize = nObjectBufSize;
1816  }
1817  }
1818  else
1819  pBuffer = psSHP->pabyObjectBuf;
1820  return pBuffer;
1821 }
#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: