surf
MarshalDirectiveException: Cannot marshal 'return value': Invalid managed/unmanaged type combination
struct wiimote_t **wiiuse_init(int wiimotes)
{
int i = 0;
struct wiimote_t **wm = NULL;
/*
* Please do not remove this banner.
* GPL asks that you please leave output credits intact.
* Thank you.
*
* This banner is only displayed once so that if you need
* to call this function again it won't be intrusive.
*
* 2018: Replaced wiiuse.net with sourceforge project, since
* wiiuse.net is now abandoned and "parked".
*/
if (!g_banner)
{
printf("wiiuse v" WIIUSE_VERSION " loaded.\n"
" De-facto official fork at http://github.com/wiiuse/wiiuse\n"
" Original By: Michael Laforest <thepara[at]gmail{dot}com> <https://sourceforge.net/projects/wiiuse/>\n");
g_banner = 1;
}
logtarget[0] = stderr;
logtarget[1] = stderr;
logtarget[2] = stderr;
logtarget[3] = stderr;
if (!wiimotes)
{
return NULL;
}
wm = (struct wiimote_t **)malloc(sizeof(struct wiimote_t *) * wiimotes);
for (i = 0; i < wiimotes; ++i)
{
wm[i] = (struct wiimote_t *)malloc(sizeof(struct wiimote_t));
memset(wm[i], 0, sizeof(struct wiimote_t));
wm[i]->unid = i + 1;
wiiuse_init_platform_fields(wm[i]);
wm[i]->state = WIIMOTE_INIT_STATES;
wm[i]->flags = WIIUSE_INIT_FLAGS;
wm[i]->event = WIIUSE_NONE;
wm[i]->exp.type = EXP_NONE;
wm[i]->expansion_state = 0;
wiiuse_set_aspect_ratio(wm[i], WIIUSE_ASPECT_4_3);
wiiuse_set_ir_position(wm[i], WIIUSE_IR_ABOVE);
wm[i]->orient_threshold = 0.5f;
wm[i]->accel_threshold = 5;
wm[i]->accel_calib.st_alpha = WIIUSE_DEFAULT_SMOOTH_ALPHA;
wm[i]->type = WIIUSE_WIIMOTE_REGULAR;
}
return wm;
}
struct wiimote_t **wiiuse_init(int wiimotes)
{
int i = 0;
struct wiimote_t **wm = NULL;
/*
* Please do not remove this banner.
* GPL asks that you please leave output credits intact.
* Thank you.
*
* This banner is only displayed once so that if you need
* to call this function again it won't be intrusive.
*
* 2018: Replaced wiiuse.net with sourceforge project, since
* wiiuse.net is now abandoned and "parked".
*/
if (!g_banner)
{
printf("wiiuse v" WIIUSE_VERSION " loaded.\n"
" De-facto official fork at http://github.com/wiiuse/wiiuse\n"
" Original By: Michael Laforest <thepara[at]gmail{dot}com> <https://sourceforge.net/projects/wiiuse/>\n");
g_banner = 1;
}
logtarget[0] = stderr;
logtarget[1] = stderr;
logtarget[2] = stderr;
logtarget[3] = stderr;
if (!wiimotes)
{
return NULL;
}
wm = (struct wiimote_t **)malloc(sizeof(struct wiimote_t *) * wiimotes);
for (i = 0; i < wiimotes; ++i)
{
wm[i] = (struct wiimote_t *)malloc(sizeof(struct wiimote_t));
memset(wm[i], 0, sizeof(struct wiimote_t));
wm[i]->unid = i + 1;
wiiuse_init_platform_fields(wm[i]);
wm[i]->state = WIIMOTE_INIT_STATES;
wm[i]->flags = WIIUSE_INIT_FLAGS;
wm[i]->event = WIIUSE_NONE;
wm[i]->exp.type = EXP_NONE;
wm[i]->expansion_state = 0;
wiiuse_set_aspect_ratio(wm[i], WIIUSE_ASPECT_4_3);
wiiuse_set_ir_position(wm[i], WIIUSE_IR_ABOVE);
wm[i]->orient_threshold = 0.5f;
wm[i]->accel_threshold = 5;
wm[i]->accel_calib.st_alpha = WIIUSE_DEFAULT_SMOOTH_ALPHA;
wm[i]->type = WIIUSE_WIIMOTE_REGULAR;
}
return wm;
}
3 replies
MarshalDirectiveException: Cannot marshal 'return value': Invalid managed/unmanaged type combination
My unbuilt function in c. (wiiuse library)
/**
* @brief Initialize an array of wiimote structures.
*
* @param wiimotes Number of wiimote_t structures to create.
*
* @return An array of initialized wiimote_t structures.
*
* @see wiiuse_connect()
*
* The array returned by this function can be passed to various
* functions, including wiiuse_connect().
*/
/**
* @brief Initialize an array of wiimote structures.
*
* @param wiimotes Number of wiimote_t structures to create.
*
* @return An array of initialized wiimote_t structures.
*
* @see wiiuse_connect()
*
* The array returned by this function can be passed to various
* functions, including wiiuse_connect().
*/
3 replies