Changeset 64 for mppenc/branches/r2d/libmpcenc/tools.c
- Timestamp:
- 09/29/06 16:55:39 (18 years ago)
- Location:
- mppenc/branches/r2d/libmpcenc
- Files:
-
- 1 added
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
mppenc/branches/r2d/libmpcenc/tools.c
r60 r64 31 31 #include <string.h> 32 32 #include <errno.h> 33 #include "mppdec.h" 34 33 #include <stdio.h> 34 35 #include "libmpcenc.h" 35 36 36 37 #if defined HAVE_INCOMPLETE_READ && FILEIO != 1 … … 60 61 61 62 62 int63 isdir ( const char* Name )64 {65 #if FILEIO == 166 return 1;67 #else68 STRUCT_STAT st;69 70 if ( STAT_CMD ( Name, &st ) != 0 )71 return 0;72 return S_ISDIR ( st.st_mode );73 #endif74 }75 76 77 63 /* 78 64 * Change_Endian32() changes the endianess of a 32-bit memory block in-place … … 86 72 87 73 static void 88 Change_Endian32 ( Uint32_t* dst, size_t words32bit )74 Change_Endian32 ( mpc_uint32_t* dst, size_t words32bit ) 89 75 { 90 76 91 77 for ( ; words32bit--; dst++ ) { 92 78 # if INT_MAX >= 2147483647L 93 Uint32_t tmp = *dst;79 mpc_uint32_t tmp = *dst; 94 80 tmp = ((tmp << 0x10) & 0xFFFF0000) | ((tmp >> 0x10) & 0x0000FFFF); 95 81 tmp = ((tmp << 0x08) & 0xFF00FF00) | ((tmp >> 0x08) & 0x00FF00FF); 96 82 *dst = tmp; 97 83 # else 98 Uint8_t tmp;99 tmp = (( Uint8_t*)dst)[0];100 (( Uint8_t*)dst)[0] = ((Uint8_t*)dst)[3];101 (( Uint8_t*)dst)[3] = tmp;102 tmp = (( Uint8_t*)dst)[1];103 (( Uint8_t*)dst)[1] = ((Uint8_t*)dst)[2];104 (( Uint8_t*)dst)[2] = tmp;84 mpc_uint8_t tmp; 85 tmp = ((mpc_uint8_t*)dst)[0]; 86 ((mpc_uint8_t*)dst)[0] = ((mpc_uint8_t*)dst)[3]; 87 ((mpc_uint8_t*)dst)[3] = tmp; 88 tmp = ((mpc_uint8_t*)dst)[1]; 89 ((mpc_uint8_t*)dst)[1] = ((mpc_uint8_t*)dst)[2]; 90 ((mpc_uint8_t*)dst)[2] = tmp; 105 91 # endif 106 92 } … … 119 105 120 106 size_t 121 Read_LittleEndians ( FILE _T fp, Uint32_t* dst, size_t words32bit )107 Read_LittleEndians ( FILE* fp, mpc_uint32_t* dst, size_t words32bit ) 122 108 { 123 109 size_t wordsread; … … 541 527 542 528 void 543 Make_LookupTable ( Uint8_t* LUT, size_t LUT_len, const Huffman_t* const Table, const size_t elements )529 Make_LookupTable ( mpc_uint8_t* LUT, size_t LUT_len, const Huffman_t* const Table, const size_t elements ) 544 530 { 545 531 size_t i; 546 532 size_t idx = elements; 547 Uint32_t dval = (Uint32_t)0x80000000L / LUT_len * 2;548 Uint32_t val = dval - 1;533 mpc_uint32_t dval = (mpc_uint32_t)0x80000000L / LUT_len * 2; 534 mpc_uint32_t val = dval - 1; 549 535 550 536 for ( i = 0; i < LUT_len; i++, val += dval ) { 551 537 while ( idx > 0 && val >= Table[idx-1].Code ) 552 538 idx--; 553 *LUT++ = ( Uint8_t)idx;539 *LUT++ = (mpc_uint8_t)idx; 554 540 } 555 541 … … 561 547 Init_FPU ( void ) 562 548 { 563 Uint16_t cw;549 mpc_uint16_t cw; 564 550 565 551 #if defined __i386__ && defined _FPU_GETCW && defined _FPU_SETCW
Note: See TracChangeset
for help on using the changeset viewer.