Fix build with warnings turned on.

This commit is contained in:
Thomas Voß 2017-01-19 20:36:01 +01:00
commit 4d457153b7
29 changed files with 90 additions and 71 deletions

View file

@ -1,6 +1,10 @@
# Don't treat any warnings as error as we take the source directly from
# upstream and just compile it.
set(CMAKE_C_FLAGS "-Wall")
set(CMAKE_CXX_FLAGS "-std=c++11 -Wall")
# Ensure -fPIC
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
include_directories(
${CMAKE_SOURCE_DIR}/src

View file

@ -1,6 +1,8 @@
#ifndef __gl_h_
#define __gl_h_
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wredundant-decls"
/* $Revision: 10601 $ on $Date:: 2010-03-04 22:15:27 -0800 #$ */
#include <GLES/glplatform.h>
@ -766,5 +768,7 @@ GL_API void GL_APIENTRY glPointSizePointerOES (GLenum type, GLsizei stride, cons
}
#endif
#pragma GCC diagnostic pop
#endif /* __gl_h_ */

View file

@ -44,7 +44,7 @@ public:
if (!m_buf || len > m_bufsize) {
int allocLen = m_bufsize < len ? len : m_bufsize;
m_buf = (unsigned char *)allocBuffer(allocLen);
m_buf = static_cast<unsigned char *>(allocBuffer(allocLen));
if (!m_buf)
return NULL;
m_bufsize = m_free = allocLen;

View file

@ -24,9 +24,9 @@
#define TRACE_CHECKSUMHELPER 0
#if TRACE_CHECKSUMHELPER
#define LOG_CHECKSUMHELPER(x...) fprintf(stderr, x)
#define LOG_CHECKSUMHELPER(...) fprintf(stderr, __VA_ARGS__)
#else
#define LOG_CHECKSUMHELPER(x...)
#define LOG_CHECKSUMHELPER(...)
#endif
// ChecksumCalculator adds checksum as an array of bytes to GL pipe communication, which

View file

@ -37,5 +37,5 @@ void glUtilsPackPointerData(unsigned char *dst, unsigned char *str,
int glUtilsPixelBitSize(GLenum format, GLenum type);
#ifdef __cplusplus
};
}
#endif

View file

@ -14,6 +14,9 @@
* limitations under the License.
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wredundant-decls"
typedef void (*logger_t)(const char* fmt, ...);
extern logger_t emugl_logger;
extern logger_t emugl_cxt_logger;
@ -35,3 +38,5 @@ void set_emugl_cxt_logger(logger_t f);
#else
#define GL_LOG(...) 0
#endif
#pragma GCC diagnostic pop