aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/ijar
diff options
context:
space:
mode:
authorGravatar Austin Schuh <austin.linux@gmail.com>2018-03-28 15:01:48 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-03-28 15:03:13 -0700
commit6d4f4f9e9278dd10f722adf7a5c02cfd5efee288 (patch)
tree9c4d0458e22b6233e1da54781414171ebd613b6b /third_party/ijar
parent0bf1413833ad78784771fefb468f080a53640136 (diff)
Fix unused variable warnings from clang.
This was preventing ijar and singlejar from building when included in @bazel_tools in our repo. Change-Id: I1553e4f3615965cb997579e7d277fb2a08f9b91b PiperOrigin-RevId: 190840090
Diffstat (limited to 'third_party/ijar')
-rw-r--r--third_party/ijar/classfile.cc16
-rw-r--r--third_party/ijar/ijar.cc6
-rw-r--r--third_party/ijar/zip.cc9
3 files changed, 11 insertions, 20 deletions
diff --git a/third_party/ijar/classfile.cc b/third_party/ijar/classfile.cc
index 9d48429e0c..5e163e386b 100644
--- a/third_party/ijar/classfile.cc
+++ b/third_party/ijar/classfile.cc
@@ -815,10 +815,8 @@ struct TypeAnnotation {
};
struct EmptyInfo : TargetInfo {
- void Write(u1 *&p) {}
- static EmptyInfo *Read(const u1 *&p) {
- return new EmptyInfo;
- }
+ void Write(u1 *& /*p*/) {}
+ static EmptyInfo *Read(const u1 *& /*p*/) { return new EmptyInfo; }
};
struct MethodFormalParameterInfo : TargetInfo {
@@ -1021,8 +1019,8 @@ struct SignatureAttribute : Attribute {
// We preserve Deprecated attributes because they are required by the
// compiler to generate warning messages.
struct DeprecatedAttribute : Attribute {
-
- static DeprecatedAttribute* Read(const u1 *&p, Constant *attribute_name) {
+ static DeprecatedAttribute *Read(const u1 *& /*p*/,
+ Constant *attribute_name) {
DeprecatedAttribute *attr = new DeprecatedAttribute;
attr->attribute_name_ = attribute_name;
return attr;
@@ -1126,8 +1124,8 @@ struct ParameterAnnotationsAttribute : Attribute {
// See sec.4.7.20 of Java 8 JVM spec. Includes RuntimeVisibleTypeAnnotations
// and RuntimeInvisibleTypeAnnotations.
struct TypeAnnotationsAttribute : Attribute {
- static TypeAnnotationsAttribute* Read(const u1 *&p, Constant *attribute_name,
- u4 attribute_length) {
+ static TypeAnnotationsAttribute *Read(const u1 *&p, Constant *attribute_name,
+ u4 /*attribute_length*/) {
auto attr = new TypeAnnotationsAttribute;
attr->attribute_name_ = attribute_name;
u2 num_annotations = get_u2be(p);
@@ -1160,7 +1158,7 @@ struct TypeAnnotationsAttribute : Attribute {
// See JVMS ยง4.7.24
struct MethodParametersAttribute : Attribute {
static MethodParametersAttribute *Read(const u1 *&p, Constant *attribute_name,
- u4 attribute_length) {
+ u4 /*attribute_length*/) {
auto attr = new MethodParametersAttribute;
attr->attribute_name_ = attribute_name;
u1 parameters_count = get_u1(p);
diff --git a/third_party/ijar/ijar.cc b/third_party/ijar/ijar.cc
index bcbe242775..160645d7ae 100644
--- a/third_party/ijar/ijar.cc
+++ b/third_party/ijar/ijar.cc
@@ -76,7 +76,7 @@ class JarStripperProcessor : public ZipExtractorProcessor {
}
};
-bool JarStripperProcessor::Accept(const char* filename, const u4 attr) {
+bool JarStripperProcessor::Accept(const char *filename, const u4 /*attr*/) {
const size_t filename_len = strlen(filename);
if (filename_len < CLASS_EXTENSION_LENGTH ||
strcmp(filename + filename_len - CLASS_EXTENSION_LENGTH,
@@ -96,8 +96,8 @@ static bool IsModuleInfo(const char* filename) {
return strcmp(slash, "module-info.class") == 0;
}
-void JarStripperProcessor::Process(const char* filename, const u4 attr,
- const u1* data, const size_t size) {
+void JarStripperProcessor::Process(const char *filename, const u4 /*attr*/,
+ const u1 *data, const size_t size) {
if (verbose) {
fprintf(stderr, "INFO: StripClass: %s\n", filename);
}
diff --git a/third_party/ijar/zip.cc b/third_party/ijar/zip.cc
index c5ff929836..9a719dbac3 100644
--- a/third_party/ijar/zip.cc
+++ b/third_party/ijar/zip.cc
@@ -147,13 +147,6 @@ class InputZipFile : public ZipExtractor {
const u1 *file_name_;
const u1 *extra_field_;
- // Administration of memory reserved for decompressed data. We use the same
- // buffer for each file to avoid some malloc()/free() calls and free the
- // memory only in the dtor. C-style memory management is used so that we
- // can call realloc.
- u1 *uncompressed_data_;
- size_t uncompressed_data_allocated_;
-
// Copy of the last filename entry - Null-terminated.
char filename[PATH_MAX];
// The external file attribute field
@@ -599,7 +592,7 @@ struct EndOfCentralDirectoryRecord {
// Checks for a zip64 end of central directory record. If a valid zip64 EOCD is
// found, updates the original EOCD record and returns true.
-bool MaybeReadZip64CentralDirectory(const u1 *bytes, size_t in_length,
+bool MaybeReadZip64CentralDirectory(const u1 *bytes, size_t /*in_length*/,
const u1 *current,
const u1 **end_of_central_dir,
EndOfCentralDirectoryRecord *cd) {