static int
compare_expanded_ranges(const void *a, const void *b, void *arg)
{
- ExpandedRange *ra = (ExpandedRange *) a;
- ExpandedRange *rb = (ExpandedRange *) b;
+ const ExpandedRange *ra = a;
+ const ExpandedRange *rb = b;
Datum r;
compare_context *cxt = (compare_context *) arg;
static int
compare_values(const void *a, const void *b, void *arg)
{
- Datum *da = (Datum *) a;
- Datum *db = (Datum *) b;
+ const Datum *da = a;
+ const Datum *db = b;
Datum r;
compare_context *cxt = (compare_context *) arg;
static int
compare_distances(const void *a, const void *b)
{
- DistanceValue *da = (DistanceValue *) a;
- DistanceValue *db = (DistanceValue *) b;
+ const DistanceValue *da = a;
+ const DistanceValue *db = b;
if (da->value < db->value)
return 1;
static uint32
missing_hash(const void *key, Size keysize)
{
- const missing_cache_key *entry = (missing_cache_key *) key;
+ const missing_cache_key *entry = key;
return hash_bytes((const unsigned char *) DatumGetPointer(entry->value), entry->len);
}
static int
missing_match(const void *key1, const void *key2, Size keysize)
{
- const missing_cache_key *entry1 = (missing_cache_key *) key1;
- const missing_cache_key *entry2 = (missing_cache_key *) key2;
+ const missing_cache_key *entry1 = key1;
+ const missing_cache_key *entry2 = key2;
if (entry1->len != entry2->len)
return entry1->len > entry2->len ? 1 : -1;
static int
heap_log_freeze_cmp(const void *arg1, const void *arg2)
{
- HeapTupleFreeze *frz1 = (HeapTupleFreeze *) arg1;
- HeapTupleFreeze *frz2 = (HeapTupleFreeze *) arg2;
+ const HeapTupleFreeze *frz1 = arg1;
+ const HeapTupleFreeze *frz2 = arg2;
if (frz1->xmax < frz2->xmax)
return -1;
static int
_bt_delitems_cmp(const void *a, const void *b)
{
- TM_IndexDelete *indexdelete1 = (TM_IndexDelete *) a;
- TM_IndexDelete *indexdelete2 = (TM_IndexDelete *) b;
+ const TM_IndexDelete *indexdelete1 = a;
+ const TM_IndexDelete *indexdelete2 = b;
Assert(indexdelete1->id != indexdelete2->id);
static int
_bt_reorder_array_cmp(const void *a, const void *b)
{
- BTArrayKeyInfo *arraya = (BTArrayKeyInfo *) a;
- BTArrayKeyInfo *arrayb = (BTArrayKeyInfo *) b;
+ const BTArrayKeyInfo *arraya = a;
+ const BTArrayKeyInfo *arrayb = b;
return pg_cmp_s32(arraya->scan_key, arrayb->scan_key);
}
static int
_bt_splitcmp(const void *arg1, const void *arg2)
{
- SplitPoint *split1 = (SplitPoint *) arg1;
- SplitPoint *split2 = (SplitPoint *) arg2;
+ const SplitPoint *split1 = arg1;
+ const SplitPoint *split2 = arg2;
return pg_cmp_s16(split1->curdelta, split2->curdelta);
}
static int
x_cmp(const void *a, const void *b)
{
- SortedPoint *pa = (SortedPoint *) a;
- SortedPoint *pb = (SortedPoint *) b;
+ const SortedPoint *pa = a;
+ const SortedPoint *pb = b;
if (pa->p->x == pb->p->x)
return 0;
static int
y_cmp(const void *a, const void *b)
{
- SortedPoint *pa = (SortedPoint *) a;
- SortedPoint *pb = (SortedPoint *) b;
+ const SortedPoint *pa = a;
+ const SortedPoint *pb = b;
if (pa->p->y == pb->p->y)
return 0;
multi_sort_compare(const void *a, const void *b, void *arg)
{
MultiSortSupport mss = (MultiSortSupport) arg;
- SortItem *ia = (SortItem *) a;
- SortItem *ib = (SortItem *) b;
+ const SortItem *ia = a;
+ const SortItem *ib = b;
int i;
for (i = 0; i < mss->ndims; i++)
static int
compare_sort_item_count(const void *a, const void *b, void *arg)
{
- SortItem *ia = (SortItem *) a;
- SortItem *ib = (SortItem *) b;
+ const SortItem *ia = a;
+ const SortItem *ib = b;
if (ia->count == ib->count)
return 0;
sort_item_compare(const void *a, const void *b, void *arg)
{
SortSupport ssup = (SortSupport) arg;
- SortItem *ia = (SortItem *) a;
- SortItem *ib = (SortItem *) b;
+ const SortItem *ia = a;
+ const SortItem *ib = b;
return ApplySortComparator(ia->values[0], ia->isnull[0],
ib->values[0], ib->isnull[0],
static int
cmpcmdflag(const void *f1, const void *f2)
{
- CompoundAffixFlag *fv1 = (CompoundAffixFlag *) f1,
- *fv2 = (CompoundAffixFlag *) f2;
+ const CompoundAffixFlag *fv1 = f1;
+ const CompoundAffixFlag *fv2 = f2;
Assert(fv1->flagMode == fv2->flagMode);
static int
single_bound_cmp(const void *a, const void *b, void *arg)
{
- SingleBoundSortItem *i1 = (SingleBoundSortItem *) a;
- SingleBoundSortItem *i2 = (SingleBoundSortItem *) b;
- TypeCacheEntry *typcache = (TypeCacheEntry *) arg;
+ const SingleBoundSortItem *i1 = a;
+ const SingleBoundSortItem *i2 = b;
+ TypeCacheEntry *typcache = arg;
return range_cmp_bounds(typcache, &i1->bound, &i2->bound);
}
static int
interval_cmp_lower(const void *a, const void *b, void *arg)
{
- NonEmptyRange *i1 = (NonEmptyRange *) a;
- NonEmptyRange *i2 = (NonEmptyRange *) b;
- TypeCacheEntry *typcache = (TypeCacheEntry *) arg;
+ const NonEmptyRange *i1 = a;
+ const NonEmptyRange *i2 = b;
+ TypeCacheEntry *typcache = arg;
return range_cmp_bounds(typcache, &i1->lower, &i2->lower);
}
static int
interval_cmp_upper(const void *a, const void *b, void *arg)
{
- NonEmptyRange *i1 = (NonEmptyRange *) a;
- NonEmptyRange *i2 = (NonEmptyRange *) b;
- TypeCacheEntry *typcache = (TypeCacheEntry *) arg;
+ const NonEmptyRange *i1 = a;
+ const NonEmptyRange *i2 = b;
+ TypeCacheEntry *typcache = arg;
return range_cmp_bounds(typcache, &i1->upper, &i2->upper);
}
static int
bound_cmp(const void *a, const void *b, void *arg)
{
- RangeBound *ba = (RangeBound *) a;
- RangeBound *bb = (RangeBound *) b;
- TypeCacheEntry *typcache = (TypeCacheEntry *) arg;
+ const RangeBound *ba = a;
+ const RangeBound *bb = b;
+ TypeCacheEntry *typcache = arg;
return range_cmp_bounds(typcache, ba, bb);
}
static int
range_bound_qsort_cmp(const void *a1, const void *a2, void *arg)
{
- RangeBound *b1 = (RangeBound *) a1;
- RangeBound *b2 = (RangeBound *) a2;
- TypeCacheEntry *typcache = (TypeCacheEntry *) arg;
+ const RangeBound *b1 = a1;
+ const RangeBound *b2 = a2;
+ TypeCacheEntry *typcache = arg;
return range_cmp_bounds(typcache, b1, b2);
}
void *arg)
{
dsa_area *area = (dsa_area *) arg;
- SharedRecordTableKey *k1 = (SharedRecordTableKey *) a;
- SharedRecordTableKey *k2 = (SharedRecordTableKey *) b;
+ const SharedRecordTableKey *k1 = a;
+ const SharedRecordTableKey *k2 = b;
TupleDesc t1;
TupleDesc t2;
static uint32
shared_record_table_hash(const void *a, size_t size, void *arg)
{
- dsa_area *area = (dsa_area *) arg;
- SharedRecordTableKey *k = (SharedRecordTableKey *) a;
+ dsa_area *area = arg;
+ const SharedRecordTableKey *k = a;
TupleDesc t;
if (k->shared)
static uint32
record_type_typmod_hash(const void *data, size_t size)
{
- RecordCacheEntry *entry = (RecordCacheEntry *) data;
+ const RecordCacheEntry *entry = data;
return hashRowType(entry->tupdesc);
}
static int
record_type_typmod_compare(const void *a, const void *b, size_t size)
{
- RecordCacheEntry *left = (RecordCacheEntry *) a;
- RecordCacheEntry *right = (RecordCacheEntry *) b;
+ const RecordCacheEntry *left = a;
+ const RecordCacheEntry *right = b;
return equalRowTypes(left->tupdesc, right->tupdesc) ? 0 : 1;
}
static char *
dumpRelationStats_dumper(Archive *fout, const void *userArg, const TocEntry *te)
{
- const RelStatsInfo *rsinfo = (RelStatsInfo *) userArg;
+ const RelStatsInfo *rsinfo = userArg;
static PGresult *res;
static int rownum;
PQExpBuffer query;
* otherwise.
*/
static bool
-injection_point_allowed(InjectionPointCondition *condition)
+injection_point_allowed(const InjectionPointCondition *condition)
{
bool result = true;
void
injection_error(const char *name, const void *private_data, void *arg)
{
- InjectionPointCondition *condition = (InjectionPointCondition *) private_data;
- char *argstr = (char *) arg;
+ const InjectionPointCondition *condition = private_data;
+ char *argstr = arg;
if (!injection_point_allowed(condition))
return;
void
injection_notice(const char *name, const void *private_data, void *arg)
{
- InjectionPointCondition *condition = (InjectionPointCondition *) private_data;
- char *argstr = (char *) arg;
+ const InjectionPointCondition *condition = private_data;
+ char *argstr = arg;
if (!injection_point_allowed(condition))
return;
uint32 old_wait_counts = 0;
int index = -1;
uint32 injection_wait_event = 0;
- InjectionPointCondition *condition = (InjectionPointCondition *) private_data;
+ const InjectionPointCondition *condition = private_data;
if (inj_state == NULL)
injection_init_shmem();