Module Name:    src
Committed By:   msaitoh
Date:           Wed Apr 16 08:10:25 UTC 2014

Modified Files:
        src/sys/dev/wscons [netbsd-5]: mra.c

Log Message:
Pull up following revision(s) (requested by khorben in ticket #1900):
        sys/dev/wscons/mra.c            rev. 1.6

Fixed wrong cast and invalid array access in the calibration framework,
as documented in PR kern/45872. The AA() macro accessed sample
coordinates as long integers, whereas they are really stored as signed
integers.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.64.1 src/sys/dev/wscons/mra.c

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

Modified files:

Index: src/sys/dev/wscons/mra.c
diff -u src/sys/dev/wscons/mra.c:1.4 src/sys/dev/wscons/mra.c:1.4.64.1
--- src/sys/dev/wscons/mra.c:1.4	Mon Oct  9 10:43:01 2006
+++ src/sys/dev/wscons/mra.c	Wed Apr 16 08:10:25 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: mra.c,v 1.4 2006/10/09 10:43:01 peter Exp $	*/
+/*	$NetBSD: mra.c,v 1.4.64.1 2014/04/16 08:10:25 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1999 Shin Takemura All rights reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mra.c,v 1.4 2006/10/09 10:43:01 peter Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mra.c,v 1.4.64.1 2014/04/16 08:10:25 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -54,7 +54,7 @@ mra_Y_AX1_BX2_C(const int *y, int ys,
 	int64_t S11, S22, S12;
 	int64_t SYY, S1Y, S2Y;
 	int64_t A, B, C, M;
-#define AA(p, s, i)	(*((const long *)(((const char *)(p)) + (s) * (i))))
+#define AA(p, s, i)	(*((const int *)(((const char *)(p)) + (s) * (i))))
 #define X1(i)		AA(x1, x1s, i)
 #define X2(i)		AA(x2, x2s, i)
 #define Y(i)		AA(y, ys, i)

Reply via email to