diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-02-03 21:30:17 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-02-03 21:30:17 +0000 |
commit | 1962832771a435426a0ed6a1cf5069c45918b141 (patch) | |
tree | bd09e69fd031f198f98f996d8e52fec8b2403f89 /gpu/src | |
parent | 48cf8ac1442e62edc6fcd4af37e869326186d25e (diff) |
Fix warnings on linux build (strict aliasing, cons init order, vars used only in asserts)
git-svn-id: http://skia.googlecode.com/svn/trunk@756 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu/src')
-rw-r--r-- | gpu/src/GrDrawTarget.cpp | 4 | ||||
-rw-r--r-- | gpu/src/GrGLUtil.cpp | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/gpu/src/GrDrawTarget.cpp b/gpu/src/GrDrawTarget.cpp index 96afe2f8ed..0f31e9a429 100644 --- a/gpu/src/GrDrawTarget.cpp +++ b/gpu/src/GrDrawTarget.cpp @@ -243,13 +243,17 @@ void GrDrawTarget::VertexLayoutUnitTest() { GrAssert(!VertexUsesStage(s2, tcMask)); GrAssert(-1 == VertexTexCoordsForStage(s2, tcMask)); + #if GR_DEBUG GrVertexLayout posAsTex = tcMask | StagePosAsTexCoordVertexLayoutBit(s2); + #endif GrAssert(0 == VertexStageCoordOffset(s2, posAsTex)); GrAssert(VertexUsesStage(s2, posAsTex)); GrAssert(2*sizeof(GrPoint) == VertexSize(posAsTex)); GrAssert(-1 == VertexTexCoordsForStage(s2, posAsTex)); } + #if GR_DEBUG GrVertexLayout withColor = tcMask | kColor_VertexLayoutBit; + #endif GrAssert(2*sizeof(GrPoint) == VertexColorOffset(withColor)); GrAssert(2*sizeof(GrPoint) + sizeof(GrColor) == VertexSize(withColor)); } diff --git a/gpu/src/GrGLUtil.cpp b/gpu/src/GrGLUtil.cpp index 360e84e263..a8f06bacd3 100644 --- a/gpu/src/GrGLUtil.cpp +++ b/gpu/src/GrGLUtil.cpp @@ -15,6 +15,7 @@ */
#include "GrGLConfig.h"
+#include "GrTypes.h"
#include <stdio.h>
bool has_gl_extension(const char* ext) {
@@ -74,11 +75,11 @@ void gl_version(int* major, int* minor) { typedef void (*glProc)(void);
#define GET_PROC(EXT_STRUCT, PROC_NAME) \
- *((glProc*) &(EXT_STRUCT-> PROC_NAME)) = (glProc) GR_GL_PROC_ADDRESS((gl ## PROC_NAME)); \
+ *(GrTCast<glProc*>(&(EXT_STRUCT-> PROC_NAME))) = (glProc)GR_GL_PROC_ADDRESS((gl ## PROC_NAME)); \
GrAssert(NULL != EXT_STRUCT-> PROC_NAME)
#define GET_SUFFIX_PROC(EXT_STRUCT, PROC_NAME, SUFFIX) \
- *((glProc*) &(EXT_STRUCT-> PROC_NAME)) = (glProc) GR_GL_PROC_ADDRESS((gl ## PROC_NAME ## SUFFIX)); \
+ *(GrTCast<glProc*>(&(EXT_STRUCT-> PROC_NAME))) = (glProc)GR_GL_PROC_ADDRESS((gl ## PROC_NAME ## SUFFIX)); \
GrAssert(NULL != EXT_STRUCT-> PROC_NAME)
extern void GrGLInitExtensions(GrGLExts* exts) {
|