diff options
| author | Bruce Momjian <bruce@momjian.us> | 2011-04-10 11:42:00 -0400 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 2011-04-10 11:42:00 -0400 |
| commit | bf50caf105a901c4f83ac1df3cdaf910c26694a4 (patch) | |
| tree | dac42d7795070f107eefb085c500f86a4d35f92f /src/backend/utils/misc | |
| parent | 9a8b73147c07e02e10e0d0a34aa99d72e3336fb2 (diff) | |
| download | postgresql-bf50caf105a901c4f83ac1df3cdaf910c26694a4.tar.gz | |
pgindent run before PG 9.1 beta 1.
Diffstat (limited to 'src/backend/utils/misc')
| -rw-r--r-- | src/backend/utils/misc/guc.c | 87 | ||||
| -rw-r--r-- | src/backend/utils/misc/rbtree.c | 14 | ||||
| -rw-r--r-- | src/backend/utils/misc/tzparser.c | 2 |
3 files changed, 53 insertions, 50 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 5e4904aeb7..738e2152ba 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -146,23 +146,23 @@ extern bool optimize_bounded_sort; static int GUC_check_errcode_value; /* global variables for check hook support */ -char *GUC_check_errmsg_string; -char *GUC_check_errdetail_string; -char *GUC_check_errhint_string; +char *GUC_check_errmsg_string; +char *GUC_check_errdetail_string; +char *GUC_check_errhint_string; static void set_config_sourcefile(const char *name, char *sourcefile, int sourceline); -static bool call_bool_check_hook(struct config_bool *conf, bool *newval, - void **extra, GucSource source, int elevel); -static bool call_int_check_hook(struct config_int *conf, int *newval, - void **extra, GucSource source, int elevel); -static bool call_real_check_hook(struct config_real *conf, double *newval, - void **extra, GucSource source, int elevel); -static bool call_string_check_hook(struct config_string *conf, char **newval, - void **extra, GucSource source, int elevel); -static bool call_enum_check_hook(struct config_enum *conf, int *newval, - void **extra, GucSource source, int elevel); +static bool call_bool_check_hook(struct config_bool * conf, bool *newval, + void **extra, GucSource source, int elevel); +static bool call_int_check_hook(struct config_int * conf, int *newval, + void **extra, GucSource source, int elevel); +static bool call_real_check_hook(struct config_real * conf, double *newval, + void **extra, GucSource source, int elevel); +static bool call_string_check_hook(struct config_string * conf, char **newval, + void **extra, GucSource source, int elevel); +static bool call_enum_check_hook(struct config_enum * conf, int *newval, + void **extra, GucSource source, int elevel); static bool check_log_destination(char **newval, void **extra, GucSource source); static void assign_log_destination(const char *newval, void *extra); @@ -1571,7 +1571,7 @@ static struct config_int ConfigureNamesInt[] = GUC_UNIT_S }, &wal_receiver_status_interval, - 10, 0, INT_MAX/1000, + 10, 0, INT_MAX / 1000, NULL, NULL, NULL }, @@ -1878,7 +1878,7 @@ static struct config_int ConfigureNamesInt[] = {"max_pred_locks_per_transaction", PGC_POSTMASTER, LOCK_MANAGEMENT, gettext_noop("Sets the maximum number of predicate locks per transaction."), gettext_noop("The shared predicate lock table is sized on the assumption that " - "at most max_pred_locks_per_transaction * max_connections distinct " + "at most max_pred_locks_per_transaction * max_connections distinct " "objects will need to be locked at any one time.") }, &max_predicate_locks_per_xact, @@ -3165,9 +3165,10 @@ static struct config_enum ConfigureNamesEnum[] = " the level, the fewer messages are sent.") }, &trace_recovery_messages, + /* - * client_message_level_options allows too many values, really, - * but it's not worth having a separate options array for this. + * client_message_level_options allows too many values, really, but + * it's not worth having a separate options array for this. */ LOG, client_message_level_options, NULL, NULL, NULL @@ -5100,8 +5101,8 @@ set_config_option(const char *name, const char *value, { /* * Historically we've just silently ignored attempts to set - * PGC_INTERNAL variables from the config file. Maybe it'd - * be better to use the prohibitValueChange logic for this? + * PGC_INTERNAL variables from the config file. Maybe it'd be + * better to use the prohibitValueChange logic for this? */ return true; } @@ -5559,8 +5560,8 @@ set_config_option(const char *name, const char *value, if (value) { /* - * The value passed by the caller could be transient, - * so we always strdup it. + * The value passed by the caller could be transient, so + * we always strdup it. */ newval = guc_strdup(elevel, value); if (newval == NULL) @@ -7922,7 +7923,7 @@ validate_option_array_item(const char *name, const char *value, * ERRCODE_INVALID_PARAMETER_VALUE SQLSTATE for check hook failures. * * Note that GUC_check_errmsg() etc are just macros that result in a direct - * assignment to the associated variables. That is ugly, but forced by the + * assignment to the associated variables. That is ugly, but forced by the * limitations of C's macro mechanisms. */ void @@ -7939,7 +7940,7 @@ GUC_check_errcode(int sqlerrcode) */ static bool -call_bool_check_hook(struct config_bool *conf, bool *newval, void **extra, +call_bool_check_hook(struct config_bool * conf, bool *newval, void **extra, GucSource source, int elevel) { /* Quick success if no hook */ @@ -7973,7 +7974,7 @@ call_bool_check_hook(struct config_bool *conf, bool *newval, void **extra, } static bool -call_int_check_hook(struct config_int *conf, int *newval, void **extra, +call_int_check_hook(struct config_int * conf, int *newval, void **extra, GucSource source, int elevel) { /* Quick success if no hook */ @@ -8007,7 +8008,7 @@ call_int_check_hook(struct config_int *conf, int *newval, void **extra, } static bool -call_real_check_hook(struct config_real *conf, double *newval, void **extra, +call_real_check_hook(struct config_real * conf, double *newval, void **extra, GucSource source, int elevel) { /* Quick success if no hook */ @@ -8041,7 +8042,7 @@ call_real_check_hook(struct config_real *conf, double *newval, void **extra, } static bool -call_string_check_hook(struct config_string *conf, char **newval, void **extra, +call_string_check_hook(struct config_string * conf, char **newval, void **extra, GucSource source, int elevel) { /* Quick success if no hook */ @@ -8075,7 +8076,7 @@ call_string_check_hook(struct config_string *conf, char **newval, void **extra, } static bool -call_enum_check_hook(struct config_enum *conf, int *newval, void **extra, +call_enum_check_hook(struct config_enum * conf, int *newval, void **extra, GucSource source, int elevel) { /* Quick success if no hook */ @@ -8365,9 +8366,9 @@ static bool check_canonical_path(char **newval, void **extra, GucSource source) { /* - * Since canonicalize_path never enlarges the string, we can just - * modify newval in-place. But watch out for NULL, which is the - * default value for external_pid_file. + * Since canonicalize_path never enlarges the string, we can just modify + * newval in-place. But watch out for NULL, which is the default value + * for external_pid_file. */ if (*newval) canonicalize_path(*newval); @@ -8378,12 +8379,12 @@ static bool check_timezone_abbreviations(char **newval, void **extra, GucSource source) { /* - * The boot_val given above for timezone_abbreviations is NULL. - * When we see this we just do nothing. If this value isn't overridden - * from the config file then pg_timezone_abbrev_initialize() will - * eventually replace it with "Default". This hack has two purposes: to - * avoid wasting cycles loading values that might soon be overridden from - * the config file, and to avoid trying to read the timezone abbrev files + * The boot_val given above for timezone_abbreviations is NULL. When we + * see this we just do nothing. If this value isn't overridden from the + * config file then pg_timezone_abbrev_initialize() will eventually + * replace it with "Default". This hack has two purposes: to avoid + * wasting cycles loading values that might soon be overridden from the + * config file, and to avoid trying to read the timezone abbrev files * during InitializeGUCOptions(). The latter doesn't work in an * EXEC_BACKEND subprocess because my_exec_path hasn't been set yet and so * we can't locate PGSHAREDIR. @@ -8443,15 +8444,15 @@ static void assign_tcp_keepalives_idle(int newval, void *extra) { /* - * The kernel API provides no way to test a value without setting it; - * and once we set it we might fail to unset it. So there seems little - * point in fully implementing the check-then-assign GUC API for these + * The kernel API provides no way to test a value without setting it; and + * once we set it we might fail to unset it. So there seems little point + * in fully implementing the check-then-assign GUC API for these * variables. Instead we just do the assignment on demand. pqcomm.c * reports any problems via elog(LOG). * - * This approach means that the GUC value might have little to do with - * the actual kernel value, so we use a show_hook that retrieves the - * kernel value rather than trusting GUC's copy. + * This approach means that the GUC value might have little to do with the + * actual kernel value, so we use a show_hook that retrieves the kernel + * value rather than trusting GUC's copy. */ (void) pq_setkeepalivesidle(newval, MyProcPort); } @@ -8574,7 +8575,7 @@ check_effective_io_concurrency(int *newval, void **extra, GucSource source) /* This range check shouldn't fail, but let's be paranoid */ if (new_prefetch_pages >= 0.0 && new_prefetch_pages < (double) INT_MAX) { - int *myextra = (int *) guc_malloc(ERROR, sizeof(int)); + int *myextra = (int *) guc_malloc(ERROR, sizeof(int)); *myextra = (int) rint(new_prefetch_pages); *extra = (void *) myextra; diff --git a/src/backend/utils/misc/rbtree.c b/src/backend/utils/misc/rbtree.c index 7a8ddf0a17..f8143724d0 100644 --- a/src/backend/utils/misc/rbtree.c +++ b/src/backend/utils/misc/rbtree.c @@ -75,7 +75,7 @@ struct RBTree */ #define RBNIL (&sentinel) -static RBNode sentinel = {InitialState, RBBLACK, RBNIL, RBNIL, NULL}; +static RBNode sentinel = {InitialState, RBBLACK, RBNIL, RBNIL, NULL}; /* @@ -99,10 +99,10 @@ static RBNode sentinel = {InitialState, RBBLACK, RBNIL, RBNIL, NULL}; * * The freefunc should just be pfree or equivalent; it should NOT attempt * to free any subsidiary data, because the node passed to it may not contain - * valid data! freefunc can be NULL if caller doesn't require retail + * valid data! freefunc can be NULL if caller doesn't require retail * space reclamation. * - * The RBTree node is palloc'd in the caller's memory context. Note that + * The RBTree node is palloc'd in the caller's memory context. Note that * all contents of the tree are actually allocated by the caller, not here. * * Since tree contents are managed by the caller, there is currently not @@ -130,6 +130,7 @@ rb_create(Size node_size, tree->combiner = combiner; tree->allocfunc = allocfunc; tree->freefunc = freefunc; + tree->arg = arg; return tree; @@ -161,7 +162,7 @@ rb_find(RBTree *rb, const RBNode *data) while (node != RBNIL) { - int cmp = rb->comparator(data, node, rb->arg); + int cmp = rb->comparator(data, node, rb->arg); if (cmp == 0) return node; @@ -434,10 +435,11 @@ rb_insert(RBTree *rb, const RBNode *data, bool *isNew) */ *isNew = true; - x = rb->allocfunc(rb->arg); + x = rb->allocfunc (rb->arg); x->iteratorState = InitialState; x->color = RBRED; + x->left = RBNIL; x->right = RBNIL; x->parent = parent; @@ -629,7 +631,7 @@ rb_delete_node(RBTree *rb, RBNode *z) /* Now we can recycle the y node */ if (rb->freefunc) - rb->freefunc(y, rb->arg); + rb->freefunc (y, rb->arg); } /* diff --git a/src/backend/utils/misc/tzparser.c b/src/backend/utils/misc/tzparser.c index b2f6dd3a2b..b52942db72 100644 --- a/src/backend/utils/misc/tzparser.c +++ b/src/backend/utils/misc/tzparser.c @@ -4,7 +4,7 @@ * Functions for parsing timezone offset files * * Note: this code is invoked from the check_hook for the GUC variable - * timezone_abbreviations. Therefore, it should report problems using + * timezone_abbreviations. Therefore, it should report problems using * GUC_check_errmsg() and related functions, and try to avoid throwing * elog(ERROR). This is not completely bulletproof at present --- in * particular out-of-memory will throw an error. Could probably fix with |
