diff --git a/uppsrc/Core/Algo.h b/uppsrc/Core/Algo.h index eb3124dcb..edd66bca7 100644 --- a/uppsrc/Core/Algo.h +++ b/uppsrc/Core/Algo.h @@ -1000,7 +1000,7 @@ template inline void __IndexSort(II begin, II end, VI pair, const Less& less, const K *) { Sort(IndexSortIterator(begin, pair), - IndexSortIterator(end, pair + (end - begin)), + IndexSortIterator(end, pair + (int)(ptrdiff_t)(end - begin)), less); } diff --git a/uppsrc/Geom/polyalg.cpp b/uppsrc/Geom/polyalg.cpp index 2d4aa64d8..7395b3735 100644 --- a/uppsrc/Geom/polyalg.cpp +++ b/uppsrc/Geom/polyalg.cpp @@ -506,7 +506,7 @@ void PolygonIterator::Add(typename PIUtils::ConstIterator vertices, int ve ue--; } typename PIUtils::PointList& seg1 = segments.Add(); - seg1.SetCount(degen1 ? 2 : ue - ub + 1 + (ue > ub ? 0 : *counts)); + seg1.SetCount(degen1 ? 2 : (int)(ue - ub) + 1 + (ue > ub ? 0 : *counts)); ASSERT(seg1.GetCount() >= 2); ASSERT(ub != e); typename PIUtils::Iterator sp = seg1.End(); @@ -575,7 +575,7 @@ void PolygonIterator::Add(typename PIUtils::ConstIterator vertices, int ve ue--; } typename PIUtils::PointList& seg2 = segments.Add(); - seg2.SetCount(degen2 ? 2 : ue - ub + 1 + (ue > ub ? 0 : *counts)); + seg2.SetCount(degen2 ? 2 : (int)(ue - ub) + 1 + (ue > ub ? 0 : *counts)); ASSERT(seg2.GetCount() >= 2); sp = seg2.Begin(); if(degen2) @@ -965,7 +965,7 @@ void PolygonIterator::Flush(int index, T ypos) typename PIUtils::ConstIterator qb = q.done.Begin(); if(*qb == p.done[0] && qb < qe) qb++; - out_vertices.SetCountR(out_vertices.GetCount() + (qe - qb)); + out_vertices.SetCountR(out_vertices.GetCount() + (int)(qe - qb)); typename PIUtils::Iterator out = out_vertices.End(); while(qb < qe) *--out = *qb++; diff --git a/uppsrc/plugin/dbf/dbf.cpp b/uppsrc/plugin/dbf/dbf.cpp index c4b3dfac5..befd0c7c0 100644 --- a/uppsrc/plugin/dbf/dbf.cpp +++ b/uppsrc/plugin/dbf/dbf.cpp @@ -125,7 +125,7 @@ DbfStream::Field::Field(const char *_name, char type, byte width, byte decimal) { if(_name) { const char *p = reinterpret_cast(memchr(_name, 0, 11)); - name = String(_name, p ? p - _name : 11); + name = String(_name, p ? (int)(p - _name) : 11); } name = ToUpper(name); } @@ -604,7 +604,7 @@ bool DbfStream::Fetch(int row) dbf.Seek(data_offset + row * record.GetCount()); byte *p = record.Begin(), *e = record.End(); - int count = dbf.Get(p, e - p); + int count = dbf.Get(p, (int)(e - p)); if(count < record.GetCount()) memset(p + count, ' ', record.GetCount() - count); if(count <= 0 || (*p != ' ' && *p != 0)) { @@ -750,7 +750,7 @@ void DbfStream::DumpData(Stream& stream) int i; for(i = 0; i < fields.GetCount(); i++) { const Field& field = GetField(i); - int width = max(field.width, strlen(field.name)); + int width = max(field.width, (int)strlen(field.name)); switch(field.type) { case 'D': width = max(width, 10); break; } @@ -843,7 +843,7 @@ Value DbfStream::GetItemString(int i) const p++; while(e > p && e[-1] == ' ') e--; - String s(p, e - p); + String s(p, (int)(e - p)); if(charset == GetDefaultCharset()) return s; return ToUnicode(s, charset); @@ -920,8 +920,8 @@ Value DbfStream::GetItemMemo(int i, bool binary) const return Value(); if(!binary) { byte *p; - if(p = (byte *)memchr(buffer, '\0', len)) len = p - buffer; - if(p = (byte *)memchr(buffer, '\x1A', len)) len = p - buffer; + if(p = (byte *)memchr(buffer, '\0', len)) len = (unsigned)(p - buffer); + if(p = (byte *)memchr(buffer, '\x1A', len)) len = (unsigned)(p - buffer); } out = String(buffer, len); } @@ -936,7 +936,7 @@ Value DbfStream::GetItemMemo(int i, bool binary) const eof = true; break; } - int l = e - buffer; + int l = (int)(e - buffer); if(!eof && l > dbt_block_size) { dbt.SeekCur(dbt_block_size - l); e = buffer + l;