changeset: 6644:9dfe211355b6
user:      Kevin McCarthy <[email protected]>
date:      Tue May 03 09:46:51 2016 -0700
link:      http://dev.mutt.org/hg/mutt/rev/9dfe211355b6

Change mutt_window_getyx() to accept NULL *y/*x params.

Thanks to Vincent Lefèvre for suggesting this nice cleanup.
Previously, _mutt_get_field() was employing an ugly hack to avoid an
unused var warning.

diffs (25 lines):

diff -r fb68199318ae -r 9dfe211355b6 curs_lib.c
--- a/curs_lib.c        Sat Apr 30 14:39:19 2016 -0700
+++ b/curs_lib.c        Tue May 03 09:46:51 2016 -0700
@@ -165,7 +165,7 @@
     addstr ((char *)field); /* cast to get around bad prototypes */
     NORMAL_COLOR;
     mutt_refresh ();
-    mutt_window_getyx (MuttMessageWindow, &ret, &x);  /* don't care about y: 
avoiding unused var warning */
+    mutt_window_getyx (MuttMessageWindow, NULL, &x);
     ret = _mutt_enter_string (buf, buflen, x, complete, multiple, files, 
numfiles, es);
   }
   while (ret == 1);
@@ -628,8 +628,10 @@
   int row, col;
 
   getyx (stdscr, row, col);
-  *y = row - win->row_offset;
-  *x = col - win->col_offset;
+  if (y)
+    *y = row - win->row_offset;
+  if (x)
+    *x = col - win->col_offset;
 }
 
 

Reply via email to