[Midnightbsd-cvs] src: batt.c: style(9) fixes
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sat Dec 6 10:03:29 EST 2008
Log Message:
-----------
style(9) fixes
Modified Files:
--------------
src/usr.bin/batt:
batt.c (r1.1 -> r1.2)
-------------- next part --------------
Index: batt.c
===================================================================
RCS file: /home/cvs/src/usr.bin/batt/batt.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -L usr.bin/batt/batt.c -L usr.bin/batt/batt.c -u -r1.1 -r1.2
--- usr.bin/batt/batt.c
+++ usr.bin/batt/batt.c
@@ -1,29 +1,29 @@
/* $MidnightBSD$ */
/*-
- Copyright (c) 2008 Lucas Holt
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-*/
+ * Copyright (c) 2008 Lucas Holt
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
#include <sys/types.h>
#include <sys/sysctl.h>
@@ -31,6 +31,8 @@
#include <stdio.h>
#include <unistd.h>
+static void usage();
+
int
main(int argc, char *argv[]) {
int life, time, units;
@@ -49,10 +51,10 @@
case 'u':
uflag = 1;
break;
- case '?': /* FALLS THROUGH */
+ case '?': /* FALLTHROUGH */
default:
- fprintf(stderr, "usage: %s [-ltf]\n", argv[0]);
- exit(1);
+ usage();
+ /* NOTREACHED */
}
}
argc -= optind;
@@ -93,3 +95,9 @@
return 0;
}
+
+static void
+usage() {
+ fprintf(stderr, "usage: batt [-ltf]\n");
+ exit(1);
+}
More information about the Midnightbsd-cvs
mailing list