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.

Fixes calibration on my Wetab device.
This commit is contained in:
khorben 2014-03-14 05:03:19 +00:00
parent 54d90457f6
commit 4a9c7f6c2b
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mra.c,v 1.5 2013/09/14 21:06:50 martin Exp $ */
/* $NetBSD: mra.c,v 1.6 2014/03/14 05:03:19 khorben 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.5 2013/09/14 21:06:50 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: mra.c,v 1.6 2014/03/14 05:03:19 khorben Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -55,7 +55,7 @@ mra_Y_AX1_BX2_C(const int *y, int ys,
// int64_t SYY;
int64_t 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)