B4R Question Inline C - Error too few arguments to function

Discussion in 'B4R Questions' started by Hypnos, May 2, 2018.

  1. Hypnos

    Hypnos Active Member Licensed User

    I'm now working on some Inline C on B4R, my inline C code something like this:

    Code:
    void wb_fillCircle(B4R::Object* usused)
    {
        wb32_fillCircle(b4r_main::_x0, b4r_main::_y0, b4r_main::_r, b4r_main::_cornername, b4r_main::_delta, b4r_main::_color);
    }
    But I got the below error, anyone know what's wrong on my code? Thanks!

    rCore.h:455: error: too few arguments to function 'void wb32_fillCircle(int16_t, int16_t, int16_t, uint8_t, int16_t, uint16_t)'
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Looks like you are missing a parameter. Where is wb32_fillCircle defined? Can you post a C example that calls it?
     
  3. Hypnos

    Hypnos Active Member Licensed User

    Hi Erel,

    Here is my code:

    Code:
    Sub wbFillCircle (wX0 As UInt, wY0 As UInt, wR As UInt, wCornername As UInt, wDelta As UInt, wColor As UInt)
        x0 = wX0
        y0 = wY0
        r = wR
        corner = wCornername
        delta = wDelta
        color = wColor
        RunNative(
    "wb32_fillCircle"Null)
    End Sub   


    #if C
    #include "wifiboy32.h"

    void wb_fillCircle(B4R::Object* usused)
    {
        wb32_fillCircle(b4r_main::_x0, b4r_main::_y0, b4r_main::_r, b4r_main::_cornername, b4r_main::_delta, b4r_main::_color);
    }


    #end if
     
  4. tigrot

    tigrot Well-Known Member Licensed User

    Seems you defined wb_fillcircle and you callnative wb32_fillcircle.
    Code:
    RunNative("wb32_fillCircle"Null)
    While sub
    Code:
    void wb_fillCircle(B4R::Object* usused)
     
    Last edited: May 2, 2018
  5. Hypnos

    Hypnos Active Member Licensed User

    Oh yes.......... :oops:
    Thank you!
     
    tigrot likes this.
Loading...