mirror of
https://github.com/zebrajr/postgres.git
synced 2025-12-06 12:20:15 +01:00
Fix compiler warnings in test_bitmapset
The macros doing conversions of/from "text" from/to Bitmapset were using arbitrary casts with Datum, something that is not fine since2a600a93c7. These macros do not actually need casts with Datum, as they are given already "text" and Bitmapset data in input. They are updated to use cstring_to_text() and text_to_cstring(), fixing the compiler warnings reported by the buildfarm. Note that appending a -m32 to gcc to trigger 32-bit builds was enough to reproduce the warnings here. While on it, outer parenthesis are added to TEXT_TO_BITMAPSET(), and inner parenthesis are removed from BITMAPSET_TO_TEXT(), to make these macros more consistent with the style used in the tree, based on suggestions by Tom Lane. Oversights in commit00c3d87a5c. Reported-by: Tom Lane <tgl@sss.pgh.pa.us> Author: Greg Burd <greg@burd.me> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/3027069.1758606227@sss.pgh.pa.us
This commit is contained in:
parent
f2bae51dfd
commit
f83fe65f3f
|
|
@ -84,8 +84,8 @@ PG_FUNCTION_INFO_V1(test_random_operations);
|
|||
} while (0)
|
||||
|
||||
/* Encode/Decode to/from TEXT and Bitmapset */
|
||||
#define BITMAPSET_TO_TEXT(bms) (text *) CStringGetTextDatum(nodeToString((bms)))
|
||||
#define TEXT_TO_BITMAPSET(str) (Bitmapset *) stringToNode(TextDatumGetCString((Datum) (str)))
|
||||
#define BITMAPSET_TO_TEXT(bms) cstring_to_text(nodeToString(bms))
|
||||
#define TEXT_TO_BITMAPSET(str) ((Bitmapset *) stringToNode(text_to_cstring(str)))
|
||||
|
||||
/*
|
||||
* Individual test functions for each bitmapset API function
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user