diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/cutils/open_memstream.h | 4 | ||||
-rw-r--r-- | include/log/logprint.h | 1 | ||||
-rw-r--r-- | include/private/pixelflinger/ggl_fixed.h | 2 | ||||
-rw-r--r-- | include/utils/AndroidThreads.h | 3 | ||||
-rw-r--r-- | include/utils/Compat.h | 12 | ||||
-rw-r--r-- | include/utils/RefBase.h | 6 | ||||
-rw-r--r-- | include/utils/Thread.h | 4 | ||||
-rw-r--r-- | include/ziparchive/zip_archive.h | 31 |
8 files changed, 37 insertions, 26 deletions
diff --git a/include/cutils/open_memstream.h b/include/cutils/open_memstream.h index b7998be..c1a81eb 100644 --- a/include/cutils/open_memstream.h +++ b/include/cutils/open_memstream.h @@ -19,7 +19,7 @@ #include <stdio.h> -#ifndef HAVE_OPEN_MEMSTREAM +#if defined(__APPLE__) #ifdef __cplusplus extern "C" { @@ -31,6 +31,6 @@ FILE* open_memstream(char** bufp, size_t* sizep); } #endif -#endif /*!HAVE_OPEN_MEMSTREAM*/ +#endif /* __APPLE__ */ #endif /*__CUTILS_OPEN_MEMSTREAM_H__*/ diff --git a/include/log/logprint.h b/include/log/logprint.h index 481c96e..1e42b47 100644 --- a/include/log/logprint.h +++ b/include/log/logprint.h @@ -36,6 +36,7 @@ typedef enum { FORMAT_TIME, FORMAT_THREADTIME, FORMAT_LONG, + FORMAT_COLOR, } AndroidLogPrintFormat; typedef struct AndroidLogFormat_t AndroidLogFormat; diff --git a/include/private/pixelflinger/ggl_fixed.h b/include/private/pixelflinger/ggl_fixed.h index d0493f3..787f620 100644 --- a/include/private/pixelflinger/ggl_fixed.h +++ b/include/private/pixelflinger/ggl_fixed.h @@ -190,7 +190,7 @@ inline int64_t gglMulii(int32_t x, int32_t y) ); return res; } -#elif defined(__mips__) +#elif defined(__mips__) && __mips_isa_rev < 6 /*inline MIPS implementations*/ inline GGLfixed gglMulx(GGLfixed a, GGLfixed b, int shift) CONST; diff --git a/include/utils/AndroidThreads.h b/include/utils/AndroidThreads.h index 4eee14d..3c640b6 100644 --- a/include/utils/AndroidThreads.h +++ b/include/utils/AndroidThreads.h @@ -73,9 +73,6 @@ extern void androidSetCreateThreadFunc(android_create_thread_fn func); // ------------------------------------------------------------------ // Extra functions working with raw pids. -// Get pid for the current thread. -extern pid_t androidGetTid(); - #ifdef HAVE_ANDROID_OS // Change the priority AND scheduling group of a particular thread. The priority // should be one of the ANDROID_PRIORITY constants. Returns INVALID_OPERATION diff --git a/include/utils/Compat.h b/include/utils/Compat.h index fb7748e..20a6920 100644 --- a/include/utils/Compat.h +++ b/include/utils/Compat.h @@ -19,11 +19,9 @@ #include <unistd.h> -/* Compatibility definitions for non-Linux (i.e., BSD-based) hosts. */ -#ifndef HAVE_OFF64_T -#if _FILE_OFFSET_BITS < 64 -#error "_FILE_OFFSET_BITS < 64; large files are not supported on this platform" -#endif /* _FILE_OFFSET_BITS < 64 */ +#if defined(__APPLE__) + +/* Mac OS has always had a 64-bit off_t, so it doesn't have off64_t. */ typedef off_t off64_t; @@ -31,13 +29,11 @@ static inline off64_t lseek64(int fd, off64_t offset, int whence) { return lseek(fd, offset, whence); } -#ifdef HAVE_PREAD static inline ssize_t pread64(int fd, void* buf, size_t nbytes, off64_t offset) { return pread(fd, buf, nbytes, offset); } -#endif -#endif /* !HAVE_OFF64_T */ +#endif /* __APPLE__ */ #if HAVE_PRINTF_ZD # define ZD "%zd" diff --git a/include/utils/RefBase.h b/include/utils/RefBase.h index 8e15c19..eac6a78 100644 --- a/include/utils/RefBase.h +++ b/include/utils/RefBase.h @@ -491,7 +491,8 @@ public: TYPE::renameRefId(d[i].get(), &s[i], &d[i]); } public: - Renamer(sp<TYPE>* d, sp<TYPE> const* s) : s(s), d(d) { } + Renamer(sp<TYPE>* d, sp<TYPE> const* s) : d(d), s(s) { } + virtual ~Renamer() { } }; memmove(d, s, n*sizeof(sp<TYPE>)); @@ -510,7 +511,8 @@ public: TYPE::renameRefId(d[i].get_refs(), &s[i], &d[i]); } public: - Renamer(wp<TYPE>* d, wp<TYPE> const* s) : s(s), d(d) { } + Renamer(wp<TYPE>* d, wp<TYPE> const* s) : d(d), s(s) { } + virtual ~Renamer() { } }; memmove(d, s, n*sizeof(wp<TYPE>)); diff --git a/include/utils/Thread.h b/include/utils/Thread.h index df30611..c867e95 100644 --- a/include/utils/Thread.h +++ b/include/utils/Thread.h @@ -71,8 +71,8 @@ public: bool isRunning() const; #ifdef HAVE_ANDROID_OS - // Return the thread's kernel ID, same as the thread itself calling gettid() or - // androidGetTid(), or -1 if the thread is not running. + // Return the thread's kernel ID, same as the thread itself calling gettid(), + // or -1 if the thread is not running. pid_t getTid() const; #endif diff --git a/include/ziparchive/zip_archive.h b/include/ziparchive/zip_archive.h index 1877494..7da6e84 100644 --- a/include/ziparchive/zip_archive.h +++ b/include/ziparchive/zip_archive.h @@ -21,6 +21,7 @@ #define LIBZIPARCHIVE_ZIPARCHIVE_H_ #include <stdint.h> +#include <string.h> #include <sys/types.h> #include <utils/Compat.h> @@ -33,8 +34,16 @@ enum { }; struct ZipEntryName { - const char* name; + const uint8_t* name; uint16_t name_length; + + ZipEntryName() {} + + /* + * entry_name has to be an c-style string with only ASCII characters. + */ + explicit ZipEntryName(const char* entry_name) + : name(reinterpret_cast<const uint8_t*>(entry_name)), name_length(strlen(entry_name)) {} }; /* @@ -124,24 +133,24 @@ void CloseArchive(ZipArchiveHandle handle); * and length, a call to VerifyCrcAndLengths must be made after entry data * has been processed. */ -int32_t FindEntry(const ZipArchiveHandle handle, const char* entryName, +int32_t FindEntry(const ZipArchiveHandle handle, const ZipEntryName& entryName, ZipEntry* data); /* * Start iterating over all entries of a zip file. The order of iteration * is not guaranteed to be the same as the order of elements - * in the central directory but is stable for a given zip file. |cookie| - * must point to a writeable memory location, and will be set to the value - * of an opaque cookie which can be used to make one or more calls to - * Next. + * in the central directory but is stable for a given zip file. |cookie| will + * contain the value of an opaque cookie which can be used to make one or more + * calls to Next. All calls to StartIteration must be matched by a call to + * EndIteration to free any allocated memory. * * This method also accepts an optional prefix to restrict iteration to - * entry names that start with |prefix|. + * entry names that start with |optional_prefix|. * * Returns 0 on success and negative values on failure. */ int32_t StartIteration(ZipArchiveHandle handle, void** cookie_ptr, - const char* prefix); + const ZipEntryName* optional_prefix); /* * Advance to the next element in the zipfile in iteration order. @@ -152,6 +161,12 @@ int32_t StartIteration(ZipArchiveHandle handle, void** cookie_ptr, int32_t Next(void* cookie, ZipEntry* data, ZipEntryName *name); /* + * End iteration over all entries of a zip file and frees the memory allocated + * in StartIteration. + */ +void EndIteration(void* cookie); + +/* * Uncompress and write an entry to an open file identified by |fd|. * |entry->uncompressed_length| bytes will be written to the file at * its current offset, and the file will be truncated at the end of |