[uim-commit] r2945 - trunk/xim

ekato at freedesktop.org ekato at freedesktop.org
Fri Jan 20 07:09:48 PST 2006


Author: ekato
Date: 2006-01-20 07:09:07 -0800 (Fri, 20 Jan 2006)
New Revision: 2945

Modified:
   trunk/xim/canddisp.cpp
   trunk/xim/connection.cpp
   trunk/xim/convdisp.cpp
   trunk/xim/helper.cpp
   trunk/xim/locale.cpp
   trunk/xim/main.cpp
   trunk/xim/util.cpp
   trunk/xim/ximic.cpp
   trunk/xim/ximim.cpp
   trunk/xim/ximpacket.cpp
   trunk/xim/ximserver.cpp
   trunk/xim/ximtrans.cpp
Log:
* xim/canddisp.cpp      
* xim/connection.cpp
* xim/convdisp.cpp      
* xim/helper.cpp        
* xim/locale.cpp
* xim/main.cpp  
* xim/util.cpp  
* xim/ximtrans.cpp
* xim/ximic.cpp
* xim/ximim.cpp
* xim/ximpacket.cpp     
* xim/ximserver.cpp
  - Cosmetic changes, suppress compilation time warnings of unused
    parameters, and some optimizations about STL containers.


Modified: trunk/xim/canddisp.cpp
===================================================================
--- trunk/xim/canddisp.cpp	2006-01-20 07:59:29 UTC (rev 2944)
+++ trunk/xim/canddisp.cpp	2006-01-20 15:09:07 UTC (rev 2945)
@@ -66,7 +66,7 @@
 static int candwin_pid;
 static Canddisp *disp;
 static const char *command;
-static bool candwin_inited = false;
+static bool candwin_initted = false;
 
 static void candwin_read_cb(int fd, int ev);
 
@@ -104,7 +104,7 @@
     if (!command)
 	command = candwin_command();
 
-    if (!candwin_inited && command) {
+    if (!candwin_initted && command) {
 	candwin_pid = uim_ipc_open_command(candwin_pid, &candwin_r, &candwin_w, command);
 	if (disp)
 	    delete disp;
@@ -118,7 +118,7 @@
 		    add_fd_watch(fd, READ_OK, candwin_read_cb);
 	    }
 	}
-	candwin_inited = true;
+	candwin_initted = true;
     }
     return disp;
 }
@@ -139,7 +139,7 @@
 
     fprintf(candwin_w, "activate\ncharset=UTF-8\ndisplay_limit=%d\n",
 		    display_limit);
-    for (i = candidates.begin(); i != candidates.end(); i++)
+    for (i = candidates.begin(); i != candidates.end(); ++i)
 	fprintf(candwin_w, "%s\n", *i);
     fprintf(candwin_w, "\n");
     fflush(candwin_w);
@@ -231,7 +231,7 @@
 	terminate_canddisp_connection();
 }
 
-static void candwin_read_cb(int fd, int ev)
+static void candwin_read_cb(int fd, int /* ev */)
 {
     char buf[1024];
     int n;
@@ -289,6 +289,6 @@
     }
 
     candwin_w = candwin_r = NULL;
-    candwin_inited = false;
+    candwin_initted = false;
     return;
 }

Modified: trunk/xim/connection.cpp
===================================================================
--- trunk/xim/connection.cpp	2006-01-20 07:59:29 UTC (rev 2944)
+++ trunk/xim/connection.cpp	2006-01-20 15:09:07 UTC (rev 2945)
@@ -93,7 +93,7 @@
 reapOldConnection()
 {
     std::map<Window, XConnection *>::iterator it;
-    for (it = gXConnections.begin(); it != gXConnections.end(); it++) {
+    for (it = gXConnections.begin(); it != gXConnections.end(); ++it) {
 	XConnection *xc = (*it).second;
 	if (!xc->isValid()) {
 	    delete xc;
@@ -150,7 +150,7 @@
     free(mBuf.buf);
 }
 
-void XConnection::destroy(Window w)
+void XConnection::destroy(Window /* w */)
 {
     if (mIsValid)
 	OnClose();
@@ -256,7 +256,7 @@
     bool sent_preedit_done = false;
     int major;
 
-    while (mPendingTxQ.size()) {
+    while (!mPendingTxQ.empty()) {
 	if (hasSyncFlag() || hasPreeditStartSyncFlag() ||
 			hasPreeditCaretSyncFlag())
 	    break;
@@ -291,7 +291,7 @@
 	    // push first XIM_COMMIT into the head of the queue
 	    std::list<TxPacket *> tmp;
 	    bool first = true;
-	    while (mPendingTxQ.size()) {
+	    while (!mPendingTxQ.empty()) {
 		j = mPendingTxQ.begin();
 		major = (*j)->get_major();
 		if (major == XIM_COMMIT && first == true) {
@@ -314,8 +314,8 @@
     bool sent_preedit_done = false;
     int major;
 
-    while (mPTxQ.size()) {
-	if (mPendingTxQ.size())
+    while (!mPTxQ.empty()) {
+	if (!mPendingTxQ.empty())
 	    break;
 
 	i = mPTxQ.begin();
@@ -355,7 +355,7 @@
 	    // push first XIM_COMMIT into the head of passive queue
 	    std::list<TxPacket *> tmp;
 	    bool first = true;
-	    while (mPTxQ.size()) {
+	    while (!mPTxQ.empty()) {
 		j = mPTxQ.begin();
 		major = (*j)->get_major();
 		if (major == XIM_COMMIT && first == true) {
@@ -377,7 +377,7 @@
     std::list<TxPacket *>::iterator i;
     int major;
 
-    while (mTxQ.size()) {
+    while (!mTxQ.empty()) {
 	i = mTxQ.begin();
 	major = (*i)->get_major();
 	if (major == XIM_FORWARD_EVENT) {

Modified: trunk/xim/convdisp.cpp
===================================================================
--- trunk/xim/convdisp.cpp	2006-01-20 07:59:29 UTC (rev 2944)
+++ trunk/xim/convdisp.cpp	2006-01-20 15:09:07 UTC (rev 2945)
@@ -676,7 +676,7 @@
     mCursorX = m_x;
     mCharPos = 0;
     std::list<pe_ustring>::iterator i;
-    for (i = p->ustrings.begin(); i != p->ustrings.end(); i++) {
+    for (i = p->ustrings.begin(); i != p->ustrings.end(); ++i) {
 	draw_segment(&(*i));
     }
     draw_cursor();
@@ -733,7 +733,7 @@
     uString::iterator i;
     int caret_pos = mConvdisp->get_caret_pos();
 
-    for (i = s->s.begin(); i != s->s.end(); i++) {
+    for (i = s->s.begin(); i != s->s.end(); ++i) {
 	uchar ch = *i;
 	int width = get_char_width(ch);
 	draw_char(m_x, PE_LINE_WIN_FONT_POS_Y, ch, s->stat);
@@ -768,7 +768,7 @@
     int width = 0;
     uString::iterator i;
 
-    for (i = s->s.begin(); i != s->s.end(); i++) {
+    for (i = s->s.begin(); i != s->s.end(); ++i) {
 	uchar ch = *i;
 	width += get_char_width(ch);
     }
@@ -780,7 +780,7 @@
     int width = 0;
     std::list<pe_ustring>::iterator i;
 
-    for (i = p->ustrings.begin(); i != p->ustrings.end(); i++)
+    for (i = p->ustrings.begin(); i != p->ustrings.end(); ++i)
 	width += calc_segment_extent(&(*i));	
 
     if (width < PE_LINE_WIN_WIDTH)
@@ -921,7 +921,7 @@
 {
     uString s;
     std::list<pe_ustring>::iterator it;
-    for (it = m_pe->ustrings.begin(); it != m_pe->ustrings.end(); it++) {
+    for (it = m_pe->ustrings.begin(); it != m_pe->ustrings.end(); ++it) {
 	append_ustring(&s, &(*it).s);
     }
     return s;
@@ -1395,9 +1395,9 @@
     uString::iterator j;
     int s;
     int c = 0;
-    for (i = m_pe->ustrings.begin(); i != m_pe->ustrings.end(); i++) {
+    for (i = m_pe->ustrings.begin(); i != m_pe->ustrings.end(); ++i) {
 	s = (*i).stat;
-	for (j = (*i).s.begin(); j != (*i).s.end(); j++) {
+	for (j = (*i).s.begin(); j != (*i).s.end(); ++j) {
 	    m_ce[c].c = *j;
 	    m_ce[c].stat = s;
 	    c++;
@@ -1552,7 +1552,7 @@
     t->pushC32(0); // chg_first
     t->pushC32(mPrevLen); // chg_length
 
-    if (m_pe->ustrings.size())
+    if (!m_pe->ustrings.empty())
 	t->pushC32(0);
     else
 	t->pushC32(3);
@@ -1631,7 +1631,7 @@
 {
     uString s;
     std::list<pe_ustring>::iterator it;
-    for (it = m_pe->ustrings.begin(); it != m_pe->ustrings.end(); it++) {
+    for (it = m_pe->ustrings.begin(); it != m_pe->ustrings.end(); ++it) {
 	append_ustring(&s, &(*it).s);
     }
 
@@ -1659,7 +1659,7 @@
     t->pushC16(len * 4);
     t->pushC16(0);
     std::list<pe_ustring>::iterator it;
-    for (it = m_pe->ustrings.begin(); it != m_pe->ustrings.end(); it++) {
+    for (it = m_pe->ustrings.begin(); it != m_pe->ustrings.end(); ++it) {
 	len = (*it).s.size();
 	stat = (*it).stat;
 	xstat = FB_None;

Modified: trunk/xim/helper.cpp
===================================================================
--- trunk/xim/helper.cpp	2006-01-20 07:59:29 UTC (rev 2944)
+++ trunk/xim/helper.cpp	2006-01-20 15:09:07 UTC (rev 2945)
@@ -61,7 +61,7 @@
 
     if (!strcmp(level, "im_change_whole_desktop")) {
 	std::map<Window, XimServer *>::iterator it;
-	for (it = XimServer::gServerMap.begin(); it != XimServer::gServerMap.end(); it++) {
+	for (it = XimServer::gServerMap.begin(); it != XimServer::gServerMap.end(); ++it) {
 	    (*it).second->changeContext(engine);
 	}
     }
@@ -93,7 +93,7 @@
 	return;
 
     std::list<UIMInfo>::iterator it;
-    for (it = uim_info.begin(); it != uim_info.end(); it++) {
+    for (it = uim_info.begin(); it != uim_info.end(); ++it) {
 	if (client_locale) { // context with legacy encodings
 	    const char *engine_locales =
 		    compose_localenames_from_im_lang(it->lang);
@@ -239,13 +239,13 @@
 	    return;
 
 	std::map<Window, XimServer *>::iterator it;
-	for (it = XimServer::gServerMap.begin(); it != XimServer::gServerMap.end(); it++) {
+	for (it = XimServer::gServerMap.begin(); it != XimServer::gServerMap.end(); ++it) {
 	    (*it).second->customContext(custom, val);
 	}
 	return;
     } else if (strcmp("custom_reload_notify", line) == 0) {
 	std::map<Window, XimServer *>::iterator it;
-	for (it = XimServer::gServerMap.begin(); it != XimServer::gServerMap.end(); it++) {
+	for (it = XimServer::gServerMap.begin(); it != XimServer::gServerMap.end(); ++it) {
 	    (*it).second->reloadConfigs();
 	}
 	return;
@@ -253,7 +253,7 @@
 }
 
 static void
-helper_read_cb(int fd, int ev)
+helper_read_cb(int fd, int /* ev */)
 {
     uim_helper_read_proc(fd);
     char *tmp;

Modified: trunk/xim/locale.cpp
===================================================================
--- trunk/xim/locale.cpp	2006-01-20 07:59:29 UTC (rev 2944)
+++ trunk/xim/locale.cpp	2006-01-20 15:09:07 UTC (rev 2945)
@@ -169,14 +169,14 @@
     int l = 0, nbyte;
     unsigned char utf8[6];
     // count the length
-    for (i = s->begin(); i != s->end(); i++) {
+    for (i = s->begin(); i != s->end(); ++i) {
 	nbyte = utf8_wctomb(utf8, *i);
 	l += nbyte;
     }
     char *c = (char *)malloc(l + 1);
     c[l] = 0;
     l = 0;
-    for (i = s->begin(); i != s->end(); i++) {
+    for (i = s->begin(); i != s->end(); ++i) {
 	nbyte = utf8_wctomb(utf8, *i);
 	int j;
 	for (j = 0; j < nbyte; j++) {

Modified: trunk/xim/main.cpp
===================================================================
--- trunk/xim/main.cpp	2006-01-20 07:59:29 UTC (rev 2944)
+++ trunk/xim/main.cpp	2006-01-20 15:09:07 UTC (rev 2945)
@@ -151,7 +151,7 @@
 
 	std::map<int, fd_watch_struct>::iterator it;
 	int  fd_max = 0;
-	for (it = fd_watch_stat.begin(); it != fd_watch_stat.end(); it++) {
+	for (it = fd_watch_stat.begin(); it != fd_watch_stat.end(); ++it) {
 	    int fd = it->first;
 	    if (it->second.mask & READ_OK)
 		FD_SET(fd, &rfds);
@@ -179,7 +179,7 @@
 	    it = fd_watch_stat.find(fd);
 	    if (it == fd_watch_stat.end())	// shouldn't happen
 		break;
-	    it++;
+	    ++it;
 	}
     }
 }
@@ -335,7 +335,7 @@
 }
 
 static void
-xEventRead(int fd, int ev)
+xEventRead(int /* fd */, int /* ev */)
 {
     XFlush(XimServer::gDpy);
     check_pending_xevent();
@@ -405,7 +405,7 @@
     if (uim_info.empty())
 	printf("  None.\n");
     else
-	for (it = uim_info.begin(); it != uim_info.end(); it++)
+	for (it = uim_info.begin(); it != uim_info.end(); ++it)
 	    printf("  %s (%s)\n", it->name, it->lang);
     
 }
@@ -414,7 +414,7 @@
 clear_uim_info()
 {
     std::list<UIMInfo>::iterator it;
-    for (it = uim_info.begin(); it != uim_info.end(); it++) {
+    for (it = uim_info.begin(); it != uim_info.end(); ++it) {
 	free(it->name);
 	free(it->lang);
 	free(it->desc);
@@ -494,7 +494,7 @@
     bool found = false;
     if (default_engine) {
 	std::list<UIMInfo>::iterator it;
-	for (it = uim_info.begin(); it != uim_info.end(); it++) {
+	for (it = uim_info.begin(); it != uim_info.end(); ++it) {
 	    if (!strcmp(it->name, default_engine)) {
 		found = true;
 		break;
@@ -526,7 +526,7 @@
 }
 
 void
-reload_uim(int x)
+reload_uim(int /* x */)
 {
     fprintf(stderr, "\nReloading uim...\n\n");
 
@@ -537,9 +537,9 @@
     std::map<Window, XimServer *>::iterator it;
     std::list<InputContext *>::iterator it_c;
 
-    for (it = XimServer::gServerMap.begin(); it != XimServer::gServerMap.end(); it++) {
+    for (it = XimServer::gServerMap.begin(); it != XimServer::gServerMap.end(); ++it) {
 	XimServer *xs = it->second;
-	for (it_c = xs->ic_list.begin(); it_c != xs->ic_list.end(); it_c++)
+	for (it_c = xs->ic_list.begin(); it_c != xs->ic_list.end(); ++it_c)
 	    (*it_c)->clear();
     }
 
@@ -548,9 +548,9 @@
     get_uim_info();
     //print_uim_info();
 
-    for (it = XimServer::gServerMap.begin(); it != XimServer::gServerMap.end(); it++) {
+    for (it = XimServer::gServerMap.begin(); it != XimServer::gServerMap.end(); ++it) {
 	XimServer *xs = it->second;
-	for (it_c = xs->ic_list.begin(); it_c != xs->ic_list.end(); it_c++) {
+	for (it_c = xs->ic_list.begin(); it_c != xs->ic_list.end(); ++it_c) {
 	    const char *engine = (*it_c)->get_engine_name();
 	    (*it_c)->createUimContext(engine);
 	}
@@ -611,7 +611,7 @@
 
     // First, setup conversion engine selected by cmdline option or
     // "default-im-name" on ~/.uim.
-    for (it = uim_info.begin(); it != uim_info.end(); it++) {
+    for (it = uim_info.begin(); it != uim_info.end(); ++it) {
 	if (strcmp(it->name, default_engine) == 0) {
 	    XimServer *xs = new XimServer(it->name, it->lang);
 	    res = xs->setupConnection(true);

Modified: trunk/xim/util.cpp
===================================================================
--- trunk/xim/util.cpp	2006-01-20 07:59:29 UTC (rev 2944)
+++ trunk/xim/util.cpp	2006-01-20 15:09:07 UTC (rev 2945)
@@ -626,7 +626,7 @@
     double x = x0;
     double f = 1.0;
 
-    for (i=0;i<100;i++) {
+    for (i = 0; i < 100; i++) {
 	l = (long)x;
 	if (l <= (x+1) && l >= (x-1)) break;
 	x *= 0.1;

Modified: trunk/xim/ximic.cpp
===================================================================
--- trunk/xim/ximic.cpp	2006-01-20 07:59:29 UTC (rev 2944)
+++ trunk/xim/ximic.cpp	2006-01-20 15:09:07 UTC (rev 2945)
@@ -73,7 +73,7 @@
 get_font_set(const char *name, const char *locale)
 {
     std::list<FSCache>::iterator it;
-    for (it = fs_cache.begin(); it != fs_cache.end(); it++) {
+    for (it = fs_cache.begin(); it != fs_cache.end(); ++it) {
 	if (!strcmp(it->name, name) && !strcmp(it->locale, locale)) {
 	    it->refc++;
 	    return it->fs;
@@ -103,7 +103,7 @@
 release_font_set(const char *name, const char *locale)
 {
     std::list<FSCache>::iterator it;
-    for (it = fs_cache.begin(); it != fs_cache.end(); it++) {
+    for (it = fs_cache.begin(); it != fs_cache.end(); ++it) {
 	if (!strcmp(it->name, name) && !strcmp(it->locale, locale)) {
 	    it->refc--;
 	    if (!it->refc) {
@@ -147,8 +147,8 @@
     std::list<pe_ustring>::iterator i;
     uString::iterator j;
     int k = 0;
-    for (i = ustrings.begin(); i != ustrings.end(); i++) {
-	for (j = (*i).s.begin(); j != (*i).s.end(); j++) {
+    for (i = ustrings.begin(); i != ustrings.end(); ++i) {
+	for (j = (*i).s.begin(); j != (*i).s.end(); ++j) {
 	    k++;
 	}
     }
@@ -574,7 +574,7 @@
     // m_kkContext->get_preedit_string() returns uncommitted preedit
     // strings, which will be committed in client applications.
     s = m_kkContext->get_preedit_string();
-    if (s.size()) {
+    if (!s.empty()) {
 	char *p;
 	int i, len = 0;
 	p = get_im_by_id(mIMid)->uStringToCtext(&s);
@@ -615,7 +615,7 @@
 
 void XimIC::onSendPacket()
 {
-    if (!mPending.size())
+    if (mPending.empty())
 	return;
 
     char *p;

Modified: trunk/xim/ximim.cpp
===================================================================
--- trunk/xim/ximim.cpp	2006-01-20 07:59:29 UTC (rev 2944)
+++ trunk/xim/ximim.cpp	2006-01-20 15:09:07 UTC (rev 2945)
@@ -154,7 +154,7 @@
 void XimIM_impl::changeContext(const char *engine)
 {
     std::map<int, XimIC *>::iterator i;
-    for (i = m_ics.begin(); i != m_ics.end(); i++) {
+    for (i = m_ics.begin(); i != m_ics.end(); ++i) {
 	(*i).second->changeContext(engine);
     }
     if (mEngineName)
@@ -234,7 +234,7 @@
 {
     std::map<int, XimIC *>::iterator i;
     int max_id = 1; // Does ID of input-context start with 1?
-    for (i = m_ics.begin(); i != m_ics.end(); i++) {
+    for (i = m_ics.begin(); i != m_ics.end(); ++i) {
 	if (max_id <= (*i).first)
 	    max_id = (*i).first + 1;
     }
@@ -336,7 +336,7 @@
 void XimIM_impl::free_all_ic()
 {
     std::map<int, XimIC *>::iterator i;
-    for (i = m_ics.begin(); i != m_ics.end(); i++) {
+    for (i = m_ics.begin(); i != m_ics.end(); ++i) {
 	(*i).second->unsetFocus();
 	delete (*i).second;
     }
@@ -346,7 +346,7 @@
 void XimIM_impl::delete_ic(XimIC *ic)
 {
     std::map<int, XimIC *>::iterator it;
-    for (it = m_ics.begin(); it != m_ics.end(); it++) {
+    for (it = m_ics.begin(); it != m_ics.end(); ++it) {
 	if (it->second == ic) {
 	    it->second->unsetFocus();
 	    delete it->second;
@@ -375,7 +375,7 @@
 void XimIM_impl::onSendPacket()
 {
     std::map<int, XimIC *>::iterator i;
-    for (i = m_ics.begin(); i != m_ics.end(); i++) {
+    for (i = m_ics.begin(); i != m_ics.end(); ++i) {
 	(*i).second->onSendPacket();
     }
 }
@@ -472,7 +472,7 @@
     int max_id;
     std::map<int, XimIM *>::iterator i;
     max_id = 1;
-    for (i = g_ims.begin(); i != g_ims.end(); i++) {
+    for (i = g_ims.begin(); i != g_ims.end(); ++i) {
 	if ((*i).first == max_id)
 	    max_id = (*i).first + 1;
     }

Modified: trunk/xim/ximpacket.cpp
===================================================================
--- trunk/xim/ximpacket.cpp	2006-01-20 07:59:29 UTC (rev 2944)
+++ trunk/xim/ximpacket.cpp	2006-01-20 15:09:07 UTC (rev 2945)
@@ -54,7 +54,7 @@
 }
 
 void
-writeC8(C8 val, int byte_order, unsigned char *buf)
+writeC8(C8 val, int /* byte_order */, unsigned char *buf)
 {
     buf[0] = val;
 }
@@ -211,7 +211,7 @@
     virtual int get_size() {
 	return m_len;
     }
-    virtual int write_to_buf(unsigned char *buf, int bo) {
+    virtual int write_to_buf(unsigned char *buf, int /* bo */) {
 	memcpy(buf, m_str, m_len);
 	return get_size();
     }
@@ -253,7 +253,7 @@
 TxPacket_impl::~TxPacket_impl()
 {
     std::list<TxElement *>::iterator i;
-    for (i = m_elms.begin(); i != m_elms.end(); i++) {
+    for (i = m_elms.begin(); i != m_elms.end(); ++i) {
 	delete *i;
     }
 }
@@ -263,7 +263,7 @@
     std::list<TxElement *>::iterator i;
     int l;
     l = 4;
-    for (i = m_elms.begin(); i != m_elms.end(); i++) {
+    for (i = m_elms.begin(); i != m_elms.end(); ++i) {
 	l +=  (*i)->get_size();
     }  
     return l;
@@ -274,7 +274,7 @@
     std::list<TxElement *>::iterator i;
     int l, m;
     l = 4;
-    for (i = m_elms.begin(); i != m_elms.end(); i++) {
+    for (i = m_elms.begin(); i != m_elms.end(); ++i) {
 	m = (*i)->get_size();
 	if (l + m > buflen)
 	    return 0;

Modified: trunk/xim/ximserver.cpp
===================================================================
--- trunk/xim/ximserver.cpp	2006-01-20 07:59:29 UTC (rev 2944)
+++ trunk/xim/ximserver.cpp	2006-01-20 15:09:07 UTC (rev 2945)
@@ -77,7 +77,7 @@
     uchar ch;
     char utf8[6];
     int nbyte;
-    for (i = s->begin(); i != s->end(); i++) {
+    for (i = s->begin(); i != s->end(); ++i) {
 	ch = *i;
 	nbyte = utf8_wctomb((unsigned char *)utf8, ch);
 	utf8[nbyte] = '\0';
@@ -94,7 +94,7 @@
 void append_ustring(uString *d, uString *s)
 {
     uString::iterator i;
-    for (i = s->begin(); i !=s->end(); i++) {
+    for (i = s->begin(); i !=s->end(); ++i) {
 	d->push_back(*i);
     }
 }
@@ -115,7 +115,7 @@
 void XimServer::deleteContext(InputContext *ic)
 {
     std::list<InputContext *>::iterator it;
-    for (it = ic_list.begin(); it != ic_list.end(); it++) {
+    for (it = ic_list.begin(); it != ic_list.end(); ++it) {
 	if (*it == ic) {
 	    ic_list.erase(it);
 	    break;
@@ -126,7 +126,7 @@
 void XimServer::changeContext(const char *engine) {
     set_im(engine);
     std::list<InputContext *>::iterator it;
-    for (it = ic_list.begin(); it != ic_list.end(); it++) {
+    for (it = ic_list.begin(); it != ic_list.end(); ++it) {
 	(*it)->changeContext(engine);
     }
     // make sure to use appropriate locale for the focused context
@@ -137,7 +137,7 @@
 
 void XimServer::customContext(const char *custom, const char *val) {
     std::list<InputContext *>::iterator it;
-    for (it = ic_list.begin(); it != ic_list.end(); it++) {
+    for (it = ic_list.begin(); it != ic_list.end(); ++it) {
 	(*it)->customContext(custom, val);
 	break;
     }
@@ -298,7 +298,7 @@
 const char *get_im_lang_from_engine(const char *engine)
 {
     std::list<UIMInfo>::iterator it;
-    for (it = uim_info.begin(); it != uim_info.end(); it++) {
+    for (it = uim_info.begin(); it != uim_info.end(); ++it) {
 	if (!strcmp(it->name, engine))
 	    return it->lang;
     }
@@ -660,7 +660,7 @@
     mServer->strToUstring(&js, str);
 
     uString::iterator it;
-    for (it = js.begin(); it != js.end(); it++) {
+    for (it = js.begin(); it != js.end(); ++it) {
 	m_pe->push_uchar(*it);
     }
 }
@@ -826,7 +826,7 @@
 	Canddisp *disp = canddisp_singleton();
 
 	disp->deactivate();
-	for (i = active_candidates.begin(); i != active_candidates.end(); i++) {
+	for (i = active_candidates.begin(); i != active_candidates.end(); ++i) {
 	    free((char *)*i);
 	}
 	mCandwinActive = false;
@@ -1066,7 +1066,7 @@
 {
     int ret = 0;
     std::list<KeySym>::iterator i;
-    for (i = keysym_list.begin(); i != keysym_list.end(); i++) {
+    for (i = keysym_list.begin(); i != keysym_list.end(); ++i) {
 	switch (*i) {
 	case XK_Alt_L:
 	case XK_Alt_R:

Modified: trunk/xim/ximtrans.cpp
===================================================================
--- trunk/xim/ximtrans.cpp	2006-01-20 07:59:29 UTC (rev 2944)
+++ trunk/xim/ximtrans.cpp	2006-01-20 15:09:07 UTC (rev 2945)
@@ -203,22 +203,22 @@
 {
     // destruct all the IM created by this Connection
     std::list<int>::iterator i;
-    for (i = mCreatedIm.begin(); i != mCreatedIm.end(); i++) {
+    for (i = mCreatedIm.begin(); i != mCreatedIm.end(); ++i) {
 	close_im(*i);
     }
     //
     std::list<RxPacket *>::iterator ir;
-    for (ir = mRxQ.begin(); ir != mRxQ.end(); ir++) {
+    for (ir = mRxQ.begin(); ir != mRxQ.end(); ++ir) {
 	delete *ir;
     }
     std::list<TxPacket *>::iterator it;
-    for (it = mTxQ.begin(); it != mTxQ.end(); it++) {
+    for (it = mTxQ.begin(); it != mTxQ.end(); ++it) {
 	delete *it;
     }
-    for (it = mPTxQ.begin(); it != mPTxQ.end(); it++) {
+    for (it = mPTxQ.begin(); it != mPTxQ.end(); ++it) {
 	delete *it;
     }
-    for (it = mPendingTxQ.begin(); it != mPendingTxQ.end(); it++) {
+    for (it = mPendingTxQ.begin(); it != mPendingTxQ.end(); ++it) {
 	delete *it;
     }
 }
@@ -231,7 +231,7 @@
 void Connection::OnRecv()
 {
     std::list<RxPacket *>::iterator i;
-    while (mRxQ.size()) {
+    while (!mRxQ.empty()) {
 	i = mRxQ.begin();
 	int major = (*i)->getMajor();
 	if (g_option_mask & OPT_TRACE_XIM)
@@ -321,7 +321,7 @@
 void Connection::OnSend()
 {
     std::list<int>::iterator i;
-    for (i = mCreatedIm.begin(); i != mCreatedIm.end(); i++) {
+    for (i = mCreatedIm.begin(); i != mCreatedIm.end(); ++i) {
 	XimIM *im;
 	im = get_im_by_id(*i);
 	if (im)
@@ -332,7 +332,7 @@
 void Connection::OnClose()
 {
     std::list<int>::iterator i;
-    for (i = mCreatedIm.begin(); i != mCreatedIm.end(); i++) {
+    for (i = mCreatedIm.begin(); i != mCreatedIm.end(); ++i) {
 	close_im(*i);
     }
     mCreatedIm.erase(mCreatedIm.begin(), mCreatedIm.end());
@@ -537,7 +537,7 @@
     push_packet(t);
     close_im(imid);
     std::list<int>::iterator i;
-    for (i = mCreatedIm.begin(); i != mCreatedIm.end(); i++) {
+    for (i = mCreatedIm.begin(); i != mCreatedIm.end(); ++i) {
 	if (*i == imid) {
 	    mCreatedIm.erase(i);
 	    return;
@@ -799,7 +799,7 @@
 
 void Connection::clear_pending_queue() {
     std::list<TxPacket *>::iterator i;
-    while (mPendingTxQ.size()) {
+    while (!mPendingTxQ.empty()) {
 	i = mPendingTxQ.begin();
 	mPendingTxQ.pop_front();
 	delete *i;



More information about the uim-commit mailing list