diff --git a/src/backend/nodes/bitmapset.c b/src/backend/nodes/bitmapset.c
index 34d242b..7146ba1 100644
--- a/src/backend/nodes/bitmapset.c
+++ b/src/backend/nodes/bitmapset.c
@@ -789,7 +789,7 @@ bms_add_members(Bitmapset *a, const Bitmapset *b)
  *		Add members in the range of 'lower' to 'upper' to the set.
  *
  * Note this could also be done by calling bms_add_member in a loop, however,
- * using this function will be faster when the range is large as we work with
+ * using this function will be faster when the range is large as we're working
  * at the bitmapword level rather than at bit level.
  */
 Bitmapset *
@@ -834,7 +834,7 @@ bms_add_range(Bitmapset *a, int lower, int upper)
 	 */
 	while (wordnum <= uwordnum)
 	{
-		bitmapword mask = (bitmapword) ~0;
+		bitmapword mask = (~(bitmapword) 0);
 
 		/* If working on the lower word, zero out bits below 'lower'. */
 		if (wordnum == lwordnum)
