Suppressed many integer size warnings by a mix of type adjustments and casts,
none of which should have a real effect. --HG-- branch : WINDOWSPORT
This commit is contained in:
@@ -217,7 +217,7 @@ void base64_encode(const string &in, string &out)
|
||||
|
||||
out.clear();
|
||||
|
||||
int srclength = in.length();
|
||||
string::size_type srclength = in.length();
|
||||
int sidx = 0;
|
||||
while (2 < srclength) {
|
||||
input[0] = in[sidx++];
|
||||
|
||||
@@ -1013,10 +1013,10 @@ bool CirCache::put(const string& udi, const ConfSimple *iconf,
|
||||
unsigned short flags = 0;
|
||||
TempBuf compbuf;
|
||||
if (!(iflags & NoCompHint)) {
|
||||
ULONG len = compressBound(data.size());
|
||||
uLong len = compressBound(static_cast<uLong>(data.size()));
|
||||
char *bf = compbuf.setsize(len);
|
||||
if (bf != 0 &&
|
||||
compress((Bytef*)bf, &len, (Bytef*)data.c_str(), data.size())
|
||||
compress((Bytef*)bf, &len, (Bytef*)data.c_str(), static_cast<uLong>(data.size()))
|
||||
== Z_OK) {
|
||||
if (float(len) < 0.9 * float(data.size())) {
|
||||
// bf is local but it's our static buffer address
|
||||
@@ -1034,7 +1034,7 @@ bool CirCache::put(const string& udi, const ConfSimple *iconf,
|
||||
}
|
||||
|
||||
// Characteristics for the new entry.
|
||||
int nsize = CIRCACHE_HEADER_SIZE + dic.size() + datalen;
|
||||
off_t nsize = CIRCACHE_HEADER_SIZE + dic.size() + datalen;
|
||||
off_t nwriteoffs = m_d->m_oheadoffs;
|
||||
off_t npadsize = 0;
|
||||
bool extending = false;
|
||||
|
||||
@@ -68,7 +68,7 @@ void ConfSimple::parseinput(istream &input)
|
||||
}
|
||||
|
||||
{
|
||||
int ll = strlen(cline);
|
||||
size_t ll = strlen(cline);
|
||||
while (ll > 0 && (cline[ll-1] == '\n' || cline[ll-1] == '\r')) {
|
||||
cline[ll-1] = 0;
|
||||
ll--;
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ struct HighlightData {
|
||||
* user term or group may generate many processed/expanded terms
|
||||
* or groups, this is how we relate an expansion to its source.
|
||||
*/
|
||||
std::vector<unsigned int> grpsugidx;
|
||||
std::vector<size_t> grpsugidx;
|
||||
|
||||
void clear()
|
||||
{
|
||||
|
||||
@@ -134,7 +134,7 @@ bool file_scan(const string &fn, FileScanDo* doer, off_t startoffs,
|
||||
if (cnttoread != size_t(-1)) {
|
||||
toread = MIN(toread, cnttoread - totread);
|
||||
}
|
||||
int n = read(fd, buf, toread);
|
||||
ssize_t n = static_cast<ssize_t>(read(fd, buf, toread));
|
||||
if (n < 0) {
|
||||
catstrerror(reason, "read", errno);
|
||||
goto out;
|
||||
|
||||
@@ -54,7 +54,7 @@ int stringicmp(const string & s1, const string& s2)
|
||||
{
|
||||
string::const_iterator it1 = s1.begin();
|
||||
string::const_iterator it2 = s2.begin();
|
||||
int size1 = s1.length(), size2 = s2.length();
|
||||
string::size_type size1 = s1.length(), size2 = s2.length();
|
||||
char c1, c2;
|
||||
|
||||
if (size1 < size2) {
|
||||
@@ -114,7 +114,7 @@ int stringlowercmp(const string & s1, const string& s2)
|
||||
{
|
||||
string::const_iterator it1 = s1.begin();
|
||||
string::const_iterator it2 = s2.begin();
|
||||
int size1 = s1.length(), size2 = s2.length();
|
||||
string::size_type size1 = s1.length(), size2 = s2.length();
|
||||
char c2;
|
||||
|
||||
if (size1 < size2) {
|
||||
@@ -143,7 +143,7 @@ int stringuppercmp(const string & s1, const string& s2)
|
||||
{
|
||||
string::const_iterator it1 = s1.begin();
|
||||
string::const_iterator it2 = s2.begin();
|
||||
int size1 = s1.length(), size2 = s2.length();
|
||||
string::size_type size1 = s1.length(), size2 = s2.length();
|
||||
char c2;
|
||||
|
||||
if (size1 < size2) {
|
||||
@@ -486,7 +486,7 @@ void utf8truncate(string &s, int maxlen)
|
||||
if (s.size() <= string::size_type(maxlen))
|
||||
return;
|
||||
Utf8Iter iter(s);
|
||||
int pos = 0;
|
||||
string::size_type pos = 0;
|
||||
while (iter++ != string::npos)
|
||||
if (iter.getBpos() < string::size_type(maxlen))
|
||||
pos = iter.getBpos();
|
||||
@@ -1176,7 +1176,7 @@ void HighlightData::toString(std::string& out)
|
||||
int(groups.size()), int(grpsugidx.size()), int(ugroups.size()));
|
||||
out.append(cbuf);
|
||||
|
||||
unsigned int ugidx = (unsigned int)-1;
|
||||
size_t ugidx = (size_t)-1;
|
||||
for (unsigned int i = 0; i < groups.size(); i++) {
|
||||
if (ugidx != grpsugidx[i]) {
|
||||
ugidx = grpsugidx[i];
|
||||
@@ -1205,7 +1205,7 @@ void HighlightData::append(const HighlightData& hl)
|
||||
|
||||
groups.insert(groups.end(), hl.groups.begin(), hl.groups.end());
|
||||
slacks.insert(slacks.end(), hl.slacks.begin(), hl.slacks.end());
|
||||
for (std::vector<unsigned int>::const_iterator it = hl.grpsugidx.begin();
|
||||
for (std::vector<size_t>::const_iterator it = hl.grpsugidx.begin();
|
||||
it != hl.grpsugidx.end(); it++) {
|
||||
grpsugidx.push_back(*it + ugsz0);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
/** "Direct" access. Awfully inefficient as we skip from start or current
|
||||
* position at best. This can only be useful for a lookahead from the
|
||||
* current position */
|
||||
unsigned int operator[](unsigned int charpos) const
|
||||
unsigned int operator[](std::string::size_type charpos) const
|
||||
{
|
||||
std::string::size_type mypos = 0;
|
||||
unsigned int mycp = 0;
|
||||
|
||||
Reference in New Issue
Block a user