qt5base: activate iconv support when libiconv-full is avaliable
[feed/video.git] / frameworks / qt5base / patches / 010-iconv-cast.patch
1 --- a/src/corelib/codecs/qiconvcodec.cpp
2 +++ b/src/corelib/codecs/qiconvcodec.cpp
3 @@ -137,7 +137,7 @@ QIconvCodec::IconvState::IconvState(icon
4
5 QIconvCodec::IconvState::~IconvState()
6 {
7 - if (cd != reinterpret_cast<iconv_t>(-1))
8 + if (cd != (iconv_t)-1)
9 iconv_close(cd);
10 if (buffer != array)
11 delete[] buffer;
12 @@ -200,7 +200,7 @@ QString QIconvCodec::convertToUnicode(co
13 if (!*pstate) {
14 // first time, create the state
15 iconv_t cd = createIconv_t(UTF16, 0);
16 - if (cd == reinterpret_cast<iconv_t>(-1)) {
17 + if (cd == (iconv_t)-1) {
18 static int reported = 0;
19 if (!reported++) {
20 fprintf(stderr,
21 @@ -345,19 +345,19 @@ QByteArray QIconvCodec::convertFromUnico
22 IconvState *&state = ts ? ts->localData() : temporaryState;
23 if (!state) {
24 iconv_t cd = createIconv_t(0, UTF16);
25 - if (cd != reinterpret_cast<iconv_t>(-1)) {
26 + if (cd != (iconv_t)-1) {
27 if (!setByteOrder(cd)) {
28 perror("QIconvCodec::convertFromUnicode: using Latin-1 for conversion, iconv failed for BOM");
29
30 iconv_close(cd);
31 - cd = reinterpret_cast<iconv_t>(-1);
32 + cd = (iconv_t)-1;
33
34 return QString(uc, len).toLatin1();
35 }
36 }
37 state = new IconvState(cd);
38 }
39 - if (state->cd == reinterpret_cast<iconv_t>(-1)) {
40 + if (state->cd == (iconv_t)-1) {
41 static int reported = 0;
42 if (!reported++) {
43 fprintf(stderr,