aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/btree_gist/btree_cash.c14
-rw-r--r--contrib/btree_gist/btree_date.c14
-rw-r--r--contrib/btree_gist/btree_float4.c14
-rw-r--r--contrib/btree_gist/btree_float8.c14
-rw-r--r--contrib/btree_gist/btree_inet.c14
-rw-r--r--contrib/btree_gist/btree_int2.c14
-rw-r--r--contrib/btree_gist/btree_int4.c14
-rw-r--r--contrib/btree_gist/btree_int8.c14
-rw-r--r--contrib/btree_gist/btree_interval.c6
-rw-r--r--contrib/btree_gist/btree_macaddr.c4
-rw-r--r--contrib/btree_gist/btree_oid.c14
-rw-r--r--contrib/btree_gist/btree_time.c4
-rw-r--r--contrib/btree_gist/btree_ts.c4
-rw-r--r--contrib/dict_xsyn/dict_xsyn.c2
-rw-r--r--contrib/hstore/hstore_gist.c2
-rw-r--r--contrib/hstore/hstore_io.c15
-rw-r--r--contrib/intarray/_int_gist.c4
-rw-r--r--contrib/intarray/_int_tool.c8
-rw-r--r--contrib/ltree/_ltree_gist.c2
-rw-r--r--contrib/pg_stat_statements/pg_stat_statements.c4
-rw-r--r--contrib/pg_trgm/trgm.h2
-rw-r--r--contrib/pg_trgm/trgm_gist.c4
-rw-r--r--contrib/pgcrypto/crypt-blowfish.c6
-rw-r--r--contrib/pgcrypto/crypt-des.c4
-rw-r--r--contrib/pgcrypto/crypt-gensalt.c6
-rw-r--r--contrib/pgcrypto/crypt-md5.c20
26 files changed, 112 insertions, 111 deletions
diff --git a/contrib/btree_gist/btree_cash.c b/contrib/btree_gist/btree_cash.c
index f22e1bff929..8e8495ca068 100644
--- a/contrib/btree_gist/btree_cash.c
+++ b/contrib/btree_gist/btree_cash.c
@@ -35,34 +35,34 @@ Datum gbt_cash_same(PG_FUNCTION_ARGS);
static bool
gbt_cashgt(const void *a, const void *b)
{
- return (*((Cash *) a) > *((Cash *) b));
+ return (*((const Cash *) a) > *((const Cash *) b));
}
static bool
gbt_cashge(const void *a, const void *b)
{
- return (*((Cash *) a) >= *((Cash *) b));
+ return (*((const Cash *) a) >= *((const Cash *) b));
}
static bool
gbt_casheq(const void *a, const void *b)
{
- return (*((Cash *) a) == *((Cash *) b));
+ return (*((const Cash *) a) == *((const Cash *) b));
}
static bool
gbt_cashle(const void *a, const void *b)
{
- return (*((Cash *) a) <= *((Cash *) b));
+ return (*((const Cash *) a) <= *((const Cash *) b));
}
static bool
gbt_cashlt(const void *a, const void *b)
{
- return (*((Cash *) a) < *((Cash *) b));
+ return (*((const Cash *) a) < *((const Cash *) b));
}
static int
gbt_cashkey_cmp(const void *a, const void *b)
{
- cashKEY *ia = (cashKEY *) (((Nsrt *) a)->t);
- cashKEY *ib = (cashKEY *) (((Nsrt *) b)->t);
+ cashKEY *ia = (cashKEY *) (((const Nsrt *) a)->t);
+ cashKEY *ib = (cashKEY *) (((const Nsrt *) b)->t);
if (ia->lower == ib->lower)
{
diff --git a/contrib/btree_gist/btree_date.c b/contrib/btree_gist/btree_date.c
index d6b989a177b..1c0c3ec20c8 100644
--- a/contrib/btree_gist/btree_date.c
+++ b/contrib/btree_gist/btree_date.c
@@ -36,7 +36,7 @@ static bool
gbt_dategt(const void *a, const void *b)
{
return DatumGetBool(
- DirectFunctionCall2(date_gt, DateADTGetDatum(*((DateADT *) a)), DateADTGetDatum(*((DateADT *) b)))
+ DirectFunctionCall2(date_gt, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b)))
);
}
@@ -44,7 +44,7 @@ static bool
gbt_datege(const void *a, const void *b)
{
return DatumGetBool(
- DirectFunctionCall2(date_ge, DateADTGetDatum(*((DateADT *) a)), DateADTGetDatum(*((DateADT *) b)))
+ DirectFunctionCall2(date_ge, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b)))
);
}
@@ -52,7 +52,7 @@ static bool
gbt_dateeq(const void *a, const void *b)
{
return DatumGetBool(
- DirectFunctionCall2(date_eq, DateADTGetDatum(*((DateADT *) a)), DateADTGetDatum(*((DateADT *) b)))
+ DirectFunctionCall2(date_eq, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b)))
);
}
@@ -60,7 +60,7 @@ static bool
gbt_datele(const void *a, const void *b)
{
return DatumGetBool(
- DirectFunctionCall2(date_le, DateADTGetDatum(*((DateADT *) a)), DateADTGetDatum(*((DateADT *) b)))
+ DirectFunctionCall2(date_le, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b)))
);
}
@@ -68,7 +68,7 @@ static bool
gbt_datelt(const void *a, const void *b)
{
return DatumGetBool(
- DirectFunctionCall2(date_lt, DateADTGetDatum(*((DateADT *) a)), DateADTGetDatum(*((DateADT *) b)))
+ DirectFunctionCall2(date_lt, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b)))
);
}
@@ -77,8 +77,8 @@ gbt_datelt(const void *a, const void *b)
static int
gbt_datekey_cmp(const void *a, const void *b)
{
- dateKEY *ia = (dateKEY *) (((Nsrt *) a)->t);
- dateKEY *ib = (dateKEY *) (((Nsrt *) b)->t);
+ dateKEY *ia = (dateKEY *) (((const Nsrt *) a)->t);
+ dateKEY *ib = (dateKEY *) (((const Nsrt *) b)->t);
int res;
res = DatumGetInt32(DirectFunctionCall2(date_cmp, DateADTGetDatum(ia->lower), DateADTGetDatum(ib->lower)));
diff --git a/contrib/btree_gist/btree_float4.c b/contrib/btree_gist/btree_float4.c
index e3f2155d593..cf1e45a381b 100644
--- a/contrib/btree_gist/btree_float4.c
+++ b/contrib/btree_gist/btree_float4.c
@@ -34,34 +34,34 @@ Datum gbt_float4_same(PG_FUNCTION_ARGS);
static bool
gbt_float4gt(const void *a, const void *b)
{
- return (*((float4 *) a) > *((float4 *) b));
+ return (*((const float4 *) a) > *((const float4 *) b));
}
static bool
gbt_float4ge(const void *a, const void *b)
{
- return (*((float4 *) a) >= *((float4 *) b));
+ return (*((const float4 *) a) >= *((const float4 *) b));
}
static bool
gbt_float4eq(const void *a, const void *b)
{
- return (*((float4 *) a) == *((float4 *) b));
+ return (*((const float4 *) a) == *((const float4 *) b));
}
static bool
gbt_float4le(const void *a, const void *b)
{
- return (*((float4 *) a) <= *((float4 *) b));
+ return (*((const float4 *) a) <= *((const float4 *) b));
}
static bool
gbt_float4lt(const void *a, const void *b)
{
- return (*((float4 *) a) < *((float4 *) b));
+ return (*((const float4 *) a) < *((const float4 *) b));
}
static int
gbt_float4key_cmp(const void *a, const void *b)
{
- float4KEY *ia = (float4KEY *) (((Nsrt *) a)->t);
- float4KEY *ib = (float4KEY *) (((Nsrt *) b)->t);
+ float4KEY *ia = (float4KEY *) (((const Nsrt *) a)->t);
+ float4KEY *ib = (float4KEY *) (((const Nsrt *) b)->t);
if (ia->lower == ib->lower)
{
diff --git a/contrib/btree_gist/btree_float8.c b/contrib/btree_gist/btree_float8.c
index 0fbebeea077..3ce87642cb9 100644
--- a/contrib/btree_gist/btree_float8.c
+++ b/contrib/btree_gist/btree_float8.c
@@ -35,34 +35,34 @@ Datum gbt_float8_same(PG_FUNCTION_ARGS);
static bool
gbt_float8gt(const void *a, const void *b)
{
- return (*((float8 *) a) > *((float8 *) b));
+ return (*((const float8 *) a) > *((const float8 *) b));
}
static bool
gbt_float8ge(const void *a, const void *b)
{
- return (*((float8 *) a) >= *((float8 *) b));
+ return (*((const float8 *) a) >= *((const float8 *) b));
}
static bool
gbt_float8eq(const void *a, const void *b)
{
- return (*((float8 *) a) == *((float8 *) b));
+ return (*((const float8 *) a) == *((const float8 *) b));
}
static bool
gbt_float8le(const void *a, const void *b)
{
- return (*((float8 *) a) <= *((float8 *) b));
+ return (*((const float8 *) a) <= *((const float8 *) b));
}
static bool
gbt_float8lt(const void *a, const void *b)
{
- return (*((float8 *) a) < *((float8 *) b));
+ return (*((const float8 *) a) < *((const float8 *) b));
}
static int
gbt_float8key_cmp(const void *a, const void *b)
{
- float8KEY *ia = (float8KEY *) (((Nsrt *) a)->t);
- float8KEY *ib = (float8KEY *) (((Nsrt *) b)->t);
+ float8KEY *ia = (float8KEY *) (((const Nsrt *) a)->t);
+ float8KEY *ib = (float8KEY *) (((const Nsrt *) b)->t);
if (ia->lower == ib->lower)
{
diff --git a/contrib/btree_gist/btree_inet.c b/contrib/btree_gist/btree_inet.c
index 439e6c90a7c..c136296ab53 100644
--- a/contrib/btree_gist/btree_inet.c
+++ b/contrib/btree_gist/btree_inet.c
@@ -36,34 +36,34 @@ Datum gbt_inet_same(PG_FUNCTION_ARGS);
static bool
gbt_inetgt(const void *a, const void *b)
{
- return (*((double *) a) > *((double *) b));
+ return (*((const double *) a) > *((const double *) b));
}
static bool
gbt_inetge(const void *a, const void *b)
{
- return (*((double *) a) >= *((double *) b));
+ return (*((const double *) a) >= *((const double *) b));
}
static bool
gbt_ineteq(const void *a, const void *b)
{
- return (*((double *) a) == *((double *) b));
+ return (*((const double *) a) == *((const double *) b));
}
static bool
gbt_inetle(const void *a, const void *b)
{
- return (*((double *) a) <= *((double *) b));
+ return (*((const double *) a) <= *((const double *) b));
}
static bool
gbt_inetlt(const void *a, const void *b)
{
- return (*((double *) a) < *((double *) b));
+ return (*((const double *) a) < *((const double *) b));
}
static int
gbt_inetkey_cmp(const void *a, const void *b)
{
- inetKEY *ia = (inetKEY *) (((Nsrt *) a)->t);
- inetKEY *ib = (inetKEY *) (((Nsrt *) b)->t);
+ inetKEY *ia = (inetKEY *) (((const Nsrt *) a)->t);
+ inetKEY *ib = (inetKEY *) (((const Nsrt *) b)->t);
if (ia->lower == ib->lower)
{
diff --git a/contrib/btree_gist/btree_int2.c b/contrib/btree_gist/btree_int2.c
index 3eb76b8be06..a40912b13d6 100644
--- a/contrib/btree_gist/btree_int2.c
+++ b/contrib/btree_gist/btree_int2.c
@@ -34,34 +34,34 @@ Datum gbt_int2_same(PG_FUNCTION_ARGS);
static bool
gbt_int2gt(const void *a, const void *b)
{
- return (*((int16 *) a) > *((int16 *) b));
+ return (*((const int16 *) a) > *((const int16 *) b));
}
static bool
gbt_int2ge(const void *a, const void *b)
{
- return (*((int16 *) a) >= *((int16 *) b));
+ return (*((const int16 *) a) >= *((const int16 *) b));
}
static bool
gbt_int2eq(const void *a, const void *b)
{
- return (*((int16 *) a) == *((int16 *) b));
+ return (*((const int16 *) a) == *((const int16 *) b));
}
static bool
gbt_int2le(const void *a, const void *b)
{
- return (*((int16 *) a) <= *((int16 *) b));
+ return (*((const int16 *) a) <= *((const int16 *) b));
}
static bool
gbt_int2lt(const void *a, const void *b)
{
- return (*((int16 *) a) < *((int16 *) b));
+ return (*((const int16 *) a) < *((const int16 *) b));
}
static int
gbt_int2key_cmp(const void *a, const void *b)
{
- int16KEY *ia = (int16KEY *) (((Nsrt *) a)->t);
- int16KEY *ib = (int16KEY *) (((Nsrt *) b)->t);
+ int16KEY *ia = (int16KEY *) (((const Nsrt *) a)->t);
+ int16KEY *ib = (int16KEY *) (((const Nsrt *) b)->t);
if (ia->lower == ib->lower)
{
diff --git a/contrib/btree_gist/btree_int4.c b/contrib/btree_gist/btree_int4.c
index 9e1362cc2f3..426f23f3fe0 100644
--- a/contrib/btree_gist/btree_int4.c
+++ b/contrib/btree_gist/btree_int4.c
@@ -35,34 +35,34 @@ Datum gbt_int4_same(PG_FUNCTION_ARGS);
static bool
gbt_int4gt(const void *a, const void *b)
{
- return (*((int32 *) a) > *((int32 *) b));
+ return (*((const int32 *) a) > *((const int32 *) b));
}
static bool
gbt_int4ge(const void *a, const void *b)
{
- return (*((int32 *) a) >= *((int32 *) b));
+ return (*((const int32 *) a) >= *((const int32 *) b));
}
static bool
gbt_int4eq(const void *a, const void *b)
{
- return (*((int32 *) a) == *((int32 *) b));
+ return (*((const int32 *) a) == *((const int32 *) b));
}
static bool
gbt_int4le(const void *a, const void *b)
{
- return (*((int32 *) a) <= *((int32 *) b));
+ return (*((const int32 *) a) <= *((const int32 *) b));
}
static bool
gbt_int4lt(const void *a, const void *b)
{
- return (*((int32 *) a) < *((int32 *) b));
+ return (*((const int32 *) a) < *((const int32 *) b));
}
static int
gbt_int4key_cmp(const void *a, const void *b)
{
- int32KEY *ia = (int32KEY *) (((Nsrt *) a)->t);
- int32KEY *ib = (int32KEY *) (((Nsrt *) b)->t);
+ int32KEY *ia = (int32KEY *) (((const Nsrt *) a)->t);
+ int32KEY *ib = (int32KEY *) (((const Nsrt *) b)->t);
if (ia->lower == ib->lower)
{
diff --git a/contrib/btree_gist/btree_int8.c b/contrib/btree_gist/btree_int8.c
index 45f5379a3e0..c05d8687fd3 100644
--- a/contrib/btree_gist/btree_int8.c
+++ b/contrib/btree_gist/btree_int8.c
@@ -35,34 +35,34 @@ Datum gbt_int8_same(PG_FUNCTION_ARGS);
static bool
gbt_int8gt(const void *a, const void *b)
{
- return (*((int64 *) a) > *((int64 *) b));
+ return (*((const int64 *) a) > *((const int64 *) b));
}
static bool
gbt_int8ge(const void *a, const void *b)
{
- return (*((int64 *) a) >= *((int64 *) b));
+ return (*((const int64 *) a) >= *((const int64 *) b));
}
static bool
gbt_int8eq(const void *a, const void *b)
{
- return (*((int64 *) a) == *((int64 *) b));
+ return (*((const int64 *) a) == *((const int64 *) b));
}
static bool
gbt_int8le(const void *a, const void *b)
{
- return (*((int64 *) a) <= *((int64 *) b));
+ return (*((const int64 *) a) <= *((const int64 *) b));
}
static bool
gbt_int8lt(const void *a, const void *b)
{
- return (*((int64 *) a) < *((int64 *) b));
+ return (*((const int64 *) a) < *((const int64 *) b));
}
static int
gbt_int8key_cmp(const void *a, const void *b)
{
- int64KEY *ia = (int64KEY *) (((Nsrt *) a)->t);
- int64KEY *ib = (int64KEY *) (((Nsrt *) b)->t);
+ int64KEY *ia = (int64KEY *) (((const Nsrt *) a)->t);
+ int64KEY *ib = (int64KEY *) (((const Nsrt *) b)->t);
if (ia->lower == ib->lower)
{
diff --git a/contrib/btree_gist/btree_interval.c b/contrib/btree_gist/btree_interval.c
index b56494684f7..bb779adf8e5 100644
--- a/contrib/btree_gist/btree_interval.c
+++ b/contrib/btree_gist/btree_interval.c
@@ -69,8 +69,8 @@ gbt_intvlt(const void *a, const void *b)
static int
gbt_intvkey_cmp(const void *a, const void *b)
{
- intvKEY *ia = (intvKEY *) (((Nsrt *) a)->t);
- intvKEY *ib = (intvKEY *) (((Nsrt *) b)->t);
+ intvKEY *ia = (intvKEY *) (((const Nsrt *) a)->t);
+ intvKEY *ib = (intvKEY *) (((const Nsrt *) b)->t);
int res;
res = DatumGetInt32(DirectFunctionCall2(interval_cmp, IntervalPGetDatum(&ia->lower), IntervalPGetDatum(&ib->lower)));
@@ -90,7 +90,7 @@ intr2num(const Interval *i)
static float8
gbt_intv_dist(const void *a, const void *b)
{
- return (float8) Abs(intr2num((Interval *) a) - intr2num((Interval *) b));
+ return (float8) Abs(intr2num((const Interval *) a) - intr2num((const Interval *) b));
}
/*
diff --git a/contrib/btree_gist/btree_macaddr.c b/contrib/btree_gist/btree_macaddr.c
index 2a223361b8d..31125beda61 100644
--- a/contrib/btree_gist/btree_macaddr.c
+++ b/contrib/btree_gist/btree_macaddr.c
@@ -65,8 +65,8 @@ gbt_macadlt(const void *a, const void *b)
static int
gbt_macadkey_cmp(const void *a, const void *b)
{
- macKEY *ia = (macKEY *) (((Nsrt *) a)->t);
- macKEY *ib = (macKEY *) (((Nsrt *) b)->t);
+ macKEY *ia = (macKEY *) (((const Nsrt *) a)->t);
+ macKEY *ib = (macKEY *) (((const Nsrt *) b)->t);
int res;
res = DatumGetInt32(DirectFunctionCall2(macaddr_cmp, MacaddrPGetDatum(&ia->lower), MacaddrPGetDatum(&ib->lower)));
diff --git a/contrib/btree_gist/btree_oid.c b/contrib/btree_gist/btree_oid.c
index 7b4de5726dc..e80a23c0b1a 100644
--- a/contrib/btree_gist/btree_oid.c
+++ b/contrib/btree_gist/btree_oid.c
@@ -35,34 +35,34 @@ Datum gbt_oid_same(PG_FUNCTION_ARGS);
static bool
gbt_oidgt(const void *a, const void *b)
{
- return (*((Oid *) a) > *((Oid *) b));
+ return (*((const Oid *) a) > *((const Oid *) b));
}
static bool
gbt_oidge(const void *a, const void *b)
{
- return (*((Oid *) a) >= *((Oid *) b));
+ return (*((const Oid *) a) >= *((const Oid *) b));
}
static bool
gbt_oideq(const void *a, const void *b)
{
- return (*((Oid *) a) == *((Oid *) b));
+ return (*((const Oid *) a) == *((const Oid *) b));
}
static bool
gbt_oidle(const void *a, const void *b)
{
- return (*((Oid *) a) <= *((Oid *) b));
+ return (*((const Oid *) a) <= *((const Oid *) b));
}
static bool
gbt_oidlt(const void *a, const void *b)
{
- return (*((Oid *) a) < *((Oid *) b));
+ return (*((const Oid *) a) < *((const Oid *) b));
}
static int
gbt_oidkey_cmp(const void *a, const void *b)
{
- oidKEY *ia = (oidKEY *) (((Nsrt *) a)->t);
- oidKEY *ib = (oidKEY *) (((Nsrt *) b)->t);
+ oidKEY *ia = (oidKEY *) (((const Nsrt *) a)->t);
+ oidKEY *ib = (oidKEY *) (((const Nsrt *) b)->t);
if (ia->lower == ib->lower)
{
diff --git a/contrib/btree_gist/btree_time.c b/contrib/btree_gist/btree_time.c
index c7f37d42302..a148e5e120b 100644
--- a/contrib/btree_gist/btree_time.c
+++ b/contrib/btree_gist/btree_time.c
@@ -105,8 +105,8 @@ gbt_timelt(const void *a, const void *b)
static int
gbt_timekey_cmp(const void *a, const void *b)
{
- timeKEY *ia = (timeKEY *) (((Nsrt *) a)->t);
- timeKEY *ib = (timeKEY *) (((Nsrt *) b)->t);
+ timeKEY *ia = (timeKEY *) (((const Nsrt *) a)->t);
+ timeKEY *ib = (timeKEY *) (((const Nsrt *) b)->t);
int res;
res = DatumGetInt32(DirectFunctionCall2(time_cmp, TimeADTGetDatumFast(ia->lower), TimeADTGetDatumFast(ib->lower)));
diff --git a/contrib/btree_gist/btree_ts.c b/contrib/btree_gist/btree_ts.c
index 4badb80bd2f..05609232d25 100644
--- a/contrib/btree_gist/btree_ts.c
+++ b/contrib/btree_gist/btree_ts.c
@@ -106,8 +106,8 @@ gbt_tslt(const void *a, const void *b)
static int
gbt_tskey_cmp(const void *a, const void *b)
{
- tsKEY *ia = (tsKEY *) (((Nsrt *) a)->t);
- tsKEY *ib = (tsKEY *) (((Nsrt *) b)->t);
+ tsKEY *ia = (tsKEY *) (((const Nsrt *) a)->t);
+ tsKEY *ib = (tsKEY *) (((const Nsrt *) b)->t);
int res;
res = DatumGetInt32(DirectFunctionCall2(timestamp_cmp, TimestampGetDatumFast(ia->lower), TimestampGetDatumFast(ib->lower)));
diff --git a/contrib/dict_xsyn/dict_xsyn.c b/contrib/dict_xsyn/dict_xsyn.c
index a6b413bb554..3c05a1ea908 100644
--- a/contrib/dict_xsyn/dict_xsyn.c
+++ b/contrib/dict_xsyn/dict_xsyn.c
@@ -69,7 +69,7 @@ find_word(char *in, char **end)
static int
compare_syn(const void *a, const void *b)
{
- return strcmp(((Syn *) a)->key, ((Syn *) b)->key);
+ return strcmp(((const Syn *) a)->key, ((const Syn *) b)->key);
}
static void
diff --git a/contrib/hstore/hstore_gist.c b/contrib/hstore/hstore_gist.c
index 800de48247e..f5c4b71eaff 100644
--- a/contrib/hstore/hstore_gist.c
+++ b/contrib/hstore/hstore_gist.c
@@ -322,7 +322,7 @@ typedef struct
static int
comparecost(const void *a, const void *b)
{
- return ((SPLITCOST *) a)->cost - ((SPLITCOST *) b)->cost;
+ return ((const SPLITCOST *) a)->cost - ((const SPLITCOST *) b)->cost;
}
diff --git a/contrib/hstore/hstore_io.c b/contrib/hstore/hstore_io.c
index fc39bebc58f..0eb48cf5806 100644
--- a/contrib/hstore/hstore_io.c
+++ b/contrib/hstore/hstore_io.c
@@ -276,24 +276,25 @@ parse_hstore(HSParser *state)
static int
comparePairs(const void *a, const void *b)
{
- if (((Pairs *) a)->keylen == ((Pairs *) b)->keylen)
+ const Pairs *pa = a;
+ const Pairs *pb = b;
+
+ if (pa->keylen == pb->keylen)
{
- int res = memcmp(((Pairs *) a)->key,
- ((Pairs *) b)->key,
- ((Pairs *) a)->keylen);
+ int res = memcmp(pa->key, pb->key, pa->keylen);
if (res)
return res;
/* guarantee that needfree will be later */
- if (((Pairs *) b)->needfree == ((Pairs *) a)->needfree)
+ if (pb->needfree == pa->needfree)
return 0;
- else if (((Pairs *) a)->needfree)
+ else if (pa->needfree)
return 1;
else
return -1;
}
- return (((Pairs *) a)->keylen > ((Pairs *) b)->keylen) ? 1 : -1;
+ return (pa->keylen > pb->keylen) ? 1 : -1;
}
/*
diff --git a/contrib/intarray/_int_gist.c b/contrib/intarray/_int_gist.c
index 0a173bfcb66..0123906be88 100644
--- a/contrib/intarray/_int_gist.c
+++ b/contrib/intarray/_int_gist.c
@@ -357,10 +357,10 @@ typedef struct
static int
comparecost(const void *a, const void *b)
{
- if (((SPLITCOST *) a)->cost == ((SPLITCOST *) b)->cost)
+ if (((const SPLITCOST *) a)->cost == ((const SPLITCOST *) b)->cost)
return 0;
else
- return (((SPLITCOST *) a)->cost > ((SPLITCOST *) b)->cost) ? 1 : -1;
+ return (((const SPLITCOST *) a)->cost > ((const SPLITCOST *) b)->cost) ? 1 : -1;
}
/*
diff --git a/contrib/intarray/_int_tool.c b/contrib/intarray/_int_tool.c
index bfc55501dbc..79f018d333b 100644
--- a/contrib/intarray/_int_tool.c
+++ b/contrib/intarray/_int_tool.c
@@ -388,15 +388,15 @@ int_to_intset(int32 n)
int
compASC(const void *a, const void *b)
{
- if (*(int4 *) a == *(int4 *) b)
+ if (*(const int4 *) a == *(const int4 *) b)
return 0;
- return (*(int4 *) a > *(int4 *) b) ? 1 : -1;
+ return (*(const int4 *) a > *(const int4 *) b) ? 1 : -1;
}
int
compDESC(const void *a, const void *b)
{
- if (*(int4 *) a == *(int4 *) b)
+ if (*(const int4 *) a == *(const int4 *) b)
return 0;
- return (*(int4 *) a < *(int4 *) b) ? 1 : -1;
+ return (*(const int4 *) a < *(const int4 *) b) ? 1 : -1;
}
diff --git a/contrib/ltree/_ltree_gist.c b/contrib/ltree/_ltree_gist.c
index f03f6332906..8afc2bd5407 100644
--- a/contrib/ltree/_ltree_gist.c
+++ b/contrib/ltree/_ltree_gist.c
@@ -280,7 +280,7 @@ typedef struct
static int
comparecost(const void *a, const void *b)
{
- return ((SPLITCOST *) a)->cost - ((SPLITCOST *) b)->cost;
+ return ((const SPLITCOST *) a)->cost - ((const SPLITCOST *) b)->cost;
}
Datum
diff --git a/contrib/pg_stat_statements/pg_stat_statements.c b/contrib/pg_stat_statements/pg_stat_statements.c
index eb4c494ae68..8dc3054e372 100644
--- a/contrib/pg_stat_statements/pg_stat_statements.c
+++ b/contrib/pg_stat_statements/pg_stat_statements.c
@@ -973,8 +973,8 @@ entry_alloc(pgssHashKey *key)
static int
entry_cmp(const void *lhs, const void *rhs)
{
- double l_usage = (*(const pgssEntry **) lhs)->counters.usage;
- double r_usage = (*(const pgssEntry **) rhs)->counters.usage;
+ double l_usage = (*(pgssEntry * const *) lhs)->counters.usage;
+ double r_usage = (*(pgssEntry * const *) rhs)->counters.usage;
if (l_usage < r_usage)
return -1;
diff --git a/contrib/pg_trgm/trgm.h b/contrib/pg_trgm/trgm.h
index 61de5d89d16..067f29d4daf 100644
--- a/contrib/pg_trgm/trgm.h
+++ b/contrib/pg_trgm/trgm.h
@@ -33,7 +33,7 @@
typedef char trgm[3];
#define CMPCHAR(a,b) ( ((a)==(b)) ? 0 : ( ((a)<(b)) ? -1 : 1 ) )
-#define CMPPCHAR(a,b,i) CMPCHAR( *(((char*)(a))+i), *(((char*)(b))+i) )
+#define CMPPCHAR(a,b,i) CMPCHAR( *(((const char*)(a))+i), *(((const char*)(b))+i) )
#define CMPTRGM(a,b) ( CMPPCHAR(a,b,0) ? CMPPCHAR(a,b,0) : ( CMPPCHAR(a,b,1) ? CMPPCHAR(a,b,1) : CMPPCHAR(a,b,2) ) )
#define CPTRGM(a,b) do { \
diff --git a/contrib/pg_trgm/trgm_gist.c b/contrib/pg_trgm/trgm_gist.c
index aee060bab73..5621e909775 100644
--- a/contrib/pg_trgm/trgm_gist.c
+++ b/contrib/pg_trgm/trgm_gist.c
@@ -594,10 +594,10 @@ typedef struct
static int
comparecost(const void *a, const void *b)
{
- if (((SPLITCOST *) a)->cost == ((SPLITCOST *) b)->cost)
+ if (((const SPLITCOST *) a)->cost == ((const SPLITCOST *) b)->cost)
return 0;
else
- return (((SPLITCOST *) a)->cost > ((SPLITCOST *) b)->cost) ? 1 : -1;
+ return (((const SPLITCOST *) a)->cost > ((const SPLITCOST *) b)->cost) ? 1 : -1;
}
diff --git a/contrib/pgcrypto/crypt-blowfish.c b/contrib/pgcrypto/crypt-blowfish.c
index 7cca92b6ab5..b49747d9265 100644
--- a/contrib/pgcrypto/crypt-blowfish.c
+++ b/contrib/pgcrypto/crypt-blowfish.c
@@ -371,7 +371,7 @@ BF_decode(BF_word *dst, const char *src, int size)
{
unsigned char *dptr = (unsigned char *) dst;
unsigned char *end = dptr + size;
- unsigned char *sptr = (unsigned char *) src;
+ const unsigned char *sptr = (const unsigned char *) src;
unsigned int tmp,
c1,
c2,
@@ -401,8 +401,8 @@ BF_decode(BF_word *dst, const char *src, int size)
static void
BF_encode(char *dst, const BF_word *src, int size)
{
- unsigned char *sptr = (unsigned char *) src;
- unsigned char *end = sptr + size;
+ const unsigned char *sptr = (const unsigned char *) src;
+ const unsigned char *end = sptr + size;
unsigned char *dptr = (unsigned char *) dst;
unsigned int c1,
c2;
diff --git a/contrib/pgcrypto/crypt-des.c b/contrib/pgcrypto/crypt-des.c
index e50c1f4a925..44475a1b446 100644
--- a/contrib/pgcrypto/crypt-des.c
+++ b/contrib/pgcrypto/crypt-des.c
@@ -407,8 +407,8 @@ des_setkey(const char *key)
if (!des_initialised)
des_init();
- rawkey0 = ntohl(*(uint32 *) key);
- rawkey1 = ntohl(*(uint32 *) (key + 4));
+ rawkey0 = ntohl(*(const uint32 *) key);
+ rawkey1 = ntohl(*(const uint32 *) (key + 4));
if ((rawkey0 | rawkey1)
&& rawkey0 == old_rawkey0
diff --git a/contrib/pgcrypto/crypt-gensalt.c b/contrib/pgcrypto/crypt-gensalt.c
index 062ab864167..ec2e0fa0250 100644
--- a/contrib/pgcrypto/crypt-gensalt.c
+++ b/contrib/pgcrypto/crypt-gensalt.c
@@ -123,8 +123,8 @@ static unsigned char BF_itoa64[64 + 1] =
static void
BF_encode(char *dst, const BF_word *src, int size)
{
- unsigned char *sptr = (unsigned char *) src;
- unsigned char *end = sptr + size;
+ const unsigned char *sptr = (const unsigned char *) src;
+ const unsigned char *end = sptr + size;
unsigned char *dptr = (unsigned char *) dst;
unsigned int c1,
c2;
@@ -180,7 +180,7 @@ _crypt_gensalt_blowfish_rn(unsigned long count,
output[5] = '0' + count % 10;
output[6] = '$';
- BF_encode(&output[7], (BF_word *) input, 16);
+ BF_encode(&output[7], (const BF_word *) input, 16);
output[7 + 22] = '\0';
return output;
diff --git a/contrib/pgcrypto/crypt-md5.c b/contrib/pgcrypto/crypt-md5.c
index 30eb8bf5a27..2215f38d8bf 100644
--- a/contrib/pgcrypto/crypt-md5.c
+++ b/contrib/pgcrypto/crypt-md5.c
@@ -72,18 +72,18 @@ px_crypt_md5(const char *pw, const char *salt, char *passwd, unsigned dstlen)
err = px_find_digest("md5", &ctx1);
/* The password first, since that is what is most unknown */
- px_md_update(ctx, (uint8 *) pw, strlen(pw));
+ px_md_update(ctx, (const uint8 *) pw, strlen(pw));
/* Then our magic string */
px_md_update(ctx, (uint8 *) magic, strlen(magic));
/* Then the raw salt */
- px_md_update(ctx, (uint8 *) sp, sl);
+ px_md_update(ctx, (const uint8 *) sp, sl);
/* Then just as many characters of the MD5(pw,salt,pw) */
- px_md_update(ctx1, (uint8 *) pw, strlen(pw));
- px_md_update(ctx1, (uint8 *) sp, sl);
- px_md_update(ctx1, (uint8 *) pw, strlen(pw));
+ px_md_update(ctx1, (const uint8 *) pw, strlen(pw));
+ px_md_update(ctx1, (const uint8 *) sp, sl);
+ px_md_update(ctx1, (const uint8 *) pw, strlen(pw));
px_md_finish(ctx1, final);
for (pl = strlen(pw); pl > 0; pl -= MD5_SIZE)
px_md_update(ctx, final, pl > MD5_SIZE ? MD5_SIZE : pl);
@@ -96,7 +96,7 @@ px_crypt_md5(const char *pw, const char *salt, char *passwd, unsigned dstlen)
if (i & 1)
px_md_update(ctx, final, 1);
else
- px_md_update(ctx, (uint8 *) pw, 1);
+ px_md_update(ctx, (const uint8 *) pw, 1);
/* Now make the output string */
strcpy(passwd, magic);
@@ -114,20 +114,20 @@ px_crypt_md5(const char *pw, const char *salt, char *passwd, unsigned dstlen)
{
px_md_reset(ctx1);
if (i & 1)
- px_md_update(ctx1, (uint8 *) pw, strlen(pw));
+ px_md_update(ctx1, (const uint8 *) pw, strlen(pw));
else
px_md_update(ctx1, final, MD5_SIZE);
if (i % 3)
- px_md_update(ctx1, (uint8 *) sp, sl);
+ px_md_update(ctx1, (const uint8 *) sp, sl);
if (i % 7)
- px_md_update(ctx1, (uint8 *) pw, strlen(pw));
+ px_md_update(ctx1, (const uint8 *) pw, strlen(pw));
if (i & 1)
px_md_update(ctx1, final, MD5_SIZE);
else
- px_md_update(ctx1, (uint8 *) pw, strlen(pw));
+ px_md_update(ctx1, (const uint8 *) pw, strlen(pw));
px_md_finish(ctx1, final);
}