diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-07-12 00:44:38 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-07-12 00:44:38 +0000 |
commit | 960af47efdc1670ef90bb1f19e03cd9469bb636b (patch) | |
tree | a02fe1f1f67bfcf083117315823fec104ab80b6a /src/backend/utils/adt/oracle_compat.c | |
parent | 27cb66fdfe862f395cefa0d498b681ce142f59d8 (diff) | |
download | postgresql-960af47efdc1670ef90bb1f19e03cd9469bb636b.tar.gz postgresql-960af47efdc1670ef90bb1f19e03cd9469bb636b.zip |
Const-ify the arguments of str_tolower() and friends to suppress compile
warnings. Clean up various unneeded cruft that was left behind after
creating those routines. Introduce some convenience functions str_tolower_z
etc to eliminate tedious and error-prone double arguments in formatting.c.
(Currently there seems no need to export the latter, but maybe reconsider
this later.)
Diffstat (limited to 'src/backend/utils/adt/oracle_compat.c')
-rw-r--r-- | src/backend/utils/adt/oracle_compat.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/src/backend/utils/adt/oracle_compat.c b/src/backend/utils/adt/oracle_compat.c index bf29e7d1651..1e89272386c 100644 --- a/src/backend/utils/adt/oracle_compat.c +++ b/src/backend/utils/adt/oracle_compat.c @@ -9,28 +9,14 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/oracle_compat.c,v 1.81 2008/06/23 19:27:19 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/oracle_compat.c,v 1.82 2008/07/12 00:44:37 tgl Exp $ * *------------------------------------------------------------------------- */ #include "postgres.h" -#include <ctype.h> -#include <limits.h> -/* - * towlower() and friends should be in <wctype.h>, but some pre-C99 systems - * declare them in <wchar.h>. - */ -#ifdef HAVE_WCHAR_H -#include <wchar.h> -#endif -#ifdef HAVE_WCTYPE_H -#include <wctype.h> -#endif - #include "utils/builtins.h" #include "utils/formatting.h" -#include "utils/pg_locale.h" #include "mb/pg_wchar.h" @@ -60,7 +46,8 @@ lower(PG_FUNCTION_ARGS) char *out_string; text *result; - out_string = str_tolower(VARDATA_ANY(in_string), VARSIZE_ANY_EXHDR(in_string)); + out_string = str_tolower(VARDATA_ANY(in_string), + VARSIZE_ANY_EXHDR(in_string)); result = cstring_to_text(out_string); pfree(out_string); @@ -89,7 +76,8 @@ upper(PG_FUNCTION_ARGS) char *out_string; text *result; - out_string = str_toupper(VARDATA_ANY(in_string), VARSIZE_ANY_EXHDR(in_string)); + out_string = str_toupper(VARDATA_ANY(in_string), + VARSIZE_ANY_EXHDR(in_string)); result = cstring_to_text(out_string); pfree(out_string); @@ -121,7 +109,8 @@ initcap(PG_FUNCTION_ARGS) char *out_string; text *result; - out_string = str_initcap(VARDATA_ANY(in_string), VARSIZE_ANY_EXHDR(in_string)); + out_string = str_initcap(VARDATA_ANY(in_string), + VARSIZE_ANY_EXHDR(in_string)); result = cstring_to_text(out_string); pfree(out_string); |