]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
cal: fix preprocessor directive indendation
authorSami Kerola <kerolasa@iki.fi>
Sat, 27 Apr 2013 21:09:24 +0000 (22:09 +0100)
committerSami Kerola <kerolasa@iki.fi>
Sun, 26 May 2013 08:59:18 +0000 (09:59 +0100)
And code within the blocks selected by preprocessor to be live code.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
misc-utils/cal.c

index 276148db6317e5eb78d452a620bab9e4d2b2c42d..13830deecbcc1034e9f29570368792f4f2085630 100644 (file)
 #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="";