[Scummvm-cvs-logs] CVS: scummvm/scumm instrument.h,2.15,2.16 instrument.cpp,2.32,2.33
Max Horn
fingolfin at users.sourceforge.net
Thu Apr 14 12:24:49 CEST 2005
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14966
Modified Files:
instrument.h instrument.cpp
Log Message:
Removing this casting operator. I changed the only place it was used to an 'error' a long time ago, and so far nobody reported anything about it.
Index: instrument.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/instrument.h,v
retrieving revision 2.15
retrieving revision 2.16
diff -u -d -r2.15 -r2.16
--- instrument.h 12 Apr 2005 22:41:25 -0000 2.15
+++ instrument.h 14 Apr 2005 19:23:21 -0000 2.16
@@ -62,19 +62,6 @@
void clear();
void copy_to (Instrument *dest) { if (_instrument) _instrument->copy_to (dest); else dest->clear(); }
- // FIXME: This is evil! We cast a pointer to an int. Besides not being
- // portable to 64bit systems, it is unclear why this is needed.
- // If the only reason is to supply a unique identifier of that
- // instrument: there are better ways do do that.
- // OTOH, maybe the code is simply wrong, and what is really meant
- // here is to first dereference _instrument, then cast it? Like
- // this: (int)*_instrument
- // At least this would explain the otherwise unused operator int()
- // supplied by class Instrument_Program.
- // If that is the case, the operator int() should all be replaced by
- // a proper method, like "get_something()"
- operator int() { return (_instrument ? (int) _instrument : 255); }
-
void program (byte program, bool mt32);
void adlib (byte *instrument);
void roland (byte *instrument);
Index: instrument.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/instrument.cpp,v
retrieving revision 2.32
retrieving revision 2.33
diff -u -d -r2.32 -r2.33
--- instrument.cpp 12 Apr 2005 22:41:25 -0000 2.32
+++ instrument.cpp 14 Apr 2005 19:23:21 -0000 2.33
@@ -135,7 +135,6 @@
void send (MidiChannel *mc);
void copy_to (Instrument *dest) { dest->program (_program, _mt32); }
bool is_valid() { return (_program < 128) && ((_native_mt32 == _mt32) || _native_mt32 ? (MidiDriver::_gmToMt32[_program] < 128) : (MidiDriver::_mt32ToGm[_program] < 128)); }
- operator int() { return (_program < 128) ? _program : 255; }
};
class Instrument_Adlib : public InstrumentInternal {
More information about the Scummvm-git-logs
mailing list