File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 88 *
99 *
1010 * IDENTIFICATION
11- * $PostgreSQL: pgsql/src/backend/access/common/reloptions.c,v 1.26 2009/04/04 21:12:30 tgl Exp $
11+ * $PostgreSQL: pgsql/src/backend/access/common/reloptions.c,v 1.27 2009/05/24 22:22:44 tgl Exp $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -190,7 +190,7 @@ static relopt_string stringRelOpts[] =
190190};
191191
192192static relopt_gen * * relOpts = NULL ;
193- static bits32 last_assigned_kind = RELOPT_KIND_LAST_DEFAULT << 1 ;
193+ static bits32 last_assigned_kind = RELOPT_KIND_LAST_DEFAULT ;
194194
195195static int num_custom_options = 0 ;
196196static relopt_gen * * custom_options = NULL ;
@@ -278,17 +278,13 @@ initialize_reloptions(void)
278278relopt_kind
279279add_reloption_kind (void )
280280{
281- relopt_kind kind ;
282-
283- /* don't hand out the last bit so that the wraparound check is portable */
281+ /* don't hand out the last bit so that the enum's behavior is portable */
284282 if (last_assigned_kind >= RELOPT_KIND_MAX )
285283 ereport (ERROR ,
286284 (errcode (ERRCODE_PROGRAM_LIMIT_EXCEEDED ),
287285 errmsg ("user-defined relation parameter types limit exceeded" )));
288-
289- kind = (relopt_kind ) last_assigned_kind ;
290286 last_assigned_kind <<= 1 ;
291- return kind ;
287+ return ( relopt_kind ) last_assigned_kind ;
292288}
293289
294290/*
Original file line number Diff line number Diff line change 1111 * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
1212 * Portions Copyright (c) 1994, Regents of the University of California
1313 *
14- * $PostgreSQL: pgsql/src/include/access/reloptions.h,v 1.14 2009/04/04 00:45:02 alvherre Exp $
14+ * $PostgreSQL: pgsql/src/include/access/reloptions.h,v 1.15 2009/05/24 22:22:44 tgl Exp $
1515 *
1616 *-------------------------------------------------------------------------
1717 */
@@ -41,7 +41,8 @@ typedef enum relopt_kind
4141 RELOPT_KIND_GIST = (1 << 5 ),
4242 /* if you add a new kind, make sure you update "last_default" too */
4343 RELOPT_KIND_LAST_DEFAULT = RELOPT_KIND_GIST ,
44- RELOPT_KIND_MAX = (1 << 31 )
44+ /* some compilers treat enums as signed ints, so we can't use 1 << 31 */
45+ RELOPT_KIND_MAX = (1 << 30 )
4546} relopt_kind ;
4647
4748/* reloption namespaces allowed for heaps -- currently only TOAST */
You can’t perform that action at this time.
0 commit comments