diff --git a/src/export.cpp b/src/export.cpp index 46ab076..f670f1b 100644 --- a/src/export.cpp +++ b/src/export.cpp @@ -890,7 +890,7 @@ void SolveSpaceUI::ExportMeshAsThreeJsTo(FILE *f, const std::string &filename, if(lastSlash == std::string::npos) oops(); baseFilename.erase(0, lastSlash + 1); - for(int i = 0; i < baseFilename.length(); i++) { + for(size_t i = 0; i < baseFilename.length(); i++) { if(!isalpha(baseFilename[i]) && /* also permit UTF-8 */ !((unsigned char)baseFilename[i] >= 0x80)) baseFilename[i] = '_'; diff --git a/src/file.cpp b/src/file.cpp index 61d1c24..a404f93 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -695,13 +695,13 @@ static std::string MakePathRelative(const std::string &base, const std::string & resultParts; baseParts.pop_back(); - int common; + size_t common; for(common = 0; common < baseParts.size() && common < pathParts.size(); common++) { if(!PlatformPathEqual(baseParts[common], pathParts[common])) break; } - for(int i = common; i < baseParts.size(); i++) + for(size_t i = common; i < baseParts.size(); i++) resultParts.push_back(".."); resultParts.insert(resultParts.end(), @@ -732,7 +732,7 @@ static std::string MakePathAbsolute(const std::string &base, const std::string & static void PathSepNormalize(std::string &filename) { - for(int i = 0; i < filename.length(); i++) { + for(size_t i = 0; i < filename.length(); i++) { if(filename[i] == '\\') filename[i] = '/'; } @@ -742,7 +742,7 @@ static std::string PathSepPlatformToUNIX(const std::string &filename) { #if defined(WIN32) std::string result = filename; - for(int i = 0; i < result.length(); i++) { + for(size_t i = 0; i < result.length(); i++) { if(result[i] == '\\') result[i] = '/'; } @@ -756,7 +756,7 @@ static std::string PathSepUNIXToPlatform(const std::string &filename) { #if defined(WIN32) std::string result = filename; - for(int i = 0; i < result.length(); i++) { + for(size_t i = 0; i < result.length(); i++) { if(result[i] == '/') result[i] = '\\'; } diff --git a/src/group.cpp b/src/group.cpp index f736774..fa70408 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -204,7 +204,7 @@ void Group::MenuGroup(int id) { if(pos != std::string::npos) groupName.erase(pos); - for(int i = 0; i < groupName.length(); i++) { + for(size_t i = 0; i < groupName.length(); i++) { if(!(isalnum(groupName[i]) || (unsigned)groupName[i] >= 0x80)) { // convert punctuation to dashes groupName[i] = '-'; diff --git a/src/style.cpp b/src/style.cpp index c1dd0b2..76cf353 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -35,7 +35,7 @@ std::string Style::CnfWidth(const std::string &prefix) { std::string Style::CnfPrefixToName(const std::string &prefix) { std::string name = "#def-"; - for(int i = 0; i < prefix.length(); i++) { + for(size_t i = 0; i < prefix.length(); i++) { if(isupper(prefix[i]) && i != 0) name += '-'; name += tolower(prefix[i]); diff --git a/tools/unifont2c.cpp b/tools/unifont2c.cpp index 8def106..7e9bf7a 100644 --- a/tools/unifont2c.cpp +++ b/tools/unifont2c.cpp @@ -217,7 +217,7 @@ int main(int argc, char** argv) { deflate(&stream, Z_FINISH); chunk_output_size[chunk_index] += sizeof(compressed_chunk_data) - stream.avail_out; - for(int i = 0; i < sizeof(compressed_chunk_data) - stream.avail_out; i += 16) { + for(size_t i = 0; i < sizeof(compressed_chunk_data) - stream.avail_out; i += 16) { unsigned char *d = &compressed_chunk_data[i]; fprintf(source, " %3d, %3d, %3d, %3d, %3d, %3d, %3d, %3d, " "%3d, %3d, %3d, %3d, %3d, %3d, %3d, %3d,\n",