aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-05-17 15:38:00 +0000
committerGravatar tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-05-17 15:38:00 +0000
commitffe39bd3b66eb5090684959e7f2409346ab72d93 (patch)
treea57a3e648b5bfaa8d6fd3fb7dd40352d879320c8
parent5b94153a7b039a9269a8aabbe8f0da0e878e3978 (diff)
Fix type errors and a few warnings for Visual Studio 2010 64-bit build.
We're still far from 64b statically safe, mostly around SkReader32.h and the address-alignment code in GrTypes.h. Original code provided by jianliang79. http://code.google.com/p/skia/issues/detail?id=601 git-svn-id: http://skia.googlecode.com/svn/trunk@3994 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--gm/shadows.cpp2
-rw-r--r--include/core/SkTDArray.h6
-rw-r--r--samplecode/SampleAll.cpp6
-rw-r--r--samplecode/SampleText.cpp2
4 files changed, 9 insertions, 7 deletions
diff --git a/gm/shadows.cpp b/gm/shadows.cpp
index e9274c72a6..2fb1615cf9 100644
--- a/gm/shadows.cpp
+++ b/gm/shadows.cpp
@@ -95,7 +95,7 @@ protected:
paint.setLooper(shadowLoopers[i]);
- canvas->translate(SkIntToScalar(i*40), SkIntToScalar(0));
+ canvas->translate(SkIntToScalar((unsigned int)i*40), SkIntToScalar(0));
setup(&paint, gRec[0].fColor, gRec[0].fStrokeWidth);
canvas->drawRect(fRect, paint);
diff --git a/include/core/SkTDArray.h b/include/core/SkTDArray.h
index 5f62203d21..f0f94494f3 100644
--- a/include/core/SkTDArray.h
+++ b/include/core/SkTDArray.h
@@ -154,7 +154,7 @@ public:
return this->append(1, NULL);
}
T* append(size_t count, const T* src = NULL) {
- unsigned oldCount = fCount;
+ size_t oldCount = fCount;
if (count) {
SkASSERT(src == NULL || fArray == NULL ||
src + count <= fArray || fArray + oldCount <= src);
@@ -179,7 +179,7 @@ public:
T* insert(size_t index, size_t count, const T* src = NULL) {
SkASSERT(count);
SkASSERT(index <= fCount);
- int oldCount = fCount;
+ size_t oldCount = fCount;
this->growBy(count);
T* dst = fArray + index;
memmove(dst + count, dst, sizeof(T) * (oldCount - index));
@@ -197,7 +197,7 @@ public:
void removeShuffle(size_t index) {
SkASSERT(index < fCount);
- unsigned newCount = fCount - 1;
+ size_t newCount = fCount - 1;
fCount = newCount;
if (index != newCount) {
memcpy(fArray + index, fArray + newCount, sizeof(T));
diff --git a/samplecode/SampleAll.cpp b/samplecode/SampleAll.cpp
index 2aea5b021a..ea35ff1ea9 100644
--- a/samplecode/SampleAll.cpp
+++ b/samplecode/SampleAll.cpp
@@ -386,11 +386,13 @@ protected:
SkTDArray<SkPoint>(pos);
pos.setCount(asciiLength);
for (index = 0; index < asciiLength; index++)
- pos[index].set(SkIntToScalar(index * 10), SkIntToScalar(index * 2));
+ pos[index].set(SkIntToScalar((unsigned int)index * 10),
+ SkIntToScalar((unsigned int)index * 2));
SkTDArray<SkPoint>(pos2);
pos2.setCount(asciiLength);
for (index = 0; index < asciiLength; index++)
- pos2[index].set(SkIntToScalar(index * 10), SkIntToScalar(20));
+ pos2[index].set(SkIntToScalar((unsigned int)index * 10),
+ SkIntToScalar(20));
// shaders
SkPoint linearPoints[] = { { 0, 0, }, { SkIntToScalar(40), SkIntToScalar(40) } };
diff --git a/samplecode/SampleText.cpp b/samplecode/SampleText.cpp
index eced08a239..db4dbeaef2 100644
--- a/samplecode/SampleText.cpp
+++ b/samplecode/SampleText.cpp
@@ -105,7 +105,7 @@ static void test_breakText() {
SkASSERT(m > mm);
}
}
- nn = SkIntToScalar(n);
+ nn = SkIntToScalar((unsigned int)n);
mm = m;
}