News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

integer conversion cleanup & copyright notice cleanup

Started by neroden, July 10, 2010, 09:41:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

neroden

There are again two separate things in this patch, a real patch and a comment fix.

(1) Change the types within struct clip_dimension to KOORD_VAL, to match practically every time they're used.
This eliminates a *huge* number of warnings with -Wconversion.  It also generates two new warnings, which are real warnings, but only matter in case of a clipping rectangle larger than 32767 in width or height.  This case was broken already anyway.

(If people start buying very large screens, we can in the future fix it by changing KOORD_VAL from a short int to a larger datatype.  But in order to do that, first we should apply the fixes like this so that *all* the clipping math is being done with the same integer type, KOORD_VAL.)

I added comments to the two genuine warnings.

EDIT: patch attached now

(2) Update the copyright notice in simgraph16.cc, which was out of date and misleading.  

I'd really appreciate it if at least (1) was committed.  It's been tested and it compiles and plays correctly.  It eliminates a lot of the -Wconversion warnings.

EDIT: actually (cough) there are three things in this patch.
(3)   I also eliminated a signed/unsigned comparison warning in simworld.h (by using a signed type, there was no real reason to use an unsigned type there).

prissi


Dwachs

@neroden: thank you very much.

however, this is not incorporated yet, moving to 'considered patches'
Parsley, sage, rosemary, and maggikraut.

prissi

Too tired, commit failed, but I switched off computer anyway. Accidently submitted together with minmax.-c ... Sorry.