On Wed, Mar 9, 2011 at 1:22 PM, Ping Cheng <pingli...@gmail.com> wrote: > Looks like there are more work related to this RawSample bit. > XWACOM_MAX_SAMPLES is defined in Xwacom.h under include. But a MAX_SAMPLES > with the same value (20) is also defined in xf86WacomDefs.h under src. > > Since we are on this page, can we move "#include "Xwacom.h" from xf86Wacom.h > to xf86WacomDefs.h and get rid of the MAX_SAMPLES?
Oh wow. I totally overlooked that. I'm not really sure of Xwacom.h purpose to know which place should it be defined... but offhand it seems like removing it from Xwacom.h may be better idea. Chris > > Ping > > On Wed, Mar 9, 2011 at 9:52 AM, Jason Gerecke <killert...@gmail.com> wrote: >> >> I made the mistake of setting this to zero and then bringing my >> pen into proximity. Ooops. X crashed. Looks like mathematics >> still can't handle getting the average of zero things ;) >> >> Signed-off-by: Jason Gerecke <killert...@gmail.com> >> --- >> Changes in v2: >> - Modified patch subject to better match 2nd change >> - Add lower and upper bounds checking into wcmParseOptions >> >> src/wcmValidateDevice.c | 6 ++++++ >> src/wcmXCommand.c | 2 +- >> 2 files changed, 7 insertions(+), 1 deletions(-) >> >> diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c >> index 755d417..af6b8d2 100644 >> --- a/src/wcmValidateDevice.c >> +++ b/src/wcmValidateDevice.c >> @@ -539,6 +539,12 @@ int wcmParseOptions(InputInfoPtr pInfo, int >> hotplugged) >> >> common->wcmRawSample = xf86SetIntOption(pInfo->options, >> "RawSample", >> common->wcmRawSample); >> + if (common->wcmRawSample < 1 || common->wcmRawSample > >> XWACOM_MAX_SAMPLES) >> + { >> + xf86Msg(X_ERROR, "%s: RawSample setting '%d' out of range >> [1..%d]. Using default.\n", >> + pInfo->name, common->wcmRawSample, >> XWACOM_MAX_SAMPLES); >> + common->wcmRawSample = DEFAULT_SAMPLES; >> + } >> >> common->wcmSuppress = xf86SetIntOption(pInfo->options, "Suppress", >> common->wcmSuppress); >> diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c >> index 4207dbe..e589e37 100644 >> --- a/src/wcmXCommand.c >> +++ b/src/wcmXCommand.c >> @@ -620,7 +620,7 @@ int wcmSetProperty(DeviceIntPtr dev, Atom property, >> XIPropertyValuePtr prop, >> if ((values[0] < 0) || (values[0] > 100)) >> return BadValue; >> >> - if ((values[1] < 0) || (values[1] > XWACOM_MAX_SAMPLES)) >> + if ((values[1] < 1) || (values[1] > XWACOM_MAX_SAMPLES)) >> return BadValue; >> >> if (!checkonly) >> -- >> 1.7.1 >> >> >> >> ------------------------------------------------------------------------------ >> Colocation vs. Managed Hosting >> A question and answer guide to determining the best fit >> for your organization - today and in the future. >> http://p.sf.net/sfu/internap-sfd2d >> _______________________________________________ >> Linuxwacom-devel mailing list >> Linuxwacom-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel > > > ------------------------------------------------------------------------------ > Colocation vs. Managed Hosting > A question and answer guide to determining the best fit > for your organization - today and in the future. > http://p.sf.net/sfu/internap-sfd2d > _______________________________________________ > Linuxwacom-devel mailing list > Linuxwacom-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel > > ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel