Introduced upx_compress_result_t.
This commit is contained in:
+13
-12
@@ -69,25 +69,26 @@ int upx_compress ( const upx_bytep src, upx_uint src_len,
|
||||
upx_callback_p cb,
|
||||
int method, int level,
|
||||
const struct upx_compress_config_t *conf,
|
||||
upx_uintp result )
|
||||
struct upx_compress_result_t *result )
|
||||
{
|
||||
int r = UPX_E_ERROR;
|
||||
upx_uint result_buffer[16];
|
||||
upx_compress_result_t result_buffer;
|
||||
|
||||
assert(level > 0);
|
||||
if (!result)
|
||||
result = result_buffer;
|
||||
result = &result_buffer;
|
||||
|
||||
memset(result, 0, sizeof(*result));
|
||||
// assume no info available - fill in worst case results
|
||||
//result[0] = 1; // min_offset_found - NOT USED
|
||||
result[1] = src_len - 1; // max_offset_found
|
||||
//result[2] = 2; // min_match_found - NOT USED
|
||||
result[3] = src_len - 1; // max_match_found
|
||||
//result[4] = 1; // min_run_found - NOT USED
|
||||
result[5] = src_len; // max_run_found
|
||||
result[6] = 1; // first_offset_found
|
||||
//result[7] = 999999; // same_match_offsets_found - NOT USED
|
||||
result[8] = 0; // LzmaGetNumProbs()
|
||||
upx_uint *res = result->result_ucl.result;
|
||||
//res[0] = 1; // min_offset_found - NOT USED
|
||||
res[1] = src_len - 1; // max_offset_found
|
||||
//res[2] = 2; // min_match_found - NOT USED
|
||||
res[3] = src_len - 1; // max_match_found
|
||||
//res[4] = 1; // min_run_found - NOT USED
|
||||
res[5] = src_len; // max_run_found
|
||||
res[6] = 1; // first_offset_found
|
||||
//res[7] = 999999; // same_match_offsets_found - NOT USED
|
||||
|
||||
#if defined(WITH_LZMA)
|
||||
if (M_IS_LZMA(method))
|
||||
|
||||
Reference in New Issue
Block a user