Module Name:    src
Committed By:   joerg
Date:           Sun Mar 25 06:54:04 UTC 2012

Modified Files:
        src/tests/include: t_bitstring.c

Log Message:
Use array access


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/include/t_bitstring.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/include/t_bitstring.c
diff -u src/tests/include/t_bitstring.c:1.3 src/tests/include/t_bitstring.c:1.4
--- src/tests/include/t_bitstring.c:1.3	Sun Nov  7 17:51:19 2010
+++ src/tests/include/t_bitstring.c	Sun Mar 25 06:54:04 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: t_bitstring.c,v 1.3 2010/11/07 17:51:19 jmmv Exp $ */
+/* $NetBSD: t_bitstring.c,v 1.4 2012/03/25 06:54:04 joerg Exp $ */
 
 /*-
  * Copyright (c) 1993, 2008, 2010 The NetBSD Foundation, Inc.
@@ -92,7 +92,7 @@ calculate_data(FILE *file, const int tes
 		bit_set(bs, i);
 	(void) fprintf(file, "be:   1   0 ");
 	for (i=0; i < test_length; i++)
-		(void) fprintf(file, "%c", *("100" + (i % 3)));
+		(void) fprintf(file, "%c", "100"[i % 3]);
 	(void) fprintf(file, "\nis: ");
 	printbits(file, bs, test_length);
 
@@ -101,7 +101,7 @@ calculate_data(FILE *file, const int tes
 		bit_clear(bs, i);
 	(void) fprintf(file, "be:   0   3 ");
 	for (i=0; i < test_length; i++)
-		(void) fprintf(file, "%c", *("000100" + (i % 6)));
+		(void) fprintf(file, "%c", "000100"[i % 6]);
 	(void) fprintf(file, "\nis: ");
 	printbits(file, bs, test_length);
 

Reply via email to