Fixed remaining clang compiler warnings

https://codereview.appspot.com/6865053/



git-svn-id: http://skia.googlecode.com/svn/trunk@6646 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
robertphillips@google.com 2012-12-03 17:35:19 +00:00
Родитель 08cb7286c6
Коммит 93f0332418
10 изменённых файлов: 26 добавлений и 21 удалений

Просмотреть файл

@ -59,8 +59,8 @@ public:
fBitmap.eraseColor(SK_ColorBLACK);
drawIntoBitmap(fBitmap);
fSrcR.set(0, 0, w, h);
fDstR.set(0, 0, w, h);
fSrcR.iset(0, 0, w, h);
fDstR.iset(0, 0, w, h);
}
protected:

Просмотреть файл

@ -94,9 +94,9 @@ static void make_3x3_bitmap(SkBitmap* bitmap) {
static const int gYSize = 3;
SkColor textureData[gXSize][gYSize] = {
SK_ColorRED, SK_ColorWHITE, SK_ColorBLUE,
SK_ColorGREEN, SK_ColorBLACK, SK_ColorCYAN,
SK_ColorYELLOW, SK_ColorGRAY, SK_ColorMAGENTA
{ SK_ColorRED, SK_ColorWHITE, SK_ColorBLUE },
{ SK_ColorGREEN, SK_ColorBLACK, SK_ColorCYAN },
{ SK_ColorYELLOW, SK_ColorGRAY, SK_ColorMAGENTA }
};

Просмотреть файл

@ -81,7 +81,8 @@ protected:
for (int i = 0; i < REPEAT_LOOP; ++i) {
SkPath line, path;
line.moveTo(1, 2); line.lineTo(4 + i, 1);
line.moveTo(SkIntToScalar(1), SkIntToScalar(2));
line.lineTo(SkIntToScalar(4 + i), SkIntToScalar(1));
paint.getFillPath(line, &path);
draw_fatpath(canvas, surface, &path, 1);

Просмотреть файл

@ -123,11 +123,11 @@ protected:
int idx = 0;
static const int kRectsPerRow = SkMax32(this->getISize().fWidth / kRectWidth, 1);
for (size_t cfm = 0; cfm < SK_ARRAY_COUNT(modes); ++cfm) {
for (int cfc = 0; cfc < SK_ARRAY_COUNT(colors); ++cfc) {
for (size_t cfc = 0; cfc < SK_ARRAY_COUNT(colors); ++cfc) {
SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter(colors[cfc],
modes[cfm]));
paint.setColorFilter(cf);
for (int s = 0; s < SK_ARRAY_COUNT(shaders); ++s) {
for (size_t s = 0; s < SK_ARRAY_COUNT(shaders); ++s) {
paint.setShader(shaders[s]);
bool hasShader = NULL == paint.getShader();
int paintColorCnt = hasShader ? SK_ARRAY_COUNT(alphas) : SK_ARRAY_COUNT(colors);
@ -146,7 +146,7 @@ protected:
}
}
for (int i = 0; i < SK_ARRAY_COUNT(shaders); ++i) {
for (size_t i = 0; i < SK_ARRAY_COUNT(shaders); ++i) {
SkSafeUnref(shaders[i]);
}
}

Просмотреть файл

@ -170,6 +170,8 @@ static SkShader* make_grad(SkShader::TileMode tx, SkShader::TileMode ty) {
case 2:
return SkGradientShader::CreateSweep(center.fX, center.fY, colors, NULL, SK_ARRAY_COUNT(colors));
}
return NULL;
}
static SkShader* make_radial(SkShader::TileMode tx, SkShader::TileMode ty) {

Просмотреть файл

@ -10,6 +10,7 @@
class SkRunnable {
public:
virtual ~SkRunnable() {};
virtual void run() = 0;
};

Просмотреть файл

@ -417,7 +417,7 @@ GrEffect* ColorMatrixEffect::TestCreate(SkRandom* random,
GrContext*,
GrTexture* dummyTextures[2]) {
SkColorMatrix colorMatrix;
for (int i = 0; i < SK_ARRAY_COUNT(colorMatrix.fMat); ++i) {
for (size_t i = 0; i < SK_ARRAY_COUNT(colorMatrix.fMat); ++i) {
colorMatrix.fMat[i] = random->nextSScalar1();
}
return SkNEW_ARGS(ColorMatrixEffect, (colorMatrix));

Просмотреть файл

@ -102,7 +102,7 @@ void SkMatrix44::setColMajord(const double src[]) {
memcpy(dst, src, 16 * sizeof(double));
#elif defined SK_MSCALAR_IS_FLOAT
for (int i = 0; i < 16; ++i) {
dst[i] = SkMScalarToDouble(src[i]);
dst[i] = SkDoubleToMScalar(src[i]);
}
#endif
fIdentity = false;
@ -124,10 +124,10 @@ void SkMatrix44::setRowMajorf(const float src[]) {
void SkMatrix44::setRowMajord(const double src[]) {
SkMScalar* dst = &fMat[0][0];
for (int i = 0; i < 4; ++i) {
dst[0] = SkMScalarToDouble(src[0]);
dst[4] = SkMScalarToDouble(src[1]);
dst[8] = SkMScalarToDouble(src[2]);
dst[12] = SkMScalarToDouble(src[3]);
dst[0] = SkDoubleToMScalar(src[0]);
dst[4] = SkDoubleToMScalar(src[1]);
dst[8] = SkDoubleToMScalar(src[2]);
dst[12] = SkDoubleToMScalar(src[3]);
src += 4;
dst += 1;
}

Просмотреть файл

@ -98,7 +98,8 @@ static void test_matrix_recttorect(skiatest::Reporter* reporter) {
dst.fRight += SK_Scalar1;
matrix.setRectToRect(src, dst, SkMatrix::kFill_ScaleToFit);
REPORTER_ASSERT(reporter, SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask == matrix.getType());
REPORTER_ASSERT(reporter,
(SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask) == matrix.getType());
REPORTER_ASSERT(reporter, matrix.rectStaysRect());
dst = src;

Просмотреть файл

@ -136,7 +136,7 @@ static void test_round_rect_rects(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr1.type());
r = rr1.rect();
REPORTER_ASSERT(reporter, rect == r);
for (int i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
for (size_t i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
REPORTER_ASSERT(reporter, isIn[i] == rr1.contains(pts[i].fX, pts[i].fY));
}
@ -149,7 +149,7 @@ static void test_round_rect_rects(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr2.type());
r = rr2.rect();
REPORTER_ASSERT(reporter, rect == r);
for (int i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
for (size_t i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
REPORTER_ASSERT(reporter, isIn[i] == rr2.contains(pts[i].fX, pts[i].fY));
}
@ -195,7 +195,7 @@ static void test_round_rect_ovals(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, SkRRect::kOval_Type == rr1.type());
oval = rr1.rect();
REPORTER_ASSERT(reporter, oval == rect);
for (int i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
for (size_t i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
REPORTER_ASSERT(reporter, isIn[i] == rr1.contains(pts[i].fX, pts[i].fY));
}
}
@ -230,7 +230,7 @@ static void test_round_rect_general(skiatest::Reporter* reporter) {
rr1.setRectXY(rect, 20, 20);
REPORTER_ASSERT(reporter, SkRRect::kSimple_Type == rr1.type());
for (int i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
for (size_t i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
REPORTER_ASSERT(reporter, isIn[i] == rr1.contains(pts[i].fX, pts[i].fY));
}
@ -261,7 +261,7 @@ static void test_round_rect_general(skiatest::Reporter* reporter) {
rr2.setRectRadii(rect, radii);
REPORTER_ASSERT(reporter, SkRRect::kComplex_Type == rr2.type());
for (int i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
for (size_t i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
REPORTER_ASSERT(reporter, isIn[i] == rr2.contains(pts2[i].fX, pts2[i].fY));
}
}