comparison decoders/shn.c @ 401:c42ac9ee2ce4

Fixed "inline" keyword to compile.
author Ryan C. Gordon <icculus@icculus.org>
date Fri, 12 Jul 2002 23:16:24 +0000
parents fb519e6028e3
children b4abd7c48b6e
comparison
equal deleted inserted replaced
400:9d0b5ec9cc26 401:c42ac9ee2ce4
321 321
322 return(1); 322 return(1);
323 } /* ulong_get */ 323 } /* ulong_get */
324 324
325 325
326 static inline int uint_get(int nbit, shn_t *shn, SDL_RWops *rw, Sint32 *word) 326 static __inline__ int uint_get(int nbit, shn_t *shn, SDL_RWops *rw, Sint32 *w)
327 { 327 {
328 return((shn->version == 0) ? 328 return((shn->version == 0) ?
329 uvar_get(nbit, shn, rw, word) : 329 uvar_get(nbit, shn, rw, w) :
330 ulong_get(shn, rw, word)); 330 ulong_get(shn, rw, w));
331 } /* uint_get */ 331 } /* uint_get */
332 332
333 333
334 static int SHN_init(void) 334 static int SHN_init(void)
335 { 335 {
345 345
346 /* 346 /*
347 * Look through the whole file for a SHN magic number. This is costly, so 347 * Look through the whole file for a SHN magic number. This is costly, so
348 * it should only be done if the user SWEARS they have a Shorten stream... 348 * it should only be done if the user SWEARS they have a Shorten stream...
349 */ 349 */
350 static inline int extended_shn_magic_search(Sound_Sample *sample) 350 static __inline__ int extended_shn_magic_search(Sound_Sample *sample)
351 { 351 {
352 SDL_RWops *rw = ((Sound_SampleInternal *) sample->opaque)->rw; 352 SDL_RWops *rw = ((Sound_SampleInternal *) sample->opaque)->rw;
353 Uint32 word = 0; 353 Uint32 word = 0;
354 Uint8 ch; 354 Uint8 ch;
355 355
367 return((int) ch); 367 return((int) ch);
368 } /* extended_shn_magic_search */ 368 } /* extended_shn_magic_search */
369 369
370 370
371 /* look for the magic number in the RWops and see what kind of file this is. */ 371 /* look for the magic number in the RWops and see what kind of file this is. */
372 static inline int determine_shn_version(Sound_Sample *sample, const char *ext) 372 static __inline__ int determine_shn_version(Sound_Sample *sample,
373 const char *ext)
373 { 374 {
374 SDL_RWops *rw = ((Sound_SampleInternal *) sample->opaque)->rw; 375 SDL_RWops *rw = ((Sound_SampleInternal *) sample->opaque)->rw;
375 Uint32 magic; 376 Uint32 magic;
376 Uint8 ch; 377 Uint8 ch;
377 378
431 offset[chan][i] = mean; 432 offset[chan][i] = mean;
432 } /* for */ 433 } /* for */
433 } /* init_shn_offset */ 434 } /* init_shn_offset */
434 435
435 436
436 static inline Uint16 cvt_shnftype_to_sdlfmt(Sint16 shntype) 437 static __inline__ Uint16 cvt_shnftype_to_sdlfmt(Sint16 shntype)
437 { 438 {
438 switch (shntype) 439 switch (shntype)
439 { 440 {
440 case SHN_TYPE_S8: 441 case SHN_TYPE_S8:
441 return(AUDIO_S8); 442 return(AUDIO_S8);
463 464
464 return(0); 465 return(0);
465 } /* cvt_shnftype_to_sdlfmt */ 466 } /* cvt_shnftype_to_sdlfmt */
466 467
467 468
468 static inline int skip_bits(shn_t *shn, SDL_RWops *rw) 469 static __inline__ int skip_bits(shn_t *shn, SDL_RWops *rw)
469 { 470 {
470 int i; 471 int i;
471 Sint32 skip; 472 Sint32 skip;
472 Sint32 trash; 473 Sint32 trash;
473 474
541 542
542 return(1); 543 return(1);
543 } /* verb_ReadLE16 */ 544 } /* verb_ReadLE16 */
544 545
545 546
546 static inline int parse_riff_header(shn_t *shn, Sound_Sample *sample) 547 static __inline__ int parse_riff_header(shn_t *shn, Sound_Sample *sample)
547 { 548 {
548 Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque; 549 Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque;
549 SDL_RWops *rw = internal->rw; 550 SDL_RWops *rw = internal->rw;
550 Uint16 u16; 551 Uint16 u16;
551 Uint32 u32; 552 Uint32 u32;