more int fixups

--HG--
branch : WINDOWSPORT
This commit is contained in:
Jean-Francois Dockes
2015-09-02 07:34:59 +02:00
parent 1cbf02f713
commit c1c73573d8
10 changed files with 68 additions and 37 deletions
+1
View File
@@ -25,6 +25,7 @@
*/
#ifndef convert_h_included
#define convert_h_included
#include <stddef.h>
#include <string>
#include <vector>
#include <iomanip>
+2 -2
View File
@@ -308,7 +308,7 @@ bool Binc::MimePart::skipUntilBoundary(const string &delimiter,
{
string::size_type endpos = delimiter.length();
char *delimiterqueue = 0;
int delimiterpos = 0;
string::size_type delimiterpos = 0;
const char *delimiterStr = delimiter.c_str();
if (delimiter != "") {
delimiterqueue = new char[endpos];
@@ -540,7 +540,7 @@ void Binc::MimePart::parseSinglePart(const string &toboundary,
string line;
bool toboundaryIsEmpty = (toboundary == "");
char c;
int boundarypos = 0;
string::size_type boundarypos = 0;
while (mimeSource->getChar(&c)) {
if (c == '\n') { ++*nbodylines; ++*nlines; }
+2 -2
View File
@@ -223,7 +223,7 @@ inline bool TextSplit::emitterm(bool isspan, string &w, int pos,
{
LOGDEB2(("TextSplit::emitterm: [%s] pos %d\n", w.c_str(), pos));
size_t l = w.length();
int l = int(w.length());
#ifdef TEXTSPLIT_STATS
// Update word length statistics. Do this before we filter out
@@ -232,7 +232,7 @@ inline bool TextSplit::emitterm(bool isspan, string &w, int pos,
m_stats.newsamp(m_wordChars);
#endif
if (l > 0 && l < (unsigned)m_maxWordLength) {
if (l > 0 && l < m_maxWordLength) {
// 1 byte word: we index single ascii letters and digits, but
// nothing else. We might want to turn this into a test for a
// single utf8 character instead ?
+1 -1
View File
@@ -184,7 +184,7 @@ private:
// Current span. Might be jf.dockes@wanadoo.f
std::string m_span;
std::vector <std::pair<unsigned int, unsigned int> > m_words_in_span;
std::vector <std::pair<int, int> > m_words_in_span;
// Current word: no punctuation at all in there. Byte offset
// relative to the current span and byte length
+2 -2
View File
@@ -15,7 +15,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <limits.h>
#include <string>
#include <utility>
#include <list>
@@ -417,7 +417,7 @@ 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) {
size_t ibyteidx = chariter.getBpos();
int ibyteidx = int(chariter.getBpos());
if (ibyteidx == tPosIt->offs.first) {
if (!intag && ibyteidx >= (int)headend) {
*olit += startMatch((unsigned int)(tPosIt->grpidx));
+1 -1
View File
@@ -270,7 +270,7 @@ public:
{
return m_parentSearch ? m_parentSearch->getMaxExp() : 10000;
}
int getMaxCl()
size_t getMaxCl()
{
return m_parentSearch ? m_parentSearch->getMaxCl() : 100000;
}
+4 -4
View File
@@ -14171,8 +14171,8 @@ int unacmaybefold_string_utf16(const char* in, size_t in_length,
{
char* out;
size_t out_size;
int out_length;
unsigned int i;
size_t out_length;
size_t i;
out_size = in_length > 0 ? in_length : 1024;
@@ -14191,7 +14191,7 @@ int unacmaybefold_string_utf16(const char* in, size_t in_length,
unsigned short c;
unsigned short* p;
size_t l;
int k;
size_t k;
c = (in[i] << 8) | (in[i + 1] & 0xff);
/*
* Lookup the tables for decomposition information
@@ -14236,7 +14236,7 @@ int unacmaybefold_string_utf16(const char* in, size_t in_length,
if(l == 0) {
DEBUG_APPEND("untouched\n");
} else {
int i;
size_t i;
for(i = 0; i < l; i++)
DEBUG_APPEND("0x%04x ", p[i]);
DEBUG_APPEND("\n");
+1 -1
View File
@@ -244,7 +244,7 @@ void base64_encode(const string &in, string &out)
if (0 != srclength) {
/* Get what's left. */
input[0] = input[1] = input[2] = '\0';
for (int i = 0; i < srclength; i++)
for (string::size_type i = 0; i < srclength; i++)
input[i] = in[sidx++];
output[0] = input[0] >> 2;
+31 -2
View File
@@ -1341,7 +1341,7 @@ int main(int argc, char **argv)
{
thisprog = *argv++;argc--;
#if 1
#if 0
if (argc <=0 ) {
cerr << "Usage: smallut <stringtosplit>" << endl;
exit(1);
@@ -1446,8 +1446,37 @@ int main(int argc, char **argv)
string out;
stringsToCSV(tokens, out);
cout << "CSV line: [" << out << "]" << endl;
#endif
#elif 1
string sshort("ABC");
string slong("ABCD");
string sshortsmaller("ABB");
vector<pair<string,string> > cmps;
cmps.push_back(pair<string,string>(sshort,sshort));
cmps.push_back(pair<string,string>(sshort,slong));
cmps.push_back(pair<string,string>(slong,sshort));
cmps.push_back(pair<string,string>(sshortsmaller,sshort));
cmps.push_back(pair<string,string>(sshort, sshortsmaller));
for (vector<pair<string,string> >::const_iterator it = cmps.begin();
it != cmps.end(); it++) {
cout << it->first << " " << it->second << " " <<
stringicmp(it->first, it->second) << endl;
}
cout << endl;
for (vector<pair<string,string> >::const_iterator it = cmps.begin();
it != cmps.end(); it++) {
cout << it->first << " " << it->second << " " <<
stringlowercmp(stringtolower(it->first), it->second) << endl;
}
cout << endl;
for (vector<pair<string,string> >::const_iterator it = cmps.begin();
it != cmps.end(); it++) {
cout << it->first << " " << it->second << " " <<
stringuppercmp(it->first, it->second) << endl;
}
#endif
}
#endif