#9122 closed patch
MSVC: conversions warnings in common code
Reported by: | Templier | Owned by: | lordhoto |
---|---|---|---|
Priority: | low | Component: | Port: Win32 |
Version: | Keywords: | ||
Cc: | Game: |
Description
I'm now compiling my engine (lastexpress) using MSVC with C4244 ('conversion' conversion from 'type1' to 'type2', possible loss of data) turned on and I've noticed a few warnings in headers included from common code. I'm opening this entry to track those cases.
Patch1: Cursor struct constructor using an int parameter to initialize a byte field: targetScale is defined as byte, but the constructor takes an int value. This changes the constructor to take a byte value for targetScale.
Patch2: Rect::clip taking int parameters while it's using int16 internally. This changes the clip method to take int16 values.
Ticket imported from: #2911414. Ticket imported from: patches/1227.
Attachments (2)
Change History (7)
by , 15 years ago
Attachment: | C4244_cursorman_cursor_struct_constructor.patch added |
---|
comment:1 by , 15 years ago
Priority: | normal → low |
---|
comment:2 by , 15 years ago
I do not think these warnings are that bad btw., I still chose to commit your patch for the Common::Rect code, I did decide to make "_targetScale" in the CursorMan code an "int" though (instead of making the constructor parameter byte), since the OSystem method, where this is passed, takes an int too. (It is debatable whether byte would be enough for that value though... :-).
Btw. I can tell you that when I enable a similar warning for g++ and try to build ScummVM with it I get *tons* of warnings about similar things :-/.
comment:3 by , 15 years ago
Owner: | set to |
---|---|
Status: | new → closed |
comment:4 by , 15 years ago
Yes, there are tons of those warnings when turning it on globally on MSVC too. Those patches were mainly so that you can turn on the warning on a per-engine basis and not get warnings from the common header files.
Thanks for accepting it!
comment:5 by , 6 years ago
Component: | → Port: Win32 |
---|
Patch1 - Cursor struct constructor