sup

A curses threads-with-tags style email client

ncursesw-ruby.git

git clone https://supmua.dev/git/ncursesw-ruby/
commit d0005dbe5ec0992cb2e38ba0f162a2d92554c169
parent 1db8ae8d06ce906ddd8b3910782897084eb5cdcc
Author: Dan Callaghan <djc@djc.id.au>
Date:   Sun, 14 Apr 2024 11:42:48 +1000

fix some incorrectly declared method arguments

These are reported as function pointer type mismatches by clang 16:

    panel_wrap.c:201:5: error: incompatible function pointer types passing 'VALUE (*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') to parameter of type 'VALUE (*)(VALUE, VALUE)' (aka 'unsigned long (*)(unsigned long, unsigned long)') [-Wincompatible-function-pointer-types]
    panel_wrap.c:208:5: error: incompatible function pointer types passing 'VALUE (*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') to parameter of type 'VALUE (*)(VALUE, VALUE)' (aka 'unsigned long (*)(unsigned long, unsigned long)') [-Wincompatible-function-pointer-types]
    form_wrap.c:1422:3: error: incompatible function pointer types passing 'VALUE (*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') to parameter of type 'VALUE (*)(VALUE, VALUE)' (aka 'unsigned long (*)(unsigned long, unsigned long)') [-Wincompatible-function-pointer-types]
    form_wrap.c:1424:3: error: incompatible function pointer types passing 'VALUE (*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') to parameter of type 'VALUE (*)(VALUE, VALUE)' (aka 'unsigned long (*)(unsigned long, unsigned long)') [-Wincompatible-function-pointer-types]
    form_wrap.c:1431:3: error: incompatible function pointer types passing 'VALUE (*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') to parameter of type 'VALUE (*)(VALUE, VALUE)' (aka 'unsigned long (*)(unsigned long, unsigned long)') [-Wincompatible-function-pointer-types]
    ncurses_wrap.c:2593:5: error: incompatible function pointer types passing 'VALUE (*)(VALUE, VALUE, VALUE, VALUE)' (aka 'unsigned long (*)(unsigned long, unsigned long, unsigned long, unsigned long)') to parameter of type 'VALUE (*)(VALUE, VALUE)' (aka 'unsigned long (*)(unsigned long, unsigned long)') [-Wincompatible-function-pointer-types]
    ncurses_wrap.c:2607:5: error: incompatible function pointer types passing 'VALUE (*)(VALUE, VALUE)' (aka 'unsigned long (*)(unsigned long, unsigned long)') to parameter of type 'VALUE (*)(VALUE, VALUE, VALUE)' (aka 'unsigned long (*)(unsigned long, unsigned long, unsigned long)') [-Wincompatible-function-pointer-types]

Diffstat:
M form_wrap.c | 6 +++---
M ncurses_wrap.c | 4 ++--
M panel_wrap.c | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/form_wrap.c b/form_wrap.c
@@ -1421,16 +1421,16 @@ void init_form(void)
   RB_CLASS_METH(cFIELD, "dup", dup_field,2);
   RB_CLASS_METH(cFIELD, "dynamic_info", dynamic_field_info,3);
   RB_CLASS_METH(cFIELD, "arg", field_arg,0);
-  RB_CLASS_METH(cFIELD, "back", field_back,1);
+  RB_CLASS_METH(cFIELD, "back", field_back,0);
   RB_CLASS_METH(cFIELD, "buffer", field_buffer,1);
-  RB_CLASS_METH(cFIELD, "fore", field_fore,1);
+  RB_CLASS_METH(cFIELD, "fore", field_fore,0);
   RB_CLASS_METH(cFIELD, "index", field_index,0);
   RB_CLASS_METH(cFIELD, "info", field_info,6);
   RB_CLASS_METH(cFIELD, "just", field_just,0);
   RB_CLASS_METH(cFIELD, "opts", field_opts,0);
   RB_CLASS_METH(cFIELD, "opts_off", field_opts_off,1);
   RB_CLASS_METH(cFIELD, "opts_on", field_opts_on,1);
-  RB_CLASS_METH(cFIELD, "pad", field_pad,1);
+  RB_CLASS_METH(cFIELD, "pad", field_pad,0);
   RB_CLASS_METH(cFIELD, "status", field_status,0);
   RB_CLASS_METH(cFIELD, "type", field_type,0);
   /*   RB_CLASS_METH(cFIELD, "userptr", field_userptr,0); */
diff --git a/ncurses_wrap.c b/ncurses_wrap.c
@@ -2592,7 +2592,7 @@ static void init_functions_3(void)
 #ifdef HAVE_WENCLOSE
     rb_define_module_function(mNcurses, "wenclose?",
                               (&rbncurs_wenclose),
-                              1);
+                              3);
 #endif
 #ifdef HAVE_MOUSEINTERVAL
     NCFUNC(mouseinterval, 1);
@@ -2606,7 +2606,7 @@ static void init_functions_3(void)
 #ifdef HAVE_HAS_KEY
     rb_define_module_function(mNcurses, "has_key?",
                               (&rbncurs_has_key),
-                              2);
+                              1);
 #endif
     NCFUNC(getyx, 3);
     NCFUNC(getbegyx, 3);
diff --git a/panel_wrap.c b/panel_wrap.c
@@ -100,11 +100,11 @@ static VALUE rbncurs_m_new_panel(VALUE dummy, VALUE rb_window)
 { return rbncurs_c_new_panel(rb_window); }
 static VALUE rbncurs_c_panel_above(VALUE rb_panel)
 { return wrap_panel(panel_above(get_panel(rb_panel))); }
-static VALUE rbncurs_m_panel_above(VALUE rb_panel)
+static VALUE rbncurs_m_panel_above(VALUE dummy, VALUE rb_panel)
 { return rbncurs_c_panel_above(rb_panel); }
 static VALUE rbncurs_c_panel_below(VALUE rb_panel)
 { return wrap_panel(panel_below(get_panel(rb_panel))); }
-static VALUE rbncurs_m_panel_below(VALUE rb_panel)
+static VALUE rbncurs_m_panel_below(VALUE dummy, VALUE rb_panel)
 { return rbncurs_c_panel_below(rb_panel); }
 static VALUE rbncurs_c_set_panel_userptr(VALUE rb_panel, VALUE userptr)
 { return INT2NUM(set_panel_userptr(get_panel(rb_panel),