Mercurial > audlegacy
comparison Plugins/Input/console/Audacious_Driver.cpp @ 1377:61d78065b630 trunk
[svn] - properly respect signedness in get_spc_info_().
| author | nenolod |
|---|---|
| date | Sun, 09 Jul 2006 22:59:20 -0700 |
| parents | ece68ef26b94 |
| children | b7250d516b62 |
comparison
equal
deleted
inserted
replaced
| 1376:c71e2ef2dcf4 | 1377:61d78065b630 |
|---|---|
| 250 | 250 |
| 251 static void get_spc_info_( Spc_Emu::header_t const& h, byte const* xid6, long xid6_size, | 251 static void get_spc_info_( Spc_Emu::header_t const& h, byte const* xid6, long xid6_size, |
| 252 track_info_t* out ) | 252 track_info_t* out ) |
| 253 { | 253 { |
| 254 // decode length (can be in text or binary format) | 254 // decode length (can be in text or binary format) |
| 255 char s [4] = { h.len_secs [0], h.len_secs [1], h.len_secs [2], 0 }; | 255 unsigned const char s [4] = { h.len_secs [0], h.len_secs [1], h.len_secs [2], 0 }; |
| 256 int len_secs = (unsigned char) s [1] * 0x100 + s [0]; | 256 int len_secs = (unsigned char) s [1] * 0x100 + s [0]; |
| 257 if ( s [1] >= ' ' || (!s [1] && isdigit( s [0] )) ) | 257 |
| 258 len_secs = atoi( s ); | |
| 259 if ( len_secs ) | 258 if ( len_secs ) |
| 260 out->length = len_secs * 1000; | 259 out->length = len_secs * 1000; |
| 261 | 260 |
| 262 if ( xid6_size ) | 261 if ( xid6_size ) |
| 263 get_spc_xid6( xid6, xid6_size, out ); | 262 get_spc_xid6( xid6, xid6_size, out ); |
