From 9d85c66e5fdde55e45edd057312dbeeca8f58d34 Mon Sep 17 00:00:00 2001 From: oetiker Date: Tue, 27 Oct 2009 16:18:43 +0000 Subject: [PATCH] remove HAVE_LOCALE_H and HAVE_TIME_H and HAVE_SETLOCALE since they have not been used consistantly anyway git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1953 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/configure.ac | 4 ++-- program/src/rrd_dump.c | 7 +------ program/src/rrd_graph.c | 4 ---- program/src/rrd_restore.c | 4 ---- program/src/rrd_tool.c | 6 ++---- 5 files changed, 5 insertions(+), 20 deletions(-) diff --git a/program/configure.ac b/program/configure.ac index c5fe57d4..f21892fb 100644 --- a/program/configure.ac +++ b/program/configure.ac @@ -182,7 +182,7 @@ CONFIGURE_PART(Checking for Header Files) dnl Checks for header files. AC_HEADER_STDC AC_HEADER_DIRENT -AC_CHECK_HEADERS(stdint.h inttypes.h libgen.h features.h sys/stat.h sys/types.h fcntl.h locale.h fp_class.h malloc.h unistd.h ieeefp.h math.h time.h sys/times.h sys/param.h sys/resource.h signal.h float.h stdio.h stdlib.h errno.h string.h ctype.h) +AC_CHECK_HEADERS(stdint.h inttypes.h libgen.h features.h sys/stat.h sys/types.h fcntl.h fp_class.h malloc.h unistd.h ieeefp.h math.h sys/times.h sys/param.h sys/resource.h signal.h float.h stdio.h stdlib.h errno.h string.h ctype.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST @@ -209,7 +209,7 @@ AC_C_BIGENDIAN dnl for each function found we get a definition in config.h dnl of the form HAVE_FUNCTION -AC_CHECK_FUNCS(tzset fsync mbstowcs opendir readdir chdir chroot getuid setlocale strerror snprintf vsnprintf vasprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday) +AC_CHECK_FUNCS(tzset fsync mbstowcs opendir readdir chdir chroot getuid strerror snprintf vsnprintf vasprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday) AC_FUNC_STRERROR_R diff --git a/program/src/rrd_dump.c b/program/src/rrd_dump.c index 57bd0b8d..3b7867f4 100644 --- a/program/src/rrd_dump.c +++ b/program/src/rrd_dump.c @@ -45,9 +45,7 @@ #include "rrd_rpncalc.h" #include "rrd_client.h" -#ifdef HAVE_LOCALE_H #include -#endif #if !(defined(NETWARE) || defined(WIN32)) extern char *tzname[2]; @@ -105,9 +103,8 @@ int rrd_dump_cb_r( return (-1); } -#ifdef HAVE_SETLOCALE old_locale = setlocale(LC_NUMERIC, "C"); -#endif + if (opt_header == 1) { CB_PUTS("\n"); @@ -451,9 +448,7 @@ int rrd_dump_cb_r( rrd_free(&rrd); -#ifdef HAVE_SETLOCALE setlocale(LC_NUMERIC, old_locale); -#endif return rrd_close(rrd_file); diff --git a/program/src/rrd_graph.c b/program/src/rrd_graph.c index b1cb663c..d3aa6269 100644 --- a/program/src/rrd_graph.c +++ b/program/src/rrd_graph.c @@ -25,13 +25,9 @@ #include #endif -#ifdef HAVE_TIME_H #include -#endif -#ifdef HAVE_LOCALE_H #include -#endif #include "rrd_graph.h" #include "rrd_client.h" diff --git a/program/src/rrd_restore.c b/program/src/rrd_restore.c index fc6f17be..d75247dc 100644 --- a/program/src/rrd_restore.c +++ b/program/src/rrd_restore.c @@ -1256,15 +1256,11 @@ int rrd_restore( return (-1); } -#ifdef HAVE_SETLOCALE old_locale = setlocale(LC_NUMERIC, "C"); -#endif rrd = parse_file(argv[optind]); -#ifdef HAVE_SETLOCALE setlocale(LC_NUMERIC, old_locale); -#endif if (rrd == NULL) return (-1); diff --git a/program/src/rrd_tool.c b/program/src/rrd_tool.c index 7464b3cd..302669d6 100644 --- a/program/src/rrd_tool.c +++ b/program/src/rrd_tool.c @@ -18,9 +18,8 @@ #include "rrd_xport.h" #include "rrd_i18n.h" -#ifdef HAVE_LOCALE_H #include -#endif + void PrintUsage( char *cmd); @@ -408,11 +407,10 @@ int main( #ifdef MUST_DISABLE_FPMASK fpsetmask(0); #endif -#ifdef HAVE_LOCALE_H + /* initialize locale settings according to localeconv(3) */ setlocale(LC_ALL, ""); -#endif #if defined(HAVE_LIBINTL_H) && defined(BUILD_LIBINTL) bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR); -- 2.30.2