From 5b0ede32395913afcf5e57fbfbcf6e529b469532 Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Wed, 2 Oct 2013 11:56:36 -0400 Subject: [PATCH] Fix win32 cltool. --- CLTool/src/clwin32.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CLTool/src/clwin32.cpp b/CLTool/src/clwin32.cpp index 9104841..cd24835 100644 --- a/CLTool/src/clwin32.cpp +++ b/CLTool/src/clwin32.cpp @@ -70,8 +70,8 @@ void PrintUsage() { fprintf(stderr, "\t-j \tUse blocks for each work item in a worker queue threading model. Default: (Blocks / Threads)\n"); } -void ExtractBasename(const char *filename, char *buf, int bufSz) { - int len = strlen(filename); +void ExtractBasename(const char *filename, char *buf, size_t bufSz) { + size_t len = strlen(filename); const char *end = filename + len; const char *ext = end; const char *base = NULL; @@ -83,8 +83,8 @@ void ExtractBasename(const char *filename, char *buf, int bufSz) { } } - int numChars = ext - base + 1; - int toCopy = ::std::min(numChars, bufSz); + size_t numChars = ext - base + 1; + size_t toCopy = (::std::min)(numChars, bufSz); memcpy(buf, base, toCopy); buf[toCopy - 1] = '\0'; return;