summaryrefslogtreecommitdiffstats
path: root/src/codecs
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2025-12-05 09:16:19 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2025-12-05 09:16:19 +0900
commitd9f24c630d3a86190017de303bc5750e532cdb61 (patch)
tree50ef1ae6ea0187fbbe258f0d73388fc93508eeec /src/codecs
parent4d495175043c399fdca6e1bb4c74ef176fc76fb4 (diff)
downloadtqt-d9f24c630d3a86190017de303bc5750e532cdb61.tar.gz
tqt-d9f24c630d3a86190017de303bc5750e532cdb61.zip
Replace TRUE/FALSE with boolean values true/false - part 5
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'src/codecs')
-rw-r--r--src/codecs/tqbig5codec.cpp12
-rw-r--r--src/codecs/tqeucjpcodec.cpp6
-rw-r--r--src/codecs/tqeuckrcodec.cpp6
-rw-r--r--src/codecs/tqfontcncodec.cpp2
-rw-r--r--src/codecs/tqgb18030codec.cpp12
-rw-r--r--src/codecs/tqhebrewcodec.cpp22
-rw-r--r--src/codecs/tqisciicodec.cpp4
-rw-r--r--src/codecs/tqjiscodec.cpp18
-rw-r--r--src/codecs/tqsjiscodec.cpp6
-rw-r--r--src/codecs/tqtextcodec.cpp18
-rw-r--r--src/codecs/tqtextcodecfactory.cpp2
-rw-r--r--src/codecs/tqutfcodec.cpp20
12 files changed, 64 insertions, 64 deletions
diff --git a/src/codecs/tqbig5codec.cpp b/src/codecs/tqbig5codec.cpp
index 5184973d2..09db78800 100644
--- a/src/codecs/tqbig5codec.cpp
+++ b/src/codecs/tqbig5codec.cpp
@@ -715,15 +715,15 @@ int TQBig5Codec::heuristicNameMatch(const char* hint) const
{
//tqDebug("TQBig5hkscsCodec::heuristicNameMatch(const char* hint = \"%s\")", hint);
int score = 0;
- bool zh = FALSE;
+ bool zh = false;
if (tqstrnicmp(hint, "zh_TW", 5) == 0) {
score += 16;
- zh = TRUE;
+ zh = true;
}
else if ( tqstrnicmp(hint, "zh", 2) == 0 ||
tqstrnicmp(hint, "chinese", 7) == 0) {
score += 2;
- zh = TRUE;
+ zh = true;
}
const char *p;
if (zh) {
@@ -962,15 +962,15 @@ int TQBig5hkscsCodec::heuristicNameMatch(const char* hint) const
{
//tqDebug("TQBig5hkscsCodec::heuristicNameMatch(const char* hint = \"%s\")", hint);
int score = 0;
- bool zh = FALSE;
+ bool zh = false;
if (tqstrnicmp(hint, "zh_HK", 5) == 0) {
score += 16;
- zh = TRUE;
+ zh = true;
}
else if ( tqstrnicmp(hint, "zh", 2) == 0 ||
tqstrnicmp(hint, "chinese", 7) == 0) {
score += 2;
- zh = TRUE;
+ zh = true;
}
const char *p;
if (zh) {
diff --git a/src/codecs/tqeucjpcodec.cpp b/src/codecs/tqeucjpcodec.cpp
index 6d75e2161..0bfd69a92 100644
--- a/src/codecs/tqeucjpcodec.cpp
+++ b/src/codecs/tqeucjpcodec.cpp
@@ -301,13 +301,13 @@ const char* TQEucJpCodec::mimeName() const
int TQEucJpCodec::heuristicNameMatch(const char* hint) const
{
int score = 0;
- bool ja = FALSE;
+ bool ja = false;
if (tqstrnicmp(hint, "ja_JP", 5) == 0 || tqstrnicmp(hint, "japan", 5) == 0) {
score += 3;
- ja = TRUE;
+ ja = true;
} else if (tqstrnicmp(hint, "ja", 2) == 0) {
score += 2;
- ja = TRUE;
+ ja = true;
}
const char *p;
if (ja) {
diff --git a/src/codecs/tqeuckrcodec.cpp b/src/codecs/tqeuckrcodec.cpp
index bba2c8808..9b9192a80 100644
--- a/src/codecs/tqeuckrcodec.cpp
+++ b/src/codecs/tqeuckrcodec.cpp
@@ -211,14 +211,14 @@ const char* TQEucKrCodec::mimeName() const
int TQEucKrCodec::heuristicNameMatch(const char* hint) const
{
int score = 0;
- bool ko = FALSE;
+ bool ko = false;
if (tqstrnicmp(hint, "ko_KR", 5) == 0 ||
tqstrnicmp(hint, "korean", 5) == 0) {
score += 3;
- ko = TRUE;
+ ko = true;
} else if (tqstrnicmp(hint, "ko", 2) == 0) {
score += 2;
- ko = TRUE;
+ ko = true;
}
const char *p;
if (ko) {
diff --git a/src/codecs/tqfontcncodec.cpp b/src/codecs/tqfontcncodec.cpp
index 36ffc4e54..58bc956b3 100644
--- a/src/codecs/tqfontcncodec.cpp
+++ b/src/codecs/tqfontcncodec.cpp
@@ -233,7 +233,7 @@ void TQFontGbkCodec::fromUnicode(const TQChar *in, unsigned short *out, int leng
bool TQFontGbkCodec::canEncode( TQChar ch ) const
{
if (ch.unicode() >= 0x4e00 && ch.unicode() <= 0x9fa5)
- return TRUE;
+ return true;
uchar buf[4];
int len = qt_UnicodeToGbk( ch.unicode(), buf );
//tqDebug("TQFontGbkCodec::canEncode( TQChar ch = %02X%02X )", ch.row(), ch.cell());
diff --git a/src/codecs/tqgb18030codec.cpp b/src/codecs/tqgb18030codec.cpp
index d2578dc8e..e1010864c 100644
--- a/src/codecs/tqgb18030codec.cpp
+++ b/src/codecs/tqgb18030codec.cpp
@@ -265,11 +265,11 @@ TQString TQGb18030Codec::toUnicode(const char* chars, int len) const
int TQGb18030Codec::heuristicNameMatch(const char* hint) const
{
int score = 0;
- bool zh = FALSE;
+ bool zh = false;
//tqDebug("TQGb18030Codec::heuristicNameMatch(const char* hint = \"%s\")", hint);
if (tqstrnicmp(hint, "zh_CN", 5) == 0){
score += 10;
- zh = TRUE;
+ zh = true;
}
const char *p;
if ( zh ) {
@@ -476,11 +476,11 @@ int TQGbkCodec::heuristicNameMatch(const char* hint) const
#endif
int score = 0;
- bool zh = FALSE;
+ bool zh = false;
//tqDebug("TQGbkCodec::heuristicNameMatch(const char* hint = \"%s\")", hint);
if (tqstrnicmp(hint, "zh_CN", 5) == 0){
score += 10;
- zh = TRUE;
+ zh = true;
}
const char *p;
if ( zh ) {
@@ -670,11 +670,11 @@ const char* TQGb2312Codec::name() const
int TQGb2312Codec::heuristicNameMatch(const char* hint) const
{
int score = 0;
- bool zh = FALSE;
+ bool zh = false;
//tqDebug("TQGb2312Codec::heuristicNameMatch(const char* hint = \"%s\")", hint);
if (tqstrnicmp(hint, "zh_CN", 5) == 0){
score += 10;
- zh = TRUE;
+ zh = true;
}
const char *p;
if ( zh ) {
diff --git a/src/codecs/tqhebrewcodec.cpp b/src/codecs/tqhebrewcodec.cpp
index 0140117b0..928dc0035 100644
--- a/src/codecs/tqhebrewcodec.cpp
+++ b/src/codecs/tqhebrewcodec.cpp
@@ -82,51 +82,51 @@ static const uchar unicode_to_heb_05[32] = {
static bool to8bit(const TQChar ch, TQCString *rstr)
{
- bool converted = FALSE;
+ bool converted = false;
- if( ch.isMark() ) return TRUE; // ignore marks for conversion
+ if( ch.isMark() ) return true; // ignore marks for conversion
if ( ch.row() ) {
if ( ch.row() == 0x05 ) {
if ( ch.cell() > 0x91 )
- converted = TRUE;
+ converted = true;
// 0x0591 - 0x05cf: Hebrew punctuation... dropped
if ( ch.cell() >= 0xD0 )
*rstr += (char)unicode_to_heb_05[ch.cell()- 0xD0];
} else if ( ch.row() == 0x20 ) {
if ( ch.cell() == 0x3E ) {
*rstr += (char)0xAF;
- converted = TRUE;
+ converted = true;
} else if ( ch.cell() == 0x17 ) {
*rstr += (char)0xCF;
- converted = TRUE;
+ converted = true;
}
} else {
- converted = FALSE;
+ converted = false;
}
} else {
if ( ch.cell() < 0x80 ) {
*rstr += (char)ch.cell();
- converted = TRUE;
+ converted = true;
} else if( ch.cell() < 0xA0 ) {
*rstr += (char)unicode_to_heb_00[ch.cell() - 0x80];
- converted = TRUE;
+ converted = true;
}
}
- if(converted) return TRUE;
+ if(converted) return true;
// couldn't convert the char... lets try its decomposition
TQString d = ch.decomposition();
if(d.isNull())
- return FALSE;
+ return false;
int l = d.length();
for (int i=0; i<l; i++) {
const TQChar ch = d[i];
if(to8bit(ch, rstr))
- converted = TRUE;
+ converted = true;
}
return converted;
diff --git a/src/codecs/tqisciicodec.cpp b/src/codecs/tqisciicodec.cpp
index 75d3db3e7..08e0669d7 100644
--- a/src/codecs/tqisciicodec.cpp
+++ b/src/codecs/tqisciicodec.cpp
@@ -172,7 +172,7 @@ TQCString TQIsciiCodec::fromUnicode(const TQString& uc, int& len_in_out) const
int base = codecs[idx].base;
- bool halant = FALSE;
+ bool halant = false;
for (int i =0; i < l; ++i) {
int pos = data[i].unicode() - base;
if (pos > 0 && pos < 0x80) {
@@ -215,7 +215,7 @@ TQString TQIsciiCodec::toUnicode( const char* chars, int len_in ) const
int base = codecs[idx].base;
- bool halant = FALSE;
+ bool halant = false;
for (int i = 0; i < len_in; ++i) {
ushort ch = (uchar) chars[i];
if (ch < 0xa0)
diff --git a/src/codecs/tqjiscodec.cpp b/src/codecs/tqjiscodec.cpp
index beb5863c3..b3be343f2 100644
--- a/src/codecs/tqjiscodec.cpp
+++ b/src/codecs/tqjiscodec.cpp
@@ -393,13 +393,13 @@ int TQJisCodec::heuristicNameMatch(const char* hint) const
return 10;
int score = 0;
- bool ja = FALSE;
+ bool ja = false;
if (tqstrnicmp(hint, "ja_JP", 5) == 0 || tqstrnicmp(hint, "japan", 5) == 0) {
score += 3;
- ja = TRUE;
+ ja = true;
} else if (tqstrnicmp(hint, "ja", 2) == 0) {
score += 2;
- ja = TRUE;
+ ja = true;
}
const char *p;
if (ja) {
@@ -558,7 +558,7 @@ class TQJisDecoder : public TQTextDecoder {
bool esc;
const TQJpUnicodeConv * const conv;
public:
- TQJisDecoder(const TQJpUnicodeConv *c) : nbuf(0), state(Ascii), prev(Ascii), esc(FALSE), conv(c)
+ TQJisDecoder(const TQJpUnicodeConv *c) : nbuf(0), state(Ascii), prev(Ascii), esc(false), conv(c)
{
}
@@ -576,7 +576,7 @@ public:
buf[nbuf++] = ch;
} else {
nbuf = 0;
- esc = FALSE;
+ esc = false;
}
break;
case 1:
@@ -593,7 +593,7 @@ public:
break;
}
nbuf = 0;
- esc = FALSE;
+ esc = false;
}
} else {
if (buf[0] == '(') {
@@ -610,7 +610,7 @@ public:
}
}
nbuf = 0;
- esc = FALSE;
+ esc = false;
}
break;
case 2:
@@ -622,14 +622,14 @@ public:
}
}
nbuf = 0;
- esc = FALSE;
+ esc = false;
break;
}
} else {
if (ch == Esc) {
// Escape sequence
nbuf = 0;
- esc = TRUE;
+ esc = true;
} else if (ch == So) {
// Shift out
prev = state;
diff --git a/src/codecs/tqsjiscodec.cpp b/src/codecs/tqsjiscodec.cpp
index 6262604e3..010ff9293 100644
--- a/src/codecs/tqsjiscodec.cpp
+++ b/src/codecs/tqsjiscodec.cpp
@@ -248,13 +248,13 @@ const char* TQSjisCodec::mimeName() const
int TQSjisCodec::heuristicNameMatch(const char* hint) const
{
int score = 0;
- bool ja = FALSE;
+ bool ja = false;
if (tqstrnicmp(hint, "ja_JP", 5) == 0 || tqstrnicmp(hint, "japan", 5) == 0) {
score += 3;
- ja = TRUE;
+ ja = true;
} else if (tqstrnicmp(hint, "ja", 2) == 0) {
score += 2;
- ja = TRUE;
+ ja = true;
}
const char *p;
if (ja) {
diff --git a/src/codecs/tqtextcodec.cpp b/src/codecs/tqtextcodec.cpp
index 7082c43b0..01aa6e31c 100644
--- a/src/codecs/tqtextcodec.cpp
+++ b/src/codecs/tqtextcodec.cpp
@@ -1154,8 +1154,8 @@ unsigned short TQTextCodec::characterFromUnicode(const TQString &str, int pos) c
}
/*!
- Returns TRUE if the Unicode character \a ch can be fully encoded
- with this codec; otherwise returns FALSE. The default
+ Returns true if the Unicode character \a ch can be fully encoded
+ with this codec; otherwise returns false. The default
implementation tests if the result of toUnicode(fromUnicode(ch))
is the original \a ch. Subclasses may be able to improve the
efficiency.
@@ -1173,7 +1173,7 @@ bool TQTextCodec::canEncode( TQChar ch ) const
bool TQTextCodec::canEncode( const TQString& s ) const
{
if ( s.isEmpty() )
- return TRUE;
+ return true;
return toUnicode(fromUnicode(s)) == s;
}
@@ -1315,7 +1315,7 @@ public:
char line[maxlen];
char esc='\\';
char comm='%';
- bool incmap = FALSE;
+ bool incmap = false;
while (iod->readLine(line,maxlen) > 0) {
if (0==tqstrnicmp(line,"<code_set_name>",15))
n = line+15;
@@ -1334,7 +1334,7 @@ public:
if (!to_unicode) {
to_unicode = new ushort[256];
}
- incmap = TRUE;
+ incmap = true;
} else if (0==tqstrnicmp(line,"END CHARMAP",11))
break;
else if (incmap) {
@@ -2380,7 +2380,7 @@ bool TQSimpleTextCodec::canEncode( TQChar ch ) const
unsigned short u = ch.unicode();
unsigned char* rmp = reverseMap->data();
int rmsize = (int) reverseMap->size();
- return u < 128 ? TRUE : (( u < rmsize ) ? (*(rmp+u) != 0) : FALSE );
+ return u < 128 ? true : (( u < rmsize ) ? (*(rmp+u) != 0) : false );
}
const char* TQSimpleTextCodec::name() const
@@ -2615,7 +2615,7 @@ TQString TQLatin15Codec::toUnicode(const char* chars, int len) const
}
static inline unsigned char
-latin15CharFromUnicode( unsigned short uc, bool replacement = TRUE )
+latin15CharFromUnicode( unsigned short uc, bool replacement = true )
{
uchar c;
if ( uc < 0x0100 ) {
@@ -2678,7 +2678,7 @@ latin15CharFromUnicode( unsigned short uc, bool replacement = TRUE )
void TQLatin15Codec::fromUnicode( const TQChar *in, unsigned short *out, int length ) const
{
while ( length-- ) {
- *out = latin15CharFromUnicode( in->unicode(), FALSE );
+ *out = latin15CharFromUnicode( in->unicode(), false );
++in;
++out;
}
@@ -2704,7 +2704,7 @@ TQCString TQLatin15Codec::fromUnicode(const TQString& uc, int& len ) const
unsigned short TQLatin15Codec::characterFromUnicode(const TQString &str, int pos) const
{
- return latin15CharFromUnicode( str.unicode()[pos].unicode(), FALSE );
+ return latin15CharFromUnicode( str.unicode()[pos].unicode(), false );
}
diff --git a/src/codecs/tqtextcodecfactory.cpp b/src/codecs/tqtextcodecfactory.cpp
index b3895360c..476eaec5b 100644
--- a/src/codecs/tqtextcodecfactory.cpp
+++ b/src/codecs/tqtextcodecfactory.cpp
@@ -78,7 +78,7 @@ static void create_manager()
manager =
new TQPluginManager<TQTextCodecFactoryInterface>(IID_QTextCodecFactory,
TQApplication::libraryPaths(), "/codecs",
- FALSE);
+ false);
TQ_CHECK_PTR( manager );
cleanup_manager.set( &manager );
}
diff --git a/src/codecs/tqutfcodec.cpp b/src/codecs/tqutfcodec.cpp
index eba25e505..5c3bfb26a 100644
--- a/src/codecs/tqutfcodec.cpp
+++ b/src/codecs/tqutfcodec.cpp
@@ -158,7 +158,7 @@ class TQUtf8Decoder : public TQTextDecoder {
int need;
bool headerDone;
public:
- TQUtf8Decoder() : need(0), headerDone(FALSE)
+ TQUtf8Decoder() : need(0), headerDone(false)
{
}
@@ -180,14 +180,14 @@ public:
// surrogate pair
*qch++ = TQChar(TQChar::highSurrogate(uc));
*qch++ = TQChar(TQChar::lowSurrogate(uc));
- headerDone = TRUE;
+ headerDone = true;
} else if ((uc < min_uc) || (uc >= 0xd800 && uc <= 0xdfff) || (uc >= 0xfffe)) {
// overlong sequence, UTF16 surrogate or BOM
*qch++ = TQChar::replacement;
} else {
if (headerDone || TQChar(uc) != TQChar::byteOrderMark)
*qch++ = uc;
- headerDone = TRUE;
+ headerDone = true;
}
}
} else {
@@ -199,7 +199,7 @@ public:
} else {
if ( ch < 128 ) {
*qch++ = ch;
- headerDone = TRUE;
+ headerDone = true;
} else if ((ch & 0xe0) == 0xc0) {
uc = ch & 0x1f;
need = 1;
@@ -262,7 +262,7 @@ int TQUtf16Codec::heuristicContentMatch(const char* chars, int len) const
class TQUtf16Encoder : public TQTextEncoder {
bool headerdone;
public:
- TQUtf16Encoder() : headerdone(FALSE)
+ TQUtf16Encoder() : headerdone(false)
{
}
@@ -274,7 +274,7 @@ public:
memcpy(d.data(),uc.unicode(),lenInOut);
return d;
} else {
- headerdone = TRUE;
+ headerdone = true;
lenInOut = (1+uc.length())*sizeof(TQChar);
TQCString d(lenInOut);
memcpy(d.data(),&TQChar::byteOrderMark,sizeof(TQChar));
@@ -291,7 +291,7 @@ class TQUtf16Decoder : public TQTextDecoder {
bool headerdone;
public:
- TQUtf16Decoder() : half(FALSE), swap(FALSE), headerdone(FALSE)
+ TQUtf16Decoder() : half(false), swap(false), headerdone(false)
{
}
@@ -318,13 +318,13 @@ public:
} else {
*qch++ = ch;
}
- headerdone = TRUE;
+ headerdone = true;
} else
*qch++ = ch;
- half = FALSE;
+ half = false;
} else {
buf = *chars++;
- half = TRUE;
+ half = true;
}
}
result.truncate( qch - result.unicode() );