Snap for 4957529 from 9a1614b6a68a3e05e06995ca32c9e67ffb854297 to pi-qpr1-release

Change-Id: I63a7d243c57e300aa07073fcddfe7fd62dda86b9
diff --git a/system/OpenglSystemCommon/ThreadInfo.cpp b/system/OpenglSystemCommon/ThreadInfo.cpp
index 9e11624..425904e 100644
--- a/system/OpenglSystemCommon/ThreadInfo.cpp
+++ b/system/OpenglSystemCommon/ThreadInfo.cpp
@@ -18,7 +18,9 @@
 
 thread_store_t s_tls = THREAD_STORE_INITIALIZER;
 
-static bool sDefaultTlsDestructorCallback(void* ptr) { return true; }
+static bool sDefaultTlsDestructorCallback(__attribute__((__unused__)) void* ptr) {
+  return true;
+}
 static bool (*sTlsDestructorCallback)(void*) = sDefaultTlsDestructorCallback;
 
 static void tlsDestruct(void *ptr)
diff --git a/system/OpenglSystemCommon/ThreadInfo.h b/system/OpenglSystemCommon/ThreadInfo.h
index 06d9267..57fd5ef 100644
--- a/system/OpenglSystemCommon/ThreadInfo.h
+++ b/system/OpenglSystemCommon/ThreadInfo.h
@@ -21,7 +21,6 @@
 
 #include <bionic_tls.h>
 struct EGLContext_t;
-struct HostConnection;
 
 struct EGLThreadInfo
 {
diff --git a/system/OpenglSystemCommon/goldfish_dma.cpp b/system/OpenglSystemCommon/goldfish_dma.cpp
index 59adc83..046367d 100644
--- a/system/OpenglSystemCommon/goldfish_dma.cpp
+++ b/system/OpenglSystemCommon/goldfish_dma.cpp
@@ -53,7 +53,7 @@
         }
 
         res->size = sz;
-        ALOGV("%s: successfully allocated goldfish DMA region with size %lu cxt=%p fd=%d",
+        ALOGV("%s: successfully allocated goldfish DMA region with size %u cxt=%p fd=%d",
               __FUNCTION__, sz, res, res->fd);
         return 0;
     } else {
@@ -66,7 +66,7 @@
 void* goldfish_dma_map(struct goldfish_dma_context* cxt) {
     ALOGV("%s: on fd %d errno=%d", __FUNCTION__, cxt->fd, errno);
     void *mapped = mmap(0, cxt->size, PROT_WRITE, MAP_SHARED, cxt->fd, 0);
-    ALOGV("%s: cxt=%p mapped=%p size=%lu errno=%d",
+    ALOGV("%s: cxt=%p mapped=%p size=%u errno=%d",
         __FUNCTION__, cxt, mapped, cxt->size, errno);
 
     if (mapped == MAP_FAILED) {
@@ -88,13 +88,12 @@
 void goldfish_dma_write(struct goldfish_dma_context* cxt,
                                const void* to_write,
                                uint32_t sz) {
-    ALOGV("%s: cxt=%p mapped=0x%08llx to_write=%p size=%lu",
-        __FUNCTION__, cxt, cxt->mapped_addr, to_write);
+    ALOGV("%s: cxt=%p mapped=0x%08llx to_write=%p size=%u",
+        __FUNCTION__, cxt, cxt->mapped_addr, to_write, sz);
     memcpy(reinterpret_cast<void *>(cxt->mapped_addr), to_write, sz);
 }
 
 void goldfish_dma_free(goldfish_dma_context* cxt) {
-    struct goldfish_dma_ioctl_info info;
     close(cxt->fd);
 }
 
diff --git a/system/OpenglSystemCommon/qemu_pipe.h b/system/OpenglSystemCommon/qemu_pipe.h
index 47387ab..52f4ee7 100644
--- a/system/OpenglSystemCommon/qemu_pipe.h
+++ b/system/OpenglSystemCommon/qemu_pipe.h
@@ -69,7 +69,7 @@
 {
     char  buff[256];
     int   buffLen;
-    int   fd, ret;
+    int   fd;
 
     if (pipeName == NULL || pipeName[0] == '\0') {
         errno = EINVAL;
diff --git a/system/egl/egl.cpp b/system/egl/egl.cpp
index 6480736..e52c5bd 100644
--- a/system/egl/egl.cpp
+++ b/system/egl/egl.cpp
@@ -818,9 +818,10 @@
 
 // ----------------------------------------------------------------------------
 
+// Note: C99 syntax was tried here but does not work for all compilers.
 static EGLClient_eglInterface s_eglIface = {
-    .getThreadInfo = getEGLThreadInfo,
-    .getGLString = getGLString,
+    getThreadInfo: getEGLThreadInfo,
+    getGLString: getGLString,
 };
 
 #define DBG_FUNC DBG("%s\n", __FUNCTION__)