#249 compiling error: casts lose precision

0.63
closed
None
5
2014-04-25
2005-12-03
Kimmo Mustonen
No

When being compiled on x86_64 (Linux) architecture, the
compilation of drive_cache.cpp fails:

---8<---8<---
../../../../SOURCES/dosbox-0.63/src/dos/drive_cache.
cpp: In member function 'int DOS_Drive_Cache::
CompareShortname(const char, const char)':
../../../../SOURCES/dosbox-0.63/src/dos/drive_cache.
cpp:320: error: cast from 'char' to 'int' loses
precision
../../../../SOURCES/dosbox-0.63/src/dos/drive_cache.
cpp:320: error: cast from 'const char
' to 'int' loses
precision
../../../../SOURCES/dosbox-0.63/src/dos/drive_cache.
cpp:322: error: cast from 'char' to 'int' loses
precision
../../../../SOURCES/dosbox-0.63/src/dos/drive_cache.
cpp:322: error: cast from 'char
' to 'int' loses
precision
../../../../SOURCES/dosbox-0.63/src/dos/drive_cache.
cpp:325: error: cast from 'char' to 'int' loses
precision
../../../../SOURCES/dosbox-0.63/src/dos/drive_cache.
cpp:325: error: cast from 'const char
' to 'int' loses
precision
make[3]: *** [drive_cache.o] Error 1
---8<---8<---

These are probably easy to fix by using longs instead
of ints if typecasting is necessary.

Discussion

  • Peter Veenstra
    Peter Veenstra
    2006-01-21

    Logged In: YES
    user_id=535630

    try the attached patch.
    which is a backport of a few cvs changes.

     
  • Logged In: YES
    user_id=1312539
    Originator: NO

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 365 days (the time period specified by
    the administrator of this Tracker).