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

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/sndserver.cpp

    r2 r17  
    3737int longsound;                  // longest sound effect
    3838int lengths[NUMSFX];            // lengths of all sound effects
    39 unsigned char mixbuffer[MIXBUFFERSIZE]; // mixing buffer
     39uint8_t mixbuffer[MIXBUFFERSIZE];       // mixing buffer
    4040int sfxdevice;                  // file descriptor of sfx device
    4141int musdevice;                  // file descriptor of music device
    42 unsigned char *channels[8];     // the channel data pointers
    43 unsigned char *channelsend[8];  // the channel data end pointers
     42uint8_t *channels[8];   // the channel data pointers
     43uint8_t *channelsend[8];        // the channel data end pointers
    4444int channelstart[8];            // time that the channel started playing
    4545int channelhandles[8];          // the channel handles
     
    7575    if (d > 127) mixbuffer[i] = 255;
    7676    else if (d < -128) mixbuffer[i] = 0;
    77     else mixbuffer[i] = (unsigned char) (d+128);
     77    else mixbuffer[i] = (uint8_t) (d+128);
    7878//    if (d > 127) mixbuffer[i] = 0;
    7979//    else if (d < -128) mixbuffer[i] = 255;
    80 //    else mixbuffer[i] = (unsigned char) (-d+127);
     80//    else mixbuffer[i] = (uint8_t) (-d+127);
    8181  }
    8282
     
    197197  int i;
    198198  int rc = -1;
    199   static unsigned short handlenums = 0;
     199  static uint16_t handlenums = 0;
    200200  int oldest = mytime;
    201201  int oldestnum = 0;
     
    206206    {
    207207      channelsend[i] =
    208         (channels[i] = (unsigned char *) S_sfx[sfxid].data) + lengths[sfxid];
     208        (channels[i] = (uint8_t *) S_sfx[sfxid].data) + lengths[sfxid];
    209209      if (!handlenums) handlenums = 100;
    210210      channelhandles[i] = rc = handlenums++;
     
    226226  {
    227227    channelsend[oldestnum] =
    228       (channels[oldestnum] = (unsigned char *) S_sfx[sfxid].data)
     228      (channels[oldestnum] = (uint8_t *) S_sfx[sfxid].data)
    229229       + lengths[sfxid];
    230230    if (!handlenums) handlenums = 100;
     
    237237}
    238238
    239 void outputushort(int num)
    240 {
    241 
    242   static unsigned char buff[5] = { 0, 0, 0, 0, '\n' };
     239void output_uint16(int num)
     240{
     241
     242  static uint8_t buff[5] = { 0, 0, 0, 0, '\n' };
    243243  static char *badbuff = "xxxx\n";
    244244
     
    264264{
    265265  int i;
    266   for (i=0 ; i<sizeof(channels)/sizeof(unsigned char *) ; i++) channels[i] = 0;
     266  for (i=0 ; i<sizeof(channels)/sizeof(uint8_t *) ; i++) channels[i] = 0;
    267267  gettimeofday(&last, &whocares);
    268268  usleep(100000);
     
    274274  int done = 0;
    275275  int rc, nrc, sndnum, handle = 0;
    276   unsigned char commandbuf[10];
     276  uint8_t commandbuf[10];
    277277  fd_set fdset, scratchset;
    278278  struct timeval zerowait = { 0, 0 };
Note: See TracChangeset for help on using the changeset viewer.