From 786bb5f770f52bfd4663096c0008e2af91f3db5d Mon Sep 17 00:00:00 2001 From: VincentWei Date: Thu, 18 Jan 2018 10:53:36 +0800 Subject: [PATCH] tune code for 64-bit --- configure.ac | 56 ++++++++++++++++++++++++ src/control/bidiedit.c | 2 +- src/ex_ctrl/gridview.c | 20 ++++----- src/ex_ctrl/gridviewcelltype.c | 78 +++++++++++++++++----------------- src/ex_ctrl/listview.c | 18 ++++---- src/ex_ctrl/spinbox.c | 2 +- src/ex_ctrl/treeview.c | 28 ++++++------ src/ex_ctrl/treeview_rdr.c | 24 +++++------ src/gui/arabickeymap.c | 3 -- src/gui/hebrewkeymap.c | 3 -- src/ial/netial/netial.c | 3 +- 11 files changed, 143 insertions(+), 94 deletions(-) diff --git a/configure.ac b/configure.ac index 58973239..8fb20340 100644 --- a/configure.ac +++ b/configure.ac @@ -1687,6 +1687,62 @@ fi if test "x$devel_mode" = "xyes"; then use_debug="yes" trace_message="yes" + + build_auto_ial_engine="yes" + build_random_ial_engine="yes" + build_net_ial_engine="yes" + + build_qpf_support="yes" + use_ttf_lib="ft2" + + build_latin2_support="yes" + build_latin3_support="yes" + build_latin4_support="yes" + build_cyrillic_support="yes" + build_arabic_support="yes" + build_greek_support="yes" + build_hebrew_support="yes" + build_latin5_support="yes" + build_latin6_support="yes" + build_thai_support="yes" + build_latin7_support="yes" + build_latin8_support="yes" + build_latin10_support="yes" + + build_gb18030_support="yes" + build_big5_support="yes" + build_euckr_support="yes" + build_eucjp_support="yes" + build_shiftjis_support="yes" + + use_kbd_hebrewpc="yes" + use_kbd_arabicpc="yes" + use_kbd_frpc="yes" + use_kbd_fr="yes" + use_kbd_de="yes" + use_kbd_delatin1="yes" + use_kbd_it="yes" + use_kbd_es="yes" + use_kbd_escp850="yes" + + build_ctrl_bidisledit="yes" + build_ctrl_textedit="yes" + build_ctrl_monthcal="yes" + build_ctrl_treeview="yes" + build_ctrl_treeview_rdr="yes" + build_ctrl_spinbox="yes" + build_ctrl_coolbar="yes" + build_ctrl_listview="yes" + build_ctrl_iconview="yes" + build_ctrl_gridview="yes" + + enable_video_commlcd="yes" + enable_video_shadow="yes" + enable_video_mlshadow="yes" + enable_video_custom="yes" + + build_screensaver="yes" + CFLAGS="$CFLAGS -Werror" fi diff --git a/src/control/bidiedit.c b/src/control/bidiedit.c index 20dbf41a..ed703403 100644 --- a/src/control/bidiedit.c +++ b/src/control/bidiedit.c @@ -2466,7 +2466,7 @@ SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) unsigned char charBuffer [3]; int chars; - _MG_PRINTF("get char-----------------char----%x\n", wParam); + _MG_PRINTF("get char-----------------char----%lx\n", wParam); if (wParam == 127) // BS wParam = '\b'; diff --git a/src/ex_ctrl/gridview.c b/src/ex_ctrl/gridview.c index b61b96af..4527304c 100644 --- a/src/ex_ctrl/gridview.c +++ b/src/ex_ctrl/gridview.c @@ -911,7 +911,7 @@ static BOOL gridview_is_pt_in_control(gvGridViewData* view, int x, int y) if(cell != NULL) { HWND ctrl = cell->func->get_control(cell, view, row, col); - if(ctrl != -1 && gridview_is_pt_in_hwnd_rect(view->hCtrl, ctrl, x, y)) + if(ctrl != HWND_INVALID && gridview_is_pt_in_hwnd_rect(view->hCtrl, ctrl, x, y)) return TRUE; } return FALSE; @@ -1293,7 +1293,7 @@ static int gridview_init(HWND hWnd, GRIDVIEWDATA* data) // set window handles view->ctrl_id = GetDlgCtrlID(hWnd); view->hCtrl = hWnd; - view->hEdit = -1; + view->hEdit = HWND_INVALID; //initialize modal view->modal = GridDataModalArray_new_modal(data->nr_rows, data->nr_cols); //set table properties @@ -1616,7 +1616,7 @@ static LRESULT GridViewCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM int row, col; HDC hdc = BeginPaint(hWnd); - if(view->hEdit != -1) + if(view->hEdit != HWND_INVALID) { RECT r; GetWindowRect(view->hEdit, &r); @@ -1689,7 +1689,7 @@ static LRESULT GridViewCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM int x = LOSWORD (lParam); int y = HISWORD (lParam); - if(view->hEdit != -1) + if(view->hEdit != HWND_INVALID) { int row, col; if(!gridview_is_pt_in_hwnd_rect(view->hCtrl, view->hEdit, x, y)) @@ -1749,7 +1749,7 @@ static LRESULT GridViewCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM ScreenToClient(hWnd, &x, &y); ReleaseCapture(); } - else if(view->hEdit != -1) + else if(view->hEdit != HWND_INVALID) break; switch(view->mouse_status) @@ -1786,7 +1786,7 @@ static LRESULT GridViewCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM int y = HISWORD (lParam); GetClientRect(hWnd, &rect); - if(view->hEdit != -1) + if(view->hEdit != HWND_INVALID) break; is_capture = (GetCapture() == hWnd); if (is_capture) { @@ -1827,7 +1827,7 @@ static LRESULT GridViewCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM // MiniGUI key Messages {{{ case MSG_KEYDOWN: { - if(view->hEdit != -1) + if(view->hEdit != HWND_INVALID) return DefaultControlProc(hWnd, message, wParam, lParam); else { @@ -1971,7 +1971,7 @@ static LRESULT GridViewCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM RECT rect; if(view->current_row > 0 && view->current_col > 0) { - if (view->hEdit == -1 && isalnum(wParam)) + if (view->hEdit == HWND_INVALID && isalnum(wParam)) { get_cell_rect(view, view->current_row, view->current_col, &rect); gridview_make_rect_visible(view, &rect); @@ -1987,13 +1987,13 @@ static LRESULT GridViewCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM // MiniGUI scroll Messages {{{ case MSG_HSCROLL: { - if (view->hEdit != -1) + if (view->hEdit != HWND_INVALID) SendMessage(view->hEdit, MSG_KEYDOWN, SCANCODE_ENTER, 0); break; } case MSG_VSCROLL: { - if (view->hEdit != -1) + if (view->hEdit != HWND_INVALID) SendMessage(view->hEdit, MSG_KEYDOWN, SCANCODE_ENTER, 0); break; } diff --git a/src/ex_ctrl/gridviewcelltype.c b/src/ex_ctrl/gridviewcelltype.c index 948116e6..4b391627 100644 --- a/src/ex_ctrl/gridviewcelltype.c +++ b/src/ex_ctrl/gridviewcelltype.c @@ -59,7 +59,7 @@ static inline void GridCell_get_ctrl_rect(gvGridCellData* cell, gvGridViewData* // Editor Proc {{{ -static int GridCell_EditDefaultProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam) +static LRESULT GridCell_EditDefaultProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { GridCellEditData* editdata = (GridCellEditData*)GetWindowAdditionalData(hWnd); @@ -78,7 +78,7 @@ static int GridCell_EditDefaultProc(HWND hWnd, int message, WPARAM wParam, LPARA return editdata->old_proc(hWnd, message, wParam, lParam); } -static int GridCell_EditBgColorProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam) +static LRESULT GridCell_EditBgColorProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { GridCellEditData* editdata = (GridCellEditData*)GetWindowAdditionalData(hWnd); @@ -138,7 +138,7 @@ static void GridCell_SelectionNotify(HWND hWnd, int id, int nc, DWORD add_data) switch(nc) { case CBN_DROPDOWN: - if (editdata->view->hEdit != -1) + if (editdata->view->hEdit != HWND_INVALID) { if (editdata->view->hEdit != hWnd) { @@ -321,7 +321,7 @@ double GridCellTypeNull_get_double_value(gvGridCellData* cell, int row, int col) HWND GridCellTypeNull_get_control(gvGridCellData* cell, gvGridViewData* view, int row, int col) { - return (HWND)-1; + return HWND_INVALID; } void GridCellTypeNull_get_format(gvGridCellData* cell, HWND hWnd, HDC hdc, GridCellFormat* format) @@ -350,7 +350,7 @@ int GridCellTypeNull_draw(gvGridCellData* cell, gvGridViewData* view, is_highlight = FALSE; ctrl = cell->func->get_control(cell, view, row, col); - if(ctrl != -1) + if(ctrl != HWND_INVALID) { RECT r; GetWindowRect(ctrl, &r); @@ -887,12 +887,12 @@ HWND GridCellTypeText_create_edit_ctrl(gvGridViewData* view, gvGridCellData* cel if(real_cell == NULL || real_cell != cell) is_default = TRUE; if(cell == NULL) - return -1; + return HWND_INVALID; if( cell->style & GVS_MULTLINE ) ctrl_type = CTRL_MLEDIT; else ctrl_type = CTRL_SLEDIT; - if(view->hEdit != -1) + if(view->hEdit != HWND_INVALID) { editdata = (GridCellEditData*)GetWindowAdditionalData(view->hEdit); editdata->commit = FALSE; @@ -903,7 +903,7 @@ HWND GridCellTypeText_create_edit_ctrl(gvGridViewData* view, gvGridCellData* cel WS_CHILD|WS_VISIBLE, col, rect->left, rect->top, RECTWP(rect), RECTHP(rect), view->hCtrl, 0); - if(view->hEdit != -1) + if(view->hEdit != HWND_INVALID) { editdata = calloc(1, sizeof(GridCellEditData)); editdata->view = view; @@ -922,7 +922,7 @@ int GridCellTypeText_begin_edit(gvGridCellData* cell, gvGridViewData* view, int row, int col, RECT* rect) { RECT r; - HWND hEdit = -1; + HWND hEdit = HWND_INVALID; int len; char* text; if( gvGridCell_is_readonly(cell) ) @@ -933,7 +933,7 @@ int GridCellTypeText_begin_edit(gvGridCellData* cell, gvGridViewData* view, GridCell_get_ctrl_rect(cell, view, row, col, rect, &r); hEdit = GridCellTypeText_create_edit_ctrl(view, cell, row, col, &r, text); free(text); - if (hEdit != -1) + if (hEdit != HWND_INVALID) SetFocusChild(hEdit); return 0; } @@ -945,7 +945,7 @@ int GridCellTypeText_end_edit(gvGridCellData* cell, gvGridViewData* view, int ro gvGridCellData tmp_cell; gvGridCellData* p_cell = cell; GridCellEditData* editdata; - if(view->hEdit == -1) + if(view->hEdit == HWND_INVALID) return -1; editdata = (GridCellEditData*)GetWindowAdditionalData(hEdit); if(editdata->commit) @@ -965,7 +965,7 @@ int GridCellTypeText_end_edit(gvGridCellData* cell, gvGridViewData* view, int ro free(buf); } DestroyWindow(hEdit); - view->hEdit = -1; + view->hEdit = HWND_INVALID; free(editdata); InvalidateRect(view->hCtrl, NULL, FALSE); return 0; @@ -1179,7 +1179,7 @@ int GridCellTypeCheckBox_init(gvGridCellData* cell) memset(cell, 0, sizeof(gvGridCellData)); cell->celltype = GV_TYPE_CHECKBOX; cell->func = gvGridCellTypeCheckBox; - cell->data.checkbox.handle = -1; + cell->data.checkbox.handle = HWND_INVALID; return 0; } @@ -1244,7 +1244,7 @@ int GridCellTypeCheckBox_merge(gvGridCellData* cell, gvGridCellData* data) int GridCellTypeCheckBox_copy(gvGridCellData* to, gvGridCellData* from) { memcpy(to, from, sizeof(gvGridCellData)); - to->data.checkbox.handle = -1; + to->data.checkbox.handle = HWND_INVALID; to->data.checkbox.dirty = FALSE; if(from->data.checkbox.text != NULL) to->data.checkbox.text = strdup(from->data.checkbox.text); @@ -1318,8 +1318,8 @@ HWND GridCellTypeCheckBox_create_checkbox_ctrl(gvGridViewData* view, gvGridCellD HWND ctrl; GridCellEditData* editdata = NULL; if(cell == NULL) - return -1; - if(cell->data.checkbox.handle != -1) + return HWND_INVALID; + if(cell->data.checkbox.handle != HWND_INVALID) return cell->data.checkbox.handle; ctrl = CreateWindow(CTRL_BUTTON, text, @@ -1327,10 +1327,10 @@ HWND GridCellTypeCheckBox_create_checkbox_ctrl(gvGridViewData* view, gvGridCellD row*0x10000+col, rect->left, rect->top, RECTWP(rect), RECTHP(rect), view->hCtrl, 0); - if(ctrl == -1) + if(ctrl == HWND_INVALID) { - cell->data.checkbox.handle = -1; - return -1; + cell->data.checkbox.handle = HWND_INVALID; + return HWND_INVALID; } cell->data.checkbox.handle = ctrl; editdata = calloc(1, sizeof(GridCellEditData)); @@ -1360,7 +1360,7 @@ int GridCellTypeCheckBox_draw_content(gvGridCellData* cell, gvGridViewData* view if(EqualRect(&r_bound, &view->cells_rect)) { int checked = cell->data.checkbox.checked?BST_CHECKED:BST_UNCHECKED; - if(ctrl == -1) + if(ctrl == HWND_INVALID) { char* text = cell->data.checkbox.text; if(text == NULL) @@ -1383,11 +1383,11 @@ int GridCellTypeCheckBox_invisible_draw(gvGridCellData* cell, gvGridViewData* vi HDC hdc, int row, int col, RECT* rect) { HWND ctrl = cell->data.checkbox.handle; - if(ctrl != -1) + if(ctrl != HWND_INVALID) { GridCellEditData* editdata = (GridCellEditData*)GetWindowAdditionalData(ctrl); DestroyWindow(ctrl); - cell->data.checkbox.handle = -1; + cell->data.checkbox.handle = HWND_INVALID; free(editdata); } return 0; @@ -1407,7 +1407,7 @@ int GridCellTypeCheckBox_end_edit(gvGridCellData* cell, gvGridViewData* view, in if(cell == NULL) return -1; ctrl = cell->data.checkbox.handle; - if (ctrl == -1) + if (ctrl == HWND_INVALID) return -1; editdata = (GridCellEditData*)GetWindowAdditionalData(ctrl); if(editdata->commit) @@ -1430,12 +1430,12 @@ int GridCellTypeCheckBox_on_destroy(gvGridCellData* cell) free(cell->data.checkbox.text); cell->data.checkbox.text = NULL; } - if(cell->data.checkbox.handle != -1) + if(cell->data.checkbox.handle != HWND_INVALID) { HWND ctrl = cell->data.checkbox.handle; GridCellEditData* editdata = (GridCellEditData*)GetWindowAdditionalData(ctrl); DestroyWindow(ctrl); - cell->data.checkbox.handle = -1; + cell->data.checkbox.handle = HWND_INVALID; free(editdata); } return 0; @@ -1450,7 +1450,7 @@ int GridCellTypeSelection_init(gvGridCellData* cell) memset(cell, 0, sizeof(gvGridCellData)); cell->celltype = GV_TYPE_SELECTION; cell->func = gvGridCellTypeSelection; - cell->data.selection.handle = -1; + cell->data.selection.handle = HWND_INVALID; return 0; } @@ -1514,7 +1514,7 @@ int GridCellTypeSelection_merge(gvGridCellData* cell, gvGridCellData* data) int GridCellTypeSelection_copy(gvGridCellData* to, gvGridCellData* from) { memcpy(to, from, sizeof(gvGridCellData)); - to->data.selection.handle = -1; + to->data.selection.handle = HWND_INVALID; to->data.selection.dirty = FALSE; if(from->data.selection.text != NULL) to->data.selection.text = strdup(from->data.selection.text); @@ -1590,8 +1590,8 @@ HWND GridCellTypeSelection_create_selection_ctrl(gvGridViewData* view, gvGridCel char *tmp = NULL; if(cell == NULL) - return -1; - if(cell->data.selection.handle != -1) + return HWND_INVALID; + if(cell->data.selection.handle != HWND_INVALID) return cell->data.selection.handle; ctrl = CreateWindow(CTRL_COMBOBOX, @@ -1601,9 +1601,9 @@ HWND GridCellTypeSelection_create_selection_ctrl(gvGridViewData* view, gvGridCel rect->left, rect->top, RECTWP(rect), RECTHP(rect), view->hCtrl, 0); - if(ctrl == -1) { - cell->data.selection.handle = -1; - return -1; + if(ctrl == HWND_INVALID) { + cell->data.selection.handle = HWND_INVALID; + return HWND_INVALID; } do { @@ -1645,7 +1645,7 @@ int GridCellTypeSelection_draw_content(gvGridCellData* cell, gvGridViewData* vie GetBoundRect(&r_bound, &r, &view->cells_rect); if(EqualRect(&r_bound, &view->cells_rect)) { - if(ctrl == -1) + if(ctrl == HWND_INVALID) { char* text = cell->data.selection.text; if(text == NULL) @@ -1666,11 +1666,11 @@ int GridCellTypeSelection_invisible_draw(gvGridCellData* cell, gvGridViewData* v HDC hdc, int row, int col, RECT* rect) { HWND ctrl = cell->data.selection.handle; - if(ctrl != -1) + if(ctrl != HWND_INVALID) { GridCellEditData* editdata = (GridCellEditData*)GetWindowAdditionalData(ctrl); DestroyWindow(ctrl); - cell->data.selection.handle = -1; + cell->data.selection.handle = HWND_INVALID; free(editdata); } return 0; @@ -1690,7 +1690,7 @@ int GridCellTypeSelection_end_edit(gvGridCellData* cell, gvGridViewData* view, i if(cell == NULL) return -1; ctrl = cell->data.selection.handle; - if(ctrl == -1) + if(ctrl == HWND_INVALID) return -1; editdata = (GridCellEditData*)GetWindowAdditionalData(ctrl); index = SendMessage(ctrl, CB_GETCURSEL, 0, 0); @@ -1702,7 +1702,7 @@ int GridCellTypeSelection_end_edit(gvGridCellData* cell, gvGridViewData* view, i else cell->data.selection.cur_index = 0; if(view->hEdit == ctrl) - view->hEdit = -1; + view->hEdit = HWND_INVALID; return 0; } @@ -1713,12 +1713,12 @@ int GridCellTypeSelection_on_destroy(gvGridCellData* cell) free(cell->data.selection.text); cell->data.selection.text = NULL; } - if(cell->data.selection.handle != -1) + if(cell->data.selection.handle != HWND_INVALID) { HWND ctrl = cell->data.selection.handle; GridCellEditData* editdata = (GridCellEditData*)GetWindowAdditionalData(ctrl); DestroyWindow(ctrl); - cell->data.selection.handle = -1; + cell->data.selection.handle = HWND_INVALID; free(editdata); } return 0; diff --git a/src/ex_ctrl/listview.c b/src/ex_ctrl/listview.c index 8db35a2a..5828b721 100644 --- a/src/ex_ctrl/listview.c +++ b/src/ex_ctrl/listview.c @@ -1724,17 +1724,17 @@ static LRESULT ListViewCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM } else if (pprev) { ptmp = lvGetLastChild (plvdata, pprev); - hsvi = ptmp->addData; + hsvi = (HICON)ptmp->addData; pnew->addData = (DWORD) scrollview_add_item (hWnd, &plvdata->svdata, hsvi, &svii, &nItem); } else { - hsvi = parent->addData; + hsvi = (HICON)parent->addData; pnew->addData = (DWORD) scrollview_add_item (hWnd, &plvdata->svdata, hsvi, &svii, &nItem); } - return (int)pnew; + return (LRESULT)pnew; } case LVM_GETITEM: @@ -1770,7 +1770,7 @@ static LRESULT ListViewCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM hsvi = scrollview_get_hilighted_item (&plvdata->svdata); pi = LV_GET_ITEM (hsvi); - return (int)pi; + return (LRESULT)pi; } case LVM_GETRELATEDITEM: @@ -1781,16 +1781,16 @@ static LRESULT ListViewCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM return 0; if (wParam == LVIR_PARENT) { - return (int)pi->parent; + return (LRESULT)pi->parent; } else if (wParam == LVIR_FIRSTCHILD) { - return (int)pi->child; + return (LRESULT)pi->child; } else if (wParam == LVIR_NEXTSIBLING) { - return (int)pi->next; + return (LRESULT)pi->next; } else if (wParam == LVIR_PREVSIBLING) { - return (int)lvGetPrevSib(plvdata, pi); + return (LRESULT)lvGetPrevSib(plvdata, pi); } return 0; } @@ -1918,7 +1918,7 @@ static LRESULT ListViewCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM } case LVM_FINDITEM: { - return (int)lvFindItem(plvdata, (PITEMDATA)wParam, (PLVFINDINFO)lParam); + return (LRESULT)lvFindItem(plvdata, (PITEMDATA)wParam, (PLVFINDINFO)lParam); } case LVM_DELITEM: { diff --git a/src/ex_ctrl/spinbox.c b/src/ex_ctrl/spinbox.c index bc69ed0b..4d1eecb5 100644 --- a/src/ex_ctrl/spinbox.c +++ b/src/ex_ctrl/spinbox.c @@ -295,7 +295,7 @@ SpinCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) return 0; case SPM_GETTARGET: - return pData->hTarget; + return (LRESULT)pData->hTarget; case MSG_NCPAINT: return 0; diff --git a/src/ex_ctrl/treeview.c b/src/ex_ctrl/treeview.c index 84bb1ef6..bef7379a 100644 --- a/src/ex_ctrl/treeview.c +++ b/src/ex_ctrl/treeview.c @@ -873,7 +873,7 @@ static LRESULT TreeViewCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM case TVM_GETROOT: pData = (PTVDATA) GetWindowAdditionalData2 (hwnd); - return (int) pData->root; + return (LRESULT) pData->root; break; case TVM_SEARCHITEM: @@ -892,7 +892,7 @@ static LRESULT TreeViewCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM return 0; matched = findStringDepthFirst (pData, root, text); - return (int)matched; + return (LRESULT)matched; } case TVM_FINDCHILD: @@ -911,12 +911,12 @@ static LRESULT TreeViewCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM return 0; matched = findStringInChildren (pData, item, text); - return (int)matched; + return (LRESULT)matched; } case TVM_GETSELITEM: pData = (PTVDATA) GetWindowAdditionalData2 (hwnd); - return (int)pData->pItemSelected; + return (LRESULT)pData->pItemSelected; case TVM_SETSELITEM: { @@ -957,7 +957,7 @@ static LRESULT TreeViewCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM } #endif - return (int)old_sel; + return (LRESULT)old_sel; } case TVM_GETRELATEDITEM: @@ -972,13 +972,13 @@ static LRESULT TreeViewCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM switch (related) { case TVIR_PARENT: - return (int)item->parent; + return (LRESULT)item->parent; case TVIR_FIRSTCHILD: - return (int)item->child; + return (LRESULT)item->child; case TVIR_NEXTSIBLING: - return (int)item->next; + return (LRESULT)item->next; case TVIR_PREVSIBLING: - return (int)getPrev (pData, item); + return (LRESULT)getPrev (pData, item); } return 0; @@ -1108,9 +1108,9 @@ static LRESULT TreeViewCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM if (pTVItemInfo->text == NULL || pTVItemInfo->text[0] == '\0') pTVItemInfo->text = " "; if (pTVItemInfo->hIconFold == 0) - pTVItemInfo->hIconFold = (DWORD) ICON_FOLD; + pTVItemInfo->hIconFold = (HICON) ICON_FOLD; if (pTVItemInfo->hIconUnfold == 0) - pTVItemInfo->hIconUnfold = (DWORD) ICON_UNFOLD; + pTVItemInfo->hIconUnfold = (HICON) ICON_UNFOLD; } else { return 0; @@ -1141,8 +1141,8 @@ static LRESULT TreeViewCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM } #endif if (pData->dwStyle & TVS_WITHICON) { - newItem->hIconFold = (DWORD) pTVItemInfo->hIconFold; - newItem->hIconUnfold = (DWORD) pTVItemInfo->hIconUnfold; + newItem->hIconFold = (HICON) pTVItemInfo->hIconFold; + newItem->hIconUnfold = (HICON) pTVItemInfo->hIconUnfold; } else { newItem->hIconFold = 0L; @@ -1158,7 +1158,7 @@ static LRESULT TreeViewCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM tvSetVScrollInfo (hwnd, pData, TRUE); tvSetHScrollInfo (hwnd, pData, TRUE); InvalidateRect (hwnd, NULL, TRUE); - return (int) newItem; + return (LRESULT) newItem; } case MSG_KEYDOWN: diff --git a/src/ex_ctrl/treeview_rdr.c b/src/ex_ctrl/treeview_rdr.c index 1168a803..98277c54 100644 --- a/src/ex_ctrl/treeview_rdr.c +++ b/src/ex_ctrl/treeview_rdr.c @@ -854,7 +854,7 @@ static LRESULT TreeViewCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM case TVM_GETROOT: pData = (PTVDATA) GetWindowAdditionalData2 (hwnd); - return (int) pData->root; + return (LRESULT)pData->root; break; case TVM_SEARCHITEM: @@ -873,7 +873,7 @@ static LRESULT TreeViewCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM return 0; matched = findStringDepthFirst (pData, root, text); - return (int)matched; + return (LRESULT)matched; } case TVM_FINDCHILD: @@ -892,12 +892,12 @@ static LRESULT TreeViewCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM return 0; matched = findStringInChildren (pData, item, text); - return (int)matched; + return (LRESULT)matched; } case TVM_GETSELITEM: pData = (PTVDATA) GetWindowAdditionalData2 (hwnd); - return (int)pData->pItemSelected; + return (LRESULT)pData->pItemSelected; case TVM_SETSELITEM: { @@ -938,7 +938,7 @@ static LRESULT TreeViewCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM } #endif - return (int)old_sel; + return (LRESULT)old_sel; } case TVM_GETRELATEDITEM: @@ -953,13 +953,13 @@ static LRESULT TreeViewCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM switch (related) { case TVIR_PARENT: - return (int)item->parent; + return (LRESULT)item->parent; case TVIR_FIRSTCHILD: - return (int)item->child; + return (LRESULT)item->child; case TVIR_NEXTSIBLING: - return (int)item->next; + return (LRESULT)item->next; case TVIR_PREVSIBLING: - return (int)getPrev (pData, item); + return (LRESULT)getPrev (pData, item); } return 0; @@ -1120,8 +1120,8 @@ static LRESULT TreeViewCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM } #endif if (pData->dwStyle & TVS_WITHICON) { - newItem->hIconFold = (DWORD) pTVItemInfo->hIconFold; - newItem->hIconUnfold = (DWORD) pTVItemInfo->hIconUnfold; + newItem->hIconFold = (HICON) pTVItemInfo->hIconFold; + newItem->hIconUnfold = (HICON) pTVItemInfo->hIconUnfold; } else { newItem->hIconFold = 0L; @@ -1137,7 +1137,7 @@ static LRESULT TreeViewCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM tvSetVScrollInfo (hwnd, pData, TRUE); tvSetHScrollInfo (hwnd, pData, TRUE); InvalidateRect (hwnd, NULL, TRUE); - return (int) newItem; + return (LRESULT)newItem; } case MSG_KEYDOWN: diff --git a/src/gui/arabickeymap.c b/src/gui/arabickeymap.c index 5de009db..0d64cd3b 100644 --- a/src/gui/arabickeymap.c +++ b/src/gui/arabickeymap.c @@ -180,9 +180,6 @@ static ushort *key_maps[MAX_NR_KEYMAPS] = { ctrl_alt_map,0 }; -static unsigned int keymap_count = 64; - - /* * Philosophy: most people do not define more strings, but they who do * often want quite a lot of string space. So, we statically allocate diff --git a/src/gui/hebrewkeymap.c b/src/gui/hebrewkeymap.c index 5c45e9cf..d5a5c3f3 100644 --- a/src/gui/hebrewkeymap.c +++ b/src/gui/hebrewkeymap.c @@ -162,9 +162,6 @@ static ushort *key_maps[MAX_NR_KEYMAPS] = { ctrl_alt_map,0 }; -static unsigned int keymap_count = 64; - - /* * Philosophy: most people do not define more strings, but they who do * often want quite a lot of string space. So, we statically allocate diff --git a/src/ial/netial/netial.c b/src/ial/netial/netial.c index 46409c4c..0d0d63b8 100644 --- a/src/ial/netial/netial.c +++ b/src/ial/netial/netial.c @@ -49,7 +49,6 @@ typedef struct static int mousex = 0; static int mousey = 0; static ts_EVENT ts_event; -static unsigned char state [NR_KEYS]; static int port = 8800; @@ -60,7 +59,7 @@ static struct sockaddr_in sin; static struct sockaddr_in pin; static int sock_descriptor; static int temp_sock_descriptor; -static int address_size; +static unsigned int address_size; static int n = 0; static MOUSE_EVENT *mouse_event; static char event_buf[100];