using stls should not enable new CAPAs
[apps/madmutt.git] / lib-ui / curs_lib.c
index 9236788..b283e42 100644 (file)
@@ -21,7 +21,7 @@
 #include <lib-sys/mutt_signal.h>
 
 #include "menu.h"
-#include "enter.h"
+#include "browser.h"
 
 #include "mutt.h"
 #include "pager.h"
@@ -42,7 +42,7 @@ event_t mutt_getch (void)
   event_t err = { -1, OP_NULL }, ret;
 
   if (!option (OPTUNBUFFEREDINPUT) && UngetCount)
-    return (KeyEvent[--UngetCount]);
+    return KeyEvent[--UngetCount];
 
   SigInt = 0;
 
@@ -58,29 +58,7 @@ event_t mutt_getch (void)
 
   ret.ch = ch;
   ret.op = 0;
-  return (ch == ctrl ('G') ? err : ret);
-}
-
-int _mutt_get_field ( const char *field, char *buf, ssize_t buflen,
-                     int complete, int multiple, char ***files, int *numfiles)
-{
-  int ret;
-  int x, y;
-
-  ENTER_STATE *es = mutt_new_enter_state ();
-
-  do {
-    CLEARLINE(stdscr, LINES - 1);
-    waddstr (stdscr, field);
-    mutt_refresh ();
-    getyx (stdscr, y, x);
-    ret = _mutt_enter_string(buf, buflen, y, x, complete, multiple, files,
-                             numfiles, es);
-  } while (ret == 1);
-  CLEARLINE(stdscr, LINES - 1);
-  mutt_free_enter_state (&es);
-
-  return (ret);
+  return ch == ctrl ('G') ? err : ret;
 }
 
 int mutt_get_field_unbuffered (char *msg, char *buf, ssize_t buflen, int flags)
@@ -91,7 +69,7 @@ int mutt_get_field_unbuffered (char *msg, char *buf, ssize_t buflen, int flags)
   rc = mutt_get_field (msg, buf, buflen, flags);
   unset_option (OPTUNBUFFEREDINPUT);
 
-  return (rc);
+  return rc;
 }
 
 void mutt_clear_error (void)
@@ -252,7 +230,7 @@ int mutt_yesorno (const char *msg, int def)
     mutt_refresh ();
   }
   CLEARLINE(stdscr, LINES - 1);
-  return (def);
+  return def;
 }
 
 /* this function is called when the user presses the abort key */
@@ -400,7 +378,7 @@ int mutt_any_key_to_continue (const char *s)
   close (f);
   fputs ("\r\n", stdout);
   mutt_clear_error ();
-  return (ch);
+  return ch;
 }
 
 int _mutt_enter_fname (const char *prompt, char *buf, ssize_t blen,
@@ -419,7 +397,7 @@ int _mutt_enter_fname (const char *prompt, char *buf, ssize_t blen,
   ch = mutt_getch ();
   if (ch.ch == -1) {
     CLEARLINE(stdscr, LINES - 1);
-    return (-1);
+    return -1;
   }
   else if (ch.ch == '?') {
     mutt_refresh ();
@@ -528,13 +506,13 @@ ssize_t mutt_pretty_size(char *s, ssize_t len, ssize_t n)
 
     if (n < 1023949)         /* 10K - 999K */
         /* 51 is magic which causes 10189/10240 to be rounded up to 10 */
-        return snprintf(s, len, "%ldK", (n + 51) / 1024);
+        return snprintf(s, len, "%ldK", (n + 51) / 1024L);
 
     if (n < 10433332)        /* 1.0M - 9.9M */
         return snprintf(s, len, "%3.1fM", n / 1048576.0);
 
     /* (10433332 + 52428) / 1048576 = 10 */
-    return snprintf (s, len, "%ldM", (n + 52428) / 1048576);
+    return snprintf (s, len, "%ldM", (n + 52428) / 1048576L);
 }
 
 /*