diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/aapt/AaptAssets.h | 18 | ||||
-rw-r--r-- | tools/aapt/Images.cpp | 5 | ||||
-rw-r--r-- | tools/aapt/Resource.cpp | 9 | ||||
-rw-r--r-- | tools/aapt/XMLNode.cpp | 1 | ||||
-rwxr-xr-x | tools/aidl/AST.cpp | 17 | ||||
-rwxr-xr-x | tools/aidl/AST.h | 1 | ||||
-rw-r--r-- | tools/aidl/generate_java.cpp | 7 | ||||
-rw-r--r-- | tools/aidl/options.h | 1 | ||||
-rw-r--r-- | tools/localize/Perforce.cpp | 3 | ||||
-rw-r--r-- | tools/localize/SourcePos.cpp | 1 | ||||
-rw-r--r-- | tools/localize/Values.cpp | 1 | ||||
-rw-r--r-- | tools/localize/XLIFFFile.cpp | 1 | ||||
-rw-r--r-- | tools/localize/XMLHandler.h | 1 | ||||
-rw-r--r-- | tools/localize/file_utils.cpp | 3 | ||||
-rw-r--r-- | tools/localize/file_utils.h | 1 | ||||
-rw-r--r-- | tools/localize/localize.cpp | 1 | ||||
-rw-r--r-- | tools/localize/localize_test.cpp | 1 | ||||
-rw-r--r-- | tools/localize/merge_res_and_xliff_test.cpp | 1 |
18 files changed, 40 insertions, 33 deletions
diff --git a/tools/aapt/AaptAssets.h b/tools/aapt/AaptAssets.h index 01c8140..2ef0347 100644 --- a/tools/aapt/AaptAssets.h +++ b/tools/aapt/AaptAssets.h @@ -125,7 +125,9 @@ public: { //printf("new AaptFile created %s\n", (const char*)sourceFile); } - virtual ~AaptFile() { } + virtual ~AaptFile() { + free(mData); + } const String8& getPath() const { return mPath; } const AaptGroupEntry& getGroupEntry() const { return mGroupEntry; } @@ -441,7 +443,13 @@ private: AaptSymbolEntry mDefSymbol; }; -class ResourceTypeSet; +class ResourceTypeSet : public RefBase, + public KeyedVector<String8,sp<AaptGroup> > +{ +public: + ResourceTypeSet(); +}; + /** * Asset hierarchy being operated on. @@ -449,8 +457,8 @@ class ResourceTypeSet; class AaptAssets : public AaptDir { public: - AaptAssets() : AaptDir(String8(), String8()), mHaveIncludedAssets(false) { } - virtual ~AaptAssets() { } + AaptAssets() : AaptDir(String8(), String8()), mHaveIncludedAssets(false), mRes(NULL) { } + virtual ~AaptAssets() { delete mRes; } const String8& getPackage() const { return mPackage; } void setPackage(const String8& package) { mPackage = package; mSymbolsPrivatePackage = package; } @@ -498,7 +506,7 @@ public: inline KeyedVector<String8, sp<ResourceTypeSet> >* getResources() { return mRes; } inline void - setResources(KeyedVector<String8, sp<ResourceTypeSet> >* res) { mRes = res; } + setResources(KeyedVector<String8, sp<ResourceTypeSet> >* res) { delete mRes; mRes = res; } private: String8 mPackage; diff --git a/tools/aapt/Images.cpp b/tools/aapt/Images.cpp index 0a4c68b..f2414dd 100644 --- a/tools/aapt/Images.cpp +++ b/tools/aapt/Images.cpp @@ -44,6 +44,9 @@ struct image_info } free(allocRows); } + free(info9Patch.xDivs); + free(info9Patch.yDivs); + free(info9Patch.colors); } png_uint_32 width; @@ -833,6 +836,7 @@ static void write_png(const char* imageName, int i; png_unknown_chunk unknowns[1]; + unknowns[0].data = NULL; png_bytepp outRows = (png_bytepp) malloc((int) imageInfo.height * png_sizeof(png_bytep)); if (outRows == (png_bytepp) 0) { @@ -939,6 +943,7 @@ static void write_png(const char* imageName, free(outRows[i]); } free(outRows); + free(unknowns[0].data); png_get_IHDR(write_ptr, write_info, &width, &height, &bit_depth, &color_type, &interlace_type, diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp index 49ccf71..76b9d0a 100644 --- a/tools/aapt/Resource.cpp +++ b/tools/aapt/Resource.cpp @@ -45,13 +45,6 @@ static String8 parseResourceName(const String8& leaf) } } -class ResourceTypeSet : public RefBase, - public KeyedVector<String8,sp<AaptGroup> > -{ -public: - ResourceTypeSet(); -}; - ResourceTypeSet::ResourceTypeSet() :RefBase(), KeyedVector<String8,sp<AaptGroup> >() @@ -1115,6 +1108,7 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets) printf(" Writing public definitions to %s.\n", bundle->getPublicOutputFile()); } table.writePublicDefinitions(String16(assets->getPackage()), fp); + fclose(fp); } NOISY( @@ -1132,7 +1126,6 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets) return err; } } - return err; } diff --git a/tools/aapt/XMLNode.cpp b/tools/aapt/XMLNode.cpp index 2a85bc7..832ba6c 100644 --- a/tools/aapt/XMLNode.cpp +++ b/tools/aapt/XMLNode.cpp @@ -486,6 +486,7 @@ XMLNode::XMLNode(const String8& filename, const String16& s1, const String16& s2 XMLNode::XMLNode(const String8& filename) : mFilename(filename) { + memset(&mCharsValue, 0, sizeof(mCharsValue)); } XMLNode::type XMLNode::getType() const diff --git a/tools/aidl/AST.cpp b/tools/aidl/AST.cpp index 91802a9..1856cb9 100755 --- a/tools/aidl/AST.cpp +++ b/tools/aidl/AST.cpp @@ -841,23 +841,6 @@ Document::Write(FILE* to) fprintf(to, "package %s;\n", this->package.c_str()); } - // gather the types for the import statements - set<Type*> types; - N = this->classes.size(); - for (i=0; i<N; i++) { - Class* c = this->classes[i]; - c->GatherTypes(&types); - } - - set<Type*>::iterator it; - for (it=types.begin(); it!=types.end(); it++) { - Type* t = *it; - string pkg = t->Package(); - if (pkg.length() != 0 && pkg != this->package) { - fprintf(to, "import %s;\n", t->ImportType().c_str()); - } - } - N = this->classes.size(); for (i=0; i<N; i++) { Class* c = this->classes[i]; diff --git a/tools/aidl/AST.h b/tools/aidl/AST.h index 1dedd04..aec2164 100755 --- a/tools/aidl/AST.h +++ b/tools/aidl/AST.h @@ -5,6 +5,7 @@ #include <vector> #include <set> #include <stdarg.h> +#include <stdio.h> using namespace std; diff --git a/tools/aidl/generate_java.cpp b/tools/aidl/generate_java.cpp index e3c0af0..da20d1f 100644 --- a/tools/aidl/generate_java.cpp +++ b/tools/aidl/generate_java.cpp @@ -1,6 +1,7 @@ #include "generate_java.h" #include "AST.h" #include "Type.h" +#include <string.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -133,7 +134,7 @@ StubClass::make_as_interface(Type *interfaceType) Method* m = new Method; m->comment = "/**\n * Cast an IBinder object into an "; - m->comment += interfaceType->Name(); + m->comment += interfaceType->QualifiedName(); m->comment += " interface,\n"; m->comment += " * generating a proxy if needed.\n */"; m->modifiers = PUBLIC | STATIC; @@ -323,7 +324,7 @@ generate_method(const method_type* method, Class* interface, transactCodeName += method->name.data; char transactCodeValue[50]; - sprintf(transactCodeValue, "(IBinder.FIRST_CALL_TRANSACTION + %d)", index); + sprintf(transactCodeValue, "(android.os.IBinder.FIRST_CALL_TRANSACTION + %d)", index); Field* transactCode = new Field(STATIC | FINAL, new Variable(INT_TYPE, transactCodeName)); @@ -517,7 +518,7 @@ generate_method(const method_type* method, Class* interface, new LiteralExpression("Stub." + transactCodeName), _data, _reply ? _reply : NULL_VALUE, new LiteralExpression( - oneway ? "IBinder.FLAG_ONEWAY" : "0")); + oneway ? "android.os.IBinder.FLAG_ONEWAY" : "0")); tryStatement->statements->Add(call); // throw back exceptions. diff --git a/tools/aidl/options.h b/tools/aidl/options.h index e9bf0f7..d88d988 100644 --- a/tools/aidl/options.h +++ b/tools/aidl/options.h @@ -1,6 +1,7 @@ #ifndef DEVICE_TOOLS_AIDL_H #define DEVICE_TOOLS_AIDL_H +#include <string.h> #include <string> #include <vector> diff --git a/tools/localize/Perforce.cpp b/tools/localize/Perforce.cpp index 3425668..a7f301e 100644 --- a/tools/localize/Perforce.cpp +++ b/tools/localize/Perforce.cpp @@ -5,7 +5,10 @@ #include <sstream> #include <sys/types.h> #include <unistd.h> +#include <stdlib.h> +#include <string.h> #include <sys/wait.h> +#include <cstdio> using namespace std; diff --git a/tools/localize/SourcePos.cpp b/tools/localize/SourcePos.cpp index 9d7c5c6..dd54f3a 100644 --- a/tools/localize/SourcePos.cpp +++ b/tools/localize/SourcePos.cpp @@ -2,6 +2,7 @@ #include <stdarg.h> #include <set> +#include <cstdio> using namespace std; diff --git a/tools/localize/Values.cpp b/tools/localize/Values.cpp index e396f8b..8623b97 100644 --- a/tools/localize/Values.cpp +++ b/tools/localize/Values.cpp @@ -1,5 +1,6 @@ #include "Values.h" #include <stdlib.h> +#include <cstdio> // ===================================================================================== diff --git a/tools/localize/XLIFFFile.cpp b/tools/localize/XLIFFFile.cpp index 51f81de..4e217d9 100644 --- a/tools/localize/XLIFFFile.cpp +++ b/tools/localize/XLIFFFile.cpp @@ -3,6 +3,7 @@ #include <algorithm> #include <sys/time.h> #include <time.h> +#include <cstdio> const char* const XLIFF_XMLNS = "urn:oasis:names:tc:xliff:document:1.2"; diff --git a/tools/localize/XMLHandler.h b/tools/localize/XMLHandler.h index 1130710..324385f 100644 --- a/tools/localize/XMLHandler.h +++ b/tools/localize/XMLHandler.h @@ -3,6 +3,7 @@ #include "SourcePos.h" +#include <algorithm> #include <string> #include <vector> #include <map> diff --git a/tools/localize/file_utils.cpp b/tools/localize/file_utils.cpp index bb82a9c..c0981d8 100644 --- a/tools/localize/file_utils.cpp +++ b/tools/localize/file_utils.cpp @@ -6,6 +6,9 @@ #include <sys/fcntl.h> #include <sys/stat.h> #include <errno.h> +#include <string.h> +#include <stdlib.h> +#include <cstdio> #include <host/Directories.h> #include "log.h" diff --git a/tools/localize/file_utils.h b/tools/localize/file_utils.h index 3b3fa21..7706587 100644 --- a/tools/localize/file_utils.h +++ b/tools/localize/file_utils.h @@ -4,6 +4,7 @@ #include "ValuesFile.h" #include "Configuration.h" #include <string> +#include <cstdio> using namespace std; diff --git a/tools/localize/localize.cpp b/tools/localize/localize.cpp index c0d84cc..68c03b6 100644 --- a/tools/localize/localize.cpp +++ b/tools/localize/localize.cpp @@ -15,6 +15,7 @@ #include <sstream> #include <stdio.h> #include <string.h> +#include <stdlib.h> using namespace std; diff --git a/tools/localize/localize_test.cpp b/tools/localize/localize_test.cpp index 63d904c..931ea95 100644 --- a/tools/localize/localize_test.cpp +++ b/tools/localize/localize_test.cpp @@ -1,3 +1,4 @@ +#include <cstdio> #include "XLIFFFile.h" #include "ValuesFile.h" #include "localize.h" diff --git a/tools/localize/merge_res_and_xliff_test.cpp b/tools/localize/merge_res_and_xliff_test.cpp index 5a2b0f4..f638a74 100644 --- a/tools/localize/merge_res_and_xliff_test.cpp +++ b/tools/localize/merge_res_and_xliff_test.cpp @@ -1,3 +1,4 @@ +#include <cstdio> #include "merge_res_and_xliff.h" |