Changeset 2148


Ignore:
Timestamp:
04/28/06 13:24:31 (14 years ago)
Author:
paulf
Message:

MKIII DM24 patch

Location:
trunk/src/data_sources/scream2ew
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/data_sources/scream2ew/gcf.c

    r1212 r2148  
    2525/* 
    2626 * $Log$ 
     27 * Revision 1.2  2006/04/28 20:24:31  paulf 
     28 * MKIII DM24 patch 
     29 * 
    2730 * Revision 1.1  2003/03/27 18:07:18  alex 
    2831 * Initial revision 
     
    232235 
    233236 
    234 gcf_block 
     237void  
    235238gcf_dispatch (uint8_t * buf, int sz) 
    236239{ 
    237240  int i; 
    238241  struct gcf_block_struct block; 
    239   uint8_t *ptr; 
    240242 
    241243  block.buf = buf; 
  • trunk/src/data_sources/scream2ew/gcf.h

    r1212 r2148  
    2626/* 
    2727 * $Log$ 
     28 * Revision 1.2  2006/04/28 20:24:31  paulf 
     29 * MKIII DM24 patch 
     30 * 
    2831 * Revision 1.1  2003/03/27 18:07:18  alex 
    2932 * Initial revision 
     
    7578extern void extract_24 (gcf_block b); 
    7679extern void extract_32 (gcf_block b); 
    77 extern gcf_block gcf_dispatch (uint8_t * buf, int sz); 
     80extern void gcf_dispatch (uint8_t * buf, int sz); 
    7881#endif /* __GCF_H__ */ 
  • trunk/src/data_sources/scream2ew/gputil.c

    r1212 r2148  
    2525/* 
    2626 * $Log$ 
     27 * Revision 1.2  2006/04/28 20:24:31  paulf 
     28 * MKIII DM24 patch 
     29 * 
    2730 * Revision 1.1  2003/03/27 18:07:18  alex 
    2831 * Initial revision 
     
    128131} 
    129132 
    130 /* Changed to static return and move strdup to caller */ 
    131 /* as per all other copies of gputil */ 
    132 /* 12/02/2003 - JMM */ 
    133133 
    134134char * 
    135135gp_base36_to_a (int i) 
    136136{ 
    137   static char ret[1024]; 
    138   char buf[1024]; 
    139   int j, k; 
     137  static char ret[8]; 
     138  int j, k, pos = 7; 
    140139 
    141   ret[0] = 0; 
     140  ret[pos] = 0; 
    142141 
    143   while (i) 
    144     { 
    145       k = (int) i / 36; 
    146       j = i - (k * 36); 
     142  /* bit 31 is the 'extended sysid' bit, if it is set then the next 
     143     5 bits are used for other purposes and we only have 26 bits of 
     144     base-36 characters */ 
     145  if(i & 0x80000000) i &= 0x03FFFFFF; 
    147146 
    148       strcpy (buf, ret); 
     147  while(i) { 
     148    k = (int) i / 36; 
     149    j = i - (k * 36); 
    149150 
    150       if (j < 10) 
    151         ret[0] = j + '0'; 
    152       else 
    153         ret[0] = (j - 10) + 'A'; 
     151    ret[--pos] = (j < 10) ? (j + '0') : (j - 10 + 'A'); 
     152    i = k; 
     153  } 
    154154 
    155       ret[1] = 0; 
    156       strcat (ret, buf); 
    157       i = k; 
    158     } 
    159  
    160   return ret; 
     155  return ret + pos; 
    161156} 
Note: See TracChangeset for help on using the changeset viewer.