diff options
35 files changed, 110 insertions, 100 deletions
diff --git a/cmds/atrace/atrace.cpp b/cmds/atrace/atrace.cpp index b500a6b477..34dc9fef8d 100644 --- a/cmds/atrace/atrace.cpp +++ b/cmds/atrace/atrace.cpp @@ -17,6 +17,7 @@  #include <errno.h>  #include <fcntl.h>  #include <getopt.h> +#include <inttypes.h>  #include <signal.h>  #include <stdarg.h>  #include <stdbool.h> @@ -368,7 +369,7 @@ static bool pokeBinderServices()  static bool setTagsProperty(uint64_t tags)  {      char buf[64]; -    snprintf(buf, 64, "%#llx", tags); +    snprintf(buf, 64, "%#" PRIx64, tags);      if (property_set(k_traceTagsProperty, buf) < 0) {          fprintf(stderr, "error setting trace tags system property\n");          return false; @@ -665,7 +666,7 @@ static void dumpTrace()      close(traceFD);  } -static void handleSignal(int signo) +static void handleSignal(int /*signo*/)  {      if (!g_nohup) {          g_traceAborted = true; diff --git a/cmds/flatland/Composers.cpp b/cmds/flatland/Composers.cpp index 15cdb29e82..1173a81069 100644 --- a/cmds/flatland/Composers.cpp +++ b/cmds/flatland/Composers.cpp @@ -122,12 +122,12 @@ public:      virtual void tearDown() {      } -    virtual bool compose(GLuint texName, const sp<GLConsumer>& glc) { +    virtual bool compose(GLuint /*texName*/, const sp<GLConsumer>& /*glc*/) {          return true;      }  protected: -    virtual bool setUp(GLHelper* helper) { +    virtual bool setUp(GLHelper* /*helper*/) {          return true;      } diff --git a/cmds/flatland/GLHelper.cpp b/cmds/flatland/GLHelper.cpp index 42694b3236..05d082b5f7 100644 --- a/cmds/flatland/GLHelper.cpp +++ b/cmds/flatland/GLHelper.cpp @@ -332,7 +332,7 @@ static bool compileShader(GLenum shaderType, const char* src,  static void printShaderSource(const char* const* src) {      for (size_t i = 0; i < MAX_SHADER_LINES && src[i] != NULL; i++) { -        fprintf(stderr, "%3d: %s\n", i+1, src[i]); +        fprintf(stderr, "%3zu: %s\n", i+1, src[i]);      }  } diff --git a/cmds/flatland/Main.cpp b/cmds/flatland/Main.cpp index e80dbb1505..866203f3f2 100644 --- a/cmds/flatland/Main.cpp +++ b/cmds/flatland/Main.cpp @@ -600,7 +600,7 @@ static bool runTest(const BenchmarkDesc b, size_t run) {      uint32_t runHeight = b.runHeights[run];      uint32_t runWidth = b.width * runHeight / b.height; -    printf(" %-*s | %4d x %4d | ", g_BenchmarkNameLen, b.name, +    printf(" %-*s | %4d x %4d | ", static_cast<int>(g_BenchmarkNameLen), b.name,              runWidth, runHeight);      fflush(stdout); @@ -690,8 +690,9 @@ static void printResultsTableHeader() {      size_t len = strlen(scenario);      size_t leftPad = (g_BenchmarkNameLen - len) / 2;      size_t rightPad = g_BenchmarkNameLen - len - leftPad; -    printf(" %*s%s%*s | Resolution  | Time (ms)\n", leftPad, "", -            "Scenario", rightPad, ""); +    printf(" %*s%s%*s | Resolution  | Time (ms)\n", +            static_cast<int>(leftPad), "", +            "Scenario", static_cast<int>(rightPad), "");  }  // Run ALL the benchmarks! diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index 10244ac764..f1f6f99721 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -14,6 +14,7 @@  ** limitations under the License.  */ +#include <inttypes.h>  #include <sys/capability.h>  #include "installd.h"  #include <diskusage/dirsize.h> @@ -157,7 +158,7 @@ int fix_uid(const char *pkgname, uid_t uid, gid_t gid)      if (stat(pkgdir, &s) < 0) return -1;      if (s.st_uid != 0 || s.st_gid != 0) { -        ALOGE("fixing uid of non-root pkg: %s %lu %lu\n", pkgdir, s.st_uid, s.st_gid); +        ALOGE("fixing uid of non-root pkg: %s %" PRIu32 " %" PRIu32 "\n", pkgdir, s.st_uid, s.st_gid);          return -1;      } diff --git a/cmds/installd/utils.c b/cmds/installd/utils.c index 0642330e8b..8f4da65313 100644 --- a/cmds/installd/utils.c +++ b/cmds/installd/utils.c @@ -435,7 +435,7 @@ static void _inc_num_cache_collected(cache_t* cache)  {      cache->numCollected++;      if ((cache->numCollected%20000) == 0) { -        ALOGI("Collected cache so far: %d directories, %d files", +        ALOGI("Collected cache so far: %zd directories, %zd files",              cache->numDirs, cache->numFiles);      }  } @@ -730,7 +730,7 @@ void clear_cache_files(cache_t* cache, int64_t free_size)      int skip = 0;      char path[PATH_MAX]; -    ALOGI("Collected cache files: %d directories, %d files", +    ALOGI("Collected cache files: %zd directories, %zd files",          cache->numDirs, cache->numFiles);      CACHE_NOISY(ALOGI("Sorting files...")); diff --git a/libs/ui/FramebufferNativeWindow.cpp b/libs/ui/FramebufferNativeWindow.cpp index 31a69b2119..918f2e7567 100644 --- a/libs/ui/FramebufferNativeWindow.cpp +++ b/libs/ui/FramebufferNativeWindow.cpp @@ -259,8 +259,8 @@ int FramebufferNativeWindow::dequeueBuffer(ANativeWindow* window,      return 0;  } -int FramebufferNativeWindow::lockBuffer_DEPRECATED(ANativeWindow* window,  -        ANativeWindowBuffer* buffer) +int FramebufferNativeWindow::lockBuffer_DEPRECATED(ANativeWindow* /*window*/,  +        ANativeWindowBuffer* /*buffer*/)  {      return NO_ERROR;  } @@ -326,7 +326,7 @@ int FramebufferNativeWindow::query(const ANativeWindow* window,      return BAD_VALUE;  } -int FramebufferNativeWindow::perform(ANativeWindow* window, +int FramebufferNativeWindow::perform(ANativeWindow* /*window*/,          int operation, ...)  {      switch (operation) { diff --git a/libs/ui/Region.cpp b/libs/ui/Region.cpp index 7de48a460e..fa812f4dae 100644 --- a/libs/ui/Region.cpp +++ b/libs/ui/Region.cpp @@ -16,6 +16,7 @@  #define LOG_TAG "Region" +#include <inttypes.h>  #include <limits.h>  #include <utils/Log.h> @@ -814,7 +815,7 @@ void Region::dump(String8& out, const char* what, uint32_t flags) const      size_t SIZE = 256;      char buffer[SIZE]; -    snprintf(buffer, SIZE, "  Region %s (this=%p, count=%d)\n", +    snprintf(buffer, SIZE, "  Region %s (this=%p, count=%" PRIdPTR ")\n",              what, this, tail-head);      out.append(buffer);      while (head != tail) { @@ -830,7 +831,7 @@ void Region::dump(const char* what, uint32_t flags) const      (void)flags;      const_iterator head = begin();      const_iterator const tail = end(); -    ALOGD("  Region %s (this=%p, count=%d)\n", what, this, tail-head); +    ALOGD("  Region %s (this=%p, count=%" PRIdPTR ")\n", what, this, tail-head);      while (head != tail) {          ALOGD("    [%3d, %3d, %3d, %3d]\n",                  head->left, head->top, head->right, head->bottom); diff --git a/opengl/libagl/BufferObjectManager.h b/opengl/libagl/BufferObjectManager.h index 9e9340adcb..6487faa5bd 100644 --- a/opengl/libagl/BufferObjectManager.h +++ b/opengl/libagl/BufferObjectManager.h @@ -69,10 +69,10 @@ private:      KeyedVector<GLuint, gl::buffer_t*>  mBuffers;  }; -void EGLBufferObjectManager::incStrong(const void* id) const { +void EGLBufferObjectManager::incStrong(const void* /*id*/) const {      android_atomic_inc(&mCount);  } -void EGLBufferObjectManager::decStrong(const void* id) const { +void EGLBufferObjectManager::decStrong(const void* /*id*/) const {      if (android_atomic_dec(&mCount) == 1) {          delete this;      } diff --git a/opengl/libagl/array.cpp b/opengl/libagl/array.cpp index 7fbe9b5f96..54207fa212 100644 --- a/opengl/libagl/array.cpp +++ b/opengl/libagl/array.cpp @@ -397,9 +397,9 @@ void vertex_cache_t::clear()      }  } +#if VC_CACHE_STATISTICS  void vertex_cache_t::dump_stats(GLenum mode)  { -#if VC_CACHE_STATISTICS      nsecs_t time = systemTime(SYSTEM_TIME_THREAD) - startTime;      uint32_t hits = total - misses;      uint32_t prim_count; @@ -418,8 +418,12 @@ void vertex_cache_t::dump_stats(GLenum mode)              total, hits, misses, (hits*100)/total,              prim_count, int(ns2us(time)), int(prim_count*float(seconds(1))/time),              float(misses) / prim_count); -#endif  } +#else +void vertex_cache_t::dump_stats(GLenum /*mode*/) +{ +} +#endif  // ----------------------------------------------------------------------------  #if 0 diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp index f925e7dc4e..1feac8b261 100644 --- a/opengl/libagl/egl.cpp +++ b/opengl/libagl/egl.cpp @@ -206,7 +206,7 @@ EGLint egl_surface_t::getSwapBehavior() const {      return EGL_BUFFER_PRESERVED;  }  EGLBoolean egl_surface_t::setSwapRectangle( -        EGLint l, EGLint t, EGLint w, EGLint h) +        EGLint /*l*/, EGLint /*t*/, EGLint /*w*/, EGLint /*h*/)  {      return EGL_FALSE;  } @@ -793,7 +793,7 @@ struct config_management_t {      static bool mask(GLint reqValue, GLint confValue) {          return (confValue & reqValue) == reqValue;      } -    static bool ignore(GLint reqValue, GLint confValue) { +    static bool ignore(GLint /*reqValue*/, GLint /*confValue*/) {          return true;      }  }; @@ -1197,7 +1197,7 @@ static int makeCurrent(ogles_context_t* gl)      return 0;  } -static EGLBoolean getConfigAttrib(EGLDisplay dpy, EGLConfig config, +static EGLBoolean getConfigAttrib(EGLDisplay /*dpy*/, EGLConfig config,          EGLint attribute, EGLint *value)  {      size_t numConfigs =  NELEM(gConfigs); @@ -1227,7 +1227,7 @@ static EGLBoolean getConfigAttrib(EGLDisplay dpy, EGLConfig config,  }  static EGLSurface createWindowSurface(EGLDisplay dpy, EGLConfig config, -        NativeWindowType window, const EGLint *attrib_list) +        NativeWindowType window, const EGLint* /*attrib_list*/)  {      if (egl_display_t::is_valid(dpy) == EGL_FALSE)          return setError(EGL_BAD_DISPLAY, EGL_NO_SURFACE); @@ -1276,7 +1276,7 @@ static EGLSurface createWindowSurface(EGLDisplay dpy, EGLConfig config,  }  static EGLSurface createPixmapSurface(EGLDisplay dpy, EGLConfig config, -        NativePixmapType pixmap, const EGLint *attrib_list) +        NativePixmapType pixmap, const EGLint* /*attrib_list*/)  {      if (egl_display_t::is_valid(dpy) == EGL_FALSE)          return setError(EGL_BAD_DISPLAY, EGL_NO_SURFACE); @@ -1655,7 +1655,7 @@ EGLBoolean eglQuerySurface( EGLDisplay dpy, EGLSurface eglSurface,  }  EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config, -                            EGLContext share_list, const EGLint *attrib_list) +                            EGLContext /*share_list*/, const EGLint* /*attrib_list*/)  {      if (egl_display_t::is_valid(dpy) == EGL_FALSE)          return setError(EGL_BAD_DISPLAY, EGL_NO_SURFACE); @@ -1853,7 +1853,7 @@ EGLBoolean eglWaitGL(void)      return EGL_TRUE;  } -EGLBoolean eglWaitNative(EGLint engine) +EGLBoolean eglWaitNative(EGLint /*engine*/)  {      return EGL_TRUE;  } @@ -1887,8 +1887,8 @@ EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface draw)      return EGL_TRUE;  } -EGLBoolean eglCopyBuffers(  EGLDisplay dpy, EGLSurface surface, -                            NativePixmapType target) +EGLBoolean eglCopyBuffers(  EGLDisplay dpy, EGLSurface /*surface*/, +                            NativePixmapType /*target*/)  {      if (egl_display_t::is_valid(dpy) == EGL_FALSE)          return setError(EGL_BAD_DISPLAY, EGL_FALSE); @@ -1924,7 +1924,7 @@ const char* eglQueryString(EGLDisplay dpy, EGLint name)  // ----------------------------------------------------------------------------  EGLBoolean eglSurfaceAttrib( -        EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value) +        EGLDisplay dpy, EGLSurface /*surface*/, EGLint /*attribute*/, EGLint /*value*/)  {      if (egl_display_t::is_valid(dpy) == EGL_FALSE)          return setError(EGL_BAD_DISPLAY, EGL_FALSE); @@ -1933,7 +1933,7 @@ EGLBoolean eglSurfaceAttrib(  }  EGLBoolean eglBindTexImage( -        EGLDisplay dpy, EGLSurface surface, EGLint buffer) +        EGLDisplay dpy, EGLSurface /*surface*/, EGLint /*buffer*/)  {      if (egl_display_t::is_valid(dpy) == EGL_FALSE)          return setError(EGL_BAD_DISPLAY, EGL_FALSE); @@ -1942,7 +1942,7 @@ EGLBoolean eglBindTexImage(  }  EGLBoolean eglReleaseTexImage( -        EGLDisplay dpy, EGLSurface surface, EGLint buffer) +        EGLDisplay dpy, EGLSurface /*surface*/, EGLint /*buffer*/)  {      if (egl_display_t::is_valid(dpy) == EGL_FALSE)          return setError(EGL_BAD_DISPLAY, EGL_FALSE); @@ -1950,7 +1950,7 @@ EGLBoolean eglReleaseTexImage(      return setError(EGL_BAD_PARAMETER, EGL_FALSE);  } -EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval) +EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint /*interval*/)  {      if (egl_display_t::is_valid(dpy) == EGL_FALSE)          return setError(EGL_BAD_DISPLAY, EGL_FALSE); @@ -1987,8 +1987,8 @@ EGLBoolean eglReleaseThread(void)  }  EGLSurface eglCreatePbufferFromClientBuffer( -          EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, -          EGLConfig config, const EGLint *attrib_list) +          EGLDisplay dpy, EGLenum /*buftype*/, EGLClientBuffer /*buffer*/, +          EGLConfig /*config*/, const EGLint* /*attrib_list*/)  {      if (egl_display_t::is_valid(dpy) == EGL_FALSE)          return setError(EGL_BAD_DISPLAY, EGL_NO_SURFACE); @@ -2011,21 +2011,21 @@ void (*eglGetProcAddress (const char *procname))()      return NULL;  } -EGLBoolean eglLockSurfaceKHR(EGLDisplay dpy, EGLSurface surface, -        const EGLint *attrib_list) +EGLBoolean eglLockSurfaceKHR(EGLDisplay /*dpy*/, EGLSurface /*surface*/, +        const EGLint* /*attrib_list*/)  {      EGLBoolean result = EGL_FALSE;      return result;  } -EGLBoolean eglUnlockSurfaceKHR(EGLDisplay dpy, EGLSurface surface) +EGLBoolean eglUnlockSurfaceKHR(EGLDisplay /*dpy*/, EGLSurface /*surface*/)  {      EGLBoolean result = EGL_FALSE;      return result;  }  EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx, EGLenum target, -        EGLClientBuffer buffer, const EGLint *attrib_list) +        EGLClientBuffer buffer, const EGLint* /*attrib_list*/)  {      if (egl_display_t::is_valid(dpy) == EGL_FALSE) {          return setError(EGL_BAD_DISPLAY, EGL_NO_IMAGE_KHR); @@ -2106,7 +2106,7 @@ EGLSyncKHR eglCreateSyncKHR(EGLDisplay dpy, EGLenum type,      return FENCE_SYNC_HANDLE;  } -EGLBoolean eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync) +EGLBoolean eglDestroySyncKHR(EGLDisplay /*dpy*/, EGLSyncKHR sync)  {      if (sync != FENCE_SYNC_HANDLE) {          return setError(EGL_BAD_PARAMETER, EGL_FALSE); @@ -2115,8 +2115,8 @@ EGLBoolean eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync)      return EGL_TRUE;  } -EGLint eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, -        EGLTimeKHR timeout) +EGLint eglClientWaitSyncKHR(EGLDisplay /*dpy*/, EGLSyncKHR sync, EGLint /*flags*/, +        EGLTimeKHR /*timeout*/)  {      if (sync != FENCE_SYNC_HANDLE) {          return setError(EGL_BAD_PARAMETER, EGL_FALSE); @@ -2125,7 +2125,7 @@ EGLint eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags,      return EGL_CONDITION_SATISFIED_KHR;  } -EGLBoolean eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, +EGLBoolean eglGetSyncAttribKHR(EGLDisplay /*dpy*/, EGLSyncKHR sync,          EGLint attribute, EGLint *value)  {      if (sync != FENCE_SYNC_HANDLE) { diff --git a/opengl/libagl/light.cpp b/opengl/libagl/light.cpp index fafec3fa2c..479bf7ee07 100644 --- a/opengl/libagl/light.cpp +++ b/opengl/libagl/light.cpp @@ -105,7 +105,7 @@ void ogles_init_light(ogles_context_t* c)      c->lighting.shadeModel = GL_SMOOTH;  } -void ogles_uninit_light(ogles_context_t* c) +void ogles_uninit_light(ogles_context_t* /*c*/)  {  } @@ -285,7 +285,7 @@ void ogles_invalidate_lighting_mvui(ogles_context_t* c)      invalidate_lighting(c);  } -void lightVertexNop(ogles_context_t*, vertex_t* v) +void lightVertexNop(ogles_context_t*, vertex_t* /*v*/)  {      // we should never end-up here  } diff --git a/opengl/libagl/primitives.cpp b/opengl/libagl/primitives.cpp index 769ec404a8..57a798deb3 100644 --- a/opengl/libagl/primitives.cpp +++ b/opengl/libagl/primitives.cpp @@ -94,7 +94,7 @@ static void lightTriangleDarkSmooth(ogles_context_t* c,  }  static void lightTriangleDarkFlat(ogles_context_t* c, -        vertex_t* v0, vertex_t* v1, vertex_t* v2) +        vertex_t* /*v0*/, vertex_t* /*v1*/, vertex_t* v2)  {      if (!(v2->flags & vertex_t::LIT)) {          v2->flags |= vertex_t::LIT; @@ -118,7 +118,7 @@ static void lightTriangleSmooth(ogles_context_t* c,  }  static void lightTriangleFlat(ogles_context_t* c, -        vertex_t* v0, vertex_t* v1, vertex_t* v2) +        vertex_t* /*v0*/, vertex_t* /*v1*/, vertex_t* v2)  {      if (!(v2->flags & vertex_t::LIT))          c->lighting.lightVertex(c, v2); @@ -567,8 +567,8 @@ void primitive_line(ogles_context_t* c, vertex_t* v0, vertex_t* v1)  #pragma mark Triangle  #endif -void primitive_nop_triangle(ogles_context_t* c, -        vertex_t* v0, vertex_t* v1, vertex_t* v2) { +void primitive_nop_triangle(ogles_context_t* /*c*/, +        vertex_t* /*v0*/, vertex_t* /*v1*/, vertex_t* /*v2*/) {  }  void primitive_clip_triangle(ogles_context_t* c, @@ -823,7 +823,7 @@ void lerp_texcoords_w(ogles_context_t* c,  static inline -bool cull_triangle(ogles_context_t* c, vertex_t* v0, vertex_t* v1, vertex_t* v2) +bool cull_triangle(ogles_context_t* c, vertex_t* /*v0*/, vertex_t* /*v1*/, vertex_t* /*v2*/)  {      if (ggl_likely(c->cull.enable)) {          const GLenum winding = (c->lerp.area() > 0) ? GL_CW : GL_CCW; diff --git a/opengl/libagl/state.cpp b/opengl/libagl/state.cpp index 4bc653a02a..1d5def5896 100644 --- a/opengl/libagl/state.cpp +++ b/opengl/libagl/state.cpp @@ -219,11 +219,11 @@ using namespace android;  #endif  // These ones are super-easy, we're not supporting those features! -void glSampleCoverage(GLclampf value, GLboolean invert) { +void glSampleCoverage(GLclampf /*value*/, GLboolean /*invert*/) {  } -void glSampleCoveragex(GLclampx value, GLboolean invert) { +void glSampleCoveragex(GLclampx /*value*/, GLboolean /*invert*/) {  } -void glStencilFunc(GLenum func, GLint ref, GLuint mask) { +void glStencilFunc(GLenum func, GLint /*ref*/, GLuint /*mask*/) {      ogles_context_t* c = ogles_context_t::get();      if (func < GL_NEVER || func > GL_ALWAYS) {          ogles_error(c, GL_INVALID_ENUM); diff --git a/opengl/libagl/texture.cpp b/opengl/libagl/texture.cpp index 08536dfd25..9aa1c4f867 100644 --- a/opengl/libagl/texture.cpp +++ b/opengl/libagl/texture.cpp @@ -1223,10 +1223,10 @@ void glTexImage2D(  // ----------------------------------------------------------------------------  void glCompressedTexSubImage2D( -        GLenum target, GLint level, GLint xoffset, -        GLint yoffset, GLsizei width, GLsizei height, -        GLenum format, GLsizei imageSize, -        const GLvoid *data) +        GLenum /*target*/, GLint /*level*/, GLint /*xoffset*/, +        GLint /*yoffset*/, GLsizei /*width*/, GLsizei /*height*/, +        GLenum /*format*/, GLsizei /*imageSize*/, +        const GLvoid* /*data*/)  {      ogles_context_t* c = ogles_context_t::get();      ogles_error(c, GL_INVALID_ENUM); diff --git a/opengl/libagl/vertex.cpp b/opengl/libagl/vertex.cpp index dad04d6cb5..9aacdb3c89 100644 --- a/opengl/libagl/vertex.cpp +++ b/opengl/libagl/vertex.cpp @@ -41,7 +41,7 @@ void ogles_init_vertex(ogles_context_t* c)      c->currentNormal.z = 0x10000;  } -void ogles_uninit_vertex(ogles_context_t* c) +void ogles_uninit_vertex(ogles_context_t* /*c*/)  {  } diff --git a/opengl/libs/EGL/egl_display.cpp b/opengl/libs/EGL/egl_display.cpp index 26240f1bcd..7784ca6ace 100644 --- a/opengl/libs/EGL/egl_display.cpp +++ b/opengl/libs/EGL/egl_display.cpp @@ -313,7 +313,7 @@ void egl_display_t::loseCurrentImpl(egl_context_t * cur_c)  }  EGLBoolean egl_display_t::makeCurrent(egl_context_t* c, egl_context_t* cur_c, -        EGLSurface draw, EGLSurface read, EGLContext ctx, +        EGLSurface draw, EGLSurface read, EGLContext /*ctx*/,          EGLSurface impl_draw, EGLSurface impl_read, EGLContext impl_ctx)  {      EGLBoolean result; diff --git a/opengl/libs/GLES_CM/gl.cpp b/opengl/libs/GLES_CM/gl.cpp index 18ef6f9ad1..893577b725 100644 --- a/opengl/libs/GLES_CM/gl.cpp +++ b/opengl/libs/GLES_CM/gl.cpp @@ -53,34 +53,34 @@ GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,  }  void glColorPointerBounds(GLint size, GLenum type, GLsizei stride, -        const GLvoid *ptr, GLsizei count) { +        const GLvoid *ptr, GLsizei /*count*/) {      glColorPointer(size, type, stride, ptr);  }  void glNormalPointerBounds(GLenum type, GLsizei stride, -        const GLvoid *pointer, GLsizei count) { +        const GLvoid *pointer, GLsizei /*count*/) {      glNormalPointer(type, stride, pointer);  }  void glTexCoordPointerBounds(GLint size, GLenum type, -        GLsizei stride, const GLvoid *pointer, GLsizei count) { +        GLsizei stride, const GLvoid *pointer, GLsizei /*count*/) {      glTexCoordPointer(size, type, stride, pointer);  }  void glVertexPointerBounds(GLint size, GLenum type, -        GLsizei stride, const GLvoid *pointer, GLsizei count) { +        GLsizei stride, const GLvoid *pointer, GLsizei /*count*/) {      glVertexPointer(size, type, stride, pointer);  }  void GL_APIENTRY glPointSizePointerOESBounds(GLenum type, -        GLsizei stride, const GLvoid *pointer, GLsizei count) { +        GLsizei stride, const GLvoid *pointer, GLsizei /*count*/) {      glPointSizePointerOES(type, stride, pointer);  }  GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type, -        GLsizei stride, const GLvoid *pointer, GLsizei count) { +        GLsizei stride, const GLvoid *pointer, GLsizei /*count*/) {      glMatrixIndexPointerOES(size, type, stride, pointer);  }  GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type, -        GLsizei stride, const GLvoid *pointer, GLsizei count) { +        GLsizei stride, const GLvoid *pointer, GLsizei /*count*/) {      glWeightPointerOES(size, type, stride, pointer);  } diff --git a/opengl/libs/GLES_trace/src/gltrace_egl.cpp b/opengl/libs/GLES_trace/src/gltrace_egl.cpp index 9d1682a59f..4f9b006a62 100644 --- a/opengl/libs/GLES_trace/src/gltrace_egl.cpp +++ b/opengl/libs/GLES_trace/src/gltrace_egl.cpp @@ -71,7 +71,7 @@ void GLTrace_eglMakeCurrent(int contextId) {      glContext->traceGLMessage(&glmessage);  } -void GLTrace_eglSwapBuffers(void *dpy, void *draw) { +void GLTrace_eglSwapBuffers(void* /*dpy*/, void* /*draw*/) {      GLMessage glmessage;      GLTraceContext *glContext = getGLTraceContext(); diff --git a/services/sensorservice/CorrectedGyroSensor.cpp b/services/sensorservice/CorrectedGyroSensor.cpp index 31487a7910..b07d5448a6 100644 --- a/services/sensorservice/CorrectedGyroSensor.cpp +++ b/services/sensorservice/CorrectedGyroSensor.cpp @@ -61,7 +61,7 @@ status_t CorrectedGyroSensor::activate(void* ident, bool enabled) {      return mSensorFusion.activate(ident, enabled);  } -status_t CorrectedGyroSensor::setDelay(void* ident, int handle, int64_t ns) { +status_t CorrectedGyroSensor::setDelay(void* ident, int /*handle*/, int64_t ns) {      mSensorDevice.setDelay(ident, mGyro.getHandle(), ns);      return mSensorFusion.setDelay(ident, ns);  } diff --git a/services/sensorservice/GravitySensor.cpp b/services/sensorservice/GravitySensor.cpp index dd1f650a2d..3cb3745202 100644 --- a/services/sensorservice/GravitySensor.cpp +++ b/services/sensorservice/GravitySensor.cpp @@ -70,7 +70,7 @@ status_t GravitySensor::activate(void* ident, bool enabled) {      return mSensorFusion.activate(ident, enabled);  } -status_t GravitySensor::setDelay(void* ident, int handle, int64_t ns) { +status_t GravitySensor::setDelay(void* ident, int /*handle*/, int64_t ns) {      return mSensorFusion.setDelay(ident, ns);  } diff --git a/services/sensorservice/OrientationSensor.cpp b/services/sensorservice/OrientationSensor.cpp index 10b391cac3..6d85cca0f6 100644 --- a/services/sensorservice/OrientationSensor.cpp +++ b/services/sensorservice/OrientationSensor.cpp @@ -69,7 +69,7 @@ status_t OrientationSensor::activate(void* ident, bool enabled) {      return mSensorFusion.activate(ident, enabled);  } -status_t OrientationSensor::setDelay(void* ident, int handle, int64_t ns) { +status_t OrientationSensor::setDelay(void* ident, int /*handle*/, int64_t ns) {      return mSensorFusion.setDelay(ident, ns);  } diff --git a/services/sensorservice/RotationVectorSensor.cpp b/services/sensorservice/RotationVectorSensor.cpp index a2157b4196..cb305ebf8d 100644 --- a/services/sensorservice/RotationVectorSensor.cpp +++ b/services/sensorservice/RotationVectorSensor.cpp @@ -56,7 +56,7 @@ status_t RotationVectorSensor::activate(void* ident, bool enabled) {      return mSensorFusion.activate(ident, enabled);  } -status_t RotationVectorSensor::setDelay(void* ident, int handle, int64_t ns) { +status_t RotationVectorSensor::setDelay(void* ident, int /*handle*/, int64_t ns) {      return mSensorFusion.setDelay(ident, ns);  } @@ -105,7 +105,7 @@ status_t GyroDriftSensor::activate(void* ident, bool enabled) {      return mSensorFusion.activate(ident, enabled);  } -status_t GyroDriftSensor::setDelay(void* ident, int handle, int64_t ns) { +status_t GyroDriftSensor::setDelay(void* ident, int /*handle*/, int64_t ns) {      return mSensorFusion.setDelay(ident, ns);  } diff --git a/services/sensorservice/SensorDevice.cpp b/services/sensorservice/SensorDevice.cpp index 19caa5c95a..3b64f0a8bc 100644 --- a/services/sensorservice/SensorDevice.cpp +++ b/services/sensorservice/SensorDevice.cpp @@ -78,7 +78,7 @@ void SensorDevice::dump(String8& result)      Mutex::Autolock _l(mLock);      for (size_t i=0 ; i<size_t(count) ; i++) {          const Info& info = mActivationCount.valueFor(list[i].handle); -        result.appendFormat("handle=0x%08x, active-count=%d, batch_period(ms)={ ", list[i].handle, +        result.appendFormat("handle=0x%08x, active-count=%zu, batch_period(ms)={ ", list[i].handle,                              info.batchParams.size());          for (size_t j = 0; j < info.batchParams.size(); j++) {              BatchParams params = info.batchParams.valueAt(j); @@ -87,7 +87,7 @@ void SensorDevice::dump(String8& result)          }          result.appendFormat(" }, selected=%4.1f ms\n", info.bestBatchParams.batchDelay / 1e6f); -        result.appendFormat("handle=0x%08x, active-count=%d, batch_timeout(ms)={ ", list[i].handle, +        result.appendFormat("handle=0x%08x, active-count=%zu, batch_timeout(ms)={ ", list[i].handle,                              info.batchParams.size());          for (size_t j = 0; j < info.batchParams.size(); j++) {              BatchParams params = info.batchParams.valueAt(j); @@ -309,7 +309,7 @@ int SensorDevice::getHalDeviceVersion() const {      return mSensorDevice->common.version;  } -status_t SensorDevice::flush(void* ident, int handle) { +status_t SensorDevice::flush(void* /*ident*/, int handle) {      if (getHalDeviceVersion() < SENSORS_DEVICE_API_VERSION_1_1) {          return INVALID_OPERATION;      } diff --git a/services/sensorservice/SensorFusion.cpp b/services/sensorservice/SensorFusion.cpp index 8512d6b7dc..6d93009176 100644 --- a/services/sensorservice/SensorFusion.cpp +++ b/services/sensorservice/SensorFusion.cpp @@ -139,7 +139,7 @@ int32_t SensorFusion::getMinDelay() const {  void SensorFusion::dump(String8& result) {      const Fusion& fusion(mFusion); -    result.appendFormat("9-axis fusion %s (%d clients), gyro-rate=%7.2fHz, " +    result.appendFormat("9-axis fusion %s (%zd clients), gyro-rate=%7.2fHz, "              "q=< %g, %g, %g, %g > (%g), "              "b=< %g, %g, %g >\n",              mEnabled ? "enabled" : "disabled", diff --git a/services/sensorservice/SensorInterface.cpp b/services/sensorservice/SensorInterface.cpp index f1d16634b5..2bf5e72840 100644 --- a/services/sensorservice/SensorInterface.cpp +++ b/services/sensorservice/SensorInterface.cpp @@ -50,7 +50,7 @@ status_t HardwareSensor::activate(void* ident, bool enabled) {      return mSensorDevice.activate(ident, mSensor.getHandle(), enabled);  } -status_t HardwareSensor::batch(void* ident, int handle, int flags, +status_t HardwareSensor::batch(void* ident, int /*handle*/, int flags,                                 int64_t samplingPeriodNs, int64_t maxBatchReportLatencyNs) {      return mSensorDevice.batch(ident, mSensor.getHandle(), flags, samplingPeriodNs,                                 maxBatchReportLatencyNs); diff --git a/services/sensorservice/SensorInterface.h b/services/sensorservice/SensorInterface.h index c295e22dca..3e76377166 100644 --- a/services/sensorservice/SensorInterface.h +++ b/services/sensorservice/SensorInterface.h @@ -40,7 +40,7 @@ public:      virtual status_t setDelay(void* ident, int handle, int64_t ns) = 0;      // Not all sensors need to support batching. -    virtual status_t batch(void* ident, int handle, int flags, int64_t samplingPeriodNs, +    virtual status_t batch(void* ident, int handle, int /*flags*/, int64_t samplingPeriodNs,                             int64_t maxBatchReportLatencyNs) {          if (maxBatchReportLatencyNs == 0) {              return setDelay(ident, handle, samplingPeriodNs); @@ -48,13 +48,13 @@ public:          return -EINVAL;      } -    virtual status_t flush(void* ident, int handle) { +    virtual status_t flush(void* /*ident*/, int /*handle*/) {          return -EINVAL;      }      virtual Sensor getSensor() const = 0;      virtual bool isVirtual() const = 0; -    virtual void autoDisable(void *ident, int handle) { } +    virtual void autoDisable(void* /*ident*/, int /*handle*/) { }  };  // --------------------------------------------------------------------------- diff --git a/services/sensorservice/SensorService.cpp b/services/sensorservice/SensorService.cpp index c8aed8b385..f0bfe2ca03 100644 --- a/services/sensorservice/SensorService.cpp +++ b/services/sensorservice/SensorService.cpp @@ -14,8 +14,9 @@   * limitations under the License.   */ -#include <stdint.h> +#include <inttypes.h>  #include <math.h> +#include <stdint.h>  #include <sys/types.h>  #include <cutils/properties.h> @@ -153,7 +154,7 @@ void SensorService::onFirstRef()              char line[128];              if (fp != NULL && fgets(line, sizeof(line), fp) != NULL) {                  line[sizeof(line) - 1] = '\0'; -                sscanf(line, "%u", &mSocketBufferSize); +                sscanf(line, "%zu", &mSocketBufferSize);                  if (mSocketBufferSize > MAX_SOCKET_BUFFER_SIZE_BATCHED) {                      mSocketBufferSize = MAX_SOCKET_BUFFER_SIZE_BATCHED;                  } @@ -200,7 +201,7 @@ SensorService::~SensorService()  static const String16 sDump("android.permission.DUMP"); -status_t SensorService::dump(int fd, const Vector<String16>& args) +status_t SensorService::dump(int fd, const Vector<String16>& /*args*/)  {      String8 result;      if (!PermissionCache::checkCallingPermission(sDump)) { @@ -257,7 +258,7 @@ status_t SensorService::dump(int fd, const Vector<String16>& args)                      result.appendFormat( "last=<%f>\n", e.data[0]);                      break;                  case SENSOR_TYPE_STEP_COUNTER: -                    result.appendFormat( "last=<%llu>\n", e.u64.step_counter); +                    result.appendFormat( "last=<%" PRIu64 ">\n", e.u64.step_counter);                      break;                  default:                      // default to 3 values @@ -273,19 +274,19 @@ status_t SensorService::dump(int fd, const Vector<String16>& args)          result.append("Active sensors:\n");          for (size_t i=0 ; i<mActiveSensors.size() ; i++) {              int handle = mActiveSensors.keyAt(i); -            result.appendFormat("%s (handle=0x%08x, connections=%d)\n", +            result.appendFormat("%s (handle=0x%08x, connections=%zu)\n",                      getSensorName(handle).string(),                      handle,                      mActiveSensors.valueAt(i)->getNumConnections());          } -        result.appendFormat("%u Max Socket Buffer size\n", mSocketBufferSize); -        result.appendFormat("%d active connections\n", mActiveConnections.size()); +        result.appendFormat("%zu Max Socket Buffer size\n", mSocketBufferSize); +        result.appendFormat("%zd active connections\n", mActiveConnections.size());          for (size_t i=0 ; i < mActiveConnections.size() ; i++) {              sp<SensorEventConnection> connection(mActiveConnections[i].promote());              if (connection != 0) { -                result.appendFormat("Connection Number: %d \n", i); +                result.appendFormat("Connection Number: %zu \n", i);                  connection->dump(result);              }          } diff --git a/services/sensorservice/main_sensorservice.cpp b/services/sensorservice/main_sensorservice.cpp index 303b65f9ab..0a96f42973 100644 --- a/services/sensorservice/main_sensorservice.cpp +++ b/services/sensorservice/main_sensorservice.cpp @@ -19,7 +19,7 @@  using namespace android; -int main(int argc, char** argv) { +int main(int /*argc*/, char** /*argv*/) {      SensorService::publishAndJoinThreadPool();      return 0;  } diff --git a/services/surfaceflinger/DispSync.cpp b/services/surfaceflinger/DispSync.cpp index ce07ab56c1..602f20a46c 100644 --- a/services/surfaceflinger/DispSync.cpp +++ b/services/surfaceflinger/DispSync.cpp @@ -287,7 +287,7 @@ class ZeroPhaseTracer : public DispSync::Callback {  public:      ZeroPhaseTracer() : mParity(false) {} -    virtual void onDispSyncEvent(nsecs_t when) { +    virtual void onDispSyncEvent(nsecs_t /*when*/) {          mParity = !mParity;          ATRACE_INT("ZERO_PHASE_VSYNC", mParity ? 1 : 0);      } diff --git a/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp b/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp index 0f34764bd3..086ccf8947 100644 --- a/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp +++ b/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp @@ -72,7 +72,7 @@ status_t FramebufferSurface::beginFrame(bool mustRecompose) {      return NO_ERROR;  } -status_t FramebufferSurface::prepareFrame(CompositionType compositionType) { +status_t FramebufferSurface::prepareFrame(CompositionType /*compositionType*/) {      return NO_ERROR;  } diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp index 0ca93c8ce9..a6f8d15856 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp +++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp @@ -16,12 +16,13 @@  #define ATRACE_TAG ATRACE_TAG_GRAPHICS +#include <inttypes.h> +#include <math.h>  #include <stdint.h>  #include <stdio.h>  #include <stdlib.h>  #include <string.h>  #include <sys/types.h> -#include <math.h>  #include <utils/Errors.h>  #include <utils/misc.h> @@ -1032,12 +1033,12 @@ void HWComposer::dump(String8& result) const {                      mFlinger->getLayerSortedByZForHwcDisplay(i);              result.appendFormat( -                    "  Display[%d] : %ux%u, xdpi=%f, ydpi=%f, refresh=%lld\n", +                    "  Display[%zd] : %ux%u, xdpi=%f, ydpi=%f, refresh=%" PRId64 "\n",                      i, disp.width, disp.height, disp.xdpi, disp.ydpi, disp.refresh);              if (disp.list) {                  result.appendFormat( -                        "  numHwLayers=%u, flags=%08x\n", +                        "  numHwLayers=%zu, flags=%08x\n",                          disp.list->numHwLayers, disp.list->flags);                  result.append( @@ -1076,7 +1077,7 @@ void HWComposer::dump(String8& result) const {                      if (hwcHasApiVersion(mHwc, HWC_DEVICE_API_VERSION_1_3)) {                          result.appendFormat( -                                " %10s | %08x | %08x | %08x | %02x | %05x | %08x | [%7.1f,%7.1f,%7.1f,%7.1f] | [%5d,%5d,%5d,%5d] %s\n", +                                " %10s | %08" PRIxPTR " | %08x | %08x | %02x | %05x | %08x | [%7.1f,%7.1f,%7.1f,%7.1f] | [%5d,%5d,%5d,%5d] %s\n",                                          compositionTypeName[type],                                          intptr_t(l.handle), l.hints, l.flags, l.transform, l.blending, format,                                          l.sourceCropf.left, l.sourceCropf.top, l.sourceCropf.right, l.sourceCropf.bottom, @@ -1084,7 +1085,7 @@ void HWComposer::dump(String8& result) const {                                          name.string());                      } else {                          result.appendFormat( -                                " %10s | %08x | %08x | %08x | %02x | %05x | %08x | [%7d,%7d,%7d,%7d] | [%5d,%5d,%5d,%5d] %s\n", +                                " %10s | %08" PRIxPTR " | %08x | %08x | %02x | %05x | %08x | [%7d,%7d,%7d,%7d] | [%5d,%5d,%5d,%5d] %s\n",                                          compositionTypeName[type],                                          intptr_t(l.handle), l.hints, l.flags, l.transform, l.blending, format,                                          l.sourceCrop.left, l.sourceCrop.top, l.sourceCrop.right, l.sourceCrop.bottom, diff --git a/services/surfaceflinger/MessageQueue.cpp b/services/surfaceflinger/MessageQueue.cpp index cc672b67dd..1ad86a6aca 100644 --- a/services/surfaceflinger/MessageQueue.cpp +++ b/services/surfaceflinger/MessageQueue.cpp @@ -179,7 +179,7 @@ int MessageQueue::cb_eventReceiver(int fd, int events, void* data) {      return queue->eventReceiver(fd, events);  } -int MessageQueue::eventReceiver(int fd, int events) { +int MessageQueue::eventReceiver(int /*fd*/, int /*events*/) {      ssize_t n;      DisplayEventReceiver::Event buffer[8];      while ((n = DisplayEventReceiver::getEvents(mEventTube, buffer, 8)) > 0) { diff --git a/services/surfaceflinger/RenderEngine/GLES11RenderEngine.cpp b/services/surfaceflinger/RenderEngine/GLES11RenderEngine.cpp index 521a5d2619..cbff320a94 100644 --- a/services/surfaceflinger/RenderEngine/GLES11RenderEngine.cpp +++ b/services/surfaceflinger/RenderEngine/GLES11RenderEngine.cpp @@ -237,7 +237,7 @@ void GLES11RenderEngine::drawMesh(const Mesh& mesh) {      }  } -void GLES11RenderEngine::beginGroup(const mat4& colorTransform) { +void GLES11RenderEngine::beginGroup(const mat4& /*colorTransform*/) {      // doesn't do anything in GLES 1.1  } diff --git a/services/surfaceflinger/RenderEngine/Program.cpp b/services/surfaceflinger/RenderEngine/Program.cpp index 4a7fb58d26..0424e0cca0 100644 --- a/services/surfaceflinger/RenderEngine/Program.cpp +++ b/services/surfaceflinger/RenderEngine/Program.cpp @@ -25,7 +25,7 @@  namespace android { -Program::Program(const ProgramCache::Key& needs, const char* vertex, const char* fragment) +Program::Program(const ProgramCache::Key& /*needs*/, const char* vertex, const char* fragment)          : mInitialized(false) {      GLuint vertexId = buildShader(vertex, GL_VERTEX_SHADER);      GLuint fragmentId = buildShader(fragment, GL_FRAGMENT_SHADER); @@ -112,7 +112,7 @@ GLuint Program::buildShader(const char* source, GLenum type) {      return shader;  } -String8& Program::dumpShader(String8& result, GLenum type) { +String8& Program::dumpShader(String8& result, GLenum /*type*/) {      GLuint shader = GL_FRAGMENT_SHADER ? mFragmentShader : mVertexShader;      GLint l;      glGetShaderiv(shader, GL_SHADER_SOURCE_LENGTH, &l);  |