Revision: 6196
Author: nogu.dev
Date: Sun Feb 28 14:58:23 2010
Log: * qt4/immodule/candidatewindow.cpp
* qt4/immodule/plugin.cpp
* qt4/immodule/qhelpermanager.cpp
* qt4/immodule/qtextutil.cpp
* qt4/immodule/quiminfomanager.cpp
* qt4/immodule/quiminputcontext.cpp
* qt4/immodule/quiminputcontext_compose.cpp
* qt4/immodule/quiminputcontext_with_slave.cpp
- Replace NULL with 0.
http://code.google.com/p/uim/source/detail?r=6196
Modified:
/trunk/qt4/immodule/candidatewindow.cpp
/trunk/qt4/immodule/plugin.cpp
/trunk/qt4/immodule/qhelpermanager.cpp
/trunk/qt4/immodule/qtextutil.cpp
/trunk/qt4/immodule/quiminfomanager.cpp
/trunk/qt4/immodule/quiminputcontext.cpp
/trunk/qt4/immodule/quiminputcontext_compose.cpp
/trunk/qt4/immodule/quiminputcontext_with_slave.cpp
=======================================
--- /trunk/qt4/immodule/candidatewindow.cpp Sun Feb 28 14:58:04 2010
+++ /trunk/qt4/immodule/candidatewindow.cpp Sun Feb 28 14:58:23 2010
@@ -69,7 +69,7 @@
{
setFrameStyle( Raised | NoFrame );
- ic = NULL;
+ ic = 0;
//setup CandidateList
cList = new CandidateListView;
@@ -100,7 +100,7 @@
isAlwaysLeft = false;
- subWin = NULL;
+ subWin = 0;
QVBoxLayout *layout = new QVBoxLayout;
layout->setMargin( 0 );
@@ -210,7 +210,7 @@
// setup dummy candidate
for ( int i = 0; i < nrCandidates; i++ )
{
- uim_candidate d = NULL;
+ uim_candidate d = 0;
stores.append( d );
}
=======================================
--- /trunk/qt4/immodule/plugin.cpp Sun Feb 28 14:56:05 2010
+++ /trunk/qt4/immodule/plugin.cpp Sun Feb 28 14:58:23 2010
@@ -51,7 +51,7 @@
#define UIM_QT_LIST_SUBIM_AS_QTIM 0
-QUimInfoManager *UimInputContextPlugin::infoManager = NULL;
+QUimInfoManager *UimInputContextPlugin::infoManager = 0;
UimInputContextPlugin::UimInputContextPlugin()
@@ -80,7 +80,7 @@
else
#endif
if ( key == "uim" )
- imname = uim_get_default_im_name( setlocale( LC_ALL, NULL ) );
+ imname = uim_get_default_im_name( setlocale( LC_ALL, 0 ) );
QStringList langs = createLanguageList( key );
QUimInputContext *uic = new QUimInputContext( imname.toUtf8(),
@@ -143,8 +143,8 @@
qDebug( "name = uim" );
#if UIM_QT_LIST_SUBIM_AS_QTIM
- uim_context tmp_uc = uim_create_context( NULL, "UTF-8",
- NULL, NULL, uim_iconv, NULL );
+ uim_context tmp_uc = uim_create_context( 0, "UTF-8",
+ 0, 0, uim_iconv, 0 );
int nr = uim_get_nr_im( tmp_uc );
if ( uimReady )
{
@@ -170,8 +170,8 @@
return QStringList() << "ja" << "ko" << "zh" << "*";
#if UIM_QT_LIST_SUBIM_AS_QTIM
- uim_context tmp_uc = uim_create_context( NULL, "UTF-8",
- NULL, NULL, uim_iconv, NULL );
+ uim_context tmp_uc = uim_create_context( 0, "UTF-8",
+ 0, 0, uim_iconv, 0 );
int nr = uim_get_nr_im( tmp_uc );
if ( uimReady )
{
=======================================
--- /trunk/qt4/immodule/qhelpermanager.cpp Sun Feb 28 14:57:17 2010
+++ /trunk/qt4/immodule/qhelpermanager.cpp Sun Feb 28 14:58:23 2010
@@ -49,7 +49,7 @@
#include "plugin.h"
static int im_uim_fd = 0;
-static QSocketNotifier *notifier = NULL;
+static QSocketNotifier *notifier = 0;
extern QUimInputContext *focusedInputContext;
extern bool disableFocusedContext;
@@ -59,7 +59,7 @@
QUimHelperManager::QUimHelperManager( QObject *parent )
: QObject( parent )
{
- notifier = NULL;
+ notifier = 0;
im_uim_fd = -1;
}
=======================================
--- /trunk/qt4/immodule/qtextutil.cpp Sun Feb 28 14:57:39 2010
+++ /trunk/qt4/immodule/qtextutil.cpp Sun Feb 28 14:58:23 2010
@@ -193,7 +193,7 @@
break;
case UTextOrigin_Beginning:
- *former = NULL;
+ *former = 0;
if ( latter_req_len >= 0 ) {
if ( precedence_len >= latter_req_len )
text = text.left( latter_req_len );
@@ -237,7 +237,7 @@
text = former_text + latter_text;
}
*former = strdup( text.utf8() );
- *latter = NULL;
+ *latter = 0;
break;
case UTextOrigin_Unspecified:
@@ -321,7 +321,7 @@
break;
case UTextOrigin_Beginning:
- *former = NULL;
+ *former = 0;
start_para = 0;
start_index = 0;
@@ -387,7 +387,7 @@
text += edit->selectedText();
}
*former = strdup( text.utf8() );
- *latter = NULL;
+ *latter = 0;
break;
case UTextOrigin_Unspecified:
@@ -461,7 +461,7 @@
if ( origin == UTextOrigin_Beginning ||
( origin == UTextOrigin_Cursor && cursor_at_beginning ) ) {
- *former = NULL;
+ *former = 0;
offset = 0;
if ( latter_req_len >= 0 ) {
if ( len > latter_req_len )
@@ -482,7 +482,7 @@
return -1;
}
*former = strdup( text.mid( offset, len - offset ).utf8() );
- *latter = NULL;
+ *latter = 0;
} else {
return -1;
}
@@ -522,7 +522,7 @@
if ( origin == UTextOrigin_Beginning ||
( origin == UTextOrigin_Cursor && cursor_at_beginning ) ) {
- *former = NULL;
+ *former = 0;
offset = 0;
if ( latter_req_len >= 0 ) {
if ( len > latter_req_len )
@@ -553,7 +553,7 @@
offset = newline + 1;
}
*former = strdup( text.mid( offset, len - offset ).utf8() );
- *latter = NULL;
+ *latter = 0;
} else {
edit->setTextFormat( format );
return -1;
@@ -594,11 +594,11 @@
offset = newline + 1;
}
*former = strdup( text.mid( offset, len - offset ).utf8() );
- *latter = NULL;
+ *latter = 0;
break;
case UTextOrigin_Beginning:
- *former = NULL;
+ *former = 0;
offset = 0;
if ( latter_req_len >= 0 ) {
if ( latter_req_len < len )
=======================================
--- /trunk/qt4/immodule/quiminfomanager.cpp Sun Feb 28 14:57:17 2010
+++ /trunk/qt4/immodule/quiminfomanager.cpp Sun Feb 28 14:58:23 2010
@@ -60,7 +60,7 @@
{
info.clear();
- uim_context tmp_uc = uim_create_context( NULL, "UTF-8", NULL, NULL,
NULL, NULL );
+ uim_context tmp_uc = uim_create_context( 0, "UTF-8", 0, 0, 0, 0 );
struct uimInfo ui;
int nr = uim_get_nr_im( tmp_uc );
for ( int i = 0; i < nr; i++ )
=======================================
--- /trunk/qt4/immodule/quiminputcontext.cpp Sun Feb 28 14:55:51 2010
+++ /trunk/qt4/immodule/quiminputcontext.cpp Sun Feb 28 14:58:23 2010
@@ -66,14 +66,14 @@
#define DEFAULT_SEPARATOR_STR "|"
-QUimInputContext *focusedInputContext = NULL;
+QUimInputContext *focusedInputContext = 0;
bool disableFocusedContext = false;
QList<QUimInputContext*> contextList;
QUimHelperManager * QUimInputContext::m_HelperManager = 0L;
#ifdef Q_WS_X11
-DefTree *QUimInputContext::mTreeTop = NULL;
+DefTree *QUimInputContext::mTreeTop = 0;
#endif
static int unicodeToUKey(ushort c);
@@ -128,7 +128,7 @@
if ( this == focusedInputContext )
{
- focusedInputContext = NULL;
+ focusedInputContext = 0;
disableFocusedContext = true;
}
@@ -142,8 +142,8 @@
m_imname = imname;
uim_context uc = uim_create_context( this, "UTF-8",
- NULL, ( char * ) imname,
- NULL,
+ 0, ( char * ) imname,
+ 0,
QUimInputContext::commit_cb );
m_HelperManager->checkHelperConnection();
=======================================
--- /trunk/qt4/immodule/quiminputcontext_compose.cpp Sun Feb 28 14:56:41
2010
+++ /trunk/qt4/immodule/quiminputcontext_compose.cpp Sun Feb 28 14:58:23
2010
@@ -69,7 +69,7 @@
Compose::Compose(DefTree *top, QUimInputContext *ic)
{
m_ic = ic;
- m_composed = NULL;
+ m_composed = 0;
m_top = top;
m_context = top;
}
@@ -227,7 +227,7 @@
{
DefTree *p;
- if ((is_push == false) || m_top == NULL)
+ if ((is_push == false) || m_top == 0)
return false;
if (IsModifierKey(xkeysym))
@@ -264,7 +264,7 @@
void Compose::reset()
{
m_context = m_top;
- m_composed = NULL;
+ m_composed = 0;
}
static int
@@ -501,10 +501,10 @@
{ "Shift", ShiftMask },
{ "Alt", Mod1Mask },
{ "Meta", Mod1Mask },
- { NULL, 0 }};
+ { 0, 0 }};
mask = 0;
- for (struct _modtbl *p = tbl; p->name != NULL; p++) {
+ for (struct _modtbl *p = tbl; p->name != 0; p++) {
if (strcmp(name, p->name) == 0) {
mask = p->mask;
break;
@@ -516,7 +516,7 @@
int
QUimInputContext::TransFileName(char *transname, const char *name, size_t
len)
{
- char *home = NULL;
+ char *home = 0;
char lcCompose[MAXPATHLEN];
const char *i = name;
char *j;
@@ -578,7 +578,7 @@
#else
char *p;
- p = setlocale(LC_CTYPE, NULL);
+ p = setlocale(LC_CTYPE, 0);
if (p)
p = strchr(p, '.');
@@ -593,7 +593,7 @@
{
char *p;
- strlcpy(locale, setlocale(LC_CTYPE, NULL), len);
+ strlcpy(locale, setlocale(LC_CTYPE, 0), len);
if (locale[0] == '\0') {
return 0;
}
@@ -636,7 +636,7 @@
unsigned tmp;
KeySym keysym = NoSymbol;
DefTree **top = &mTreeTop;
- DefTree *p = NULL;
+ DefTree *p = 0;
Bool exclam, tilde;
KeySym rhs_keysym = 0;
char *rhs_string_mb;
@@ -676,7 +676,7 @@
if (!TransFileName(filename, *tokenbuf, sizeof(filename)) ||
filename[0] == '\0')
goto error;
infp = fopen(filename, "r");
- if (infp == NULL)
+ if (infp == 0)
goto error;
ParseComposeStringFile(infp);
fclose(infp);
@@ -748,7 +748,7 @@
token = nexttoken(fp, tokenbuf, &lastch, buflen);
if (token == STRING) {
- if ((rhs_string_mb = (char *)malloc(strlen(*tokenbuf) + 1)) ==
NULL)
+ if ((rhs_string_mb = (char *)malloc(strlen(*tokenbuf) + 1)) == 0)
goto error;
strcpy(rhs_string_mb, *tokenbuf);
token = nexttoken(fp, tokenbuf, &lastch, buflen);
@@ -780,7 +780,7 @@
} else {
rhs_string_mb = (char *)malloc(l + 1);
}
- if (rhs_string_mb == NULL) {
+ if (rhs_string_mb == 0) {
goto error;
}
memcpy(rhs_string_mb, local_mb_buf, l);
@@ -803,27 +803,27 @@
if (p) {
top = &p->succession;
} else {
- if ((p = (DefTree*)malloc(sizeof(DefTree))) == NULL) {
+ if ((p = (DefTree*)malloc(sizeof(DefTree))) == 0) {
free(rhs_string_mb);
goto error;
}
p->keysym = buf[i].keysym;
p->modifier = buf[i].modifier;
p->modifier_mask = buf[i].modifier_mask;
- p->succession = NULL;
+ p->succession = 0;
p->next = *top;
- p->mb = NULL;
- p->utf8 = NULL;
+ p->mb = 0;
+ p->utf8 = 0;
p->ks = NoSymbol;
*top = p;
top = &p->succession;
}
}
- if (p->mb != NULL)
+ if (p->mb != 0)
free(p->mb);
p->mb = rhs_string_mb;
- if (p->utf8 != NULL)
+ if (p->utf8 != 0)
free(p->utf8);
p->utf8 = rhs_string_utf8;
p->ks = rhs_keysym;
@@ -862,7 +862,7 @@
tbp = (char *)malloc(buflen);
p[0] = tbp;
- if (tbp != NULL) {
+ if (tbp != 0) {
while (parse_compose_line(fp, p, &buflen) >= 0) {
}
free(p[0]);
@@ -872,7 +872,7 @@
void QUimInputContext::create_compose_tree()
{
- FILE *fp = NULL;
+ FILE *fp = 0;
char name[MAXPATHLEN];
char lang_region[BUFSIZ];
const char *encoding;
@@ -882,14 +882,14 @@
name[0] = '\0';
compose_env = getenv("XCOMPOSEFILE");
- if (compose_env != NULL) {
+ if (compose_env != 0) {
strlcpy(name, compose_env, sizeof(name));
} else {
char *home = getenv("HOME");
- if (home != NULL) {
+ if (home != 0) {
snprintf(name, sizeof(name), "%s/.XCompose", home);
fp = fopen(name, "r");
- if (fp == NULL)
+ if (fp == 0)
name[0] = '\0';
}
}
@@ -897,12 +897,12 @@
if (name[0] == '\0' && !get_compose_filename(name, sizeof(name)))
return;
- if (fp == NULL && ((fp = fopen(name, "r")) == NULL))
+ if (fp == 0 && ((fp = fopen(name, "r")) == 0))
return;
ret = get_lang_region(lang_region, sizeof(lang_region));
encoding = get_encoding();
- if (!ret || encoding == NULL) {
+ if (!ret || encoding == 0) {
fprintf(stderr, "Warning: locale name is NULL\n");
fclose(fp);
return;
@@ -927,20 +927,20 @@
ret = get_lang_region(lang_region, sizeof(lang_region));
encoding = get_encoding();
- if (!ret || encoding == NULL)
+ if (!ret || encoding == 0)
return 0;
snprintf(locale, sizeof(locale), "%s.%s", lang_region, encoding);
snprintf(compose_dir_file, sizeof(compose_dir_file), "%s/%s",
XLIB_DIR, COMPOSE_DIR_FILE);
fp = fopen(compose_dir_file, "r");
- if (fp == NULL) {
+ if (fp == 0) {
/* retry with fallback file */
if (strcmp(FALLBACK_XLIB_DIR, XLIB_DIR)) {
snprintf(compose_dir_file, sizeof(compose_dir_file), "%s/%s",
FALLBACK_XLIB_DIR, COMPOSE_DIR_FILE);
fp = fopen(compose_dir_file, "r");
- if (fp == NULL)
+ if (fp == 0)
return 0;
xlib_dir = FALLBACK_XLIB_DIR;
} else
@@ -948,7 +948,7 @@
}
name[0] = '\0';
- while (fgets(buf, XLC_BUFSIZE, fp) != NULL) {
+ while (fgets(buf, XLC_BUFSIZE, fp) != 0) {
char *p = buf;
int n;
char *args[2], *from, *to;
=======================================
--- /trunk/qt4/immodule/quiminputcontext_with_slave.cpp Sun Feb 28 14:57:01
2010
+++ /trunk/qt4/immodule/quiminputcontext_with_slave.cpp Sun Feb 28 14:58:23
2010
@@ -39,7 +39,7 @@
QUimInputContextWithSlave::QUimInputContextWithSlave( const char *imname,
const char *lang )
: QUimInputContext( imname, lang )
{
- slave = QInputContextFactory::create( "simple", NULL );
+ slave = QInputContextFactory::create( "simple", 0 );
if ( slave )
{
slave->setParent( this );