[hatari-devel] New FileSelector

Eero Tamminen eerot at users.berlios.de
Mon Sep 20 23:53:19 CEST 2010


Hi,

Btw. Why the sdlgui.h struct w & h members needed to be converted
to floats?  No other objects need floats and I don't see why scrollbar
would need those to be floats either as the SDL drawing co-ordinates are
all integers.

If floats are needed for calculations, I think it should be possible to just
have exact float variables internal to the file selector which are just set 
to the (integer) scrollbar object variables before scrollbar is drawn...?

(The patches seemed to have quite a lot of "unnecessary" explicit casts too.
AFAIK variable assignment always does an implicit cast to target type and
operations on different types implicitly upcasts values that have smaller
scope.)


	- Eero

PS. Making gui-sdl const correct is easy, see attached patch.  It leaves one
warning though:
/home/eero/work/hatari/src/gui-sdl/sdlgui.c: In function ‘SDLGui_EditField’:
/home/eero/work/hatari/src/gui-sdl/sdlgui.c:482: warning: cast discards 
qualifiers from pointer target type

PPS. The othe patch fixes GCC flag changing for uae-cpu + disables only
the needed unused checks, not all the unused checks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sdl-gui-const.diff
Type: text/x-diff
Size: 3416 bytes
Desc: not available
URL: <https://lists.berlios.de/pipermail/hatari-devel/attachments/20100921/a2dfd3ea/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: uae-warn-fix.diff
Type: text/x-diff
Size: 620 bytes
Desc: not available
URL: <https://lists.berlios.de/pipermail/hatari-devel/attachments/20100921/a2dfd3ea/attachment-0001.diff>


More information about the hatari-devel mailing list