From 7b81988f9b5275e2cdf7bbb0ca0620a24f1afc82 Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Thu, 3 Jun 2004 12:26:10 +0000 Subject: - Add aligment of variable data types - Add aligment for interval data types - Avoid floating point overflow in penalty functions Janko Richter and teodor --- contrib/btree_gist/btree_utils_num.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'contrib/btree_gist/btree_utils_num.h') diff --git a/contrib/btree_gist/btree_utils_num.h b/contrib/btree_gist/btree_utils_num.h index e9e9e9eb23..122fba379a 100644 --- a/contrib/btree_gist/btree_utils_num.h +++ b/contrib/btree_gist/btree_utils_num.h @@ -41,6 +41,17 @@ typedef struct * Numeric btree functions */ + +#define penalty_range_enlarge(olower,oupper,nlower,nupper) do { \ + res = 0; \ + if ( (nupper) > (oupper) ) \ + res += ( (nupper) - (oupper) ); \ + if ( (olower) > (nlower) ) \ + res += ( (olower) - (nlower) ); \ +} while (0); + + + extern bool gbt_num_consistent( const GBT_NUMKEY_R * key , const void * query, const StrategyNumber * strategy , bool is_leaf, const gbtree_ninfo * tinfo ); -- cgit v1.2.1