diff options
author | Peter Eisentraut | 2017-03-09 20:18:59 +0000 |
---|---|---|
committer | Peter Eisentraut | 2017-03-29 01:59:23 +0000 |
commit | 4cb824699e12c39fad97fb3d9085ced0d14c067c (patch) | |
tree | 9a835d8efb7739e6436d3fc24b4b5a290b95df7d /src/backend/bootstrap | |
parent | 66b764341ba12206f01e2600713bdc3abdb070b3 (diff) |
Cast result of copyObject() to correct type
copyObject() is declared to return void *, which allows easily assigning
the result independent of the input, but it loses all type checking.
If the compiler supports typeof or something similar, cast the result to
the input type. This creates a greater amount of type safety. In some
cases, where the result is assigned to a generic type such as Node * or
Expr *, new casts are now necessary, but in general casts are now
unnecessary in the normal case and indicate that something unusual is
happening.
Reviewed-by: Mark Dilger <hornschnorter@gmail.com>
Diffstat (limited to 'src/backend/bootstrap')
-rw-r--r-- | src/backend/bootstrap/bootstrap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c index d8efdb5ed3..46c207c86c 100644 --- a/src/backend/bootstrap/bootstrap.c +++ b/src/backend/bootstrap/bootstrap.c @@ -1082,11 +1082,11 @@ index_register(Oid heap, memcpy(newind->il_info, indexInfo, sizeof(IndexInfo)); /* expressions will likely be null, but may as well copy it */ - newind->il_info->ii_Expressions = (List *) + newind->il_info->ii_Expressions = copyObject(indexInfo->ii_Expressions); newind->il_info->ii_ExpressionsState = NIL; /* predicate will likely be null, but may as well copy it */ - newind->il_info->ii_Predicate = (List *) + newind->il_info->ii_Predicate = copyObject(indexInfo->ii_Predicate); newind->il_info->ii_PredicateState = NULL; /* no exclusion constraints at bootstrap time, so no need to copy */ |