diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-03 15:46:46 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-03 15:46:46 +0000 |
commit | 8c05d501ac5cd0c010217629f0d19187fb3cfece (patch) | |
tree | 73eb518861d418afcea38b8da874b549da1c8034 | |
parent | b375c4c36a33c3604c8c57962dfa9f77a2b3da52 (diff) | |
parent | b6b1b529e505b73a29c9f3501708768c741f20e8 (diff) | |
download | dalvik-android14-mainline-adbd-release.tar.gz |
Snap for 10428683 from b6b1b529e505b73a29c9f3501708768c741f20e8 to mainline-adbd-releaseaml_adb_340912530aml_adb_340912350aml_adb_340912200aml_adb_340912000android14-mainline-adbd-release
Change-Id: I5e05a34f7d9cfe477dea30281b3ce3b6effc19d0
-rw-r--r-- | dexgen/src/com/android/dexgen/dex/file/StringIdItem.java | 7 | ||||
-rw-r--r-- | dx/src/com/android/dx/dex/file/CallSiteIdItem.java | 5 | ||||
-rw-r--r-- | dx/src/com/android/dx/dex/file/StringIdItem.java | 7 | ||||
-rw-r--r-- | tools/hprof-conv/HprofConv.c | 5 |
4 files changed, 11 insertions, 13 deletions
diff --git a/dexgen/src/com/android/dexgen/dex/file/StringIdItem.java b/dexgen/src/com/android/dexgen/dex/file/StringIdItem.java index 30f31d421..f7d1408fc 100644 --- a/dexgen/src/com/android/dexgen/dex/file/StringIdItem.java +++ b/dexgen/src/com/android/dexgen/dex/file/StringIdItem.java @@ -24,7 +24,7 @@ import com.android.dexgen.util.Hex; * Representation of a string inside a Dalvik file. */ public final class StringIdItem - extends IndexedItem implements Comparable { + extends IndexedItem implements Comparable<StringIdItem> { /** size of instances when written out to a file, in bytes */ public static final int WRITE_SIZE = 4; @@ -66,9 +66,8 @@ public final class StringIdItem } /** {@inheritDoc} */ - public int compareTo(Object other) { - StringIdItem otherString = (StringIdItem) other; - return value.compareTo(otherString.value); + public int compareTo(StringIdItem other) { + return value.compareTo(other.value); } /** {@inheritDoc} */ diff --git a/dx/src/com/android/dx/dex/file/CallSiteIdItem.java b/dx/src/com/android/dx/dex/file/CallSiteIdItem.java index cf0bb24ef..ffe445e2a 100644 --- a/dx/src/com/android/dx/dex/file/CallSiteIdItem.java +++ b/dx/src/com/android/dx/dex/file/CallSiteIdItem.java @@ -23,7 +23,7 @@ import com.android.dx.util.Hex; /** * Representation of a call site reference in a DEX file. */ -public final class CallSiteIdItem extends IndexedItem implements Comparable { +public final class CallSiteIdItem extends IndexedItem implements Comparable<CallSiteIdItem> { /** The item size when placed in a DEX file. */ private static final int ITEM_SIZE = 4; @@ -83,8 +83,7 @@ public final class CallSiteIdItem extends IndexedItem implements Comparable { /** {@inheritDoc} */ @Override - public int compareTo(Object o) { - CallSiteIdItem other = (CallSiteIdItem) o; + public int compareTo(CallSiteIdItem other) { return invokeDynamicRef.compareTo(other.invokeDynamicRef); } } diff --git a/dx/src/com/android/dx/dex/file/StringIdItem.java b/dx/src/com/android/dx/dex/file/StringIdItem.java index e4fb559b8..29d399a37 100644 --- a/dx/src/com/android/dx/dex/file/StringIdItem.java +++ b/dx/src/com/android/dx/dex/file/StringIdItem.java @@ -25,7 +25,7 @@ import com.android.dx.util.Hex; * Representation of a string inside a Dalvik file. */ public final class StringIdItem - extends IndexedItem implements Comparable { + extends IndexedItem implements Comparable<StringIdItem> { /** {@code non-null;} the string value */ private final CstString value; @@ -65,9 +65,8 @@ public final class StringIdItem /** {@inheritDoc} */ @Override - public int compareTo(Object other) { - StringIdItem otherString = (StringIdItem) other; - return value.compareTo(otherString.value); + public int compareTo(StringIdItem other) { + return value.compareTo(other.value); } /** {@inheritDoc} */ diff --git a/tools/hprof-conv/HprofConv.c b/tools/hprof-conv/HprofConv.c index cc90176f9..ff49428af 100644 --- a/tools/hprof-conv/HprofConv.c +++ b/tools/hprof-conv/HprofConv.c @@ -182,7 +182,7 @@ static int ebEnsureCapacity(ExpandBuf* pBuf, int size) unsigned char* newStorage = realloc(pBuf->storage, newSize); if (newStorage == NULL) { fprintf(stderr, "ERROR: realloc failed on size=%d\n", newSize); - return -1; + exit(1); } pBuf->storage = newStorage; @@ -663,7 +663,8 @@ static int filterData(FILE* in, FILE* out, int flags) unsigned char* buf = ebGetBuffer(pBuf); unsigned char type; - unsigned int timestamp, length; + unsigned int timestamp ATTRIBUTE_UNUSED; + unsigned int length; type = buf[0]; timestamp = get4BE(buf + 1); |