Reason: Adds missing headers (gcc-4.3 compatibility), use size_t and long where needed (amd64 fixes), and fixes some warnings. Upstream: Sent. --- htmlrecode-1.3.0.orig/argh/argh.cc +++ htmlrecode-1.3.0/argh/argh.cc @@ -1,6 +1,7 @@ #include #include #include +#include using std::strchr; using std::sprintf; @@ -153,7 +154,7 @@ else if(longo.substr(0, 5) == "with-") { nega=false; longo.erase(0, 5); } NegaDone: - unsigned p = longo.find('='); + size_t p = longo.find('='); if(p == longo.npos)p = longo.find(':'); string option; if(p != longo.npos) {option=longo.substr(p+1);longo.erase(p);} @@ -192,7 +193,7 @@ argh_descsmap::const_iterator k; vector > hdrs; - unsigned widest=0; + size_t widest=0; for(j=aliases->begin(); j!=aliases->end(); ++j) if(argtypes->find(j->second) == argtypes->end()) @@ -244,7 +245,7 @@ hdrs.push_back(pair (s, k->second.first)); } - for(unsigned a=0; a // list #include // errno #include // perror +#include // memmove #include "htmlrecode.hh" @@ -41,7 +42,7 @@ } static bool IsEqual(const wstring &s1, const char *s2) { - for(unsigned a=0; a= 0x100)return false; @@ -147,8 +148,8 @@ bool Page::Dumper::isok(ucs4 p) const { char OutBuf[256], *outptr = OutBuf, *tmp = (char *)&p; - unsigned outsize = sizeof OutBuf; - unsigned insize = sizeof(p); + size_t outsize = sizeof OutBuf; + size_t insize = sizeof(p); size_t retval = iconv(tester, &tmp, &insize, &outptr, &outsize); if(retval == (size_t)-1)return false; return true; @@ -524,10 +525,10 @@ while(left > 0) { char OutBuf[4096], *outptr = OutBuf; - unsigned outsize = sizeof OutBuf; + size_t outsize = sizeof OutBuf; #if DEBUG fprintf(stderr, "P1:Converting %u bytes to %u bytes space\n", left, outsize); - unsigned bytesread = left, converted = outsize; + size_t bytesread = left, converted = outsize; #endif size_t retval = iconv(converter, &input, &left, &outptr, &outsize); #if DEBUG @@ -761,7 +762,7 @@ wstring &s = tag.GetParamValue("CONTENT"); wstring tmp; tmp += "charset="; - unsigned a = s.find(tmp); + size_t a = s.find(tmp); if(a == s.npos) { continue; } a += 8; @@ -852,7 +853,7 @@ for(;;) { - int code = fread(bufptr+bytes, 1, sizeof InBuf - bytes, fp); + size_t code = fread(bufptr+bytes, 1, sizeof InBuf - bytes, fp); if(code <= 0) { if(!bytes)break; @@ -868,9 +869,9 @@ bool gotilseq = false; #if DEBUG fprintf(stderr, "P2:Converting %u bytes to %u bytes space\n", bytes, outsize); - unsigned bytesread = bytes; + size_t bytesread = bytes; #endif - unsigned converted = outsize; + size_t converted = outsize; size_t retval = iconv(converter, &bufptr, &bytes, &outptr, &outsize); converted -= outsize; #if DEBUG @@ -971,7 +972,7 @@ wstring s = tag.GetParamValue("CONTENT"); wstring tmp; tmp += "charset="; - unsigned a = s.find(tmp); + size_t a = s.find(tmp); if(a == s.npos) { continue; } wstring way = s.substr(a+8); @@ -1002,7 +1003,7 @@ { fprintf(stderr, "Error: The document is schizophrenic and claims to be encoded in various ways:"); set::const_iterator i; - unsigned c=newcharset.size(); + size_t c=newcharset.size(); for(i=newcharset.begin(); i!=newcharset.end(); ++i) { string s = Stringify(*i); @@ -1523,7 +1524,7 @@ Argh.StartParse(argc, argv); for(;;) { - int c = Argh.GetParam(); + long c = Argh.GetParam(); if(c == -1)break; switch(c) {