Ignore:
Timestamp:
Nov 10, 2005, 9:41:13 PM (17 years ago)
Author:
Sam Hocevar
Message:
  • absolute shitloads of 64 bit fixes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/imlib/readwav.cpp

    r2 r17  
    3838{
    3939  fp->read(&chunk.id,4);
    40   chunk.size=fp->read_long();
     40  chunk.size=fp->read_uint32();
    4141  fp->read(&chunk.type,4); 
    4242}
     
    4545{
    4646  fp->read(&tag.id,4);
    47   tag.size=fp->read_long();
     47  tag.size=fp->read_uint32();
    4848}
    4949
    5050void read_wav_format(wav_format &fmt, bFILE *fp)
    5151{
    52   fmt.fmt_tag=fp->read_short();
    53   fmt.channels=fp->read_short();
    54   fmt.samplesps=fp->read_long();
    55   fmt.avg_bytesps=fp->read_long(); 
    56   fmt.align=fp->read_short(); 
     52  fmt.fmt_tag=fp->read_uint16();
     53  fmt.channels=fp->read_uint16();
     54  fmt.samplesps=fp->read_uint32();
     55  fmt.avg_bytesps=fp->read_uint32(); 
     56  fmt.align=fp->read_uint16(); 
    5757}
    5858
     
    6161{
    6262  read_wav_format(pcm.wf,fp);
    63   pcm.bitsps=fp->read_short(); 
     63  pcm.bitsps=fp->read_uint16(); 
    6464}
    6565
     
    7878  /***************  Write the chunk ***************************/
    7979  fp->write((void *)"RIFF",4); 
    80   fp->write_long(data_size+36);
     80  fp->write_uint32(data_size+36);
    8181  fp->write((void *)"WAVE",4);
    8282
     
    8484  /************** Write the tag *******************************/
    8585  fp->write((void *)"fmt ",4);
    86   fp->write_long(16);
     86  fp->write_uint32(16);
    8787 
    8888 
    8989  /************** Write PCM ***********************************/
    90   fp->write_short(1);          // format_tag
    91   fp->write_short(1);          // mono recording
    92   fp->write_long(sample_rate);
    93   fp->write_long(sample_rate);   // average bytes per sec
    94   fp->write_short(1);    // allignment? Don't know what this does?
    95   fp->write_short(8);    // 8 bits per sample
     90  fp->write_uint16(1);          // format_tag
     91  fp->write_uint16(1);          // mono recording
     92  fp->write_uint32(sample_rate);
     93  fp->write_uint32(sample_rate);   // average bytes per sec
     94  fp->write_uint16(1);    // allignment? Don't know what this does?
     95  fp->write_uint16(8);    // 8 bits per sample
    9696 
    9797  /************* Write data tag ******************************/
    9898  fp->write((void *)"data",4);
    99   fp->write_long(data_size);
     99  fp->write_uint32(data_size);
    100100
    101101  /************ Now write sample data ************************/
Note: See TracChangeset for help on using the changeset viewer.