From: Sami Kerola Date: Sat, 27 Apr 2013 21:09:24 +0000 (+0100) Subject: cal: fix preprocessor directive indendation X-Git-Tag: v2.24-rc1~535^2~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4aefe5e88e4f986082e2c8e7fe208853204fec32;p=thirdparty%2Futil-linux.git cal: fix preprocessor directive indendation And code within the blocks selected by preprocessor to be live code. Signed-off-by: Sami Kerola --- diff --git a/misc-utils/cal.c b/misc-utils/cal.c index 276148db63..13830deecb 100644 --- a/misc-utils/cal.c +++ b/misc-utils/cal.c @@ -73,69 +73,66 @@ #include "strutils.h" #if defined(HAVE_LIBNCURSES) || defined(HAVE_LIBNCURSESW) - -#ifdef HAVE_NCURSES_H -#include -#elif defined(HAVE_NCURSES_NCURSES_H) -#include -#endif - -#include /* include after */ - -static void -my_setupterm(const char *term, int fildes, int *errret) { - setupterm((char*)term, fildes, errret); +# ifdef HAVE_NCURSES_H +# include +# elif defined(HAVE_NCURSES_NCURSES_H) +# include +# endif +# include + +static void my_setupterm(const char *term, int fildes, int *errret) +{ + setupterm((char *)term, fildes, errret); } -static void -my_putstring(char *s) { - putp(s); +static void my_putstring(char *s) +{ + putp(s); } -static const char * -my_tgetstr(char *s __attribute__ ((__unused__)), char *ss) { - const char* ret = tigetstr(ss); - if (!ret || ret==(char*)-1) - return ""; - else - return ret; +static const char *my_tgetstr(char *s __attribute__((__unused__)), char *ss) +{ + const char *ret = tigetstr(ss); + if (!ret || ret == (char *)-1) + return ""; + else + return ret; } #elif defined(HAVE_LIBTERMCAP) - -#include +# include char termbuffer[4096]; char tcbuffer[4096]; char *strbuf = termbuffer; -static void -my_setupterm(const char *term, int fildes, int *errret) { - *errret = tgetent(tcbuffer, term); +static void my_setupterm(const char *term, int fildes, int *errret) +{ + *errret = tgetent(tcbuffer, term); } -static void -my_putstring(char *s) { - tputs (s, 1, putchar); +static void my_putstring(char *s) +{ + tputs(s, 1, putchar); } -static const char * -my_tgetstr(char *s, char *ss __attribute__ ((__unused__))) { - const char* ret = tgetstr(s, &strbuf); - if (!ret) - return ""; - else - return ret; +static const char *my_tgetstr(char *s, char *ss __attribute__((__unused__))) +{ + const char *ret = tgetstr(s, &strbuf); + if (!ret) + return ""; + else + return ret; } -#else /* ! (HAVE_LIBTERMCAP || HAVE_LIBNCURSES || HAVE_LIBNCURSESW) */ +#else /* ! (HAVE_LIBTERMCAP || HAVE_LIBNCURSES || HAVE_LIBNCURSESW) */ -static void -my_putstring(char *s) { - fputs(s, stdout); +static void my_putstring(char *s) +{ + fputs(s, stdout); } -#endif +#endif /* end of LIBTERMCAP / NCURSES */ const char *term="";