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:
Jean-Francois Dockes
2015-09-01 19:39:20 +02:00
parent 2fe75dba28
commit 1cbf02f713
36 changed files with 107 additions and 103 deletions
+2 -2
View File
@@ -35,7 +35,7 @@ using std::list;
bool RclDHistoryEntry::encode(string& value)
{
char chartime[30];
sprintf(chartime,"%ld", unixtime);
sprintf(chartime,"%lld", (long long)unixtime);
string budi;
base64_encode(udi, budi);
value = string("U ") + string(chartime) + " " + budi;
@@ -161,5 +161,5 @@ int DocSequenceHistory::getResCnt()
{
if (m_hlist.empty())
m_hlist = getDocHistory(m_hist);
return m_hlist.size();
return int(m_hlist.size());
}
+4 -3
View File
@@ -16,6 +16,7 @@
*/
#ifndef _DOCSEQHIST_H_INCLUDED_
#define _DOCSEQHIST_H_INCLUDED_
#include <time.h>
#include "docseq.h"
#include "dynconf.h"
@@ -28,13 +29,13 @@ namespace Rcl {
class RclDHistoryEntry : public DynConfEntry {
public:
RclDHistoryEntry() : unixtime(0) {}
RclDHistoryEntry(long t, const string& u)
RclDHistoryEntry(time_t t, const string& u)
: unixtime(t), udi(u) {}
virtual ~RclDHistoryEntry() {}
virtual bool decode(const string &value);
virtual bool encode(string& value);
virtual bool equal(const DynConfEntry& other);
long unixtime;
time_t unixtime;
string udi;
};
@@ -57,7 +58,7 @@ private:
Rcl::Db *m_db;
RclDynConf *m_hist;
int m_prevnum;
long m_prevtime;
time_t m_prevtime;
std::string m_description; // This is just an nls translated 'doc history'
std::list<RclDHistoryEntry> m_hlist;
std::list<RclDHistoryEntry>::const_iterator m_it;
+8 -8
View File
@@ -54,8 +54,8 @@ struct MatchEntry {
pair<int, int> offs;
// Index of the search group this comes from: this is to relate a
// match to the original user input.
unsigned int grpidx;
MatchEntry(int sta, int sto, unsigned int idx)
size_t grpidx;
MatchEntry(int sta, int sto, size_t idx)
: offs(sta, sto), grpidx(idx)
{
}
@@ -105,7 +105,7 @@ class TextSplitPTR : public TextSplit {
// pos, bts, bte));
// If this word is a search term, remember its byte-offset span.
map<string, unsigned int>::const_iterator it = m_terms.find(dumb);
map<string, size_t>::const_iterator it = m_terms.find(dumb);
if (it != m_terms.end()) {
tboffs.push_back(MatchEntry(bts, bte, (*it).second));
}
@@ -135,7 +135,7 @@ private:
int m_wcount;
// In: user query terms
map<string, unsigned int> m_terms;
map<string, size_t> m_terms;
// m_gterms holds all the terms in m_groups, as a set for quick lookup
set<string> m_gterms;
@@ -214,7 +214,7 @@ static bool do_proximity_test(int window, vector<vector<int>* >& plists,
bool TextSplitPTR::matchGroup(unsigned int grpidx)
{
const vector<string>& terms = m_hdata.groups[grpidx];
int window = m_hdata.groups[grpidx].size() + m_hdata.slacks[grpidx];
int window = int(m_hdata.groups[grpidx].size() + m_hdata.slacks[grpidx]);
LOGDEB1(("TextSplitPTR::matchGroup:d %d: %s\n", window,
vecStringToString(terms).c_str()));
@@ -270,7 +270,7 @@ bool TextSplitPTR::matchGroup(unsigned int grpidx)
for (vector<int>::iterator it = plists[0]->begin();
it != plists[0]->end(); it++) {
int pos = *it;
int sta = int(10E9), sto = 0;
int sta = INT_MAX, sto = 0;
LOGDEB2(("MatchGroup: Testing at pos %d\n", pos));
if (do_proximity_test(window,plists, 1, pos, pos, &sta, &sto, minpos)) {
LOGDEB1(("TextSplitPTR::matchGroup: MATCH termpos [%d,%d]\n",
@@ -417,10 +417,10 @@ bool PlainToRich::plaintorich(const string& in,
// If we still have terms positions, check (byte) position. If
// we are at or after a term match, mark.
if (tPosIt != tPosEnd) {
int ibyteidx = chariter.getBpos();
size_t ibyteidx = chariter.getBpos();
if (ibyteidx == tPosIt->offs.first) {
if (!intag && ibyteidx >= (int)headend) {
*olit += startMatch(tPosIt->grpidx);
*olit += startMatch((unsigned int)(tPosIt->grpidx));
}
inrcltag = 1;
} else if (ibyteidx == tPosIt->offs.second) {
+4 -4
View File
@@ -77,7 +77,7 @@ void ResListPager::resultPageNext()
if (m_winfirst < 0) {
m_winfirst = 0;
} else {
m_winfirst += m_respage.size();
m_winfirst += int(m_respage.size());
}
// Get the next page of results. Note that we look ahead by one to
// determine if there is actually a next page
@@ -102,7 +102,7 @@ void ResListPager::resultPageNext()
// Next button. We'd need to remove the Next link from the page
// too.
// Restore the m_winfirst value, let the current result vector alone
m_winfirst -= m_respage.size();
m_winfirst -= int(m_respage.size());
} else {
// No results at all (on first page)
m_winfirst = -1;
@@ -213,9 +213,9 @@ void ResListPager::displayDoc(RclConfig *config, int i, Rcl::Doc& doc,
// Size information. We print both doc and file if they differ a lot
off_t fsize = -1, dsize = -1;
if (!doc.dbytes.empty())
dsize = atoll(doc.dbytes.c_str());
dsize = static_cast<off_t>(atoll(doc.dbytes.c_str()));
if (!doc.fbytes.empty())
fsize = atoll(doc.fbytes.c_str());
fsize = static_cast<off_t>(atoll(doc.fbytes.c_str()));
string sizebuf;
if (dsize > 0) {
sizebuf = displayableBytes(dsize);
+1 -1
View File
@@ -64,7 +64,7 @@ public:
int pageLastDocNum() {
if (m_winfirst < 0 || m_respage.size() == 0)
return -1;
return m_winfirst + m_respage.size() - 1;
return m_winfirst + int(m_respage.size()) - 1;
}
virtual int pageSize() const {return m_pagesize;}
void pageNext();
+1 -1
View File
@@ -39,7 +39,7 @@ class DocSeqSorted : public DocSeqModifier {
virtual bool canSort() {return true;}
virtual bool setSortSpec(const DocSeqSortSpec &sortspec);
virtual bool getDoc(int num, Rcl::Doc &doc, string *sh = 0);
virtual int getResCnt() {return m_docsp.size();}
virtual int getResCnt() {return int(m_docsp.size());}
private:
DocSeqSortSpec m_spec;
std::vector<Rcl::Doc> m_docs;
+4 -4
View File
@@ -161,10 +161,10 @@ bool WasaParserDriver::addClause(SearchData *sd,
size_t size = strtoll(cl->gettext().c_str(), &cp, 10);
if (*cp != 0) {
switch (*cp) {
case 'k': case 'K': size *= 1E3;break;
case 'm': case 'M': size *= 1E6;break;
case 'g': case 'G': size *= 1E9;break;
case 't': case 'T': size *= 1E12;break;
case 'k': case 'K': size *= 1000;break;
case 'm': case 'M': size *= 1000*1000;break;
case 'g': case 'G': size *= 1000*1000*1000;break;
case 't': case 'T': size *= size_t(1000)*1000*1000*1000;break;
default:
m_reason = string("Bad multiplier suffix: ") + *cp;
delete cl;