inputevent->ie_Qualifier on wiki (Input_Device)

This forum is for general developer support questions.
Post Reply
User avatar
javierdlr
Beta Tester
Beta Tester
Posts: 389
Joined: Sun Jun 19, 2011 10:13 pm
Location: Donostia (GUIPUZCOA) - Spain
Contact:

inputevent->ie_Qualifier on wiki (Input_Device)

Post by javierdlr »

Looking on the wiki http://wiki.amigaos.net/wiki/Input_Device found that 'inputevent->ie_Qualifier = NULL' throws a "warning: assignment makes integer from pointer without a cast", changing to 'inputevent->ie_Qualifier = 0' solves it.

Should then the wiki example/doc where it says '...ie_Qualifier...NULL' be changed to '...ie_Qualifier...0', or maybe add a new #define IEQUALIFIER_ABSOLUTEMOUSE 0x0000?

SDK inputevent.h:

Code: Select all

..
struct InputEvent
{
    struct InputEvent *ie_NextEvent; /* the chronologically next event */
    uint8              ie_Class;     /* the input event class */
    uint8              ie_SubClass;  /* optional subclass of the class */
    uint16             ie_Code;      /* the input event code */
    uint16             ie_Qualifier; /* qualifiers in effect for the event */
..
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1479
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: inputevent->ie_Qualifier on wiki (Input_Device)

Post by tonyw »

Clearly the use of NULL to initialise a uint16 is going to cause an error. I'll try to correct it.
cheers
tony
User avatar
trixie
Posts: 409
Joined: Thu Jun 30, 2011 2:54 pm
Location: Czech Republic

Re: inputevent->ie_Qualifier on wiki (Input_Device)

Post by trixie »

I've done this for you. Changed the bogus instruction
Absolute positioning is done by setting ie_Qualifier to NULL and relative positioning is done by setting ie_Qualifier to RELATIVE_MOUSE.
to the correct
Absolute positioning is done by setting ie_Qualifier to 0 and relative positioning is done by setting ie_Qualifier to IEQUALIFIER_RELATIVEMOUSE.
+ modified two more places where ie_Qualifier was set to NULL instead of 0.
The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
Belxjander
Posts: 314
Joined: Mon May 14, 2012 10:26 pm
Location: 日本千葉県松戸市 / Matsudo City, Chiba, Japan
Contact:

Re: inputevent->ie_Qualifier on wiki (Input_Device)

Post by Belxjander »

The original C= NDK had NULL defined as an integer, use of GCC includes redefines this as a Pointer.
pointer vs integer inconsistency from that update.

not the only time I've seen it (TagItems are another use case to be clear with)
User avatar
javierdlr
Beta Tester
Beta Tester
Posts: 389
Joined: Sun Jun 19, 2011 10:13 pm
Location: Donostia (GUIPUZCOA) - Spain
Contact:

Re: inputevent->ie_Qualifier on wiki (Input_Device)

Post by javierdlr »

thx trixie for fixing the wiki and Belxjander for explanation about NULL diff.
Post Reply