aboutsummaryrefslogtreecommitdiffstats
path: root/ldid.cpp
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2012-09-06 06:19:15 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2012-09-06 06:23:38 -0700
commit6f340f5149d1a54887a41da3a56f73170cd53641 (patch)
tree4deced5067c8fc53b2ac775c03d1b9f6ce4a69ed /ldid.cpp
parente0524446e9a8e8a574568d2182b23be0cb964f07 (diff)
downloadldid-6f340f5149d1a54887a41da3a56f73170cd53641.tar.gz
ldid-6f340f5149d1a54887a41da3a56f73170cd53641.tar.zst
ldid-6f340f5149d1a54887a41da3a56f73170cd53641.zip
Fix a few compilation warnings: const, %z, unused.
Diffstat (limited to 'ldid.cpp')
-rw-r--r--ldid.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/ldid.cpp b/ldid.cpp
index 48dd9db..d5c3240 100644
--- a/ldid.cpp
+++ b/ldid.cpp
@@ -419,7 +419,7 @@ class MachHeader :
return load_commands;
}
- std::vector<segment_command *> GetSegments(const char *segment_name) {
+ std::vector<segment_command *> GetSegments(const char *segment_name) const {
std::vector<struct segment_command *> segment_commands;
_foreach (load_command, GetLoadCommands()) {
@@ -447,7 +447,7 @@ class MachHeader :
return segment_commands;
}
- std::vector<section *> GetSections(const char *segment_name, const char *section_name) {
+ std::vector<section *> GetSections(const char *segment_name, const char *section_name) const {
std::vector<section *> sections;
_foreach (segment, GetSegments(segment_name)) {
@@ -907,7 +907,7 @@ int main(int argc, const char *argv[]) {
alloc /= 16;
alloc *= 16;
- asprintf(&arg, "%u", alloc);
+ asprintf(&arg, "%zu", alloc);
args.push_back(arg);
}
@@ -994,7 +994,6 @@ int main(int argc, const char *argv[]) {
_assert(signature != NULL);
uint32_t data = mach_header.Swap(signature->dataoff);
- uint32_t size = mach_header.Swap(signature->datasize);
uint8_t *top = reinterpret_cast<uint8_t *>(mach_header.GetBase());
uint8_t *blob = top + data;
@@ -1012,7 +1011,6 @@ int main(int argc, const char *argv[]) {
_assert(signature != NULL);
uint32_t data = mach_header.Swap(signature->dataoff);
- uint32_t size = mach_header.Swap(signature->datasize);
uint8_t *top = reinterpret_cast<uint8_t *>(mach_header.GetBase());
uint8_t *blob = top + data;