aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/builtins.h
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2020-06-13 12:32:00 +1200
committerDavid Rowley <drowley@postgresql.org>2020-06-13 12:32:00 +1200
commitdad75eb4a8d5835ecc795d7a7978e7702e4d5912 (patch)
tree8d0f2778f3c6f60e1343b585818d408d18881f14 /src/include/utils/builtins.h
parent9a7fccd9eac85726ced3f3794a743eeab447f334 (diff)
downloadpostgresql-dad75eb4a8d5835ecc795d7a7978e7702e4d5912.tar.gz
postgresql-dad75eb4a8d5835ecc795d7a7978e7702e4d5912.zip
Have pg_itoa, pg_ltoa and pg_lltoa return the length of the string
Core by no means makes excessive use of these functions, but quite a large number of those usages do require the caller to call strlen() on the returned string. This is quite wasteful since these functions do already have a good idea of the length of the string, so we might as well just have them return that. Reviewed-by: Andrew Gierth Discussion: https://postgr.es/m/CAApHDvrm2A5x2uHYxsqriO2cUaGcFvND%2BksC9e7Tjep0t2RK_A%40mail.gmail.com
Diffstat (limited to 'src/include/utils/builtins.h')
-rw-r--r--src/include/utils/builtins.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h
index a5c8772e95f..f8595642da9 100644
--- a/src/include/utils/builtins.h
+++ b/src/include/utils/builtins.h
@@ -47,11 +47,11 @@ extern int namestrcmp(Name name, const char *str);
extern int32 pg_atoi(const char *s, int size, int c);
extern int16 pg_strtoint16(const char *s);
extern int32 pg_strtoint32(const char *s);
-extern void pg_itoa(int16 i, char *a);
+extern int pg_itoa(int16 i, char *a);
extern int pg_ultoa_n(uint32 l, char *a);
extern int pg_ulltoa_n(uint64 l, char *a);
-extern void pg_ltoa(int32 l, char *a);
-extern void pg_lltoa(int64 ll, char *a);
+extern int pg_ltoa(int32 l, char *a);
+extern int pg_lltoa(int64 ll, char *a);
extern char *pg_ultostr_zeropad(char *str, uint32 value, int32 minwidth);
extern char *pg_ultostr(char *str, uint32 value);
extern uint64 pg_strtouint64(const char *str, char **endptr, int base);