fix warnings on Mac in src/pipe

Fix these class of warnings:
- unused functions
- unused locals
- sign mismatch
- missing function prototypes
- missing newline at end of file
- 64 to 32 bit truncation

The changes prefer to link in dead code in the debug build
with 'if (false)' than to comment it out, but trivial cases
are commented out or sometimes deleted if it appears to be
a copy/paste error.
Review URL: https://codereview.appspot.com/6302045

git-svn-id: http://skia.googlecode.com/svn/trunk@4177 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
caryclark@google.com 2012-06-06 12:04:11 +00:00
parent 679ab317cd
commit 920901da53
2 changed files with 11 additions and 11 deletions

View File

@ -95,19 +95,19 @@ enum DrawOps {
#define DRAWOPS_FLAG_MASK ((1 << DRAWOPS_FLAG_BITS) - 1)
#define DRAWOPS_DATA_MASK ((1 << DRAWOPS_DATA_BITS) - 1)
static unsigned DrawOp_unpackOp(uint32_t op32) {
static inline unsigned DrawOp_unpackOp(uint32_t op32) {
return (op32 >> (DRAWOPS_FLAG_BITS + DRAWOPS_DATA_BITS));
}
static unsigned DrawOp_unpackFlags(uint32_t op32) {
static inline unsigned DrawOp_unpackFlags(uint32_t op32) {
return (op32 >> DRAWOPS_DATA_BITS) & DRAWOPS_FLAG_MASK;
}
static unsigned DrawOp_unpackData(uint32_t op32) {
static inline unsigned DrawOp_unpackData(uint32_t op32) {
return op32 & DRAWOPS_DATA_MASK;
}
static uint32_t DrawOp_packOpFlagData(DrawOps op, unsigned flags, unsigned data) {
static inline uint32_t DrawOp_packOpFlagData(DrawOps op, unsigned flags, unsigned data) {
SkASSERT(0 == (op & ~DRAWOPS_OP_MASK));
SkASSERT(0 == (flags & ~DRAWOPS_FLAG_MASK));
SkASSERT(0 == (data & ~DRAWOPS_DATA_MASK));
@ -168,32 +168,32 @@ enum PaintOps {
#define PAINTOPS_FLAG_MASK ((1 << PAINTOPS_FLAG_BITS) - 1)
#define PAINTOPS_DATA_MASK ((1 << PAINTOPS_DATA_BITS) - 1)
static unsigned PaintOp_unpackOp(uint32_t op32) {
static inline unsigned PaintOp_unpackOp(uint32_t op32) {
return (op32 >> (PAINTOPS_FLAG_BITS + PAINTOPS_DATA_BITS));
}
static unsigned PaintOp_unpackFlags(uint32_t op32) {
static inline unsigned PaintOp_unpackFlags(uint32_t op32) {
return (op32 >> PAINTOPS_DATA_BITS) & PAINTOPS_FLAG_MASK;
}
static unsigned PaintOp_unpackData(uint32_t op32) {
static inline unsigned PaintOp_unpackData(uint32_t op32) {
return op32 & PAINTOPS_DATA_MASK;
}
static uint32_t PaintOp_packOp(PaintOps op) {
static inline uint32_t PaintOp_packOp(PaintOps op) {
SkASSERT(0 == (op & ~PAINTOPS_OP_MASK));
return op << (PAINTOPS_FLAG_BITS + PAINTOPS_DATA_BITS);
}
static uint32_t PaintOp_packOpData(PaintOps op, unsigned data) {
static inline uint32_t PaintOp_packOpData(PaintOps op, unsigned data) {
SkASSERT(0 == (op & ~PAINTOPS_OP_MASK));
SkASSERT(0 == (data & ~PAINTOPS_DATA_MASK));
return (op << (PAINTOPS_FLAG_BITS + PAINTOPS_DATA_BITS)) | data;
}
static uint32_t PaintOp_packOpFlagData(PaintOps op, unsigned flags, unsigned data) {
static inline uint32_t PaintOp_packOpFlagData(PaintOps op, unsigned flags, unsigned data) {
SkASSERT(0 == (op & ~PAINTOPS_OP_MASK));
SkASSERT(0 == (flags & ~PAINTOPS_FLAG_MASK));
SkASSERT(0 == (data & ~PAINTOPS_DATA_MASK));

View File

@ -577,7 +577,7 @@ SkGPipeReader::Status SkGPipeReader::playback(const void* data, size_t length,
while (!reader.eof()) {
uint32_t op32 = reader.readU32();
unsigned op = DrawOp_unpackOp(op32);
SkDEBUGCODE(DrawOps drawOp = (DrawOps)op;)
// SkDEBUGCODE(DrawOps drawOp = (DrawOps)op;)
if (op >= SK_ARRAY_COUNT(gReadTable)) {
SkDebugf("---- bad op during GPipeState::playback\n");