Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/amiga/dev Ansification by Petri Koistinen



details:   https://anonhg.NetBSD.org/src/rev/07d135d376ad
branches:  trunk
changeset: 513921:07d135d376ad
user:      is <is%NetBSD.org@localhost>
date:      Fri Aug 17 19:56:51 2001 +0000

description:
Ansification by Petri Koistinen

diffstat:

 sys/arch/amiga/dev/genpar.c |  17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diffs (41 lines):

diff -r ff7b0eb7df0d -r 07d135d376ad sys/arch/amiga/dev/genpar.c
--- a/sys/arch/amiga/dev/genpar.c       Fri Aug 17 17:11:51 2001 +0000
+++ b/sys/arch/amiga/dev/genpar.c       Fri Aug 17 19:56:51 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: genpar.c,v 1.6 1995/02/16 21:57:31 chopps Exp $        */
+/* $NetBSD: genpar.c,v 1.7 2001/08/17 19:56:51 is Exp $ */
 
 /*
  * Copyright (c) 1993 Markus Wild
@@ -30,20 +30,27 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#define bset(i,b) ((i & (1<<b))?1:0)
+#include <stdio.h>
+
+int main(void);
 
-main()
+#define BSET(i,b) ((i & (1 << b)) ? 1 : 0)
+
+int
+main(void)
 {
        int i;
        unsigned char par;
   
        printf("u_char even_parity[] = {\n\t");
        for (i = 0; i < 0x80; i++) {
-               par = bset(i,0) + bset(i,1) + bset(i,2) + bset(i,3)
-                   + bset(i,4) + bset(i,5) + bset(i,6) + bset(i,7);
+               par = BSET(i,0) + BSET(i,1) + BSET(i,2) + BSET(i,3) +
+                   BSET(i,4) + BSET(i,5) + BSET(i,6) + BSET(i,7);
                printf("%2d, ", par & 1);
                if ((i & 15) == 15)
                        printf("\n\t");
        }
        printf("};\n");
+       exit(0);
+       /* NOTREACHED */
 }



Home | Main Index | Thread Index | Old Index