Remove some lint.
Change-Id: Ieecd7c10e62bce27e2db38f96d5df9782ef0cff6
diff --git a/src/compiler/Compiler.h b/src/compiler/Compiler.h
index 917e3fd..d16735c 100644
--- a/src/compiler/Compiler.h
+++ b/src/compiler/Compiler.h
@@ -119,11 +119,11 @@
/* Clear the visited flag for each BB */
bool oatClearVisitedFlag(struct CompilationUnit* cUnit,
struct BasicBlock* bb);
-char *oatGetDalvikDisassembly(const DecodedInstruction* insn,
+char* oatGetDalvikDisassembly(const DecodedInstruction* insn,
const char* note);
-char *oatFullDisassembler(const struct CompilationUnit* cUnit,
+char* oatFullDisassembler(const struct CompilationUnit* cUnit,
const struct MIR* mir);
-char *oatGetSSAString(struct CompilationUnit* cUnit,
+char* oatGetSSAString(struct CompilationUnit* cUnit,
struct SSARepresentation* ssaRep);
void oatDataFlowAnalysisDispatcher(struct CompilationUnit* cUnit,
bool (*func)(struct CompilationUnit* , struct BasicBlock*),
diff --git a/src/compiler/Dataflow.cc b/src/compiler/Dataflow.cc
index 8b92c86..67d900e 100644
--- a/src/compiler/Dataflow.cc
+++ b/src/compiler/Dataflow.cc
@@ -1587,7 +1587,7 @@
* and subscript pair. Each SSA register can be used to index the
* ssaToDalvikMap list to get the subscript[31..16]/dalvik_reg[15..0] mapping.
*/
-char *oatGetDalvikDisassembly(const DecodedInstruction* insn,
+char* oatGetDalvikDisassembly(const DecodedInstruction* insn,
const char* note)
{
char buffer[256];
@@ -1668,12 +1668,12 @@
}
}
int length = strlen(buffer) + 1;
- ret = (char *)oatNew(length, false);
+ ret = (char*)oatNew(length, false);
memcpy(ret, buffer, length);
return ret;
}
-char *getSSAName(const CompilationUnit* cUnit, int ssaReg, char* name)
+char* getSSAName(const CompilationUnit* cUnit, int ssaReg, char* name)
{
int ssa2DalvikValue = oatConvertSSARegToDalvik(cUnit, ssaReg);
@@ -1685,7 +1685,7 @@
/*
* Dalvik instruction disassembler with optional SSA printing.
*/
-char *oatFullDisassembler(const CompilationUnit* cUnit,
+char* oatFullDisassembler(const CompilationUnit* cUnit,
const MIR* mir)
{
char buffer[256];
@@ -1693,7 +1693,7 @@
const DecodedInstruction *insn = &mir->dalvikInsn;
int opcode = insn->opcode;
int dfAttributes = oatDataFlowAttributes[opcode];
- char *ret;
+ char* ret;
int length;
OpcodeFlags flags;
@@ -1804,7 +1804,7 @@
done:
length = strlen(buffer) + 1;
- ret = (char *) oatNew(length, false);
+ ret = (char*) oatNew(length, false);
memcpy(ret, buffer, length);
return ret;
}
@@ -1814,7 +1814,7 @@
* and subscript pair. Each SSA register can be used to index the
* ssaToDalvikMap list to get the subscript[31..16]/dalvik_reg[15..0] mapping.
*/
-char *oatGetSSAString(CompilationUnit* cUnit, SSARepresentation* ssaRep)
+char* oatGetSSAString(CompilationUnit* cUnit, SSARepresentation* ssaRep)
{
char buffer[256];
char* ret;
@@ -1846,7 +1846,7 @@
}
int length = strlen(buffer) + 1;
- ret = (char *)oatNew(length, false);
+ ret = (char*)oatNew(length, false);
memcpy(ret, buffer, length);
return ret;
}
diff --git a/src/compiler/Frontend.cc b/src/compiler/Frontend.cc
index 57d4616..89f63be 100644
--- a/src/compiler/Frontend.cc
+++ b/src/compiler/Frontend.cc
@@ -74,7 +74,7 @@
dexDecodeInstruction(codePtr, decInsn);
if (printMe) {
- char *decodedString = oatGetDalvikDisassembly(decInsn, NULL);
+ char* decodedString = oatGetDalvikDisassembly(decInsn, NULL);
LOG(INFO) << codePtr << ": 0x" << std::hex << (int)opcode <<
" " << decodedString;
}
@@ -218,7 +218,7 @@
std::string name = art::PrettyMethod(cUnit->method_idx, *cUnit->dex_file);
char startOffset[80];
sprintf(startOffset, "_%x", cUnit->entryBlock->fallThrough->startOffset);
- char* fileName = (char *) oatNew(
+ char* fileName = (char*) oatNew(
strlen(dirPrefix) +
name.length() +
strlen(".dot") + 1, true);
diff --git a/src/compiler/codegen/arm/MethodCodegenDriver.cc b/src/compiler/codegen/arm/MethodCodegenDriver.cc
index 7a719f7..15fd1ba 100644
--- a/src/compiler/codegen/arm/MethodCodegenDriver.cc
+++ b/src/compiler/codegen/arm/MethodCodegenDriver.cc
@@ -1822,7 +1822,7 @@
return res;
}
-STATIC const char *extendedMIROpNames[kMirOpLast - kMirOpFirst] = {
+STATIC const char* extendedMIROpNames[kMirOpLast - kMirOpFirst] = {
"kMirOpPhi",
"kMirOpNullNRangeUpCheck",
"kMirOpNullNRangeDownCheck",
@@ -2031,7 +2031,7 @@
/* Don't generate the SSA annotation unless verbose mode is on */
if (cUnit->printMe && mir->ssaRep) {
- char *ssaString = oatGetSSAString(cUnit, mir->ssaRep);
+ char* ssaString = oatGetSSAString(cUnit, mir->ssaRep);
newLIR1(cUnit, kArmPseudoSSARep, (int) ssaString);
}
diff --git a/src/dalvik_system_Zygote.cc b/src/dalvik_system_Zygote.cc
index 00a011c..cd3f656 100644
--- a/src/dalvik_system_Zygote.cc
+++ b/src/dalvik_system_Zygote.cc
@@ -42,7 +42,7 @@
if (command.c_str() == NULL) {
return;
}
- const char *argp[] = {_PATH_BSHELL, "-c", command.c_str(), NULL};
+ const char* argp[] = {_PATH_BSHELL, "-c", command.c_str(), NULL};
LOG(INFO) << "Exec: " << argp[0] << ' ' << argp[1] << ' ' << argp[2];
execv(_PATH_BSHELL, (char**)argp);
diff --git a/src/hprof/hprof.cc b/src/hprof/hprof.cc
index 47d31fc..3c5227f 100644
--- a/src/hprof/hprof.cc
+++ b/src/hprof/hprof.cc
@@ -49,7 +49,7 @@
/*
* Initialize an Hprof.
*/
-Hprof::Hprof(const char *outputFileName, int fd, bool writeHeader, bool directToDdms)
+Hprof::Hprof(const char* outputFileName, int fd, bool writeHeader, bool directToDdms)
: current_record_(),
gc_thread_serial_number_(0),
gc_scan_state_(0),
@@ -78,7 +78,7 @@
fd_ = fd;
current_record_.alloc_length_ = 128;
- current_record_.body_ = (unsigned char *)malloc(current_record_.alloc_length_);
+ current_record_.body_ = (unsigned char*)malloc(current_record_.alloc_length_);
// TODO check for/return an error
if (writeHeader) {
@@ -147,7 +147,7 @@
// The ID for the synthetic object generated to account for class static overhead.
#define CLASS_STATICS_ID(clazz) ((HprofObjectId)(((uint32_t)(clazz)) | 1))
-HprofBasicType Hprof::SignatureToBasicTypeAndSize(const char *sig, size_t *sizeOut) {
+HprofBasicType Hprof::SignatureToBasicTypeAndSize(const char* sig, size_t* sizeOut) {
char c = sig[0];
HprofBasicType ret;
size_t size;
diff --git a/src/hprof/hprof.h b/src/hprof/hprof.h
index 7378ec9..e999dce 100644
--- a/src/hprof/hprof.h
+++ b/src/hprof/hprof.h
@@ -39,7 +39,7 @@
#define U2_TO_BUF_BE(buf, offset, value) \
do { \
- unsigned char *buf_ = (unsigned char *)(buf); \
+ unsigned char* buf_ = (unsigned char*)(buf); \
int offset_ = (int)(offset); \
uint16_t value_ = (uint16_t)(value); \
buf_[offset_ + 0] = (unsigned char)(value_ >> 8); \
@@ -48,7 +48,7 @@
#define U4_TO_BUF_BE(buf, offset, value) \
do { \
- unsigned char *buf_ = (unsigned char *)(buf); \
+ unsigned char* buf_ = (unsigned char*)(buf); \
int offset_ = (int)(offset); \
uint32_t value_ = (uint32_t)(value); \
buf_[offset_ + 0] = (unsigned char)(value_ >> 24); \
@@ -59,7 +59,7 @@
#define U8_TO_BUF_BE(buf, offset, value) \
do { \
- unsigned char *buf_ = (unsigned char *)(buf); \
+ unsigned char* buf_ = (unsigned char*)(buf); \
int offset_ = (int)(offset); \
uint64_t value_ = (uint64_t)(value); \
buf_[offset_ + 0] = (unsigned char)(value_ >> 56); \
@@ -157,9 +157,9 @@
int AddU4List(const uint32_t *values, size_t numValues);
int AddU8List(const uint64_t *values, size_t numValues);
int AddIdList(const HprofObjectId *values, size_t numValues);
- int AddUtf8String(const char *str);
+ int AddUtf8String(const char* str);
- unsigned char *body_;
+ unsigned char* body_;
uint32_t time_;
uint32_t length_;
size_t alloc_length_;
@@ -178,7 +178,7 @@
class Hprof {
public:
- Hprof(const char *outputFileName, int fd, bool writeHeader, bool directToDdms);
+ Hprof(const char* outputFileName, int fd, bool writeHeader, bool directToDdms);
~Hprof();
void VisitRoot(const Object* obj);
@@ -196,8 +196,8 @@
HprofStringId LookupStringId(const char* string);
HprofStringId LookupStringId(std::string string);
HprofStringId LookupClassNameId(Class* clazz);
- static HprofBasicType SignatureToBasicTypeAndSize(const char *sig, size_t *sizeOut);
- static HprofBasicType PrimitiveToBasicTypeAndSize(Primitive::Type prim, size_t *sizeOut);
+ static HprofBasicType SignatureToBasicTypeAndSize(const char* sig, size_t* sizeOut);
+ static HprofBasicType PrimitiveToBasicTypeAndSize(Primitive::Type prim, size_t* sizeOut);
static int StackTraceSerialNumber(const void *obj);
// current_record_ *must* be first so that we can cast from a context to a record.
@@ -212,8 +212,8 @@
// Otherwise, "file_name_" must be valid, though if "fd" >= 0 it will
// only be used for debug messages.
bool direct_to_ddms_;
- char *file_name_;
- char *file_data_ptr_; // for open_memstream
+ char* file_name_;
+ char* file_data_ptr_; // for open_memstream
size_t file_data_size_; // for open_memstream
FILE *mem_fp_;
int fd_;
diff --git a/src/hprof/hprof_record.cc b/src/hprof/hprof_record.cc
index 1813a44..ad4b43c 100644
--- a/src/hprof/hprof_record.cc
+++ b/src/hprof/hprof_record.cc
@@ -55,7 +55,7 @@
if (newAllocLen < minSize) {
newAllocLen = alloc_length_ + nmore + nmore/2;
}
- unsigned char *newBody = (unsigned char *)realloc(body_, newAllocLen);
+ unsigned char* newBody = (unsigned char*)realloc(body_, newAllocLen);
if (newBody != NULL) {
body_ = newBody;
alloc_length_ = newAllocLen;
@@ -90,7 +90,7 @@
return 0;
}
-int HprofRecord::AddUtf8String(const char *str) {
+int HprofRecord::AddUtf8String(const char* str) {
// The terminating NUL character is NOT written.
return AddU1List((const uint8_t *)str, strlen(str));
}
@@ -101,7 +101,7 @@
return err;
}
- unsigned char *insert = body_ + length_;
+ unsigned char* insert = body_ + length_;
for (size_t i = 0; i < numValues; i++) {
U2_TO_BUF_BE(insert, 0, *values++);
insert += sizeof(*values);
@@ -124,7 +124,7 @@
return err;
}
- unsigned char *insert = body_ + length_;
+ unsigned char* insert = body_ + length_;
for (size_t i = 0; i < numValues; i++) {
U4_TO_BUF_BE(insert, 0, *values++);
insert += sizeof(*values);
@@ -147,7 +147,7 @@
return err;
}
- unsigned char *insert = body_ + length_;
+ unsigned char* insert = body_ + length_;
for (size_t i = 0; i < numValues; i++) {
U8_TO_BUF_BE(insert, 0, *values++);
insert += sizeof(*values);
diff --git a/src/oatopt.cc b/src/oatopt.cc
index dd702d4..314b7ee 100644
--- a/src/oatopt.cc
+++ b/src/oatopt.cc
@@ -13,7 +13,7 @@
namespace art {
-int ProcessZipFile(int zip_fd, int cache_fd, const char* zip_name, const char *flags) {
+int ProcessZipFile(int zip_fd, int cache_fd, const char* zip_name, const char* flags) {
// TODO: need to read/write to installd opened file descriptors
if (false) {
UniquePtr<ZipArchive> zip_archive(ZipArchive::Open(zip_fd));
diff --git a/src/runtime.cc b/src/runtime.cc
index f52bca8..9e6ebb1 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -147,12 +147,12 @@
// Returns 0 (a useless size) if "s" is malformed or specifies a low or
// non-evenly-divisible value.
//
-size_t ParseMemoryOption(const char *s, size_t div) {
+size_t ParseMemoryOption(const char* s, size_t div) {
// strtoul accepts a leading [+-], which we don't want,
// so make sure our string starts with a decimal digit.
if (isdigit(*s)) {
- const char *s2;
- size_t val = strtoul(s, (char **)&s2, 10);
+ const char* s2;
+ size_t val = strtoul(s, (char**)&s2, 10);
if (s2 != s) {
// s2 should be pointing just after the number.
// If this is the end of the string, the user
diff --git a/src/utils.cc b/src/utils.cc
index c528f1c..63787a8 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -496,10 +496,10 @@
}
}
-void SetThreadName(const char *threadName) {
+void SetThreadName(const char* threadName) {
int hasAt = 0;
int hasDot = 0;
- const char *s = threadName;
+ const char* s = threadName;
while (*s) {
if (*s == '.') {
hasDot = 1;
diff --git a/src/zip_archive.h b/src/zip_archive.h
index 17c9ddc..013a3da 100644
--- a/src/zip_archive.h
+++ b/src/zip_archive.h
@@ -105,7 +105,7 @@
static ZipArchive* Open(const std::string& filename);
static ZipArchive* Open(int fd);
- ZipEntry* Find(const char * name);
+ ZipEntry* Find(const char* name);
~ZipArchive() {
Close();