diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/d2s.c | 10 | ||||
-rw-r--r-- | src/common/f2s.c | 12 | ||||
-rw-r--r-- | src/common/file_utils.c | 2 | ||||
-rw-r--r-- | src/common/logging.c | 18 | ||||
-rw-r--r-- | src/common/pg_lzcompress.c | 11 | ||||
-rw-r--r-- | src/common/rmtree.c | 6 |
6 files changed, 29 insertions, 30 deletions
diff --git a/src/common/d2s.c b/src/common/d2s.c index 1e4782c10a4..8f4bc2a63c7 100644 --- a/src/common/d2s.c +++ b/src/common/d2s.c @@ -671,9 +671,9 @@ to_chars_df(const floating_decimal_64 v, const uint32 olength, char *const resul else { /* - * We can save some code later by pre-filling with zeros. We know - * that there can be no more than 16 output digits in this form, - * otherwise we would not choose fixed-point output. + * We can save some code later by pre-filling with zeros. We know that + * there can be no more than 16 output digits in this form, otherwise + * we would not choose fixed-point output. */ Assert(exp < 16 && exp + olength <= 16); memset(result, '0', 16); @@ -800,8 +800,8 @@ to_chars(floating_decimal_64 v, const bool sign, char *const result) /* * The thresholds for fixed-point output are chosen to match printf - * defaults. Beware that both the code of to_chars_df and the value - * of DOUBLE_SHORTEST_DECIMAL_LEN are sensitive to these thresholds. + * defaults. Beware that both the code of to_chars_df and the value of + * DOUBLE_SHORTEST_DECIMAL_LEN are sensitive to these thresholds. */ if (exp >= -4 && exp < 15) return to_chars_df(v, olength, result + index) + sign; diff --git a/src/common/f2s.c b/src/common/f2s.c index ff22b56c926..e3325573b28 100644 --- a/src/common/f2s.c +++ b/src/common/f2s.c @@ -481,10 +481,10 @@ to_chars_f(const floating_decimal_32 v, const uint32 olength, char *const result else { /* - * We can save some code later by pre-filling with zeros. We know - * that there can be no more than 6 output digits in this form, - * otherwise we would not choose fixed-point output. memset 8 - * rather than 6 bytes to let the compiler optimize it. + * We can save some code later by pre-filling with zeros. We know that + * there can be no more than 6 output digits in this form, otherwise + * we would not choose fixed-point output. memset 8 rather than 6 + * bytes to let the compiler optimize it. */ Assert(exp < 6 && exp + olength <= 6); memset(result, '0', 8); @@ -575,8 +575,8 @@ to_chars(const floating_decimal_32 v, const bool sign, char *const result) /* * The thresholds for fixed-point output are chosen to match printf - * defaults. Beware that both the code of to_chars_f and the value - * of FLOAT_SHORTEST_DECIMAL_LEN are sensitive to these thresholds. + * defaults. Beware that both the code of to_chars_f and the value of + * FLOAT_SHORTEST_DECIMAL_LEN are sensitive to these thresholds. */ if (exp >= -4 && exp < 6) return to_chars_f(v, olength, result + index) + sign; diff --git a/src/common/file_utils.c b/src/common/file_utils.c index eaec568819e..3d7a637212b 100644 --- a/src/common/file_utils.c +++ b/src/common/file_utils.c @@ -36,7 +36,7 @@ #define MINIMUM_VERSION_FOR_PG_WAL 100000 #ifdef PG_FLUSH_DATA_WORKS -static int pre_sync_fname(const char *fname, bool isdir); +static int pre_sync_fname(const char *fname, bool isdir); #endif static void walkdir(const char *path, int (*action) (const char *fname, bool isdir), diff --git a/src/common/logging.c b/src/common/logging.c index 59f60445c72..f247554a32b 100644 --- a/src/common/logging.c +++ b/src/common/logging.c @@ -16,10 +16,10 @@ enum pg_log_level __pg_log_level; static const char *progname; -static int log_flags; +static int log_flags; -static void (*log_pre_callback)(void); -static void (*log_locus_callback)(const char **, uint64 *); +static void (*log_pre_callback) (void); +static void (*log_locus_callback) (const char **, uint64 *); static const char *sgr_error = NULL; static const char *sgr_warning = NULL; @@ -60,13 +60,13 @@ pg_logging_init(const char *argv0) if (pg_colors_env) { - char *colors = strdup(pg_colors_env); + char *colors = strdup(pg_colors_env); if (colors) { for (char *token = strtok(colors, ":"); token; token = strtok(NULL, ":")) { - char *e = strchr(token, '='); + char *e = strchr(token, '='); if (e) { @@ -111,19 +111,19 @@ pg_logging_set_level(enum pg_log_level new_level) } void -pg_logging_set_pre_callback(void (*cb)(void)) +pg_logging_set_pre_callback(void (*cb) (void)) { log_pre_callback = cb; } void -pg_logging_set_locus_callback(void (*cb)(const char **filename, uint64 *lineno)) +pg_logging_set_locus_callback(void (*cb) (const char **filename, uint64 *lineno)) { log_locus_callback = cb; } void -pg_log_generic(enum pg_log_level level, const char * pg_restrict fmt, ...) +pg_log_generic(enum pg_log_level level, const char *pg_restrict fmt,...) { va_list ap; @@ -133,7 +133,7 @@ pg_log_generic(enum pg_log_level level, const char * pg_restrict fmt, ...) } void -pg_log_generic_v(enum pg_log_level level, const char * pg_restrict fmt, va_list ap) +pg_log_generic_v(enum pg_log_level level, const char *pg_restrict fmt, va_list ap) { int save_errno = errno; const char *filename = NULL; diff --git a/src/common/pg_lzcompress.c b/src/common/pg_lzcompress.c index 97b0e40e403..988b3987d04 100644 --- a/src/common/pg_lzcompress.c +++ b/src/common/pg_lzcompress.c @@ -687,7 +687,7 @@ pglz_compress(const char *source, int32 slen, char *dest, */ int32 pglz_decompress(const char *source, int32 slen, char *dest, - int32 rawsize, bool check_complete) + int32 rawsize, bool check_complete) { const unsigned char *sp; const unsigned char *srcend; @@ -759,10 +759,9 @@ pglz_decompress(const char *source, int32 slen, char *dest, } /* - * Check we decompressed the right amount. - * If we are slicing, then we won't necessarily - * be at the end of the source or dest buffers - * when we hit a stop, so we don't test them. + * Check we decompressed the right amount. If we are slicing, then we + * won't necessarily be at the end of the source or dest buffers when we + * hit a stop, so we don't test them. */ if (check_complete && (dp != destend || sp != srcend)) return -1; @@ -770,5 +769,5 @@ pglz_decompress(const char *source, int32 slen, char *dest, /* * That's it. */ - return (char*)dp - dest; + return (char *) dp - dest; } diff --git a/src/common/rmtree.c b/src/common/rmtree.c index 2c3c4dd2d44..3c207917b5b 100644 --- a/src/common/rmtree.c +++ b/src/common/rmtree.c @@ -77,7 +77,7 @@ rmtree(const char *path, bool rmtopdir) if (errno != ENOENT) { pg_log_warning("could not stat file or directory \"%s\": %m", - pathbuf); + pathbuf); result = false; } continue; @@ -99,7 +99,7 @@ rmtree(const char *path, bool rmtopdir) if (errno != ENOENT) { pg_log_warning("could not remove file or directory \"%s\": %m", - pathbuf); + pathbuf); result = false; } } @@ -111,7 +111,7 @@ rmtree(const char *path, bool rmtopdir) if (rmdir(path) != 0) { pg_log_warning("could not remove file or directory \"%s\": %m", - path); + path); result = false; } } |