Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern TNF & remove trailing spaces.
details: https://anonhg.NetBSD.org/src/rev/fe7dcb4e79ae
branches: trunk
changeset: 550802:fe7dcb4e79ae
user: junyoung <junyoung%NetBSD.org@localhost>
date: Fri Aug 22 02:01:32 2003 +0000
description:
TNF & remove trailing spaces.
diffstat:
sys/kern/cnmagic.c | 29 ++++++++++++++++-------------
1 files changed, 16 insertions(+), 13 deletions(-)
diffs (93 lines):
diff -r 87c7236cf4c7 -r fe7dcb4e79ae sys/kern/cnmagic.c
--- a/sys/kern/cnmagic.c Fri Aug 22 00:46:25 2003 +0000
+++ b/sys/kern/cnmagic.c Fri Aug 22 02:01:32 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cnmagic.c,v 1.4 2001/11/27 20:00:36 bouyer Exp $ */
+/* $NetBSD: cnmagic.c,v 1.5 2003/08/22 02:01:32 junyoung Exp $ */
/*
* Copyright (c) 2000 Eduardo Horvath
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cnmagic.c,v 1.4 2001/11/27 20:00:36 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cnmagic.c,v 1.5 2003/08/22 02:01:32 junyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -45,7 +45,8 @@
* Initialize a cnm_state_t.
*/
void
-cn_init_magic(cnm_state_t *cnm) {
+cn_init_magic(cnm_state_t *cnm)
+{
cnm->cnm_state = 0;
cnm->cnm_magic = cn_magic;
}
@@ -54,7 +55,8 @@
* Destroy a cnm_state_t.
*/
void
-cn_destroy_magic(cnm_state_t *cnm) {
+cn_destroy_magic(cnm_state_t *cnm)
+{
cnm->cnm_state = 0;
cnm->cnm_magic = NULL;
}
@@ -69,8 +71,8 @@
unsigned int i, c, n;
unsigned short m[CNS_LEN];
- for (i=0; i<CNS_LEN; i++) {
- c = (*magic++)&0xff;
+ for (i = 0; i < CNS_LEN; i++) {
+ c = (*magic++) & 0xff;
n = *magic ? i+1 : CNS_TERM;
switch (c) {
case 0:
@@ -89,7 +91,7 @@
return(0);
case 0x27:
/* Escape sequence */
- c = (*magic++)&0xff;
+ c = (*magic++) & 0xff;
n = *magic ? i+1 : CNS_TERM;
switch (c) {
case 0x27:
@@ -113,7 +115,7 @@
m[i] = ENCODE_STATE(c, n);
break;
}
- }
+ }
return (EINVAL);
}
@@ -121,11 +123,12 @@
* Translatea state machine table back to
* a magic string.
*/
-int
-cn_get_magic(char *magic, int maglen) {
+int
+cn_get_magic(char *magic, int maglen)
+{
unsigned int i, c;
-
- for (i=0; i<CNS_LEN;) {
+
+ for (i = 0; i < CNS_LEN;) {
c = cn_magic[i];
/* Translate a character */
switch (CNS_MAGIC_VAL(c)) {
@@ -142,7 +145,7 @@
*magic++ = 0x27;
break;
default:
- *magic++ = (c&0x0ff);
+ *magic++ = (c & 0x0ff);
break;
}
/* Now go to the next state */
Home |
Main Index |
Thread Index |
Old Index