Author: cazfi Date: Thu Apr 16 19:56:35 2015 New Revision: 28790 URL: http://svn.gna.org/viewcvs/freeciv?rev=28790&view=rev Log: Fixed compiler warning about "always true" array address checking if()
See bug #23483 Modified: branches/S2_6/client/gui-sdl/widget_edit.c branches/S2_6/client/gui-sdl2/widget_edit.c Modified: branches/S2_6/client/gui-sdl/widget_edit.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-sdl/widget_edit.c?rev=28790&r1=28789&r2=28790&view=diff ============================================================================== --- branches/S2_6/client/gui-sdl/widget_edit.c (original) +++ branches/S2_6/client/gui-sdl/widget_edit.c Thu Apr 16 19:56:35 2015 @@ -559,22 +559,20 @@ pEdt->pInputChain->prev->chr[0] = Key.unicode; pEdt->pInputChain->prev->chr[1] = '\0'; - if (pEdt->pInputChain->prev->chr) { - if (get_wflags(pEdt->pWidget) & WF_PASSWD_EDIT) { - Uint16 passwd_chr[2] = {'*', '\0'}; - - pEdt->pInputChain->prev->pTsurf = - TTF_RenderUNICODE_Blended(pEdt->pWidget->string16->font, - passwd_chr, - pEdt->pWidget->string16->fgcol); - } else { - pEdt->pInputChain->prev->pTsurf = - TTF_RenderUNICODE_Blended(pEdt->pWidget->string16->font, - pEdt->pInputChain->prev->chr, - pEdt->pWidget->string16->fgcol); - } - pEdt->Truelength += pEdt->pInputChain->prev->pTsurf->w; - } + if (get_wflags(pEdt->pWidget) & WF_PASSWD_EDIT) { + Uint16 passwd_chr[2] = {'*', '\0'}; + + pEdt->pInputChain->prev->pTsurf = + TTF_RenderUNICODE_Blended(pEdt->pWidget->string16->font, + passwd_chr, + pEdt->pWidget->string16->fgcol); + } else { + pEdt->pInputChain->prev->pTsurf = + TTF_RenderUNICODE_Blended(pEdt->pWidget->string16->font, + pEdt->pInputChain->prev->chr, + pEdt->pWidget->string16->fgcol); + } + pEdt->Truelength += pEdt->pInputChain->prev->pTsurf->w; if (pEdt->InputChain_X >= pEdt->pWidget->size.x + pEdt->pBg->w - adj_size(10)) { if (pEdt->pInputChain == pEdt->pEndTextChain) { Modified: branches/S2_6/client/gui-sdl2/widget_edit.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-sdl2/widget_edit.c?rev=28790&r1=28789&r2=28790&view=diff ============================================================================== --- branches/S2_6/client/gui-sdl2/widget_edit.c (original) +++ branches/S2_6/client/gui-sdl2/widget_edit.c Thu Apr 16 19:56:35 2015 @@ -620,22 +620,20 @@ pEdt->pInputChain->prev->chr[charlen] = '\0'; pEdt->pInputChain->prev->bytes = charlen; - if (pEdt->pInputChain->prev->chr) { - if (get_wflags(pEdt->pWidget) & WF_PASSWD_EDIT) { - char passwd_chr[2] = {'*', '\0'}; - - pEdt->pInputChain->prev->pTsurf = - TTF_RenderUTF8_Blended(pEdt->pWidget->string_utf8->font, - passwd_chr, - pEdt->pWidget->string_utf8->fgcol); - } else { - pEdt->pInputChain->prev->pTsurf = - TTF_RenderUTF8_Blended(pEdt->pWidget->string_utf8->font, - pEdt->pInputChain->prev->chr, - pEdt->pWidget->string_utf8->fgcol); - } - pEdt->Truelength += pEdt->pInputChain->prev->pTsurf->w; - } + if (get_wflags(pEdt->pWidget) & WF_PASSWD_EDIT) { + char passwd_chr[2] = {'*', '\0'}; + + pEdt->pInputChain->prev->pTsurf = + TTF_RenderUTF8_Blended(pEdt->pWidget->string_utf8->font, + passwd_chr, + pEdt->pWidget->string_utf8->fgcol); + } else { + pEdt->pInputChain->prev->pTsurf = + TTF_RenderUTF8_Blended(pEdt->pWidget->string_utf8->font, + pEdt->pInputChain->prev->chr, + pEdt->pWidget->string_utf8->fgcol); + } + pEdt->Truelength += pEdt->pInputChain->prev->pTsurf->w; if (pEdt->InputChain_X >= pEdt->pWidget->size.x + pEdt->pBg->w - adj_size(10)) { if (pEdt->pInputChain == pEdt->pEndTextChain) { _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits