diff options
-rw-r--r-- | include/core/SkTemplates.h | 12 | ||||
-rw-r--r-- | include/core/SkWriter32.h | 8 | ||||
-rw-r--r-- | include/utils/SkMeshUtils.h | 4 | ||||
-rw-r--r-- | src/core/SkOrderedWriteBuffer.h | 4 | ||||
-rw-r--r-- | src/core/SkRTree.cpp | 2 | ||||
-rw-r--r-- | src/core/SkRTree.h | 2 | ||||
-rw-r--r-- | src/gpu/GrBufferAllocPool.cpp | 12 | ||||
-rw-r--r-- | src/gpu/GrDefaultPathRenderer.cpp | 4 | ||||
-rw-r--r-- | src/gpu/GrDrawTarget.cpp | 4 | ||||
-rw-r--r-- | src/gpu/GrDrawTarget.h | 2 | ||||
-rw-r--r-- | src/gpu/GrGpu.cpp | 4 | ||||
-rw-r--r-- | src/gpu/GrGpu.h | 8 | ||||
-rw-r--r-- | src/gpu/GrIndexBuffer.h | 2 | ||||
-rw-r--r-- | src/gpu/GrMemoryPool.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrRenderTarget.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrResourceCache.cpp | 2 | ||||
-rw-r--r-- | src/gpu/SkGrFontScaler.cpp | 2 | ||||
-rw-r--r-- | src/gpu/gl/GrGpuGL.cpp | 4 | ||||
-rw-r--r-- | src/gpu/gl/GrGpuGL.h | 6 | ||||
-rw-r--r-- | src/ports/SkFontHost_win_dw.cpp | 2 | ||||
-rw-r--r-- | src/utils/SkDeferredCanvas.cpp | 2 | ||||
-rw-r--r-- | src/utils/SkDumpCanvas.cpp | 8 | ||||
-rw-r--r-- | src/utils/win/SkWGL_win.cpp | 4 | ||||
-rw-r--r-- | tools/skdiff_utils.cpp | 2 | ||||
-rw-r--r-- | tools/skpdiff/skpdiff_util.cpp | 2 |
25 files changed, 52 insertions, 54 deletions
diff --git a/include/core/SkTemplates.h b/include/core/SkTemplates.h index c63a1140d1..8317b24717 100644 --- a/include/core/SkTemplates.h +++ b/include/core/SkTemplates.h @@ -231,7 +231,7 @@ private: /** Wraps SkAutoTArray, with room for up to N elements preallocated */ -template <size_t N, typename T> class SkAutoSTArray : SkNoncopyable { +template <int N, typename T> class SkAutoSTArray : SkNoncopyable { public: /** Initialize with no objects */ SkAutoSTArray() { @@ -241,7 +241,7 @@ public: /** Allocate count number of T elements */ - SkAutoSTArray(size_t count) { + SkAutoSTArray(int count) { fArray = NULL; fCount = 0; this->reset(count); @@ -252,7 +252,7 @@ public: } /** Destroys previous objects in the array and default constructs count number of objects */ - void reset(size_t count) { + void reset(int count) { T* start = fArray; T* iter = start + fCount; while (iter > start) { @@ -286,7 +286,7 @@ public: /** Return the number of T elements in the array */ - size_t count() const { return fCount; } + int count() const { return fCount; } /** Return the array of T elements. Will be NULL if count == 0 */ @@ -295,12 +295,12 @@ public: /** Return the nth element in the array */ T& operator[](int index) const { - SkASSERT((unsigned)index < fCount); + SkASSERT(index < fCount); return fArray[index]; } private: - size_t fCount; + int fCount; T* fArray; // since we come right after fArray, fStorage should be properly aligned char fStorage[N * sizeof(T)]; diff --git a/include/core/SkWriter32.h b/include/core/SkWriter32.h index 0db6540a9f..ba8893eab9 100644 --- a/include/core/SkWriter32.h +++ b/include/core/SkWriter32.h @@ -45,9 +45,9 @@ public: ~SkWriter32(); // return the current offset (will always be a multiple of 4) - uint32_t bytesWritten() const { return fSize; } + size_t bytesWritten() const { return fSize; } // DEPRECATED: use bytesWritten instead TODO(mtklein): clean up - uint32_t size() const { return this->bytesWritten(); } + size_t size() const { return this->bytesWritten(); } // Returns true if we've written only into the storage passed into constructor or reset. // (You may be able to use this to avoid a call to flatten.) @@ -268,9 +268,9 @@ private: Block* fHead; Block* fTail; size_t fMinSize; - uint32_t fSize; + size_t fSize; // sum of bytes written in all blocks *before* fTail - uint32_t fWrittenBeforeLastBlock; + size_t fWrittenBeforeLastBlock; bool isHeadExternallyAllocated() const { return fHead == &fExternalBlock; diff --git a/include/utils/SkMeshUtils.h b/include/utils/SkMeshUtils.h index 564df67a8e..7e0e8f4de2 100644 --- a/include/utils/SkMeshUtils.h +++ b/include/utils/SkMeshUtils.h @@ -27,14 +27,14 @@ public: bool init(SkPoint tex[], uint16_t indices[], int texW, int texH, int rows, int cols); - size_t indexCount() const { return fIndexCount; } + int indexCount() const { return fIndexCount; } const uint16_t* indices() const { return fIndices; } size_t texCount() const { return fTexCount; } const SkPoint* tex() const { return fTex; } private: - size_t fIndexCount, fTexCount; + int fIndexCount, fTexCount; SkPoint* fTex; uint16_t* fIndices; void* fStorage; // may be null diff --git a/src/core/SkOrderedWriteBuffer.h b/src/core/SkOrderedWriteBuffer.h index 180f9a4d63..277b7bfd81 100644 --- a/src/core/SkOrderedWriteBuffer.h +++ b/src/core/SkOrderedWriteBuffer.h @@ -42,9 +42,9 @@ public: void writeToMemory(void* dst) { fWriter.flatten(dst); } uint32_t* reserve(size_t size) { return fWriter.reserve(size); } - uint32_t bytesWritten() const { return fWriter.bytesWritten(); } + size_t bytesWritten() const { return fWriter.bytesWritten(); } // Deprecated. Please call bytesWritten instead. TODO(mtklein): clean up - uint32_t size() const { return this->bytesWritten(); } + size_t size() const { return this->bytesWritten(); } virtual void writeByteArray(const void* data, size_t size) SK_OVERRIDE; virtual void writeBool(bool value) SK_OVERRIDE; diff --git a/src/core/SkRTree.cpp b/src/core/SkRTree.cpp index b6f8e95dea..e3d2eb696d 100644 --- a/src/core/SkRTree.cpp +++ b/src/core/SkRTree.cpp @@ -406,7 +406,7 @@ void SkRTree::validate() { if (this->isEmpty()) { return; } - SkASSERT(fCount == (size_t)this->validateSubtree(fRoot.fChild.subtree, fRoot.fBounds, true)); + SkASSERT(fCount == this->validateSubtree(fRoot.fChild.subtree, fRoot.fBounds, true)); #endif } diff --git a/src/core/SkRTree.h b/src/core/SkRTree.h index 54421de14c..2f905e7909 100644 --- a/src/core/SkRTree.h +++ b/src/core/SkRTree.h @@ -179,7 +179,7 @@ private: const size_t fNodeSize; // This is the count of data elements (rather than total nodes in the tree) - size_t fCount; + int fCount; Branch fRoot; SkChunkAlloc fNodes; diff --git a/src/gpu/GrBufferAllocPool.cpp b/src/gpu/GrBufferAllocPool.cpp index 887f8cdfe1..b34fe8a8e3 100644 --- a/src/gpu/GrBufferAllocPool.cpp +++ b/src/gpu/GrBufferAllocPool.cpp @@ -203,9 +203,9 @@ int GrBufferAllocPool::currentBufferItems(size_t itemSize) const { const BufferBlock& back = fBlocks.back(); size_t usedBytes = back.fBuffer->sizeInBytes() - back.fBytesFree; size_t pad = GrSizeAlignUpPad(usedBytes, itemSize); - return (back.fBytesFree - pad) / itemSize; + return static_cast<int>((back.fBytesFree - pad) / itemSize); } else if (fPreallocBuffersInUse < fPreallocBuffers.count()) { - return fMinBlockSize / itemSize; + return static_cast<int>(fMinBlockSize / itemSize); } return 0; } @@ -404,7 +404,7 @@ void* GrVertexBufferAllocPool::makeSpace(size_t vertexSize, *buffer = (const GrVertexBuffer*) geomBuffer; SkASSERT(0 == offset % vertexSize); - *startVertex = offset / vertexSize; + *startVertex = static_cast<int>(offset / vertexSize); return ptr; } @@ -425,7 +425,7 @@ bool GrVertexBufferAllocPool::appendVertices(size_t vertexSize, } int GrVertexBufferAllocPool::preallocatedBufferVertices(size_t vertexSize) const { - return INHERITED::preallocatedBufferSize() / vertexSize; + return static_cast<int>(INHERITED::preallocatedBufferSize() / vertexSize); } int GrVertexBufferAllocPool::currentBufferVertices(size_t vertexSize) const { @@ -462,7 +462,7 @@ void* GrIndexBufferAllocPool::makeSpace(int indexCount, *buffer = (const GrIndexBuffer*) geomBuffer; SkASSERT(0 == offset % sizeof(uint16_t)); - *startIndex = offset / sizeof(uint16_t); + *startIndex = static_cast<int>(offset / sizeof(uint16_t)); return ptr; } @@ -480,7 +480,7 @@ bool GrIndexBufferAllocPool::appendIndices(int indexCount, } int GrIndexBufferAllocPool::preallocatedBufferIndices() const { - return INHERITED::preallocatedBufferSize() / sizeof(uint16_t); + return static_cast<int>(INHERITED::preallocatedBufferSize() / sizeof(uint16_t)); } int GrIndexBufferAllocPool::currentBufferIndices() const { diff --git a/src/gpu/GrDefaultPathRenderer.cpp b/src/gpu/GrDefaultPathRenderer.cpp index bd52ce1f95..85485c86a3 100644 --- a/src/gpu/GrDefaultPathRenderer.cpp +++ b/src/gpu/GrDefaultPathRenderer.cpp @@ -317,8 +317,8 @@ FINISHED: SkASSERT((vert - base) <= maxPts); SkASSERT((idx - idxBase) <= maxIdxs); - *vertexCnt = vert - base; - *indexCnt = idx - idxBase; + *vertexCnt = static_cast<int>(vert - base); + *indexCnt = static_cast<int>(idx - idxBase); } return true; diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp index fc3014e398..c33dcb701e 100644 --- a/src/gpu/GrDrawTarget.cpp +++ b/src/gpu/GrDrawTarget.cpp @@ -362,7 +362,7 @@ bool GrDrawTarget::checkDraw(GrPrimitiveType type, int startVertex, maxValidVertex = geoSrc.fVertexCount; break; case kBuffer_GeometrySrcType: - maxValidVertex = geoSrc.fVertexBuffer->sizeInBytes() / geoSrc.fVertexSize; + maxValidVertex = static_cast<int>(geoSrc.fVertexBuffer->sizeInBytes() / geoSrc.fVertexSize); break; } if (maxVertex > maxValidVertex) { @@ -379,7 +379,7 @@ bool GrDrawTarget::checkDraw(GrPrimitiveType type, int startVertex, maxValidIndex = geoSrc.fIndexCount; break; case kBuffer_GeometrySrcType: - maxValidIndex = geoSrc.fIndexBuffer->sizeInBytes() / sizeof(uint16_t); + maxValidIndex = static_cast<int>(geoSrc.fIndexBuffer->sizeInBytes() / sizeof(uint16_t)); break; } if (maxIndex > maxValidIndex) { diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h index feba55ea5b..c75bba2a10 100644 --- a/src/gpu/GrDrawTarget.h +++ b/src/gpu/GrDrawTarget.h @@ -688,7 +688,7 @@ protected: case kArray_GeometrySrcType: return src.fIndexCount; case kBuffer_GeometrySrcType: - return src.fIndexBuffer->sizeInBytes() / sizeof(uint16_t); + return static_cast<int>(src.fIndexBuffer->sizeInBytes() / sizeof(uint16_t)); default: GrCrash("Unexpected Index Source."); return 0; diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp index 186091f20c..42b82f6789 100644 --- a/src/gpu/GrGpu.cpp +++ b/src/gpu/GrGpu.cpp @@ -183,12 +183,12 @@ GrRenderTarget* GrGpu::wrapBackendRenderTarget(const GrBackendRenderTargetDesc& return this->onWrapBackendRenderTarget(desc); } -GrVertexBuffer* GrGpu::createVertexBuffer(uint32_t size, bool dynamic) { +GrVertexBuffer* GrGpu::createVertexBuffer(size_t size, bool dynamic) { this->handleDirtyContext(); return this->onCreateVertexBuffer(size, dynamic); } -GrIndexBuffer* GrGpu::createIndexBuffer(uint32_t size, bool dynamic) { +GrIndexBuffer* GrGpu::createIndexBuffer(size_t size, bool dynamic) { this->handleDirtyContext(); return this->onCreateIndexBuffer(size, dynamic); } diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h index 48caf7c410..c0a4b8f2dc 100644 --- a/src/gpu/GrGpu.h +++ b/src/gpu/GrGpu.h @@ -106,7 +106,7 @@ public: * * @return The vertex buffer if successful, otherwise NULL. */ - GrVertexBuffer* createVertexBuffer(uint32_t size, bool dynamic); + GrVertexBuffer* createVertexBuffer(size_t size, bool dynamic); /** * Creates an index buffer. @@ -118,7 +118,7 @@ public: * * @return The index buffer if successful, otherwise NULL. */ - GrIndexBuffer* createIndexBuffer(uint32_t size, bool dynamic); + GrIndexBuffer* createIndexBuffer(size_t size, bool dynamic); /** * Creates a path object that can be stenciled using stencilPath(). It is @@ -421,8 +421,8 @@ private: size_t rowBytes) = 0; virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&) = 0; virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&) = 0; - virtual GrVertexBuffer* onCreateVertexBuffer(uint32_t size, bool dynamic) = 0; - virtual GrIndexBuffer* onCreateIndexBuffer(uint32_t size, bool dynamic) = 0; + virtual GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) = 0; + virtual GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) = 0; virtual GrPath* onCreatePath(const SkPath& path, const SkStrokeRec&) = 0; // overridden by backend-specific derived class to perform the clear and diff --git a/src/gpu/GrIndexBuffer.h b/src/gpu/GrIndexBuffer.h index 69ee86f769..e23bc9b19a 100644 --- a/src/gpu/GrIndexBuffer.h +++ b/src/gpu/GrIndexBuffer.h @@ -21,7 +21,7 @@ public: * @return the maximum number of quads using full size of index buffer. */ int maxQuads() const { - return this->sizeInBytes() / (sizeof(uint16_t) * 6); + return static_cast<int>(this->sizeInBytes() / (sizeof(uint16_t) * 6)); } protected: GrIndexBuffer(GrGpu* gpu, bool isWrapped, size_t sizeInBytes, bool dynamic, bool cpuBacked) diff --git a/src/gpu/GrMemoryPool.cpp b/src/gpu/GrMemoryPool.cpp index deb7d1a814..75a3c9a3b9 100644 --- a/src/gpu/GrMemoryPool.cpp +++ b/src/gpu/GrMemoryPool.cpp @@ -41,7 +41,7 @@ void* GrMemoryPool::allocate(size_t size) { size = GrSizeAlignUp(size, kAlignment); size += kPerAllocPad; if (fTail->fFreeSize < size) { - int blockSize = size; + size_t blockSize = size; blockSize = GrMax<size_t>(blockSize, fMinAllocSize); BlockHeader* block = CreateBlock(blockSize); diff --git a/src/gpu/GrRenderTarget.cpp b/src/gpu/GrRenderTarget.cpp index f55859636f..49a76149f0 100644 --- a/src/gpu/GrRenderTarget.cpp +++ b/src/gpu/GrRenderTarget.cpp @@ -57,7 +57,7 @@ void GrRenderTarget::resolve() { } size_t GrRenderTarget::sizeInBytes() const { - int colorBits; + size_t colorBits; if (kUnknown_GrPixelConfig == fDesc.fConfig) { colorBits = 32; // don't know, make a guess } else { diff --git a/src/gpu/GrResourceCache.cpp b/src/gpu/GrResourceCache.cpp index 210cbf8d78..1d0f3845c5 100644 --- a/src/gpu/GrResourceCache.cpp +++ b/src/gpu/GrResourceCache.cpp @@ -354,7 +354,7 @@ void GrResourceCache::purgeAllUnlocked() { // so we don't want to just do a simple loop kicking each // entry out. Instead change the budget and purge. - int savedMaxBytes = fMaxBytes; + size_t savedMaxBytes = fMaxBytes; int savedMaxCount = fMaxCount; fMaxBytes = (size_t) -1; fMaxCount = 0; diff --git a/src/gpu/SkGrFontScaler.cpp b/src/gpu/SkGrFontScaler.cpp index 3c42af83df..651486665b 100644 --- a/src/gpu/SkGrFontScaler.cpp +++ b/src/gpu/SkGrFontScaler.cpp @@ -52,7 +52,7 @@ bool SkGrDescKey::lt(const GrKey& rh) const { const SkDescriptor* srcDesc = ((const SkGrDescKey*)&rh)->fDesc; size_t lenLH = fDesc->getLength(); size_t lenRH = srcDesc->getLength(); - int cmp = memcmp(fDesc, srcDesc, SkMin32(lenLH, lenRH)); + int cmp = memcmp(fDesc, srcDesc, SkTMin<size_t>(lenLH, lenRH)); if (0 == cmp) { return lenLH < lenRH; } else { diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp index cdf9be9547..5845066291 100644 --- a/src/gpu/gl/GrGpuGL.cpp +++ b/src/gpu/gl/GrGpuGL.cpp @@ -1149,7 +1149,7 @@ bool GrGpuGL::attachStencilBufferToRenderTarget(GrStencilBuffer* sb, GrRenderTar //////////////////////////////////////////////////////////////////////////////// -GrVertexBuffer* GrGpuGL::onCreateVertexBuffer(uint32_t size, bool dynamic) { +GrVertexBuffer* GrGpuGL::onCreateVertexBuffer(size_t size, bool dynamic) { GrGLVertexBuffer::Desc desc; desc.fDynamic = dynamic; desc.fSizeInBytes = size; @@ -1182,7 +1182,7 @@ GrVertexBuffer* GrGpuGL::onCreateVertexBuffer(uint32_t size, bool dynamic) { } } -GrIndexBuffer* GrGpuGL::onCreateIndexBuffer(uint32_t size, bool dynamic) { +GrIndexBuffer* GrGpuGL::onCreateIndexBuffer(size_t size, bool dynamic) { GrGLIndexBuffer::Desc desc; desc.fDynamic = dynamic; desc.fSizeInBytes = size; diff --git a/src/gpu/gl/GrGpuGL.h b/src/gpu/gl/GrGpuGL.h index aa3f0172f5..65e82077bc 100644 --- a/src/gpu/gl/GrGpuGL.h +++ b/src/gpu/gl/GrGpuGL.h @@ -117,10 +117,8 @@ private: virtual GrTexture* onCreateTexture(const GrTextureDesc& desc, const void* srcData, size_t rowBytes) SK_OVERRIDE; - virtual GrVertexBuffer* onCreateVertexBuffer(uint32_t size, - bool dynamic) SK_OVERRIDE; - virtual GrIndexBuffer* onCreateIndexBuffer(uint32_t size, - bool dynamic) SK_OVERRIDE; + virtual GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) SK_OVERRIDE; + virtual GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) SK_OVERRIDE; virtual GrPath* onCreatePath(const SkPath&, const SkStrokeRec&) SK_OVERRIDE; virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&) SK_OVERRIDE; virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&) SK_OVERRIDE; diff --git a/src/ports/SkFontHost_win_dw.cpp b/src/ports/SkFontHost_win_dw.cpp index 1ab0b7e92b..974b90f903 100644 --- a/src/ports/SkFontHost_win_dw.cpp +++ b/src/ports/SkFontHost_win_dw.cpp @@ -1460,7 +1460,7 @@ static void populate_glyph_to_unicode(IDWriteFontFace* fontFace, } glyphToUnicode->setCount(maxGlyph+1); - for (size_t j = 0; j < maxGlyph+1u; ++j) { + for (USHORT j = 0; j < maxGlyph+1u; ++j) { (*glyphToUnicode)[j] = 0; } diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp index 4509038eb0..ce5eb5e6ab 100644 --- a/src/utils/SkDeferredCanvas.cpp +++ b/src/utils/SkDeferredCanvas.cpp @@ -106,7 +106,7 @@ void* DeferredPipeController::requestBlock(size_t minRequest, size_t *actual) { PipeBlock previousBloc(fBlock, fBytesWritten); fBlockList.push(previousBloc); } - int32_t blockSize = SkMax32(minRequest, kMinBlockSize); + size_t blockSize = SkTMax<size_t>(minRequest, kMinBlockSize); fBlock = fAllocator.allocThrow(blockSize); fBytesWritten = 0; *actual = blockSize; diff --git a/src/utils/SkDumpCanvas.cpp b/src/utils/SkDumpCanvas.cpp index e471974d13..0e1a2321e1 100644 --- a/src/utils/SkDumpCanvas.cpp +++ b/src/utils/SkDumpCanvas.cpp @@ -142,15 +142,15 @@ static void toString(const void* text, size_t byteLen, SkPaint::TextEncoding enc // FIXME: this code appears to be untested - and probably unused - and probably wrong switch (enc) { case SkPaint::kUTF8_TextEncoding: - str->appendf("\"%.*s\"%s", SkMax32(byteLen, 32), (const char*) text, + str->appendf("\"%.*s\"%s", (int)SkTMax<size_t>(byteLen, 32), (const char*) text, byteLen > 32 ? "..." : ""); break; case SkPaint::kUTF16_TextEncoding: - str->appendf("\"%.*ls\"%s", SkMax32(byteLen, 32), (const wchar_t*) text, + str->appendf("\"%.*ls\"%s", (int)SkTMax<size_t>(byteLen, 32), (const wchar_t*) text, byteLen > 64 ? "..." : ""); break; case SkPaint::kUTF32_TextEncoding: - str->appendf("\"%.*ls\"%s", SkMax32(byteLen, 32), (const wchar_t*) text, + str->appendf("\"%.*ls\"%s", (int)SkTMax<size_t>(byteLen, 32), (const wchar_t*) text, byteLen > 128 ? "..." : ""); break; case SkPaint::kGlyphID_TextEncoding: @@ -444,7 +444,7 @@ void SkDumpCanvas::drawVertices(VertexMode vmode, int vertexCount, void SkDumpCanvas::drawData(const void* data, size_t length) { // this->dump(kDrawData_Verb, NULL, "drawData(%d)", length); this->dump(kDrawData_Verb, NULL, "drawData(%d) %.*s", length, - SkMin32(length, 64), data); + SkTMin<size_t>(length, 64), data); } void SkDumpCanvas::beginCommentGroup(const char* description) { diff --git a/src/utils/win/SkWGL_win.cpp b/src/utils/win/SkWGL_win.cpp index ac77c56288..3b1966dae8 100644 --- a/src/utils/win/SkWGL_win.cpp +++ b/src/utils/win/SkWGL_win.cpp @@ -20,10 +20,10 @@ bool SkWGLExtensions::hasExtension(HDC dc, const char* ext) const { return true; } const char* extensionString = this->getExtensionsString(dc); - int extLength = strlen(ext); + size_t extLength = strlen(ext); while (true) { - int n = strcspn(extensionString, " "); + size_t n = strcspn(extensionString, " "); if (n == extLength && 0 == strncmp(ext, extensionString, n)) { return true; } diff --git a/tools/skdiff_utils.cpp b/tools/skdiff_utils.cpp index 0eb405aaa5..1f5289b353 100644 --- a/tools/skdiff_utils.cpp +++ b/tools/skdiff_utils.cpp @@ -102,7 +102,7 @@ static SkString replace_all(const SkString &input, const char *input_cstr = input.c_str(); const char *first_char = input_cstr; const char *match_char; - int oldSubstringLen = strlen(oldSubstring); + size_t oldSubstringLen = strlen(oldSubstring); while (NULL != (match_char = strstr(first_char, oldSubstring))) { output.append(first_char, (match_char - first_char)); output.append(newSubstring); diff --git a/tools/skpdiff/skpdiff_util.cpp b/tools/skpdiff/skpdiff_util.cpp index 5b19c7311d..171721c3be 100644 --- a/tools/skpdiff/skpdiff_util.cpp +++ b/tools/skpdiff/skpdiff_util.cpp @@ -130,7 +130,7 @@ bool get_directory(const char path[], SkTArray<SkString>* entries) { return true; #elif SK_BUILD_FOR_WIN32 char pathDirGlob[MAX_PATH]; - char pathLength = strlen(path); + size_t pathLength = strlen(path); strncpy(pathDirGlob, path, pathLength); if (path[pathLength - 1] == '/' || path[pathLength - 1] == '\\') { |