src/video/windows/SDL_windowskeyboard.c
changeset 8976 1a5d959d7b32
parent 8732 c62baa0b8827
child 9619 b94b6d0bff0f
     1.1 --- a/src/video/windows/SDL_windowskeyboard.c	Sun Jul 06 20:41:39 2014 -0700
     1.2 +++ b/src/video/windows/SDL_windowskeyboard.c	Mon Jul 07 10:26:28 2014 -0700
     1.3 @@ -750,18 +750,16 @@
     1.4          if (cand_list) {
     1.5              size = ImmGetCandidateListW(himc, 0, cand_list, size);
     1.6              if (size) {
     1.7 -                int i = 0;
     1.8 -                int j = 0;
     1.9 -                int page_start = 0;
    1.10 +                UINT i, j;
    1.11 +                UINT page_start = 0;
    1.12                  videodata->ime_candsel = cand_list->dwSelection;
    1.13                  videodata->ime_candcount = cand_list->dwCount;
    1.14  
    1.15                  if (LANG() == LANG_CHS && IME_GetId(videodata, 0)) {
    1.16                      const UINT maxcandchar = 18;
    1.17 -                    UINT i = 0;
    1.18                      size_t cchars = 0;
    1.19  
    1.20 -                    for (; i < videodata->ime_candcount; ++i) {
    1.21 +                    for (i = 0; i < videodata->ime_candcount; ++i) {
    1.22                          size_t len = SDL_wcslen((LPWSTR)((DWORD_PTR)cand_list + cand_list->dwOffset[i])) + 1;
    1.23                          if (len + cchars > maxcandchar) {
    1.24                              if (i > cand_list->dwSelection)
    1.25 @@ -775,8 +773,7 @@
    1.26                          }
    1.27                      }
    1.28                      videodata->ime_candpgsize = i - page_start;
    1.29 -                }
    1.30 -                else {
    1.31 +                } else {
    1.32                      videodata->ime_candpgsize = SDL_min(cand_list->dwPageSize, MAX_CANDLIST);
    1.33                      page_start = (cand_list->dwSelection / videodata->ime_candpgsize) * videodata->ime_candpgsize;
    1.34                  }