aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Wachowski <mattwach@google.com>2018-08-10 12:45:18 -0700
committerLingfeng Yang <lfy@google.com>2018-09-21 11:46:02 -0700
commitdeb0a70b7a686c55b07c0acf3bb745d555dde8f7 (patch)
tree20419fdf315d0008f6a398040e53fe16026edf3b
parentdfbc1b303882abcc2a88b7e5ec0f9afebb4ba1e7 (diff)
downloaddevice_generic_goldfish-opengl-deb0a70b7a686c55b07c0acf3bb745d555dde8f7.tar.gz
device_generic_goldfish-opengl-deb0a70b7a686c55b07c0acf3bb745d555dde8f7.tar.bz2
device_generic_goldfish-opengl-deb0a70b7a686c55b07c0acf3bb745d555dde8f7.zip
Fix compiler warnings emmited from system/egl/egl.cpp.
Bug: b/80194417 Test: Recompile and check for warnings. Change-Id: Ie9c301ddb14d7c49a1106aac1255eb47d626adf1
-rw-r--r--system/egl/egl.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/system/egl/egl.cpp b/system/egl/egl.cpp
index 0afa3ff5..ecfddb6e 100644
--- a/system/egl/egl.cpp
+++ b/system/egl/egl.cpp
@@ -291,7 +291,7 @@ struct egl_surface_t {
void setTextureTarget(EGLint _texTarget) { texTarget = _texTarget; }
EGLint getTextureTarget() { return texTarget; }
- virtual void setCollectingTimestamps(EGLint collect) { }
+ virtual void setCollectingTimestamps(EGLint) { }
virtual EGLint isCollectingTimestamps() const { return EGL_FALSE; }
EGLint deletePending;
void setIsCurrent(bool isCurrent) { mIsCurrent = isCurrent; }
@@ -321,8 +321,8 @@ protected:
};
egl_surface_t::egl_surface_t(EGLDisplay dpy, EGLConfig config, EGLint surfaceType)
- : dpy(dpy), config(config), surfaceType(surfaceType), rcSurface(0),
- deletePending(0), mIsCurrent(false)
+ : dpy(dpy), config(config), deletePending(0), mIsCurrent(false),
+ surfaceType(surfaceType), rcSurface(0)
{
width = 0;
height = 0;
@@ -721,14 +721,14 @@ static std::vector<std::string> getExtStringArray() {
int extStart = 0;
int extEnd = 0;
int currentExtIndex = 0;
- int numExts = 0;
if (sWantES30OrAbove(hostStr) &&
!strstr(hostStr, kOESEGLImageExternalEssl3)) {
res.push_back(kOESEGLImageExternalEssl3);
}
- while (extEnd < strlen(hostStr)) {
+ const int hostStrLen = strlen(hostStr);
+ while (extEnd < hostStrLen) {
if (hostStr[extEnd] == ' ') {
int extSz = extEnd - extStart;
res.push_back(std::string(hostStr + extStart, extSz));
@@ -786,7 +786,7 @@ static const char *getGLString(int glEnum)
std::vector<std::string> exts = getExtStringArray();
int totalSz = 1; // null terminator
- for (int i = 0; i < exts.size(); i++) {
+ for (unsigned int i = 0; i < exts.size(); i++) {
totalSz += exts[i].size() + 1; // for space
}
@@ -796,7 +796,7 @@ static const char *getGLString(int glEnum)
memset(hostStr, 0, totalSz);
char* current = hostStr;
- for (int i = 0; i < exts.size(); i++) {
+ for (unsigned int i = 0; i < exts.size(); i++) {
memcpy(current, exts[i].c_str(), exts[i].size());
current += exts[i].size();
*current = ' ';
@@ -828,8 +828,8 @@ static const char *getGLString(int glEnum)
// ----------------------------------------------------------------------------
static EGLClient_eglInterface s_eglIface = {
- getThreadInfo: getEGLThreadInfo,
- getGLString: getGLString,
+ .getThreadInfo = getEGLThreadInfo,
+ .getGLString = getGLString,
};
#define DBG_FUNC DBG("%s\n", __FUNCTION__)
@@ -1112,7 +1112,6 @@ EGLBoolean eglDestroySurface(EGLDisplay dpy, EGLSurface eglSurface)
VALIDATE_DISPLAY_INIT(dpy, EGL_FALSE);
VALIDATE_SURFACE_RETURN(eglSurface, EGL_FALSE);
- EGLThreadInfo* tInfo = getEGLThreadInfo();
egl_surface_t* surface(static_cast<egl_surface_t*>(eglSurface));
if (surface->isCurrent()) {
surface->deletePending = 1;
@@ -1445,7 +1444,6 @@ EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_c
EGLint minorVersion = 0;
EGLint context_flags = 0;
EGLint profile_mask = 0;
- EGLint reset_notification_strategy = 0;
bool wantedMajorVersion = false;
bool wantedMinorVersion = false;