More clang fixes. xenia-kernel is clean.

This commit is contained in:
Ben Vanik 2015-07-19 21:29:06 -07:00
parent bebda48a4f
commit 5bd7833e87
15 changed files with 83 additions and 92 deletions

View File

@ -16,6 +16,8 @@
#if XE_PLATFORM_MAC #if XE_PLATFORM_MAC
#include <libkern/OSAtomic.h> #include <libkern/OSAtomic.h>
#elif XE_PLATFORM_WIN32
#include <intrin.h>
#endif // XE_PLATFORM_MAC #endif // XE_PLATFORM_MAC
namespace xe { namespace xe {

View File

@ -55,11 +55,11 @@
#define NOMINMAX // Don't want windows.h including min/max macros. #define NOMINMAX // Don't want windows.h including min/max macros.
#endif // XE_PLATFORM_WIN32 #endif // XE_PLATFORM_WIN32
#if XE_COMPILER_MSVC #if XE_PLATFORM_WIN32
#include <intrin.h> #include <intrin.h>
#else #else
#include <x86intrin.h> #include <x86intrin.h>
#endif // XE_COMPILER_MSVC #endif // XE_PLATFORM_WIN32
namespace xe { namespace xe {

View File

@ -19,7 +19,7 @@ namespace gpu {
namespace ucode { namespace ucode {
#if XE_PLATFORM_WIN32 #if XE_COMPILER_MSVC
#define XEPACKEDSTRUCT(name, value) \ #define XEPACKEDSTRUCT(name, value) \
__pragma(pack(push, 1)) struct name##_s value __pragma(pack(pop)); \ __pragma(pack(push, 1)) struct name##_s value __pragma(pack(pop)); \
typedef struct name##_s name; typedef struct name##_s name;

View File

@ -167,14 +167,11 @@ X_STATUS XThread::Create() {
} }
const uint32_t kDefaultTlsSlotCount = 32; const uint32_t kDefaultTlsSlotCount = 32;
uint32_t tls_slots = 0; uint32_t tls_slots = kDefaultTlsSlotCount;
uint32_t tls_extended_size = 0; uint32_t tls_extended_size = 0;
if (tls_header) { if (tls_header && tls_header->slot_count) {
tls_slots = tls_slots = tls_header->slot_count;
tls_header->slot_count ? tls_header->slot_count : kDefaultTlsSlotCount;
tls_extended_size = tls_header->data_size; tls_extended_size = tls_header->data_size;
} else {
tls_slots = kDefaultTlsSlotCount;
} }
// Allocate both the slots and the extended data. // Allocate both the slots and the extended data.

View File

@ -416,7 +416,7 @@ void XUserModule::Dump() {
} break; } break;
case XEX_HEADER_TITLE_WORKSPACE_SIZE: { case XEX_HEADER_TITLE_WORKSPACE_SIZE: {
printf(" XEX_HEADER_TITLE_WORKSPACE_SIZE: %d\n", printf(" XEX_HEADER_TITLE_WORKSPACE_SIZE: %d\n",
(uint32_t)opt_header.value); uint32_t(opt_header.value));
} break; } break;
case XEX_HEADER_GAME_RATINGS: { case XEX_HEADER_GAME_RATINGS: {
printf(" XEX_HEADER_GAME_RATINGS (TODO):\n"); printf(" XEX_HEADER_GAME_RATINGS (TODO):\n");
@ -434,7 +434,8 @@ void XUserModule::Dump() {
printf(" XEX_HEADER_ALTERNATE_TITLE_IDS (TODO):\n"); printf(" XEX_HEADER_ALTERNATE_TITLE_IDS (TODO):\n");
} break; } break;
case XEX_HEADER_ADDITIONAL_TITLE_MEMORY: { case XEX_HEADER_ADDITIONAL_TITLE_MEMORY: {
printf(" XEX_HEADER_ADDITIONAL_TITLE_MEMORY: %d\n", opt_header.value); printf(" XEX_HEADER_ADDITIONAL_TITLE_MEMORY: %d\n",
uint32_t(opt_header.value));
} break; } break;
case XEX_HEADER_EXPORTS_BY_NAME: { case XEX_HEADER_EXPORTS_BY_NAME: {
printf(" XEX_HEADER_EXPORTS_BY_NAME:\n"); printf(" XEX_HEADER_EXPORTS_BY_NAME:\n");

View File

@ -27,7 +27,7 @@ using PPCContext = xe::cpu::frontend::PPCContext;
#define SHIM_CALL void _cdecl #define SHIM_CALL void _cdecl
#define SHIM_SET_MAPPING(library_name, export_name, shim_data) \ #define SHIM_SET_MAPPING(library_name, export_name, shim_data) \
export_resolver->SetFunctionMapping( \ export_resolver->SetFunctionMapping( \
library_name, ordinals::##export_name, \ library_name, ordinals::export_name, \
(xe::cpu::xe_kernel_export_shim_fn)export_name##_shim); (xe::cpu::xe_kernel_export_shim_fn)export_name##_shim);
#define SHIM_MEM_BASE ppc_context->virtual_membase #define SHIM_MEM_BASE ppc_context->virtual_membase
@ -465,7 +465,7 @@ using xe::cpu::ExportTag;
#define DECLARE_EXPORT(module_name, name, tags) \ #define DECLARE_EXPORT(module_name, name, tags) \
const auto EXPORT_##module_name##_##name = RegisterExport_##module_name( \ const auto EXPORT_##module_name##_##name = RegisterExport_##module_name( \
xe::kernel::shim::RegisterExport< \ xe::kernel::shim::RegisterExport< \
xe::kernel::shim::KernelModuleId::module_name, ordinals::##name>( \ xe::kernel::shim::KernelModuleId::module_name, ordinals::name>( \
&name, #name, tags)); &name, #name, tags));
#define DECLARE_XAM_EXPORT(name, tags) DECLARE_EXPORT(xam, name, tags) #define DECLARE_XAM_EXPORT(name, tags) DECLARE_EXPORT(xam, name, tags)

View File

@ -29,16 +29,6 @@
namespace xe {} // namespace xe namespace xe {} // namespace xe
// TODO(benvanik): remove.
#define XEEXPECTZERO(expr) \
if ((expr) != 0) { \
goto XECLEANUP; \
}
#define XEEXPECTNOTNULL(expr) \
if ((expr) == NULL) { \
goto XECLEANUP; \
}
DEFINE_bool(xex_dev_key, false, "Use the devkit key."); DEFINE_bool(xex_dev_key, false, "Use the devkit key.");
typedef struct xe_xex2 { typedef struct xe_xex2 {
@ -70,25 +60,35 @@ xe_xex2_ref xe_xex2_load(xe::Memory* memory, const void* addr,
xex->memory = memory; xex->memory = memory;
xex->sections = new std::vector<PESection*>(); xex->sections = new std::vector<PESection*>();
XEEXPECTZERO(xe_xex2_read_header((const uint8_t*)addr, length, &xex->header)); if (xe_xex2_read_header((const uint8_t*)addr, length, &xex->header)) {
xe_xex2_dealloc(xex);
return nullptr;
}
XEEXPECTZERO(xe_xex2_decrypt_key(&xex->header)); if (xe_xex2_decrypt_key(&xex->header)) {
xe_xex2_dealloc(xex);
return nullptr;
}
XEEXPECTZERO( if (xe_xex2_read_image(xex, (const uint8_t*)addr, uint32_t(length), memory)) {
xe_xex2_read_image(xex, (const uint8_t*)addr, uint32_t(length), memory)); xe_xex2_dealloc(xex);
return nullptr;
}
XEEXPECTZERO(xe_xex2_load_pe(xex)); if (xe_xex2_load_pe(xex)) {
xe_xex2_dealloc(xex);
return nullptr;
}
for (size_t n = 0; n < xex->header.import_library_count; n++) { for (size_t n = 0; n < xex->header.import_library_count; n++) {
auto library = &xex->header.import_libraries[n]; auto library = &xex->header.import_libraries[n];
XEEXPECTZERO(xe_xex2_find_import_infos(xex, library)); if (xe_xex2_find_import_infos(xex, library)) {
xe_xex2_dealloc(xex);
return nullptr;
}
} }
return xex; return xex;
XECLEANUP:
xe_xex2_dealloc(xex);
return nullptr;
} }
void xe_xex2_dealloc(xe_xex2_ref xex) { void xe_xex2_dealloc(xe_xex2_ref xex) {
@ -292,7 +292,9 @@ int xe_xex2_read_header(const uint8_t* addr, const size_t length,
library->record_count = src_library->count; library->record_count = src_library->count;
library->records = library->records =
(uint32_t*)calloc(library->record_count, sizeof(uint32_t)); (uint32_t*)calloc(library->record_count, sizeof(uint32_t));
XEEXPECTNOTNULL(library->records); if (!library->records) {
return 1;
}
for (size_t i = 0; i < library->record_count; i++) { for (size_t i = 0; i < library->record_count; i++) {
library->records[i] = src_library->import_table[i]; library->records[i] = src_library->import_table[i];
} }
@ -343,7 +345,9 @@ int xe_xex2_read_header(const uint8_t* addr, const size_t length,
comp_info->blocks = (xe_xex2_file_basic_compression_block_t*)calloc( comp_info->blocks = (xe_xex2_file_basic_compression_block_t*)calloc(
comp_info->block_count, comp_info->block_count,
sizeof(xe_xex2_file_basic_compression_block_t)); sizeof(xe_xex2_file_basic_compression_block_t));
XEEXPECTNOTNULL(comp_info->blocks); if (!comp_info->blocks) {
return 1;
}
for (size_t m = 0; m < comp_info->block_count; m++) { for (size_t m = 0; m < comp_info->block_count; m++) {
xe_xex2_file_basic_compression_block_t* block = xe_xex2_file_basic_compression_block_t* block =
&comp_info->blocks[m]; &comp_info->blocks[m];
@ -406,7 +410,9 @@ int xe_xex2_read_header(const uint8_t* addr, const size_t length,
ps += 4; ps += 4;
header->sections = (xe_xex2_section_t*)calloc(header->section_count, header->sections = (xe_xex2_section_t*)calloc(header->section_count,
sizeof(xe_xex2_section_t)); sizeof(xe_xex2_section_t));
XEEXPECTNOTNULL(header->sections); if (!header->sections) {
return 1;
}
for (size_t n = 0; n < header->section_count; n++) { for (size_t n = 0; n < header->section_count; n++) {
xe_xex2_section_t* section = &header->sections[n]; xe_xex2_section_t* section = &header->sections[n];
section->page_size = section->page_size =
@ -418,9 +424,6 @@ int xe_xex2_read_header(const uint8_t* addr, const size_t length,
} }
return 0; return 0;
XECLEANUP:
return 1;
} }
int xe_xex2_decrypt_key(xe_xex2_header_t* header) { int xe_xex2_decrypt_key(xe_xex2_header_t* header) {
@ -700,7 +703,6 @@ int xe_xex2_read_image_compressed(const xe_xex2_header_t* header,
// TODO: a way to do without a copy/alloc? // TODO: a way to do without a copy/alloc?
free_input = true; free_input = true;
input_buffer = (const uint8_t*)calloc(1, input_size); input_buffer = (const uint8_t*)calloc(1, input_size);
XEEXPECTNOTNULL(input_buffer);
xe_xex2_decrypt_buffer(header->session_key, exe_buffer, exe_length, xe_xex2_decrypt_buffer(header->session_key, exe_buffer, exe_length,
(uint8_t*)input_buffer, input_size); (uint8_t*)input_buffer, input_size);
break; break;
@ -710,14 +712,12 @@ int xe_xex2_read_image_compressed(const xe_xex2_header_t* header,
} }
compress_buffer = (uint8_t*)calloc(1, exe_length); compress_buffer = (uint8_t*)calloc(1, exe_length);
XEEXPECTNOTNULL(compress_buffer);
p = input_buffer; p = input_buffer;
d = compress_buffer; d = compress_buffer;
// De-block. // De-block.
deblock_buffer = (uint8_t*)calloc(1, input_size); deblock_buffer = (uint8_t*)calloc(1, input_size);
XEEXPECTNOTNULL(deblock_buffer);
block_size = header->file_format_info.compression_info.normal.block_size; block_size = header->file_format_info.compression_info.normal.block_size;
while (block_size) { while (block_size) {
const uint8_t* pnext = p + block_size; const uint8_t* pnext = p + block_size;
@ -753,28 +753,24 @@ int xe_xex2_read_image_compressed(const xe_xex2_header_t* header,
XELOGE("Unable to allocate XEX memory at %.8X-%.8X.", header->exe_address, XELOGE("Unable to allocate XEX memory at %.8X-%.8X.", header->exe_address,
uncompressed_size); uncompressed_size);
result_code = 2; result_code = 2;
goto XECLEANUP; // Not doing any cleanup here;
// TODO(benvanik): rewrite this entire file using RAII.
assert_always();
return 1;
} }
uint8_t* buffer = memory->TranslateVirtual(header->exe_address); uint8_t* buffer = memory->TranslateVirtual(header->exe_address);
std::memset(buffer, 0, uncompressed_size); std::memset(buffer, 0, uncompressed_size);
// Setup decompressor and decompress. // Setup decompressor and decompress.
sys = mspack_memory_sys_create(); sys = mspack_memory_sys_create();
XEEXPECTNOTNULL(sys);
lzxsrc = mspack_memory_open(sys, (void*)compress_buffer, d - compress_buffer); lzxsrc = mspack_memory_open(sys, (void*)compress_buffer, d - compress_buffer);
XEEXPECTNOTNULL(lzxsrc);
lzxdst = mspack_memory_open(sys, buffer, uncompressed_size); lzxdst = mspack_memory_open(sys, buffer, uncompressed_size);
XEEXPECTNOTNULL(lzxdst);
lzxd = lzxd =
lzxd_init(sys, (struct mspack_file*)lzxsrc, (struct mspack_file*)lzxdst, lzxd_init(sys, (struct mspack_file*)lzxsrc, (struct mspack_file*)lzxdst,
header->file_format_info.compression_info.normal.window_bits, 0, header->file_format_info.compression_info.normal.window_bits, 0,
32768, (off_t)header->loader_info.image_size); 32768, (off_t)header->loader_info.image_size);
XEEXPECTNOTNULL(lzxd); result_code = lzxd_decompress(lzxd, (off_t)header->loader_info.image_size);
XEEXPECTZERO(lzxd_decompress(lzxd, (off_t)header->loader_info.image_size));
result_code = 0;
XECLEANUP:
if (lzxd) { if (lzxd) {
lzxd_free(lzxd); lzxd_free(lzxd);
lzxd = NULL; lzxd = NULL;
@ -1014,7 +1010,7 @@ int xe_xex2_get_import_infos(xe_xex2_ref xex,
uint32_t xe_xex2_lookup_export(xe_xex2_ref xex, const char* name) { uint32_t xe_xex2_lookup_export(xe_xex2_ref xex, const char* name) {
auto header = xe_xex2_get_header(xex); auto header = xe_xex2_get_header(xex);
// no exports :( // No exports.
if (!header->pe_export_table_offset) { if (!header->pe_export_table_offset) {
XELOGE("xe_xex2_lookup_export(%s) failed: no PE export table", name); XELOGE("xe_xex2_lookup_export(%s) failed: no PE export table", name);
return 0; return 0;
@ -1027,13 +1023,14 @@ uint32_t xe_xex2_lookup_export(xe_xex2_ref xex, const char* name) {
// e->AddressOfX RVAs are relative to the IMAGE_EXPORT_DIRECTORY! // e->AddressOfX RVAs are relative to the IMAGE_EXPORT_DIRECTORY!
uint32_t* function_table = (uint32_t*)((uint64_t)e + e->AddressOfFunctions); uint32_t* function_table = (uint32_t*)((uint64_t)e + e->AddressOfFunctions);
// Names relative to directory // Names relative to directory.
uint32_t* name_table = (uint32_t*)((uint64_t)e + e->AddressOfNames); uint32_t* name_table = (uint32_t*)((uint64_t)e + e->AddressOfNames);
// Table of ordinals (by name) // Table of ordinals (by name).
uint16_t* ordinal_table = (uint16_t*)((uint64_t)e + e->AddressOfNameOrdinals); uint16_t* ordinal_table = (uint16_t*)((uint64_t)e + e->AddressOfNameOrdinals);
const char* mod_name = (const char*)((uint64_t)e + e->Name); // Module name (sometimes).
// const char* mod_name = (const char*)((uint64_t)e + e->Name);
for (uint32_t i = 0; i < e->NumberOfNames; i++) { for (uint32_t i = 0; i < e->NumberOfNames; i++) {
const char* fn_name = (const char*)((uint64_t)e + name_table[i]); const char* fn_name = (const char*)((uint64_t)e + name_table[i]);
@ -1046,7 +1043,7 @@ uint32_t xe_xex2_lookup_export(xe_xex2_ref xex, const char* name) {
} }
} }
// No match // No match.
return 0; return 0;
} }
@ -1080,21 +1077,12 @@ uint32_t xe_xex2_lookup_export(xe_xex2_ref xex, uint16_t ordinal) {
header->pe_export_table_offset)); header->pe_export_table_offset));
// e->AddressOfX RVAs are relative to the IMAGE_EXPORT_DIRECTORY! // e->AddressOfX RVAs are relative to the IMAGE_EXPORT_DIRECTORY!
// Functions relative to base // Functions relative to base.
uint32_t* function_table = (uint32_t*)((uint64_t)e + e->AddressOfFunctions); uint32_t* function_table = (uint32_t*)((uint64_t)e + e->AddressOfFunctions);
// Names relative to directory
uint32_t* name_table = (uint32_t*)((uint64_t)e + e->AddressOfNames);
// Table of ordinals (by name)
uint16_t* ordinal_table = (uint16_t*)((uint64_t)e + e->AddressOfNameOrdinals);
const char* mod_name = (const char*)((uint64_t)e + e->Name);
if (ordinal < e->NumberOfFunctions) { if (ordinal < e->NumberOfFunctions) {
return header->exe_address + function_table[ordinal]; return header->exe_address + function_table[ordinal];
} }
// No match // No match.
return 0; return 0;
} }

View File

@ -39,8 +39,6 @@ SHIM_CALL XAudioGetVoiceCategoryVolumeChangeMask_shim(
assert_true((driver_ptr & 0xFFFF0000) == 0x41550000); assert_true((driver_ptr & 0xFFFF0000) == 0x41550000);
auto audio_system = kernel_state->emulator()->audio_system();
// Checking these bits to see if any voice volume changed. // Checking these bits to see if any voice volume changed.
// I think. // I think.
SHIM_SET_MEM_32(out_ptr, 0); SHIM_SET_MEM_32(out_ptr, 0);

View File

@ -107,21 +107,21 @@ void XeCryptSha(lpvoid_t input_1, dword_t input_1_size, lpvoid_t input_2,
DECLARE_XBOXKRNL_EXPORT(XeCryptSha, ExportTag::kImplemented); DECLARE_XBOXKRNL_EXPORT(XeCryptSha, ExportTag::kImplemented);
// Byteswap? // Byteswap?
dword_result_t XeCryptBnQw_SwapDwQwLeBe(const lpqword_t qw_inp, dword_result_t XeCryptBnQw_SwapDwQwLeBe(lpqword_t qw_inp, lpqword_t qw_out,
lpqword_t qw_out, dword_t size) { dword_t size) {
return 0; return 0;
} }
DECLARE_XBOXKRNL_EXPORT(XeCryptBnQw_SwapDwQwLeBe, ExportTag::kStub); DECLARE_XBOXKRNL_EXPORT(XeCryptBnQw_SwapDwQwLeBe, ExportTag::kStub);
dword_result_t XeCryptBnQwNeRsaPubCrypt(const lpqword_t qw_a, lpqword_t qw_b, dword_result_t XeCryptBnQwNeRsaPubCrypt(lpqword_t qw_a, lpqword_t qw_b,
const lpvoid_t rsa) { lpvoid_t rsa) {
// 0 indicates failure (but not a BOOL return value) // 0 indicates failure (but not a BOOL return value)
return 1; return 1;
} }
DECLARE_XBOXKRNL_EXPORT(XeCryptBnQwNeRsaPubCrypt, ExportTag::kStub); DECLARE_XBOXKRNL_EXPORT(XeCryptBnQwNeRsaPubCrypt, ExportTag::kStub);
dword_result_t XeCryptBnDwLePkcs1Verify(const lpvoid_t hash, const lpvoid_t sig, dword_result_t XeCryptBnDwLePkcs1Verify(lpvoid_t hash, lpvoid_t sig,
const dword_t size) { dword_t size) {
// BOOL return value // BOOL return value
return 1; return 1;
} }

View File

@ -43,7 +43,7 @@ static_assert_size(X_EXCEPTION_RECORD, 0x50);
void AppendParam(StringBuffer& string_buffer, void AppendParam(StringBuffer& string_buffer,
pointer_t<X_EXCEPTION_RECORD> record) { pointer_t<X_EXCEPTION_RECORD> record) {
string_buffer.AppendFormat("%.8X(%.8X)", record.guest_address(), string_buffer.AppendFormat("%.8X(%.8X)", record.guest_address(),
record->exception_code); uint32_t(record->exception_code));
} }
void RtlRaiseException(pointer_t<X_EXCEPTION_RECORD> record) { void RtlRaiseException(pointer_t<X_EXCEPTION_RECORD> record) {

View File

@ -960,7 +960,7 @@ const uint32_t error_table_0xC0980001[] = {
}; };
#define MAKE_ENTRY(x) \ #define MAKE_ENTRY(x) \
{ ##x, xe::countof(error_table_##x), error_table_##x } { x, xe::countof(error_table_##x), error_table_##x }
const error_lookup_table error_tables[] = { const error_lookup_table error_tables[] = {
MAKE_ENTRY(0x00000103), MAKE_ENTRY(0x40000002), MAKE_ENTRY(0x40020056), MAKE_ENTRY(0x00000103), MAKE_ENTRY(0x40000002), MAKE_ENTRY(0x40020056),
MAKE_ENTRY(0x400200AF), MAKE_ENTRY(0x80000001), MAKE_ENTRY(0x80000288), MAKE_ENTRY(0x400200AF), MAKE_ENTRY(0x80000001), MAKE_ENTRY(0x80000288),

View File

@ -328,8 +328,8 @@ SHIM_CALL ExRegisterTitleTerminateNotification_shim(PPCContext* ppc_context,
// list entry flink // list entry flink
// list entry blink // list entry blink
XELOGD("ExRegisterTitleTerminateNotification(%.8X(%.8X), %.1X)", XELOGD("ExRegisterTitleTerminateNotification(%.8X(%.8X, %d), %.1X)",
registration_ptr, routine, create); registration_ptr, routine, priority, create);
if (create) { if (create) {
// Adding. // Adding.

View File

@ -171,6 +171,11 @@ int32_t format_core(PPCContext* ppc_context, FormatData& data, ArgList& args,
restart: restart:
switch (state) { switch (state) {
case FS_Invalid:
case FS_Unknown:
case FS_End:
default: { assert_always(); }
case FS_Start: { case FS_Start: {
if (c == '%') { if (c == '%') {
state = FS_Unknown; state = FS_Unknown;

View File

@ -948,7 +948,7 @@ dword_result_t NtWaitForMultipleObjectsEx(
objects[n] = std::move(object); objects[n] = std::move(object);
} }
uint64_t timeout = timeout_ptr ? *timeout_ptr : 0; uint64_t timeout = timeout_ptr ? uint64_t(*timeout_ptr) : 0;
result = XObject::WaitMultiple( result = XObject::WaitMultiple(
count, reinterpret_cast<XObject**>(objects.data()), wait_type, 6, count, reinterpret_cast<XObject**>(objects.data()), wait_type, 6,
wait_mode, alertable, timeout_ptr ? &timeout : nullptr); wait_mode, alertable, timeout_ptr ? &timeout : nullptr);

View File

@ -216,9 +216,9 @@ static int lzxd_read_input(struct lzxd_stream *lzx) {
static int make_decode_table(unsigned int nsyms, unsigned int nbits, static int make_decode_table(unsigned int nsyms, unsigned int nbits,
unsigned char *length, unsigned short *table) unsigned char *length, unsigned short *table)
{ {
register unsigned short sym; unsigned short sym;
register unsigned int leaf, fill; unsigned int leaf, fill;
register unsigned char bit_num; unsigned char bit_num;
unsigned int pos = 0; /* the current position in the decode table */ unsigned int pos = 0; /* the current position in the decode table */
unsigned int table_mask = 1 << nbits; unsigned int table_mask = 1 << nbits;
unsigned int bit_mask = table_mask >> 1; /* don't do 0 length codes */ unsigned int bit_mask = table_mask >> 1; /* don't do 0 length codes */
@ -294,9 +294,9 @@ static int lzxd_read_lens(struct lzxd_stream *lzx, unsigned char *lens,
unsigned int first, unsigned int last) unsigned int first, unsigned int last)
{ {
/* bit buffer and huffman symbol decode variables */ /* bit buffer and huffman symbol decode variables */
register unsigned int bit_buffer; unsigned int bit_buffer;
register int bits_left, i; int bits_left, i;
register unsigned short sym; unsigned short sym;
unsigned char *i_ptr, *i_end; unsigned char *i_ptr, *i_end;
unsigned int x, y; unsigned int x, y;
@ -463,9 +463,9 @@ void lzxd_set_output_length(struct lzxd_stream *lzx, off_t out_bytes) {
int lzxd_decompress(struct lzxd_stream *lzx, off_t out_bytes) { int lzxd_decompress(struct lzxd_stream *lzx, off_t out_bytes) {
/* bitstream reading and huffman variables */ /* bitstream reading and huffman variables */
register unsigned int bit_buffer; unsigned int bit_buffer;
register int bits_left, i=0; int bits_left, i=0;
register unsigned short sym; unsigned short sym;
unsigned char *i_ptr, *i_end; unsigned char *i_ptr, *i_end;
int match_length, length_footer, extra, verbatim_bits, bytes_todo; int match_length, length_footer, extra, verbatim_bits, bytes_todo;