Commit c0e1fc82 c0e1fc828e69eceb34fab770b888cce3843c6e7f by Sergey Poznyakoff

More fixes in libmu_scm.

* libmu_scm/mu_mailbox.c (mu-mailbox-get-port): Fix return value.
* libmu_scm/mu_port.c (mu_port_flush): Avoid warnings on passing
arg 2 to mu_stream_write.
(mu_port_free): Return 0.
* libmu_scm/mu_message.c (mu_scm_message_free): Return 0.
1 parent 93b51f57
......@@ -304,6 +304,7 @@ SCM_DEFINE (scm_mu_mailbox_get_port, "mu-mailbox-get-port", 2, 0, 0,
mu_stream_t stream;
int status;
char *s;
SCM ret;
SCM_ASSERT (mu_scm_is_mailbox (MBOX), MBOX, SCM_ARG1, FUNC_NAME);
SCM_ASSERT (scm_is_string (MODE), MODE, SCM_ARG2, FUNC_NAME);
......@@ -314,9 +315,9 @@ SCM_DEFINE (scm_mu_mailbox_get_port, "mu-mailbox-get-port", 2, 0, 0,
"Cannot get mailbox stream",
scm_list_1 (MBOX));
s = scm_to_locale_string (MODE);
status = mu_port_make_from_stream (MBOX, stream, scm_mode_bits (s));
ret = mu_port_make_from_stream (MBOX, stream, scm_mode_bits (s));
free (s);
return status;
return ret;
}
#undef FUNC_NAME
......
......@@ -47,7 +47,7 @@ mu_scm_message_free (SCM message_smob)
if (mum->needs_destroy)
mu_message_destroy (&mum->msg, NULL);
free (mum);
return sizeof (struct mu_message);
return 0;
}
static char *
......
......@@ -121,7 +121,7 @@ mu_port_flush (SCM port)
if (wrsize)
{
if (mu_stream_write (mp->stream, (char*) pt->write_buf,
if (mu_stream_write (mp->stream, (const char*)pt->write_buf,
wrsize, mp->offset, &n))
return;
mp->offset += n;
......@@ -152,7 +152,7 @@ static scm_sizet
mu_port_free (SCM port)
{
mu_port_close (port);
return sizeof (struct mu_port); /*FIXME: approximate */
return 0;
}
static int
......