summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2011-01-11 13:12:02 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2011-01-11 13:12:02 (GMT)
commit3e865c9f80bd3666673158e8a1664e7405fe9364 (patch)
tree4a88fa35c5e7f703ea2c539811743242cbd58a37 /src/plugins
parentb500b9f35fbeaa5f0fe8bfaf7b225518bf6e636f (diff)
downloadQt-3e865c9f80bd3666673158e8a1664e7405fe9364.zip
Qt-3e865c9f80bd3666673158e8a1664e7405fe9364.tar.gz
Qt-3e865c9f80bd3666673158e8a1664e7405fe9364.tar.bz2
use qBinaryFind instead of bsearch
Merge-request: 906 Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/codecs/kr/qeuckrcodec.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/plugins/codecs/kr/qeuckrcodec.cpp b/src/plugins/codecs/kr/qeuckrcodec.cpp
index 1246164..0fbd2a0 100644
--- a/src/plugins/codecs/kr/qeuckrcodec.cpp
+++ b/src/plugins/codecs/kr/qeuckrcodec.cpp
@@ -67,11 +67,6 @@
#include "qeuckrcodec.h"
#include "cp949codetbl.h"
-#include <stdlib.h>
-
-#if defined(Q_OS_WINCE)
-# include <qfunctions_wince.h>
-#endif
QT_BEGIN_NAMESPACE
@@ -3402,11 +3397,6 @@ QByteArray QCP949Codec::_name()
return "cp949";
}
-int compare_ushort(const void *a, const void *b)
-{
- return *(unsigned short *)a - *(unsigned short *)b;
-}
-
/*!
\reimp
*/
@@ -3434,10 +3424,8 @@ QByteArray QCP949Codec::convertFromUnicode(const QChar *uc, int len, ConverterSt
*cursor++ = (j >> 8) | 0x80;
*cursor++ = (j & 0xff) | 0x80;
} else {
- unsigned short *ptr = (unsigned short *)bsearch(&ch, cp949_icode_to_unicode, 8822,
- sizeof(unsigned short), compare_ushort);
-
- if(!ptr) {
+ const unsigned short *ptr = qBinaryFind(cp949_icode_to_unicode, cp949_icode_to_unicode + 8822, ch);
+ if (ptr == cp949_icode_to_unicode + 8822) {
// Error
*cursor++ = replacement;
++invalid;