{
ProximityClassPtr proxc;
+ BUG_RETURN_VAL(dev == NULL, FALSE);
+ BUG_RETURN_VAL(dev->proximity != NULL, FALSE);
+
proxc = (ProximityClassPtr) malloc(sizeof(ProximityClassRec));
if (!proxc)
return FALSE;
{
AxisInfoPtr ax;
- if (!dev || !dev->valuator || (minval > maxval && mode == Absolute))
- return FALSE;
- if (axnum >= dev->valuator->numAxes)
- return FALSE;
+ BUG_RETURN_VAL(dev == NULL, FALSE);
+ BUG_RETURN_VAL(dev->valuator == NULL, FALSE);
+ BUG_RETURN_VAL(axnum >= dev->valuator->numAxes, FALSE);
+ BUG_RETURN_VAL(minval > maxval && mode == Absolute, FALSE);
ax = dev->valuator->axes + axnum;
InternalEvent dce;
DeviceIntPtr master;
- if (!dev || !dev->valuator || axnum >= dev->valuator->numAxes)
- return FALSE;
+ BUG_RETURN_VAL(dev == NULL, FALSE);
+ BUG_RETURN_VAL(dev->valuator == NULL, FALSE);
+ BUG_RETURN_VAL(axnum >= dev->valuator->numAxes, FALSE);
switch (type) {
case SCROLL_TYPE_VERTICAL:
ButtonClassPtr butc;
int i;
+ BUG_RETURN_VAL(dev == NULL, FALSE);
+ BUG_RETURN_VAL(dev->button != NULL, FALSE);
+
butc = calloc(1, sizeof(ButtonClassRec));
if (!butc)
return FALSE;
int i;
ValuatorClassPtr valc;
- if (!dev)
- return FALSE;
+ BUG_RETURN_VAL(dev == NULL, FALSE);
if (numAxes > MAX_VALUATORS) {
LogMessage(X_WARNING,
{
FocusClassPtr focc;
+ BUG_RETURN_VAL(dev == NULL, FALSE);
+ BUG_RETURN_VAL(dev->focus != NULL, FALSE);
+
focc = malloc(sizeof(FocusClassRec));
if (!focc)
return FALSE;
{
PtrFeedbackPtr feedc;
+ BUG_RETURN_VAL(dev == NULL, FALSE);
+ BUG_RETURN_VAL(dev->ptrfeed != NULL, FALSE);
+
feedc = malloc(sizeof(PtrFeedbackClassRec));
if (!feedc)
return FALSE;
int i;
StringFeedbackPtr feedc;
+ BUG_RETURN_VAL(dev == NULL, FALSE);
+ BUG_RETURN_VAL(dev->stringfeed != NULL, FALSE);
+
feedc = malloc(sizeof(StringFeedbackClassRec));
if (!feedc)
return FALSE;
{
BellFeedbackPtr feedc;
+ BUG_RETURN_VAL(dev == NULL, FALSE);
+ BUG_RETURN_VAL(dev->bell != NULL, FALSE);
+
feedc = malloc(sizeof(BellFeedbackClassRec));
if (!feedc)
return FALSE;
{
LedFeedbackPtr feedc;
+ BUG_RETURN_VAL(dev == NULL, FALSE);
+ BUG_RETURN_VAL(dev->leds != NULL, FALSE);
+
feedc = malloc(sizeof(LedFeedbackClassRec));
if (!feedc)
return FALSE;
{
IntegerFeedbackPtr feedc;
+ BUG_RETURN_VAL(dev == NULL, FALSE);
+ BUG_RETURN_VAL(dev->intfeed != NULL, FALSE);
+
feedc = malloc(sizeof(IntegerFeedbackClassRec));
if (!feedc)
return FALSE;
{
DeviceIntPtr dev = (DeviceIntPtr) device;
+ BUG_RETURN_VAL(dev == NULL, FALSE);
+ BUG_RETURN_VAL(dev->button != NULL, FALSE);
+ BUG_RETURN_VAL(dev->valuator != NULL, FALSE);
+ BUG_RETURN_VAL(dev->ptrfeed != NULL, FALSE);
+
return (InitButtonClassDeviceStruct(dev, numButtons, btn_labels, map) &&
InitValuatorClassDeviceStruct(dev, numAxes, axes_labels,
numMotionEvents, Relative) &&
TouchClassPtr touch;
int i;
- if (device->touch || !device->valuator)
- return FALSE;
+ BUG_RETURN_VAL(device == NULL, FALSE);
+ BUG_RETURN_VAL(device->touch != NULL, FALSE);
/* Check the mode is valid, and at least X and Y axes. */
- if (mode != XIDirectTouch && mode != XIDependentTouch)
- return FALSE;
- if (num_axes < 2)
- return FALSE;
+ BUG_RETURN_VAL(mode != XIDirectTouch && mode != XIDependentTouch, FALSE);
+ BUG_RETURN_VAL(num_axes < 2, FALSE);
if (num_axes > MAX_VALUATORS) {
LogMessage(X_WARNING,