Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/archival/libunarchive/decompress_unzip.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 983 by niro, Fri Apr 24 18:33:46 2009 UTC revision 984 by niro, Sun May 30 11:32:42 2010 UTC
# Line 503  static void inflate_codes_setup(STATE_PA Line 503  static void inflate_codes_setup(STATE_PA
503   md = mask_bits[bd];   md = mask_bits[bd];
504  }  }
505  /* called once from inflate_get_next_window */  /* called once from inflate_get_next_window */
506  static int inflate_codes(STATE_PARAM_ONLY)  static NOINLINE int inflate_codes(STATE_PARAM_ONLY)
507  {  {
508   unsigned e; /* table entry flag/number of extra bits */   unsigned e; /* table entry flag/number of extra bits */
509   huft_t *t; /* pointer to table entry */   huft_t *t; /* pointer to table entry */
# Line 970  static int inflate_get_next_window(STATE Line 970  static int inflate_get_next_window(STATE
970    
971    
972  /* Called from unpack_gz_stream() and inflate_unzip() */  /* Called from unpack_gz_stream() and inflate_unzip() */
973  static USE_DESKTOP(long long) int  static IF_DESKTOP(long long) int
974  inflate_unzip_internal(STATE_PARAM int in, int out)  inflate_unzip_internal(STATE_PARAM int in, int out)
975  {  {
976   USE_DESKTOP(long long) int n = 0;   IF_DESKTOP(long long) int n = 0;
977   ssize_t nwrote;   ssize_t nwrote;
978    
979   /* Allocate all global buffers (for DYN_ALLOC option) */   /* Allocate all global buffers (for DYN_ALLOC option) */
# Line 1008  inflate_unzip_internal(STATE_PARAM int i Line 1008  inflate_unzip_internal(STATE_PARAM int i
1008   n = -1;   n = -1;
1009   goto ret;   goto ret;
1010   }   }
1011   USE_DESKTOP(n += nwrote;)   IF_DESKTOP(n += nwrote;)
1012   if (r == 0) break;   if (r == 0) break;
1013   }   }
1014    
# Line 1033  inflate_unzip_internal(STATE_PARAM int i Line 1033  inflate_unzip_internal(STATE_PARAM int i
1033    
1034  /* For unzip */  /* For unzip */
1035    
1036  USE_DESKTOP(long long) int FAST_FUNC  IF_DESKTOP(long long) int FAST_FUNC
1037  inflate_unzip(inflate_unzip_result *res, off_t compr_size, int in, int out)  inflate_unzip(inflate_unzip_result *res, off_t compr_size, int in, int out)
1038  {  {
1039   USE_DESKTOP(long long) int n;   IF_DESKTOP(long long) int n;
1040   DECLARE_STATE;   DECLARE_STATE;
1041    
1042   ALLOC_STATE;   ALLOC_STATE;
# Line 1083  static uint16_t buffer_read_le_u16(STATE Line 1083  static uint16_t buffer_read_le_u16(STATE
1083  {  {
1084   uint16_t res;   uint16_t res;
1085  #if BB_LITTLE_ENDIAN  #if BB_LITTLE_ENDIAN
1086   /* gcc 4.2.1 is very clever */   move_from_unaligned16(res, &bytebuffer[bytebuffer_offset]);
  memcpy(&res, &bytebuffer[bytebuffer_offset], 2);  
1087  #else  #else
1088   res = bytebuffer[bytebuffer_offset];   res = bytebuffer[bytebuffer_offset];
1089   res |= bytebuffer[bytebuffer_offset + 1] << 8;   res |= bytebuffer[bytebuffer_offset + 1] << 8;
# Line 1097  static uint32_t buffer_read_le_u32(STATE Line 1096  static uint32_t buffer_read_le_u32(STATE
1096  {  {
1097   uint32_t res;   uint32_t res;
1098  #if BB_LITTLE_ENDIAN  #if BB_LITTLE_ENDIAN
1099   memcpy(&res, &bytebuffer[bytebuffer_offset], 4);   move_from_unaligned32(res, &bytebuffer[bytebuffer_offset]);
1100  #else  #else
1101   res = bytebuffer[bytebuffer_offset];   res = bytebuffer[bytebuffer_offset];
1102   res |= bytebuffer[bytebuffer_offset + 1] << 8;   res |= bytebuffer[bytebuffer_offset + 1] << 8;
# Line 1118  static int check_header_gzip(STATE_PARAM Line 1117  static int check_header_gzip(STATE_PARAM
1117   uint32_t mtime;   uint32_t mtime;
1118   uint8_t xtra_flags_UNUSED;   uint8_t xtra_flags_UNUSED;
1119   uint8_t os_flags_UNUSED;   uint8_t os_flags_UNUSED;
1120   } __attribute__((packed)) formatted;   } PACKED formatted;
1121   } header;   } header;
1122   struct BUG_header {   struct BUG_header {
1123   char BUG_header[sizeof(header) == 8 ? 1 : -1];   char BUG_header[sizeof(header) == 8 ? 1 : -1];
# Line 1182  static int check_header_gzip(STATE_PARAM Line 1181  static int check_header_gzip(STATE_PARAM
1181   return 1;   return 1;
1182  }  }
1183    
1184  USE_DESKTOP(long long) int FAST_FUNC  IF_DESKTOP(long long) int FAST_FUNC
1185  unpack_gz_stream_with_info(int in, int out, unpack_info_t *info)  unpack_gz_stream_with_info(int in, int out, unpack_info_t *info)
1186  {  {
1187   uint32_t v32;   uint32_t v32;
1188   USE_DESKTOP(long long) int n;   IF_DESKTOP(long long) int n;
1189   DECLARE_STATE;   DECLARE_STATE;
1190    
1191   n = 0;   n = 0;
# Line 1246  unpack_gz_stream_with_info(int in, int o Line 1245  unpack_gz_stream_with_info(int in, int o
1245   return n;   return n;
1246  }  }
1247    
1248  USE_DESKTOP(long long) int FAST_FUNC  IF_DESKTOP(long long) int FAST_FUNC
1249  unpack_gz_stream(int in, int out)  unpack_gz_stream(int in, int out)
1250  {  {
1251   return unpack_gz_stream_with_info(in, out, NULL);   return unpack_gz_stream_with_info(in, out, NULL);

Legend:
Removed from v.983  
changed lines
  Added in v.984