Gentoo Archives: gentoo-commits

From: "Santiago M. Mola (coldwind)" <coldwind@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-text/htmlrecode/files: htmlrecode-1.3.0-misc-fixes.patch
Date: Wed, 23 Jul 2008 15:55:31
Message-Id: E1KLggb-0002nn-8j@stork.gentoo.org
1 coldwind 08/07/23 15:55:29
2
3 Added: htmlrecode-1.3.0-misc-fixes.patch
4 Log:
5 Version bump, add ~amd64 keyword, fix 64bit (bug #228103) and gcc-4.3 compatibility.
6 (Portage version: 2.2_rc1/cvs/Linux 2.6.26-gentoo x86_64)
7
8 Revision Changes Path
9 1.1 app-text/htmlrecode/files/htmlrecode-1.3.0-misc-fixes.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-text/htmlrecode/files/htmlrecode-1.3.0-misc-fixes.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-text/htmlrecode/files/htmlrecode-1.3.0-misc-fixes.patch?rev=1.1&content-type=text/plain
13
14 Index: htmlrecode-1.3.0-misc-fixes.patch
15 ===================================================================
16 Reason: Adds missing headers (gcc-4.3 compatibility),
17 use size_t and long where needed (amd64 fixes), and fixes some warnings.
18 Upstream: Sent.
19 --- htmlrecode-1.3.0.orig/argh/argh.cc
20 +++ htmlrecode-1.3.0/argh/argh.cc
21 @@ -1,6 +1,7 @@
22 #include <map>
23 #include <cstdio>
24 #include <cstring>
25 +#include <cstdlib>
26
27 using std::strchr;
28 using std::sprintf;
29 @@ -153,7 +154,7 @@
30 else if(longo.substr(0, 5) == "with-") { nega=false; longo.erase(0, 5); }
31
32 NegaDone:
33 - unsigned p = longo.find('=');
34 + size_t p = longo.find('=');
35 if(p == longo.npos)p = longo.find(':');
36 string option;
37 if(p != longo.npos) {option=longo.substr(p+1);longo.erase(p);}
38 @@ -192,7 +193,7 @@
39 argh_descsmap::const_iterator k;
40
41 vector<pair<string,string> > hdrs;
42 - unsigned widest=0;
43 + size_t widest=0;
44
45 for(j=aliases->begin(); j!=aliases->end(); ++j)
46 if(argtypes->find(j->second) == argtypes->end())
47 @@ -244,7 +245,7 @@
48 hdrs.push_back(pair<string,string> (s, k->second.first));
49 }
50
51 - for(unsigned a=0; a<hdrs.size(); ++a)
52 + for(size_t a=0; a<hdrs.size(); ++a)
53 PrintOpt(widest, hdrs[a].first, hdrs[a].second);
54 }
55
56 @@ -380,9 +381,9 @@
57 printf(" %-*s ", space, opt.c_str());
58
59 bool needeol = true;
60 - for(unsigned a=0; a < desc.size(); )
61 + for(size_t a=0; a < desc.size(); )
62 {
63 - unsigned b = desc.find('\n', a);
64 + size_t b = desc.find('\n', a);
65 if(!needeol){printf("%*s", space+6, "");needeol=true;}
66 if(b == desc.npos) { printf("%s", desc.c_str()+a); break; }
67 printf("%s", desc.substr(a, b-a).c_str());
68 --- htmlrecode-1.3.0.orig/htmlrecode.cc
69 +++ htmlrecode-1.3.0/htmlrecode.cc
70 @@ -8,6 +8,7 @@
71 #include <list> // list
72 #include <cerrno> // errno
73 #include <cstdlib> // perror
74 +#include <cstring> // memmove
75
76 #include "htmlrecode.hh"
77
78 @@ -41,7 +42,7 @@
79 }
80 static bool IsEqual(const wstring &s1, const char *s2)
81 {
82 - for(unsigned a=0; a<s1.size(); ++a, ++s2)
83 + for(size_t a=0; a<s1.size(); ++a, ++s2)
84 {
85 if(!*s2)return false;
86 if(s1[a] >= 0x100)return false;
87 @@ -147,8 +148,8 @@
88 bool Page::Dumper::isok(ucs4 p) const
89 {
90 char OutBuf[256], *outptr = OutBuf, *tmp = (char *)&p;
91 - unsigned outsize = sizeof OutBuf;
92 - unsigned insize = sizeof(p);
93 + size_t outsize = sizeof OutBuf;
94 + size_t insize = sizeof(p);
95 size_t retval = iconv(tester, &tmp, &insize, &outptr, &outsize);
96 if(retval == (size_t)-1)return false;
97 return true;
98 @@ -524,10 +525,10 @@
99 while(left > 0)
100 {
101 char OutBuf[4096], *outptr = OutBuf;
102 - unsigned outsize = sizeof OutBuf;
103 + size_t outsize = sizeof OutBuf;
104 #if DEBUG
105 fprintf(stderr, "P1:Converting %u bytes to %u bytes space\n", left, outsize);
106 - unsigned bytesread = left, converted = outsize;
107 + size_t bytesread = left, converted = outsize;
108 #endif
109 size_t retval = iconv(converter, &input, &left, &outptr, &outsize);
110 #if DEBUG
111 @@ -761,7 +762,7 @@
112 wstring &s = tag.GetParamValue("CONTENT");
113
114 wstring tmp; tmp += "charset=";
115 - unsigned a = s.find(tmp);
116 + size_t a = s.find(tmp);
117 if(a == s.npos) { continue; }
118 a += 8;
119
120 @@ -852,7 +853,7 @@
121
122 for(;;)
123 {
124 - int code = fread(bufptr+bytes, 1, sizeof InBuf - bytes, fp);
125 + size_t code = fread(bufptr+bytes, 1, sizeof InBuf - bytes, fp);
126 if(code <= 0)
127 {
128 if(!bytes)break;
129 @@ -868,9 +869,9 @@
130 bool gotilseq = false;
131 #if DEBUG
132 fprintf(stderr, "P2:Converting %u bytes to %u bytes space\n", bytes, outsize);
133 - unsigned bytesread = bytes;
134 + size_t bytesread = bytes;
135 #endif
136 - unsigned converted = outsize;
137 + size_t converted = outsize;
138 size_t retval = iconv(converter, &bufptr, &bytes, &outptr, &outsize);
139 converted -= outsize;
140 #if DEBUG
141 @@ -971,7 +972,7 @@
142 wstring s = tag.GetParamValue("CONTENT");
143
144 wstring tmp; tmp += "charset=";
145 - unsigned a = s.find(tmp);
146 + size_t a = s.find(tmp);
147 if(a == s.npos) { continue; }
148
149 wstring way = s.substr(a+8);
150 @@ -1002,7 +1003,7 @@
151 {
152 fprintf(stderr, "Error: The document is schizophrenic and claims to be encoded in various ways:");
153 set<wstring>::const_iterator i;
154 - unsigned c=newcharset.size();
155 + size_t c=newcharset.size();
156 for(i=newcharset.begin(); i!=newcharset.end(); ++i)
157 {
158 string s = Stringify(*i);
159 @@ -1523,7 +1524,7 @@
160 Argh.StartParse(argc, argv);
161 for(;;)
162 {
163 - int c = Argh.GetParam();
164 + long c = Argh.GetParam();
165 if(c == -1)break;
166 switch(c)
167 {