Merge "Try using goldfish_pipe as the device name"
diff --git a/modules/gralloc/Android.mk b/modules/gralloc/Android.mk
index e1fd7d4..a4ffd20 100644
--- a/modules/gralloc/Android.mk
+++ b/modules/gralloc/Android.mk
@@ -26,8 +26,8 @@
gralloc.cpp \
framebuffer.cpp \
mapper.cpp
-
+
LOCAL_MODULE := gralloc.default
-LOCAL_CFLAGS:= -DLOG_TAG=\"gralloc\"
+LOCAL_CFLAGS:= -DLOG_TAG=\"gralloc\" -Wno-missing-field-initializers
include $(BUILD_SHARED_LIBRARY)
diff --git a/modules/gralloc/gralloc.cpp b/modules/gralloc/gralloc.cpp
index f832f35..bdc789d 100644
--- a/modules/gralloc/gralloc.cpp
+++ b/modules/gralloc/gralloc.cpp
@@ -166,7 +166,7 @@
}
static int gralloc_alloc_buffer(alloc_device_t* dev,
- size_t size, int usage, buffer_handle_t* pHandle)
+ size_t size, int /*usage*/, buffer_handle_t* pHandle)
{
int err = 0;
int fd = -1;
diff --git a/modules/gralloc/gralloc_priv.h b/modules/gralloc/gralloc_priv.h
index 86a5d52..22a5715 100644
--- a/modules/gralloc/gralloc_priv.h
+++ b/modules/gralloc/gralloc_priv.h
@@ -75,11 +75,13 @@
int offset;
// FIXME: the attributes below should be out-of-line
- int base;
+ uintptr_t base;
int pid;
#ifdef __cplusplus
- static const int sNumInts = 6;
+ static inline int sNumInts() {
+ return (((sizeof(private_handle_t) - sizeof(native_handle_t))/sizeof(int)) - sNumFds);
+ }
static const int sNumFds = 1;
static const int sMagic = 0x3141592;
@@ -88,7 +90,7 @@
base(0), pid(getpid())
{
version = sizeof(native_handle);
- numInts = sNumInts;
+ numInts = sNumInts();
numFds = sNumFds;
}
~private_handle_t() {
@@ -98,7 +100,7 @@
static int validate(const native_handle* h) {
const private_handle_t* hnd = (const private_handle_t*)h;
if (!h || h->version != sizeof(native_handle) ||
- h->numInts != sNumInts || h->numFds != sNumFds ||
+ h->numInts != sNumInts() || h->numFds != sNumFds ||
hnd->magic != sMagic)
{
ALOGE("invalid gralloc handle (at %p)", h);
diff --git a/modules/gralloc/mapper.cpp b/modules/gralloc/mapper.cpp
index 13baf2a..5a882e2 100644
--- a/modules/gralloc/mapper.cpp
+++ b/modules/gralloc/mapper.cpp
@@ -43,7 +43,7 @@
/*****************************************************************************/
-static int gralloc_map(gralloc_module_t const* module,
+static int gralloc_map(gralloc_module_t const* /*module*/,
buffer_handle_t handle,
void** vaddr)
{
@@ -56,7 +56,7 @@
ALOGE("Could not mmap %s", strerror(errno));
return -errno;
}
- hnd->base = intptr_t(mappedAddress) + hnd->offset;
+ hnd->base = uintptr_t(mappedAddress) + hnd->offset;
//ALOGD("gralloc_map() succeeded fd=%d, off=%d, size=%d, vaddr=%p",
// hnd->fd, hnd->offset, hnd->size, mappedAddress);
}
@@ -64,7 +64,7 @@
return 0;
}
-static int gralloc_unmap(gralloc_module_t const* module,
+static int gralloc_unmap(gralloc_module_t const* /*module*/,
buffer_handle_t handle)
{
private_handle_t* hnd = (private_handle_t*)handle;
@@ -163,9 +163,9 @@
return 0;
}
-int gralloc_lock(gralloc_module_t const* module,
- buffer_handle_t handle, int usage,
- int l, int t, int w, int h,
+int gralloc_lock(gralloc_module_t const* /*module*/,
+ buffer_handle_t handle, int /*usage*/,
+ int /*l*/, int /*t*/, int /*w*/, int /*h*/,
void** vaddr)
{
// this is called when a buffer is being locked for software
@@ -184,7 +184,7 @@
return 0;
}
-int gralloc_unlock(gralloc_module_t const* module,
+int gralloc_unlock(gralloc_module_t const* /*module*/,
buffer_handle_t handle)
{
// we're done with a software buffer. nothing to do in this