From 960af47efdc1670ef90bb1f19e03cd9469bb636b Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 12 Jul 2008 00:44:38 +0000 Subject: 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.) --- src/backend/utils/adt/oracle_compat.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'src/backend/utils/adt/oracle_compat.c') 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 -#include -/* - * towlower() and friends should be in , but some pre-C99 systems - * declare them in . - */ -#ifdef HAVE_WCHAR_H -#include -#endif -#ifdef HAVE_WCTYPE_H -#include -#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); -- cgit v1.2.3