am d4dabf87: am cdbf28b3: Merge "native frameworks: 64-bit compile issues"

* commit 'd4dabf872ac0a12e12aebae9032f7d62762c2aeb':
  native frameworks: 64-bit compile issues
This commit is contained in:
Mark Salyzyn 2014-03-13 23:12:09 +00:00 committed by Android Git Automerger
commit 993146092f
35 changed files with 110 additions and 100 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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]);
}
}

View File

@ -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!

View File

@ -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;
}

View File

@ -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..."));

View File

@ -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) {

View File

@ -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);

View File

@ -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;
}

View File

@ -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

View File

@ -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) {

View File

@ -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
}

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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*/)
{
}

View File

@ -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;

View File

@ -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);
}

View File

@ -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();

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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",

View File

@ -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);

View File

@ -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*/) { }
};
// ---------------------------------------------------------------------------

View File

@ -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);
}
}

View File

@ -19,7 +19,7 @@
using namespace android;
int main(int argc, char** argv) {
int main(int /*argc*/, char** /*argv*/) {
SensorService::publishAndJoinThreadPool();
return 0;
}

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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,

View File

@ -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) {

View File

@ -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
}

View File

@ -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);