Changeset 740 for vendor/current/lib/compression/lzxpress.c
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/lib/compression/lzxpress.c
r414 r740 35 35 #include "replace.h" 36 36 #include "lzxpress.h" 37 #include "../lib/util/byteorder.h" 37 38 38 39 … … 81 82 uncompressed_pos = 0; 82 83 indic = 0; 84 *(uint32_t *)compressed = 0; 83 85 compressed_pos = sizeof(uint32_t); 84 86 indic_pos = &compressed[0]; … … 130 132 /* Classical meta-data */ 131 133 metadata = (uint16_t)(((best_offset - 1) << 3) | (best_len - 3)); 132 dest[metadata_size / sizeof(uint16_t)] = metadata;134 SSVAL(dest, metadata_size / sizeof(uint16_t), metadata); 133 135 metadata_size += sizeof(uint16_t); 134 136 } else { 135 137 metadata = (uint16_t)(((best_offset - 1) << 3) | 7); 136 dest[metadata_size / sizeof(uint16_t)] = metadata;138 SSVAL(dest, metadata_size / sizeof(uint16_t), metadata); 137 139 metadata_size = sizeof(uint16_t); 138 140 … … 156 158 } 157 159 158 /* Addition nal best_len */160 /* Additional best_len */ 159 161 compressed[compressed_pos + metadata_size] = (best_len - (3 + 7 + 15)) & 0xFF; 160 162 metadata_size += sizeof(uint8_t); … … 168 170 } 169 171 170 /* Addition nal best_len */172 /* Additional best_len */ 171 173 compressed[compressed_pos + metadata_size] = 255; 172 174 … … 199 201 200 202 if ((indic_bit - 1) % 32 > (indic_bit % 32)) { 201 *(uint32_t *)indic_pos = indic;203 SIVAL(indic_pos, 0, indic); 202 204 indic = 0; 203 205 indic_pos = &compressed[compressed_pos]; … … 213 215 compressed_pos++; 214 216 if (((indic_bit - 1) % 32) > (indic_bit % 32)){ 215 *(uint32_t *)indic_pos = indic;217 SIVAL(indic_pos, 0, indic); 216 218 indic = 0; 217 219 indic_pos = &compressed[compressed_pos]; … … 224 226 indic |= 0 << (32 - ((indic_bit % 32) + 1)); 225 227 226 *(uint32_t *)indic_pos = indic; 228 *(uint32_t *)&compressed[compressed_pos] = 0; 229 SIVAL(indic_pos, 0, indic); 227 230 compressed_pos += sizeof(uint32_t); 228 231 }
Note:
See TracChangeset
for help on using the changeset viewer.