Bug 605179 - Fix build warnings in gfx/; r=roc a=bsmedberg

--HG--
extra : rebase_source : f9bd24d5f4bc6124b431ce22e6ac72bd218dc208
This commit is contained in:
Ms2ger 2010-12-05 18:38:12 +00:00
parent 80fcc6ed53
commit 3ec44ade0c
14 changed files with 41 additions and 27 deletions

View File

@ -212,7 +212,9 @@ LayerManagerOGL::Initialize(GLContext *aExistingContext)
// NOTE: Order matters here, and should be in the same order as the
// ProgramType enum!
#ifdef DEBUG
GLint programIndex = 0;
#endif
/* Layer programs */
SHADER_PROGRAM(RGBALayerProgramType, ColorTextureLayerProgram,

View File

@ -1,3 +1,4 @@
/*
// qcms
// Copyright (C) 2009 Mozilla Foundation
// Copyright (C) 1998-2007 Marti Maria
@ -19,6 +20,7 @@
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <math.h>
#include <assert.h>

View File

@ -94,7 +94,7 @@ typedef enum {
QCMS_INTENT_ABSOLUTE_COLORIMETRIC = 3
} qcms_intent;
//XXX: I don't really like the _DATA_ prefix
/* XXX: I don't really like the _DATA_ prefix */
typedef enum {
QCMS_DATA_RGB_8,
QCMS_DATA_RGBA_8,

View File

@ -113,7 +113,7 @@ struct tag_value {
} XYZNumber;
} XYZType;
};
}; // I guess we need to pack this?
}; /* I guess we need to pack this? */
#endif
#define RGB_SIGNATURE 0x52474220

View File

@ -30,7 +30,7 @@ typedef PRUptrdiff uintptr_t;
#endif
#endif
#else // MOZ_QCMS
#else /* MOZ_QCMS */
#if BYTE_ORDER == LITTLE_ENDIAN
#define IS_LITTLE_ENDIAN

View File

@ -1,3 +1,4 @@
/*
// qcms
// Copyright (C) 2009 Mozilla Corporation
// Copyright (C) 1998-2007 Marti Maria
@ -19,6 +20,7 @@
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <stdlib.h>
#include <math.h>

View File

@ -1103,7 +1103,7 @@ nsThebesDeviceContext::CalcPrintingSize()
PRBool inPoints = PR_TRUE;
gfxSize size;
gfxSize size(0, 0);
switch (mPrintingSurface->GetType()) {
case gfxASurface::SurfaceTypeImage:
inPoints = PR_FALSE;

View File

@ -1,5 +1,5 @@
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* ***** BEGIN LICENSE BLOCK *****
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
@ -636,7 +636,7 @@ CreateOffscreenPixmapContext(const gfxIntSize& aSize,
"glXChooseFBConfig() failed to match our requested format and violated its spec (!)");
ScopedXFree<XVisualInfo> vinfo;
int chosenIndex;
int chosenIndex = 0;
for (int i = 0; i < numConfigs; ++i) {
int dtype, visid;

View File

@ -477,9 +477,9 @@ static const char *sSurfaceNamesForSurfaceType[] = {
PR_STATIC_ASSERT(NS_ARRAY_LENGTH(sSurfaceNamesForSurfaceType) == gfxASurface::SurfaceTypeMax);
#ifdef CAIRO_HAS_D2D_SURFACE
PR_STATIC_ASSERT(CAIRO_SURFACE_TYPE_D2D == gfxASurface::SurfaceTypeD2D);
PR_STATIC_ASSERT(PRUint32(CAIRO_SURFACE_TYPE_D2D) == PRUint32(gfxASurface::SurfaceTypeD2D));
#endif
PR_STATIC_ASSERT(CAIRO_SURFACE_TYPE_SKIA == gfxASurface::SurfaceTypeSkia);
PR_STATIC_ASSERT(PRUint32(CAIRO_SURFACE_TYPE_SKIA) == PRUint32(gfxASurface::SurfaceTypeSkia));
static const char *
SurfaceMemoryReporterPathForType(gfxASurface::gfxSurfaceType aType)

View File

@ -294,6 +294,9 @@ static void ComputeLobes(PRInt32 aRadius, PRInt32 aLobes[3][2])
major = final = z + 1;
minor = z;
break;
default:
NS_ERROR("Mathematical impossibility.");
major = minor = final = 0;
}
NS_ASSERTION(major + minor + final == aRadius,
"Lobes don't sum to the right length");

View File

@ -1,5 +1,5 @@
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* ***** BEGIN LICENSE BLOCK *****
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version

View File

@ -1,5 +1,5 @@
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* ***** BEGIN LICENSE BLOCK *****
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
@ -532,7 +532,7 @@ gfxFontUtils::FindPreferredSubtable(const PRUint8 *aBuf, PRUint32 aBufLength,
// PRUint16 version = ReadShortAt(aBuf, OffsetVersion); // Unused: self-documenting.
PRUint16 numTables = ReadShortAt(aBuf, OffsetNumTables);
if (aBufLength < SizeOfHeader + numTables * SizeOfTable) {
if (aBufLength < PRUint32(SizeOfHeader + numTables * SizeOfTable)) {
return 0;
}
@ -1084,8 +1084,9 @@ gfxFontUtils::ValidateSFNTHeaders(const PRUint8 *aFontData,
PRBool foundHead = PR_FALSE, foundOS2 = PR_FALSE, foundName = PR_FALSE;
PRBool foundGlyphs = PR_FALSE, foundCFF = PR_FALSE, foundKern = PR_FALSE;
PRBool foundLoca = PR_FALSE, foundMaxp = PR_FALSE;
PRUint32 headOffset, headLen, nameOffset, nameLen, kernOffset, kernLen,
glyfLen, locaOffset, locaLen, maxpOffset, maxpLen;
PRUint32 headOffset = 0, headLen, nameOffset = 0, nameLen, kernOffset = 0,
kernLen = 0, glyfLen = 0, locaOffset = 0, locaLen = 0,
maxpOffset = 0, maxpLen;
PRUint32 i, numTables;
numTables = sfntHeader->numTables;

View File

@ -1,5 +1,5 @@
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* ***** BEGIN LICENSE BLOCK *****
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
@ -14,7 +14,8 @@
*
* The Original Code is Mozilla Corporation code.
*
* The Initial Developer of the Original Code is Mozilla Corporation.
* The Initial Developer of the Original Code is
* the Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2009-2010
* the Initial Developer. All Rights Reserved.
*
@ -869,8 +870,10 @@ gfxHarfBuzzShaper::InitTextRun(gfxContext *aContext,
hb_buffer_reverse(buffer);
}
nsresult rv = SetGlyphsFromRun(aContext, aTextRun, buffer,
aRunStart, aRunLength);
#ifdef DEBUG
nsresult rv =
#endif
SetGlyphsFromRun(aContext, aTextRun, buffer, aRunStart, aRunLength);
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "failed to store glyphs into textrun");
hb_buffer_destroy(buffer);
hb_font_destroy(font);
@ -1067,20 +1070,20 @@ gfxHarfBuzzShaper::SetGlyphsFromRun(gfxContext *aContext,
// and endCharIndex to the limit (position beyond the last char),
// adjusting for the offset of the stringRange relative to the textRun.
PRInt32 baseCharIndex, endCharIndex;
while (charEnd < aRunLength && charToGlyph[charEnd] == NO_GLYPH)
while (charEnd < PRInt32(aRunLength) && charToGlyph[charEnd] == NO_GLYPH)
charEnd++;
baseCharIndex = charStart;
endCharIndex = charEnd;
// Then we check if the clump falls outside our actual string range;
// if so, just go to the next.
if (baseCharIndex >= aRunLength) {
if (baseCharIndex >= PRInt32(aRunLength)) {
glyphStart = glyphEnd;
charStart = charEnd;
continue;
}
// Ensure we won't try to go beyond the valid length of the textRun's text
endCharIndex = PR_MIN(endCharIndex, aRunLength);
endCharIndex = NS_MIN<PRInt32>(endCharIndex, aRunLength);
// Now we're ready to set the glyph info in the textRun
PRInt32 glyphsInClump = glyphEnd - glyphStart;
@ -1162,7 +1165,8 @@ gfxHarfBuzzShaper::SetGlyphsFromRun(gfxContext *aContext,
// the rest of the chars in the group are ligature continuations,
// no associated glyphs
while (++baseCharIndex != endCharIndex && baseCharIndex < aRunLength) {
while (++baseCharIndex != endCharIndex &&
baseCharIndex < PRInt32(aRunLength)) {
gfxTextRun::CompressedGlyph g;
g.SetComplex(inOrder &&
aTextRun->IsClusterStart(aTextRunOffset + baseCharIndex),

View File

@ -207,9 +207,9 @@ gfxXlibNativeRenderer::DrawDirect(gfxContext *ctx, nsIntSize size,
cairo_xlib_surface_get_width(target),
cairo_xlib_surface_get_height(target)));
PRBool needs_clip;
PRBool needs_clip = PR_TRUE;
nsIntRect rectangles[MAX_STATIC_CLIP_RECTANGLES];
int rect_count;
int rect_count = 0;
/* Check that the clip is rectangular and aligned on unit boundaries. */
/* Temporarily set the matrix for _get_rectangular_clip. It's basically