コード例 #1
0
ファイル: lwout_twkb.c プロジェクト: gbroccolo/postgis
/**
* Calculates the size of the bbox in varints in the form:
* xmin, xdelta, ymin, ydelta
*/
static size_t sizeof_bbox(TWKB_STATE *ts, int ndims)
{
	int i;
	uint8_t buf[16];
	size_t size = 0;
	LWDEBUGF(2, "Entered %s", __func__);
	for ( i = 0; i < ndims; i++ )
	{
		size += varint_s64_encode_buf(ts->bbox_min[i], buf);
		size += varint_s64_encode_buf((ts->bbox_max[i] - ts->bbox_min[i]), buf);
	}
	return size;
}
コード例 #2
0
ファイル: bytebuffer.c プロジェクト: NianYue/pipelinedb
/**
* Writes a signed varInt to the buffer
*/
void 
bytebuffer_append_varint(bytebuffer_t *b, const int64_t val)
{	
	size_t size;
	bytebuffer_makeroom(b, 8);
	size = varint_s64_encode_buf(val, b->writecursor);
	b->writecursor += size;
	return;
}