1
0
mirror of https://github.com/postgres/postgres.git synced 2026-10-23 13:29:09 +03:00

Use unconstify_constexpr

Add uses of unconstify_constexpr were appropriate.

Reviewed-by: Rui Zhao <zhaorui126@gmail.com>
Discussion: https://www.postgresql.org/message-id/c76b72dd-5736-453a-b698-6968d42e4768%40eisentraut.org
This commit is contained in:
Peter Eisentraut
2026-10-07 08:21:37 +02:00
parent d396cb7e22
commit 73d4ba8505
3 changed files with 8 additions and 8 deletions

View File

@@ -93,7 +93,7 @@ static const DestReceiver spi_printtupDR = {
* It's ok to cast the constness away as any modification of the none receiver
* would be a bug (which gets easier to catch this way).
*/
DestReceiver *None_Receiver = (DestReceiver *) &donothingDR;
DestReceiver *None_Receiver = unconstify_constexpr(DestReceiver *, &donothingDR);
/* ----------------
* BeginCommand - initialize the destination at start of command

View File

@@ -415,18 +415,18 @@ typedef struct NumericSumAccum
*/
static const NumericDigit const_zero_data[1] = {0};
static const NumericVar const_zero =
{0, 0, NUMERIC_POS, 0, NULL, (NumericDigit *) const_zero_data};
{0, 0, NUMERIC_POS, 0, NULL, unconstify_constexpr(NumericDigit *, const_zero_data)};
static const NumericDigit const_one_data[1] = {1};
static const NumericVar const_one =
{1, 0, NUMERIC_POS, 0, NULL, (NumericDigit *) const_one_data};
{1, 0, NUMERIC_POS, 0, NULL, unconstify_constexpr(NumericDigit *, const_one_data)};
static const NumericVar const_minus_one =
{1, 0, NUMERIC_NEG, 0, NULL, (NumericDigit *) const_one_data};
{1, 0, NUMERIC_NEG, 0, NULL, unconstify_constexpr(NumericDigit *, const_one_data)};
static const NumericDigit const_two_data[1] = {2};
static const NumericVar const_two =
{1, 0, NUMERIC_POS, 0, NULL, (NumericDigit *) const_two_data};
{1, 0, NUMERIC_POS, 0, NULL, unconstify_constexpr(NumericDigit *, const_two_data)};
#if DEC_DIGITS == 4
static const NumericDigit const_zero_point_nine_data[1] = {9000};
@@ -436,7 +436,7 @@ static const NumericDigit const_zero_point_nine_data[1] = {90};
static const NumericDigit const_zero_point_nine_data[1] = {9};
#endif
static const NumericVar const_zero_point_nine =
{1, -1, NUMERIC_POS, 1, NULL, (NumericDigit *) const_zero_point_nine_data};
{1, -1, NUMERIC_POS, 1, NULL, unconstify_constexpr(NumericDigit *, const_zero_point_nine_data)};
#if DEC_DIGITS == 4
static const NumericDigit const_one_point_one_data[2] = {1, 1000};
@@ -446,7 +446,7 @@ static const NumericDigit const_one_point_one_data[2] = {1, 10};
static const NumericDigit const_one_point_one_data[2] = {1, 1};
#endif
static const NumericVar const_one_point_one =
{2, 0, NUMERIC_POS, 1, NULL, (NumericDigit *) const_one_point_one_data};
{2, 0, NUMERIC_POS, 1, NULL, unconstify_constexpr(NumericDigit *, const_one_point_one_data)};
static const NumericVar const_nan =
{0, 0, NUMERIC_NAN, 0, NULL, NULL};

View File

@@ -39,7 +39,7 @@ static PyType_Slot PLyCursor_slots[] =
Py_tp_dealloc, PLy_cursor_dealloc
},
{
Py_tp_doc, (char *) PLy_cursor_doc
Py_tp_doc, unconstify_constexpr(char *, PLy_cursor_doc)
},
{
Py_tp_iter, PyObject_SelfIter