mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2025-07-07 20:50:35 +00:00
Correct various compilation warnings.
- Cast result of _dyld_image_count to prevent compilation warning: The 2 int in both side of the ? operator should have the same type. - Remove unused variable for return values. - Remove unused NSUserDefaults. Review URL: https://breakpad.appspot.com/354001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@929 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
04548babac
commit
af7d5ccf7b
|
@ -310,8 +310,6 @@ Breakpad::~Breakpad() {
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
bool Breakpad::ExtractParameters(NSDictionary *parameters) {
|
bool Breakpad::ExtractParameters(NSDictionary *parameters) {
|
||||||
NSUserDefaults *stdDefaults = [NSUserDefaults standardUserDefaults];
|
|
||||||
|
|
||||||
NSString *serverType = [parameters objectForKey:@BREAKPAD_SERVER_TYPE];
|
NSString *serverType = [parameters objectForKey:@BREAKPAD_SERVER_TYPE];
|
||||||
NSString *display = [parameters objectForKey:@BREAKPAD_PRODUCT_DISPLAY];
|
NSString *display = [parameters objectForKey:@BREAKPAD_PRODUCT_DISPLAY];
|
||||||
NSString *product = [parameters objectForKey:@BREAKPAD_PRODUCT];
|
NSString *product = [parameters objectForKey:@BREAKPAD_PRODUCT];
|
||||||
|
@ -825,5 +823,6 @@ NSDictionary *BreakpadGenerateReport(BreakpadRef ref,
|
||||||
}
|
}
|
||||||
} catch(...) { // don't let exceptions leave this C API
|
} catch(...) { // don't let exceptions leave this C API
|
||||||
fprintf(stderr, "BreakpadGenerateReport() : error\n");
|
fprintf(stderr, "BreakpadGenerateReport() : error\n");
|
||||||
|
return nil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -422,13 +422,13 @@ kern_return_t ForwardException(mach_port_t task, mach_port_t failed_thread,
|
||||||
|
|
||||||
current.count = EXC_TYPES_COUNT;
|
current.count = EXC_TYPES_COUNT;
|
||||||
mach_port_t current_task = mach_task_self();
|
mach_port_t current_task = mach_task_self();
|
||||||
kern_return_t result = task_get_exception_ports(current_task,
|
task_get_exception_ports(current_task,
|
||||||
s_exception_mask,
|
s_exception_mask,
|
||||||
current.masks,
|
current.masks,
|
||||||
¤t.count,
|
¤t.count,
|
||||||
current.ports,
|
current.ports,
|
||||||
current.behaviors,
|
current.behaviors,
|
||||||
current.flavors);
|
current.flavors);
|
||||||
|
|
||||||
// Find the first exception handler that matches the exception
|
// Find the first exception handler that matches the exception
|
||||||
unsigned int found;
|
unsigned int found;
|
||||||
|
@ -450,6 +450,7 @@ kern_return_t ForwardException(mach_port_t task, mach_port_t failed_thread,
|
||||||
|
|
||||||
mach_msg_type_number_t thread_state_count = THREAD_STATE_MAX;
|
mach_msg_type_number_t thread_state_count = THREAD_STATE_MAX;
|
||||||
breakpad_thread_state_data_t thread_state;
|
breakpad_thread_state_data_t thread_state;
|
||||||
|
kern_return_t result;
|
||||||
switch (target_behavior) {
|
switch (target_behavior) {
|
||||||
case EXCEPTION_DEFAULT:
|
case EXCEPTION_DEFAULT:
|
||||||
result = exception_raise(target_port, failed_thread, task, exception,
|
result = exception_raise(target_port, failed_thread, task, exception,
|
||||||
|
@ -629,9 +630,9 @@ void *ExceptionHandler::WaitForMessage(void *exception_handler_class) {
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
||||||
// Send a reply and exit
|
// Send a reply and exit
|
||||||
result = mach_msg(&(reply.header), MACH_SEND_MSG,
|
mach_msg(&(reply.header), MACH_SEND_MSG,
|
||||||
reply.header.msgh_size, 0, MACH_PORT_NULL,
|
reply.header.msgh_size, 0, MACH_PORT_NULL,
|
||||||
MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
|
MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1318,8 +1318,9 @@ bool MinidumpGenerator::WriteModuleListStream(
|
||||||
MDRawDirectory *module_list_stream) {
|
MDRawDirectory *module_list_stream) {
|
||||||
TypedMDRVA<MDRawModuleList> list(&writer_);
|
TypedMDRVA<MDRawModuleList> list(&writer_);
|
||||||
|
|
||||||
int image_count = dynamic_images_ ?
|
size_t image_count = dynamic_images_ ?
|
||||||
dynamic_images_->GetImageCount() : _dyld_image_count();
|
static_cast<size_t>(dynamic_images_->GetImageCount()) :
|
||||||
|
_dyld_image_count();
|
||||||
|
|
||||||
if (!list.AllocateObjectAndArray(image_count, MD_MODULE_SIZE))
|
if (!list.AllocateObjectAndArray(image_count, MD_MODULE_SIZE))
|
||||||
return false;
|
return false;
|
||||||
|
@ -1330,7 +1331,7 @@ bool MinidumpGenerator::WriteModuleListStream(
|
||||||
|
|
||||||
// Write out the executable module as the first one
|
// Write out the executable module as the first one
|
||||||
MDRawModule module;
|
MDRawModule module;
|
||||||
int executableIndex = FindExecutableModule();
|
size_t executableIndex = FindExecutableModule();
|
||||||
|
|
||||||
if (!WriteModuleStream(executableIndex, &module)) {
|
if (!WriteModuleStream(executableIndex, &module)) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -1339,7 +1340,7 @@ bool MinidumpGenerator::WriteModuleListStream(
|
||||||
list.CopyIndexAfterObject(0, &module, MD_MODULE_SIZE);
|
list.CopyIndexAfterObject(0, &module, MD_MODULE_SIZE);
|
||||||
int destinationIndex = 1; // Write all other modules after this one
|
int destinationIndex = 1; // Write all other modules after this one
|
||||||
|
|
||||||
for (int i = 0; i < image_count; ++i) {
|
for (size_t i = 0; i < image_count; ++i) {
|
||||||
if (i != executableIndex) {
|
if (i != executableIndex) {
|
||||||
if (!WriteModuleStream(i, &module)) {
|
if (!WriteModuleStream(i, &module)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue