comparison src/gui_w32.c @ 10783:04eb70c77cf4 v8.0.0281

patch 8.0.0281: some files are still using ARGSUSED instead of UNUSED commit https://github.com/vim/vim/commit/1266d678bf2ed5072cca9381409536406f8d7b32 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 1 13:43:36 2017 +0100 patch 8.0.0281: some files are still using ARGSUSED instead of UNUSED Problem: MS-Windows files are still using ARGSUSED while most other files have UNUSED. Solution: Change ARGSUSED to UNUSED or delete it.
author Christian Brabandt <cb@256bit.org>
date Wed, 01 Feb 2017 13:45:04 +0100
parents f54e4c691de4
children f4ea50924c6d
comparison
equal deleted inserted replaced
10782:9b0e9cdb2aac 10783:04eb70c77cf4
556 blink_waittime = wait; 556 blink_waittime = wait;
557 blink_ontime = on; 557 blink_ontime = on;
558 blink_offtime = off; 558 blink_offtime = off;
559 } 559 }
560 560
561 /* ARGSUSED */
562 static VOID CALLBACK 561 static VOID CALLBACK
563 _OnBlinkTimer( 562 _OnBlinkTimer(
564 HWND hwnd, 563 HWND hwnd,
565 UINT uMsg, 564 UINT uMsg UNUSED,
566 UINT idEvent, 565 UINT idEvent,
567 DWORD dwTime) 566 DWORD dwTime UNUSED)
568 { 567 {
569 MSG msg; 568 MSG msg;
570 569
571 /* 570 /*
572 TRACE2("Got timer event, id %d, blink_timer %d\n", idEvent, blink_timer); 571 TRACE2("Got timer event, id %d, blink_timer %d\n", idEvent, blink_timer);
588 else 587 else
589 { 588 {
590 gui_update_cursor(TRUE, FALSE); 589 gui_update_cursor(TRUE, FALSE);
591 blink_state = BLINK_ON; 590 blink_state = BLINK_ON;
592 blink_timer = (UINT) SetTimer(NULL, 0, (UINT)blink_ontime, 591 blink_timer = (UINT) SetTimer(NULL, 0, (UINT)blink_ontime,
593 (TIMERPROC)_OnBlinkTimer); 592 (TIMERPROC)_OnBlinkTimer);
594 } 593 }
595 } 594 }
596 595
597 static void 596 static void
598 gui_mswin_rm_blink_timer(void) 597 gui_mswin_rm_blink_timer(void)
642 641
643 /* 642 /*
644 * Call-back routines. 643 * Call-back routines.
645 */ 644 */
646 645
647 /*ARGSUSED*/
648 static VOID CALLBACK 646 static VOID CALLBACK
649 _OnTimer( 647 _OnTimer(
650 HWND hwnd, 648 HWND hwnd,
651 UINT uMsg, 649 UINT uMsg UNUSED,
652 UINT idEvent, 650 UINT idEvent,
653 DWORD dwTime) 651 DWORD dwTime UNUSED)
654 { 652 {
655 MSG msg; 653 MSG msg;
656 654
657 /* 655 /*
658 TRACE2("Got timer event, id %d, s_wait_timer %d\n", idEvent, s_wait_timer); 656 TRACE2("Got timer event, id %d, s_wait_timer %d\n", idEvent, s_wait_timer);
665 ; 663 ;
666 if (idEvent == s_wait_timer) 664 if (idEvent == s_wait_timer)
667 s_wait_timer = 0; 665 s_wait_timer = 0;
668 } 666 }
669 667
670 /*ARGSUSED*/
671 static void 668 static void
672 _OnDeadChar( 669 _OnDeadChar(
673 HWND hwnd, 670 HWND hwnd UNUSED,
674 UINT ch, 671 UINT ch UNUSED,
675 int cRepeat) 672 int cRepeat UNUSED)
676 { 673 {
677 dead_key = 1; 674 dead_key = 1;
678 } 675 }
679 676
680 /* 677 /*
750 } 747 }
751 748
752 /* 749 /*
753 * Key hit, add it to the input buffer. 750 * Key hit, add it to the input buffer.
754 */ 751 */
755 /*ARGSUSED*/
756 static void 752 static void
757 _OnChar( 753 _OnChar(
758 HWND hwnd, 754 HWND hwnd UNUSED,
759 UINT ch, 755 UINT ch,
760 int cRepeat) 756 int cRepeat UNUSED)
761 { 757 {
762 char_u string[40]; 758 char_u string[40];
763 int len = 0; 759 int len = 0;
764 760
765 dead_key = 0; 761 dead_key = 0;
775 } 771 }
776 772
777 /* 773 /*
778 * Alt-Key hit, add it to the input buffer. 774 * Alt-Key hit, add it to the input buffer.
779 */ 775 */
780 /*ARGSUSED*/
781 static void 776 static void
782 _OnSysChar( 777 _OnSysChar(
783 HWND hwnd, 778 HWND hwnd UNUSED,
784 UINT cch, 779 UINT cch,
785 int cRepeat) 780 int cRepeat UNUSED)
786 { 781 {
787 char_u string[40]; /* Enough for multibyte character */ 782 char_u string[40]; /* Enough for multibyte character */
788 int len; 783 int len;
789 int modifiers; 784 int modifiers;
790 int ch = cch; /* special keys are negative */ 785 int ch = cch; /* special keys are negative */
859 vim_modifiers |= MOUSE_ALT; 854 vim_modifiers |= MOUSE_ALT;
860 855
861 gui_send_mouse_event(button, x, y, repeated_click, vim_modifiers); 856 gui_send_mouse_event(button, x, y, repeated_click, vim_modifiers);
862 } 857 }
863 858
864 /*ARGSUSED*/
865 static void 859 static void
866 _OnMouseButtonDown( 860 _OnMouseButtonDown(
867 HWND hwnd, 861 HWND hwnd UNUSED,
868 BOOL fDoubleClick, 862 BOOL fDoubleClick UNUSED,
869 int x, 863 int x,
870 int y, 864 int y,
871 UINT keyFlags) 865 UINT keyFlags)
872 { 866 {
873 static LONG s_prevTime = 0; 867 static LONG s_prevTime = 0;
958 952
959 s_prevTime = currentTime; 953 s_prevTime = currentTime;
960 } 954 }
961 } 955 }
962 956
963 /*ARGSUSED*/
964 static void 957 static void
965 _OnMouseMoveOrRelease( 958 _OnMouseMoveOrRelease(
966 HWND hwnd, 959 HWND hwnd UNUSED,
967 int x, 960 int x,
968 int y, 961 int y,
969 UINT keyFlags) 962 UINT keyFlags)
970 { 963 {
971 int button; 964 int button;
1036 pMenu = pMenu->next; 1029 pMenu = pMenu->next;
1037 } 1030 }
1038 return pMenu; 1031 return pMenu;
1039 } 1032 }
1040 1033
1041 /*ARGSUSED*/
1042 static void 1034 static void
1043 _OnMenu( 1035 _OnMenu(
1044 HWND hwnd, 1036 HWND hwnd UNUSED,
1045 int id, 1037 int id,
1046 HWND hwndCtl, 1038 HWND hwndCtl UNUSED,
1047 UINT codeNotify) 1039 UINT codeNotify UNUSED)
1048 { 1040 {
1049 vimmenu_T *pMenu; 1041 vimmenu_T *pMenu;
1050 1042
1051 pMenu = gui_mswin_find_menu(root_menu, id); 1043 pMenu = gui_mswin_find_menu(root_menu, id);
1052 if (pMenu) 1044 if (pMenu)
1525 #if defined(FEAT_EVAL) || defined(PROTO) 1517 #if defined(FEAT_EVAL) || defined(PROTO)
1526 /* 1518 /*
1527 * Return the name of font "font" in allocated memory. 1519 * Return the name of font "font" in allocated memory.
1528 * Don't know how to get the actual name, thus use the provided name. 1520 * Don't know how to get the actual name, thus use the provided name.
1529 */ 1521 */
1530 /*ARGSUSED*/
1531 char_u * 1522 char_u *
1532 gui_mch_get_fontname(GuiFont font, char_u *name) 1523 gui_mch_get_fontname(GuiFont font UNUSED, char_u *name)
1533 { 1524 {
1534 if (name == NULL) 1525 if (name == NULL)
1535 return NULL; 1526 return NULL;
1536 return vim_strsave(name); 1527 return vim_strsave(name);
1537 } 1528 }
2173 #ifdef FEAT_MENU 2164 #ifdef FEAT_MENU
2174 SetMenu(s_hwnd, flag ? s_menuBar : NULL); 2165 SetMenu(s_hwnd, flag ? s_menuBar : NULL);
2175 #endif 2166 #endif
2176 } 2167 }
2177 2168
2178 /*ARGSUSED*/
2179 void 2169 void
2180 gui_mch_set_menu_pos( 2170 gui_mch_set_menu_pos(
2181 int x, 2171 int x UNUSED,
2182 int y, 2172 int y UNUSED,
2183 int w, 2173 int w UNUSED,
2184 int h) 2174 int h UNUSED)
2185 { 2175 {
2186 /* It will be in the right place anyway */ 2176 /* It will be in the right place anyway */
2187 } 2177 }
2188 2178
2189 #if defined(FEAT_MENU) || defined(PROTO) 2179 #if defined(FEAT_MENU) || defined(PROTO)
2815 2805
2816 /* 2806 /*
2817 * Get this message when the user clicks on the cross in the top right corner 2807 * Get this message when the user clicks on the cross in the top right corner
2818 * of a Windows95 window. 2808 * of a Windows95 window.
2819 */ 2809 */
2820 /*ARGSUSED*/
2821 static void 2810 static void
2822 _OnClose( 2811 _OnClose(HWND hwnd UNUSED)
2823 HWND hwnd)
2824 { 2812 {
2825 gui_shell_closed(); 2813 gui_shell_closed();
2826 } 2814 }
2827 2815
2828 /* 2816 /*
2829 * Get a message when the window is being destroyed. 2817 * Get a message when the window is being destroyed.
2830 */ 2818 */
2831 static void 2819 static void
2832 _OnDestroy( 2820 _OnDestroy(HWND hwnd)
2833 HWND hwnd)
2834 { 2821 {
2835 if (!destroying) 2822 if (!destroying)
2836 _OnClose(hwnd); 2823 _OnClose(hwnd);
2837 } 2824 }
2838 2825
2881 #endif 2868 #endif
2882 EndPaint(hwnd, &ps); 2869 EndPaint(hwnd, &ps);
2883 } 2870 }
2884 } 2871 }
2885 2872
2886 /*ARGSUSED*/
2887 static void 2873 static void
2888 _OnSize( 2874 _OnSize(
2889 HWND hwnd, 2875 HWND hwnd,
2890 UINT state, 2876 UINT state UNUSED,
2891 int cx, 2877 int cx,
2892 int cy) 2878 int cy)
2893 { 2879 {
2894 if (!IsMinimized(hwnd)) 2880 if (!IsMinimized(hwnd))
2895 { 2881 {
3122 gui_clear_block(row, gui.scroll_region_left, 3108 gui_clear_block(row, gui.scroll_region_left,
3123 row + num_lines - 1, gui.scroll_region_right); 3109 row + num_lines - 1, gui.scroll_region_right);
3124 } 3110 }
3125 3111
3126 3112
3127 /*ARGSUSED*/
3128 void 3113 void
3129 gui_mch_exit(int rc) 3114 gui_mch_exit(int rc UNUSED)
3130 { 3115 {
3131 #if defined(FEAT_DIRECTX) 3116 #if defined(FEAT_DIRECTX)
3132 DWriteContext_Close(s_dwc); 3117 DWriteContext_Close(s_dwc);
3133 DWrite_Final(); 3118 DWrite_Final();
3134 s_dwc = NULL; 3119 s_dwc = NULL;
3283 3268
3284 /* 3269 /*
3285 * Initialise vim to use the font with the given name. 3270 * Initialise vim to use the font with the given name.
3286 * Return FAIL if the font could not be loaded, OK otherwise. 3271 * Return FAIL if the font could not be loaded, OK otherwise.
3287 */ 3272 */
3288 /*ARGSUSED*/
3289 int 3273 int
3290 gui_mch_init_font(char_u *font_name, int fontset) 3274 gui_mch_init_font(char_u *font_name, int fontset UNUSED)
3291 { 3275 {
3292 LOGFONT lf; 3276 LOGFONT lf;
3293 GuiFont font = NOFONT; 3277 GuiFont font = NOFONT;
3294 char_u *p; 3278 char_u *p;
3295 3279
3414 } 3398 }
3415 3399
3416 /* 3400 /*
3417 * Set the window title 3401 * Set the window title
3418 */ 3402 */
3419 /*ARGSUSED*/
3420 void 3403 void
3421 gui_mch_settitle( 3404 gui_mch_settitle(
3422 char_u *title, 3405 char_u *title,
3423 char_u *icon) 3406 char_u *icon UNUSED)
3424 { 3407 {
3425 set_window_title(s_hwnd, (title == NULL ? "VIM" : (char *)title)); 3408 set_window_title(s_hwnd, (title == NULL ? "VIM" : (char *)title));
3426 } 3409 }
3427 3410
3428 #if defined(FEAT_MOUSESHAPE) || defined(PROTO) 3411 #if defined(FEAT_MOUSESHAPE) || defined(PROTO)
3770 return vim_strsave(shorten_fname1((char_u *)fileBuf)); 3753 return vim_strsave(shorten_fname1((char_u *)fileBuf));
3771 # endif 3754 # endif
3772 } 3755 }
3773 #endif /* FEAT_BROWSE */ 3756 #endif /* FEAT_BROWSE */
3774 3757
3775 /*ARGSUSED*/
3776 static void 3758 static void
3777 _OnDropFiles( 3759 _OnDropFiles(
3778 HWND hwnd, 3760 HWND hwnd UNUSED,
3779 HDROP hDrop) 3761 HDROP hDrop)
3780 { 3762 {
3781 #ifdef FEAT_WINDOWS 3763 #ifdef FEAT_WINDOWS
3782 # define BUFPATHLEN _MAX_PATH 3764 # define BUFPATHLEN _MAX_PATH
3783 # define DRAGQVAL 0xFFFFFFFF 3765 # define DRAGQVAL 0xFFFFFFFF
3831 s_need_activate = TRUE; 3813 s_need_activate = TRUE;
3832 } 3814 }
3833 #endif 3815 #endif
3834 } 3816 }
3835 3817
3836 /*ARGSUSED*/
3837 static int 3818 static int
3838 _OnScroll( 3819 _OnScroll(
3839 HWND hwnd, 3820 HWND hwnd UNUSED,
3840 HWND hwndCtl, 3821 HWND hwndCtl,
3841 UINT code, 3822 UINT code,
3842 int pos) 3823 int pos)
3843 { 3824 {
3844 static UINT prev_code = 0; /* code of previous call */ 3825 static UINT prev_code = 0; /* code of previous call */
3952 * Return pointers to the arguments in "argvp". Memory is allocated with 3933 * Return pointers to the arguments in "argvp". Memory is allocated with
3953 * malloc(), use free() instead of vim_free(). 3934 * malloc(), use free() instead of vim_free().
3954 * Return pointer to buffer in "tofree". 3935 * Return pointer to buffer in "tofree".
3955 * Returns zero when out of memory. 3936 * Returns zero when out of memory.
3956 */ 3937 */
3957 /*ARGSUSED*/
3958 int 3938 int
3959 get_cmd_args(char *prog, char *cmdline, char ***argvp, char **tofree) 3939 get_cmd_args(char *prog, char *cmdline, char ***argvp, char **tofree)
3960 { 3940 {
3961 int i; 3941 int i;
3962 char *p; 3942 char *p;
5586 } 5566 }
5587 5567
5588 /* 5568 /*
5589 * Set the size of the window to the given width and height in pixels. 5569 * Set the size of the window to the given width and height in pixels.
5590 */ 5570 */
5591 /*ARGSUSED*/
5592 void 5571 void
5593 gui_mch_set_shellsize(int width, int height, 5572 gui_mch_set_shellsize(
5594 int min_width, int min_height, int base_width, int base_height, 5573 int width,
5574 int height,
5575 int min_width UNUSED,
5576 int min_height UNUSED,
5577 int base_width UNUSED,
5578 int base_height UNUSED,
5595 int direction) 5579 int direction)
5596 { 5580 {
5597 RECT workarea_rect; 5581 RECT workarea_rect;
5598 int win_width, win_height; 5582 int win_width, win_height;
5599 WINDOWPLACEMENT wndpl; 5583 WINDOWPLACEMENT wndpl;
5750 #include <imm.h> 5734 #include <imm.h>
5751 5735
5752 /* 5736 /*
5753 * handle WM_IME_NOTIFY message 5737 * handle WM_IME_NOTIFY message
5754 */ 5738 */
5755 /*ARGSUSED*/
5756 static LRESULT 5739 static LRESULT
5757 _OnImeNotify(HWND hWnd, DWORD dwCommand, DWORD dwData) 5740 _OnImeNotify(HWND hWnd, DWORD dwCommand, DWORD dwData UNUSED)
5758 { 5741 {
5759 LRESULT lResult = 0; 5742 LRESULT lResult = 0;
5760 HIMC hImc; 5743 HIMC hImc;
5761 5744
5762 if (!pImmGetContext || (hImc = pImmGetContext(hWnd)) == (HIMC)0) 5745 if (!pImmGetContext || (hImc = pImmGetContext(hWnd)) == (HIMC)0)
5800 } 5783 }
5801 pImmReleaseContext(hWnd, hImc); 5784 pImmReleaseContext(hWnd, hImc);
5802 return lResult; 5785 return lResult;
5803 } 5786 }
5804 5787
5805 /*ARGSUSED*/
5806 static LRESULT 5788 static LRESULT
5807 _OnImeComposition(HWND hwnd, WPARAM dbcs, LPARAM param) 5789 _OnImeComposition(HWND hwnd, WPARAM dbcs UNUSED, LPARAM param)
5808 { 5790 {
5809 char_u *ret; 5791 char_u *ret;
5810 int len; 5792 int len;
5811 5793
5812 if ((param & GCS_RESULTSTR) == 0) /* Composition unfinished. */ 5794 if ((param & GCS_RESULTSTR) == 0) /* Composition unfinished. */
6842 * acknowledges the INITDIALOG message so that Windows knows to do standard 6824 * acknowledges the INITDIALOG message so that Windows knows to do standard
6843 * dialog stuff (Return = default, Esc = cancel....) Second, if a button is 6825 * dialog stuff (Return = default, Esc = cancel....) Second, if a button is
6844 * pressed, return that button's ID - IDCANCEL (2), which is the button's 6826 * pressed, return that button's ID - IDCANCEL (2), which is the button's
6845 * number. 6827 * number.
6846 */ 6828 */
6847 /*ARGSUSED*/
6848 static LRESULT CALLBACK 6829 static LRESULT CALLBACK
6849 dialog_callback( 6830 dialog_callback(
6850 HWND hwnd, 6831 HWND hwnd,
6851 UINT message, 6832 UINT message,
6852 WPARAM wParam, 6833 WPARAM wParam,
6853 LPARAM lParam) 6834 LPARAM lParam UNUSED)
6854 { 6835 {
6855 if (message == WM_INITDIALOG) 6836 if (message == WM_INITDIALOG)
6856 { 6837 {
6857 CenterWindow(hwnd, GetWindow(hwnd, GW_OWNER)); 6838 CenterWindow(hwnd, GetWindow(hwnd, GW_OWNER));
6858 /* Set focus to the dialog. Set the default button, if specified. */ 6839 /* Set focus to the dialog. Set the default button, if specified. */
8534 delete_tooltip(BalloonEval *beval) 8515 delete_tooltip(BalloonEval *beval)
8535 { 8516 {
8536 PostMessage(beval->balloon, WM_CLOSE, 0, 0); 8517 PostMessage(beval->balloon, WM_CLOSE, 0, 0);
8537 } 8518 }
8538 8519
8539 /*ARGSUSED*/
8540 static VOID CALLBACK 8520 static VOID CALLBACK
8541 BevalTimerProc( 8521 BevalTimerProc(
8542 HWND hwnd, 8522 HWND hwnd UNUSED,
8543 UINT uMsg, 8523 UINT uMsg UNUSED,
8544 UINT_PTR idEvent, 8524 UINT_PTR idEvent UNUSED,
8545 DWORD dwTime) 8525 DWORD dwTime)
8546 { 8526 {
8547 POINT pt; 8527 POINT pt;
8548 RECT rect; 8528 RECT rect;
8549 8529
8550 if (cur_beval == NULL || cur_beval->showState == ShS_SHOWING || !p_beval) 8530 if (cur_beval == NULL || cur_beval->showState == ShS_SHOWING || !p_beval)
8576 if (cur_beval->msgCB != NULL) 8556 if (cur_beval->msgCB != NULL)
8577 (*cur_beval->msgCB)(cur_beval, 0); 8557 (*cur_beval->msgCB)(cur_beval, 0);
8578 } 8558 }
8579 } 8559 }
8580 8560
8581 /*ARGSUSED*/
8582 void 8561 void
8583 gui_mch_disable_beval_area(BalloonEval *beval) 8562 gui_mch_disable_beval_area(BalloonEval *beval UNUSED)
8584 { 8563 {
8585 // TRACE0("gui_mch_disable_beval_area {{{"); 8564 // TRACE0("gui_mch_disable_beval_area {{{");
8586 KillTimer(s_textArea, BevalTimerId); 8565 KillTimer(s_textArea, BevalTimerId);
8587 // TRACE0("gui_mch_disable_beval_area }}}"); 8566 // TRACE0("gui_mch_disable_beval_area }}}");
8588 } 8567 }
8589 8568
8590 /*ARGSUSED*/
8591 void 8569 void
8592 gui_mch_enable_beval_area(BalloonEval *beval) 8570 gui_mch_enable_beval_area(BalloonEval *beval)
8593 { 8571 {
8594 // TRACE0("gui_mch_enable_beval_area |||"); 8572 // TRACE0("gui_mch_enable_beval_area |||");
8595 if (beval == NULL) 8573 if (beval == NULL)
8617 make_tooltip(beval, (char *)mesg, pt); 8595 make_tooltip(beval, (char *)mesg, pt);
8618 } 8596 }
8619 // TRACE0("gui_mch_post_balloon }}}"); 8597 // TRACE0("gui_mch_post_balloon }}}");
8620 } 8598 }
8621 8599
8622 /*ARGSUSED*/
8623 BalloonEval * 8600 BalloonEval *
8624 gui_mch_create_beval_area( 8601 gui_mch_create_beval_area(
8625 void *target, /* ignored, always use s_textArea */ 8602 void *target, /* ignored, always use s_textArea */
8626 char_u *mesg, 8603 char_u *mesg,
8627 void (*mesgCB)(BalloonEval *, int), 8604 void (*mesgCB)(BalloonEval *, int),
8657 8634
8658 } 8635 }
8659 return beval; 8636 return beval;
8660 } 8637 }
8661 8638
8662 /*ARGSUSED*/
8663 static void 8639 static void
8664 Handle_WM_Notify(HWND hwnd, LPNMHDR pnmh) 8640 Handle_WM_Notify(HWND hwnd UNUSED, LPNMHDR pnmh)
8665 { 8641 {
8666 if (pnmh->idFrom != ID_BEVAL_TOOLTIP) /* it is not our tooltip */ 8642 if (pnmh->idFrom != ID_BEVAL_TOOLTIP) /* it is not our tooltip */
8667 return; 8643 return;
8668 8644
8669 if (cur_beval != NULL) 8645 if (cur_beval != NULL)