From 92dc3fc52cf097bd105460cf377779bdcf146d62 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Wed, 12 Mar 2014 13:12:44 -0700 Subject: [PATCH] native frameworks: 64-bit compile issues - Fix format (print/scanf) - Suppress unused argument warning messages (bonus) Change-Id: I05c7724d2aba6da1e82a86000e11f3a8fef4e728 --- cmds/atrace/atrace.cpp | 5 +- cmds/flatland/Composers.cpp | 4 +- cmds/flatland/GLHelper.cpp | 2 +- cmds/flatland/Main.cpp | 7 +-- cmds/installd/commands.c | 3 +- cmds/installd/utils.c | 4 +- libs/ui/FramebufferNativeWindow.cpp | 6 +-- libs/ui/Region.cpp | 5 +- opengl/libagl/BufferObjectManager.h | 4 +- opengl/libagl/array.cpp | 8 +++- opengl/libagl/egl.cpp | 46 +++++++++---------- opengl/libagl/light.cpp | 4 +- opengl/libagl/primitives.cpp | 10 ++-- opengl/libagl/state.cpp | 6 +-- opengl/libagl/texture.cpp | 8 ++-- opengl/libagl/vertex.cpp | 2 +- opengl/libs/EGL/egl_display.cpp | 2 +- opengl/libs/GLES_CM/gl.cpp | 14 +++--- opengl/libs/GLES_trace/src/gltrace_egl.cpp | 2 +- .../sensorservice/CorrectedGyroSensor.cpp | 2 +- services/sensorservice/GravitySensor.cpp | 2 +- services/sensorservice/OrientationSensor.cpp | 2 +- .../sensorservice/RotationVectorSensor.cpp | 4 +- services/sensorservice/SensorDevice.cpp | 6 +-- services/sensorservice/SensorFusion.cpp | 2 +- services/sensorservice/SensorInterface.cpp | 2 +- services/sensorservice/SensorInterface.h | 6 +-- services/sensorservice/SensorService.cpp | 17 +++---- services/sensorservice/main_sensorservice.cpp | 2 +- services/surfaceflinger/DispSync.cpp | 2 +- .../DisplayHardware/FramebufferSurface.cpp | 2 +- .../DisplayHardware/HWComposer.cpp | 11 +++-- services/surfaceflinger/MessageQueue.cpp | 2 +- .../RenderEngine/GLES11RenderEngine.cpp | 2 +- .../surfaceflinger/RenderEngine/Program.cpp | 4 +- 35 files changed, 110 insertions(+), 100 deletions(-) diff --git a/cmds/atrace/atrace.cpp b/cmds/atrace/atrace.cpp index b500a6b47..34dc9fef8 100644 --- a/cmds/atrace/atrace.cpp +++ b/cmds/atrace/atrace.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -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 15cdb29e8..1173a8106 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& glc) { + virtual bool compose(GLuint /*texName*/, const sp& /*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 42694b323..05d082b5f 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 d6ac3d259..c0e5b3dab 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(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(leftPad), "", + "Scenario", static_cast(rightPad), ""); } // Run ALL the benchmarks! diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index 10244ac76..f1f6f9972 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -14,6 +14,7 @@ ** limitations under the License. */ +#include #include #include "installd.h" #include @@ -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 0642330e8..8f4da6531 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 31a69b211..918f2e756 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 e5abcf5c8..6d58f5649 100644 --- a/libs/ui/Region.cpp +++ b/libs/ui/Region.cpp @@ -16,6 +16,7 @@ #define LOG_TAG "Region" +#include #include #include @@ -798,7 +799,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) { @@ -814,7 +815,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 9e9340adc..6487faa5b 100644 --- a/opengl/libagl/BufferObjectManager.h +++ b/opengl/libagl/BufferObjectManager.h @@ -69,10 +69,10 @@ private: KeyedVector 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 7fbe9b5f9..54207fa21 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 f925e7dc4..1feac8b26 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 fafec3fa2..479bf7ee0 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 769ec404a..57a798deb 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 4bc653a02..1d5def589 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 08536dfd2..9aa1c4f86 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 dad04d6cb..9aacdb3c8 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 26240f1bc..7784ca6ac 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 18ef6f9ad..893577b72 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 9d1682a59..4f9b006a6 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 31487a791..b07d5448a 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 dd1f650a2..3cb374520 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 10b391cac..6d85cca0f 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 a2157b419..cb305ebf8 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 19caa5c95..3b64f0a8b 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 ; icommon.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 03f94beb0..bb97286c2 100644 --- a/services/sensorservice/SensorFusion.cpp +++ b/services/sensorservice/SensorFusion.cpp @@ -147,7 +147,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 f1d16634b..2bf5e7284 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 c295e22dc..3e7637716 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 a2f433279..9cc75c637 100644 --- a/services/sensorservice/SensorService.cpp +++ b/services/sensorservice/SensorService.cpp @@ -14,8 +14,9 @@ * limitations under the License. */ -#include +#include #include +#include #include #include @@ -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& args) +status_t SensorService::dump(int fd, const Vector& /*args*/) { String8 result; if (!PermissionCache::checkCallingPermission(sDump)) { @@ -257,7 +258,7 @@ status_t SensorService::dump(int fd, const Vector& 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& args) result.append("Active sensors:\n"); for (size_t i=0 ; igetNumConnections()); } - 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 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 303b65f9a..0a96f4297 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 ce07ab56c..602f20a46 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 8c634ed64..7d4b1969f 100644 --- a/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp +++ b/services/surfaceflinger/DisplayHardware/FramebufferSurface.cpp @@ -72,7 +72,7 @@ status_t FramebufferSurface::beginFrame() { 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 1b652c354..a48582e70 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp +++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp @@ -16,12 +16,13 @@ #define ATRACE_TAG ATRACE_TAG_GRAPHICS +#include +#include #include #include #include #include #include -#include #include #include @@ -1022,12 +1023,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( @@ -1066,7 +1067,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, @@ -1074,7 +1075,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 cc672b67d..1ad86a6ac 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 521a5d261..cbff320a9 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 4a7fb58d2..0424e0cca 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);