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
diff --git a/src/client/ios/Breakpad.mm b/src/client/ios/Breakpad.mm
index efcc35b..f355406 100644
--- a/src/client/ios/Breakpad.mm
+++ b/src/client/ios/Breakpad.mm
@@ -310,8 +310,6 @@
//=============================================================================
bool Breakpad::ExtractParameters(NSDictionary *parameters) {
- NSUserDefaults *stdDefaults = [NSUserDefaults standardUserDefaults];
-
NSString *serverType = [parameters objectForKey:@BREAKPAD_SERVER_TYPE];
NSString *display = [parameters objectForKey:@BREAKPAD_PRODUCT_DISPLAY];
NSString *product = [parameters objectForKey:@BREAKPAD_PRODUCT];
@@ -825,5 +823,6 @@
}
} catch(...) { // don't let exceptions leave this C API
fprintf(stderr, "BreakpadGenerateReport() : error\n");
+ return nil;
}
}
diff --git a/src/client/mac/handler/exception_handler.cc b/src/client/mac/handler/exception_handler.cc
index 54eb409..eac1908 100644
--- a/src/client/mac/handler/exception_handler.cc
+++ b/src/client/mac/handler/exception_handler.cc
@@ -422,13 +422,13 @@
current.count = EXC_TYPES_COUNT;
mach_port_t current_task = mach_task_self();
- kern_return_t result = task_get_exception_ports(current_task,
- s_exception_mask,
- current.masks,
- ¤t.count,
- current.ports,
- current.behaviors,
- current.flavors);
+ task_get_exception_ports(current_task,
+ s_exception_mask,
+ current.masks,
+ ¤t.count,
+ current.ports,
+ current.behaviors,
+ current.flavors);
// Find the first exception handler that matches the exception
unsigned int found;
@@ -450,6 +450,7 @@
mach_msg_type_number_t thread_state_count = THREAD_STATE_MAX;
breakpad_thread_state_data_t thread_state;
+ kern_return_t result;
switch (target_behavior) {
case EXCEPTION_DEFAULT:
result = exception_raise(target_port, failed_thread, task, exception,
@@ -629,9 +630,9 @@
exit(1);
// Send a reply and exit
- result = mach_msg(&(reply.header), MACH_SEND_MSG,
- reply.header.msgh_size, 0, MACH_PORT_NULL,
- MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
+ mach_msg(&(reply.header), MACH_SEND_MSG,
+ reply.header.msgh_size, 0, MACH_PORT_NULL,
+ MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
}
}
}
diff --git a/src/client/mac/handler/minidump_generator.cc b/src/client/mac/handler/minidump_generator.cc
index 1e4ea6b..b1d429c 100644
--- a/src/client/mac/handler/minidump_generator.cc
+++ b/src/client/mac/handler/minidump_generator.cc
@@ -1318,8 +1318,9 @@
MDRawDirectory *module_list_stream) {
TypedMDRVA<MDRawModuleList> list(&writer_);
- int image_count = dynamic_images_ ?
- dynamic_images_->GetImageCount() : _dyld_image_count();
+ size_t image_count = dynamic_images_ ?
+ static_cast<size_t>(dynamic_images_->GetImageCount()) :
+ _dyld_image_count();
if (!list.AllocateObjectAndArray(image_count, MD_MODULE_SIZE))
return false;
@@ -1330,7 +1331,7 @@
// Write out the executable module as the first one
MDRawModule module;
- int executableIndex = FindExecutableModule();
+ size_t executableIndex = FindExecutableModule();
if (!WriteModuleStream(executableIndex, &module)) {
return false;
@@ -1339,7 +1340,7 @@
list.CopyIndexAfterObject(0, &module, MD_MODULE_SIZE);
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 (!WriteModuleStream(i, &module)) {
return false;