summaryrefslogtreecommitdiffstats
path: root/misc-utils
diff options
context:
space:
mode:
authorSami Kerola2013-04-27 23:09:24 +0200
committerSami Kerola2013-05-26 10:59:18 +0200
commit4aefe5e88e4f986082e2c8e7fe208853204fec32 (patch)
tree30b0964845c04bb54d03d52e0f78c56ff0b8ce8d /misc-utils
parentagetty: allow full control on CLOCAL flag (diff)
downloadkernel-qcow2-util-linux-4aefe5e88e4f986082e2c8e7fe208853204fec32.tar.gz
kernel-qcow2-util-linux-4aefe5e88e4f986082e2c8e7fe208853204fec32.tar.xz
kernel-qcow2-util-linux-4aefe5e88e4f986082e2c8e7fe208853204fec32.zip
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.c81
1 files changed, 39 insertions, 42 deletions
diff --git a/misc-utils/cal.c b/misc-utils/cal.c
index 276148db6..13830deec 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="";