diff options
author | Sami Kerola <kerolasa@iki.fi> | 2013-04-27 22:09:24 +0100 |
---|---|---|
committer | Sami Kerola <kerolasa@iki.fi> | 2013-05-26 09:59:18 +0100 |
commit | 4aefe5e88e4f986082e2c8e7fe208853204fec32 (patch) | |
tree | 30b0964845c04bb54d03d52e0f78c56ff0b8ce8d /misc-utils | |
parent | ef264c830effc91add6da334204215f61eb8515e (diff) | |
download | util-linux-4aefe5e88e4f986082e2c8e7fe208853204fec32.tar.gz |
cal: fix preprocessor directive indendation
And code within the blocks selected by preprocessor to be live code.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'misc-utils')
-rw-r--r-- | misc-utils/cal.c | 81 |
1 files changed, 39 insertions, 42 deletions
diff --git a/misc-utils/cal.c b/misc-utils/cal.c index 276148db..13830dee 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 <ncurses.h> -#elif defined(HAVE_NCURSES_NCURSES_H) -#include <ncurses/ncurses.h> -#endif - -#include <term.h> /* include after <curses.h> */ - -static void -my_setupterm(const char *term, int fildes, int *errret) { - setupterm((char*)term, fildes, errret); +# ifdef HAVE_NCURSES_H +# include <ncurses.h> +# elif defined(HAVE_NCURSES_NCURSES_H) +# include <ncurses/ncurses.h> +# endif +# include <term.h> + +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 <termcap.h> +# include <termcap.h> 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=""; |