/* do when there is more left to send */
if (call_cntr < max_calls) {
- bool *nulls = NULL;
int values_length = 2;
Datum values[values_length];
+ bool nulls[values_length];
HeapTuple tuple;
Datum result;
POSTGIS_RT_DEBUGF(3, "call number %d", call_cntr);
- nulls = palloc(sizeof(bool) * values_length);
memset(nulls, FALSE, values_length);
/* convert LWGEOM to GSERIALIZED */
/* make the tuple into a datum */
result = HeapTupleGetDatum(tuple);
- /* clean up (this is not really necessary) */
- pfree(nulls);
-
SRF_RETURN_NEXT(funcctx, result);
}
/* do when there is no more left */
*/
TupleDesc result_tuple; /* for returning a composite */
- bool *nulls = NULL;
int values_length = 6;
Datum values[values_length];
+ bool nulls[values_length];
HeapTuple heap_tuple ; /* instance of the tuple to return */
Datum result;
values[4] = Float8GetDatum(rt_raster_get_x_offset(raster));
values[5] = Float8GetDatum(rt_raster_get_y_offset(raster));
- nulls = palloc(sizeof(bool) * values_length);
memset(nulls, FALSE, values_length);
/* stick em on the heap */
/* make the tuple into a datum */
result = HeapTupleGetDatum(heap_tuple);
- /* clean up */
- pfree(nulls);
-
PG_RETURN_DATUM(result);
}
if (call_cntr < max_calls) {
int values_length = 4;
Datum values[values_length];
- bool *nulls = NULL;
+ bool nulls[values_length];
HeapTuple tuple;
Datum result;
POSTGIS_RT_DEBUGF(3, "Result %d", call_cntr);
- nulls = palloc(sizeof(bool) * values_length);
memset(nulls, FALSE, values_length);
values[0] = Float8GetDatum(hist2[call_cntr].min);
/* make the tuple into a datum */
result = HeapTupleGetDatum(tuple);
- /* clean up */
- pfree(nulls);
-
SRF_RETURN_NEXT(funcctx, result);
}
/* do when there is no more left */
if (call_cntr < max_calls) {
int values_length = 4;
Datum values[values_length];
- bool *nulls = NULL;
+ bool nulls[values_length];
HeapTuple tuple;
Datum result;
POSTGIS_RT_DEBUGF(3, "Result %d", call_cntr);
- nulls = palloc(sizeof(bool) * values_length);
memset(nulls, FALSE, values_length);
values[0] = Float8GetDatum(covhist2[call_cntr].min);
/* make the tuple into a datum */
result = HeapTupleGetDatum(tuple);
- /* clean up */
- pfree(nulls);
-
SRF_RETURN_NEXT(funcctx, result);
}
/* do when there is no more left */
if (call_cntr < max_calls) {
int values_length = 2;
Datum values[values_length];
- bool *nulls = NULL;
+ bool nulls[values_length];
HeapTuple tuple;
Datum result;
POSTGIS_RT_DEBUGF(3, "Result %d", call_cntr);
- nulls = palloc(sizeof(bool) * values_length);
memset(nulls, FALSE, values_length);
values[0] = Float8GetDatum(quant2[call_cntr].quantile);
/* make the tuple into a datum */
result = HeapTupleGetDatum(tuple);
- /* clean up */
- pfree(nulls);
-
SRF_RETURN_NEXT(funcctx, result);
}
/* do when there is no more left */
if (call_cntr < max_calls) {
int values_length = 2;
Datum values[values_length];
- bool *nulls = NULL;
+ bool nulls[values_length];
HeapTuple tuple;
Datum result;
POSTGIS_RT_DEBUGF(3, "Result %d", call_cntr);
- nulls = palloc(sizeof(bool) * values_length);
memset(nulls, FALSE, values_length);
values[0] = Float8GetDatum(covquant2[call_cntr].quantile);
/* make the tuple into a datum */
result = HeapTupleGetDatum(tuple);
- /* clean up */
- pfree(nulls);
-
SRF_RETURN_NEXT(funcctx, result);
}
/* do when there is no more left */
if (call_cntr < max_calls) {
int values_length = 3;
Datum values[values_length];
- bool *nulls = NULL;
+ bool nulls[values_length];
HeapTuple tuple;
Datum result;
POSTGIS_RT_DEBUGF(3, "Result %d", call_cntr);
- nulls = palloc(sizeof(bool) * values_length);
memset(nulls, FALSE, values_length);
values[0] = Float8GetDatum(vcnts2[call_cntr].value);
/* make the tuple into a datum */
result = HeapTupleGetDatum(tuple);
- /* clean up */
- pfree(nulls);
-
SRF_RETURN_NEXT(funcctx, result);
}
/* do when there is no more left */
if (call_cntr < max_calls) {
int values_length = 3;
Datum values[values_length];
- bool *nulls = NULL;
+ bool nulls[values_length];
HeapTuple tuple;
Datum result;
POSTGIS_RT_DEBUGF(3, "Result %d", call_cntr);
- nulls = palloc(sizeof(bool) * values_length);
memset(nulls, FALSE, values_length);
values[0] = Float8GetDatum(covvcnts2[call_cntr].value);
/* make the tuple into a datum */
result = HeapTupleGetDatum(tuple);
- /* clean up */
- pfree(nulls);
-
SRF_RETURN_NEXT(funcctx, result);
}
/* do when there is no more left */
if (call_cntr < max_calls) {
int values_length = 4;
Datum values[values_length];
- bool *nulls;
+ bool nulls[values_length];
HeapTuple tuple;
Datum result;
POSTGIS_RT_DEBUGF(3, "Result %d", call_cntr);
- nulls = palloc(sizeof(bool) * values_length);
memset(nulls, FALSE, values_length);
values[0] = Int32GetDatum(drv_set2[call_cntr].idx);
result = HeapTupleGetDatum(tuple);
/* clean up */
- pfree(nulls);
-
pfree(drv_set2[call_cntr].short_name);
pfree(drv_set2[call_cntr].long_name);
pfree(drv_set2[call_cntr].create_options);
uint32_t height;
TupleDesc tupdesc;
- bool *nulls = NULL;
int values_length = 10;
Datum values[values_length];
+ bool nulls[values_length];
HeapTuple tuple;
Datum result;
values[8] = Int32GetDatum(srid);
values[9] = UInt32GetDatum(numBands);
- nulls = palloc(sizeof(bool) * values_length);
memset(nulls, FALSE, values_length);
/* build a tuple */
/* make the tuple into a datum */
result = HeapTupleGetDatum(tuple);
- /* clean up */
- pfree(nulls);
-
PG_RETURN_DATUM(result);
}
struct bandmetadata *bmd = NULL;
struct bandmetadata *bmd2 = NULL;
- bool *nulls = NULL;
- int values_length = 5;
- Datum values[values_length];
HeapTuple tuple;
Datum result;
/* do when there is more left to send */
if (call_cntr < max_calls) {
- nulls = palloc(sizeof(bool) * values_length);
+ int values_length = 5;
+ Datum values[values_length];
+ bool nulls[values_length];
+
memset(nulls, FALSE, values_length);
values[0] = UInt32GetDatum(bmd2[call_cntr].bandnum);
result = HeapTupleGetDatum(tuple);
/* clean up */
- pfree(nulls);
pfree(bmd2[call_cntr].pixeltype);
if (bmd2[call_cntr].bandpath) pfree(bmd2[call_cntr].bandpath);
const int argkwcount = 8;
uint8_t argpos[3][8] = {{0}};
char *argkw[] = {"[rast1.x]", "[rast1.y]", "[rast1.val]", "[rast1]", "[rast2.x]", "[rast2.y]", "[rast2.val]", "[rast2]"};
- Datum values[8];
- bool nulls[8];
+ Datum values[argkwcount];
+ bool nulls[argkwcount];
TupleDesc tupdesc;
SPITupleTable *tuptable = NULL;
HeapTuple tuple;