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.
Showing
3 changed files
with
6 additions
and
5 deletions
... | @@ -304,6 +304,7 @@ SCM_DEFINE (scm_mu_mailbox_get_port, "mu-mailbox-get-port", 2, 0, 0, | ... | @@ -304,6 +304,7 @@ SCM_DEFINE (scm_mu_mailbox_get_port, "mu-mailbox-get-port", 2, 0, 0, |
304 | mu_stream_t stream; | 304 | mu_stream_t stream; |
305 | int status; | 305 | int status; |
306 | char *s; | 306 | char *s; |
307 | SCM ret; | ||
307 | 308 | ||
308 | SCM_ASSERT (mu_scm_is_mailbox (MBOX), MBOX, SCM_ARG1, FUNC_NAME); | 309 | SCM_ASSERT (mu_scm_is_mailbox (MBOX), MBOX, SCM_ARG1, FUNC_NAME); |
309 | SCM_ASSERT (scm_is_string (MODE), MODE, SCM_ARG2, FUNC_NAME); | 310 | 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, | ... | @@ -314,9 +315,9 @@ SCM_DEFINE (scm_mu_mailbox_get_port, "mu-mailbox-get-port", 2, 0, 0, |
314 | "Cannot get mailbox stream", | 315 | "Cannot get mailbox stream", |
315 | scm_list_1 (MBOX)); | 316 | scm_list_1 (MBOX)); |
316 | s = scm_to_locale_string (MODE); | 317 | s = scm_to_locale_string (MODE); |
317 | status = mu_port_make_from_stream (MBOX, stream, scm_mode_bits (s)); | 318 | ret = mu_port_make_from_stream (MBOX, stream, scm_mode_bits (s)); |
318 | free (s); | 319 | free (s); |
319 | return status; | 320 | return ret; |
320 | } | 321 | } |
321 | #undef FUNC_NAME | 322 | #undef FUNC_NAME |
322 | 323 | ... | ... |
... | @@ -47,7 +47,7 @@ mu_scm_message_free (SCM message_smob) | ... | @@ -47,7 +47,7 @@ mu_scm_message_free (SCM message_smob) |
47 | if (mum->needs_destroy) | 47 | if (mum->needs_destroy) |
48 | mu_message_destroy (&mum->msg, NULL); | 48 | mu_message_destroy (&mum->msg, NULL); |
49 | free (mum); | 49 | free (mum); |
50 | return sizeof (struct mu_message); | 50 | return 0; |
51 | } | 51 | } |
52 | 52 | ||
53 | static char * | 53 | static char * | ... | ... |
... | @@ -121,7 +121,7 @@ mu_port_flush (SCM port) | ... | @@ -121,7 +121,7 @@ mu_port_flush (SCM port) |
121 | 121 | ||
122 | if (wrsize) | 122 | if (wrsize) |
123 | { | 123 | { |
124 | if (mu_stream_write (mp->stream, (char*) pt->write_buf, | 124 | if (mu_stream_write (mp->stream, (const char*)pt->write_buf, |
125 | wrsize, mp->offset, &n)) | 125 | wrsize, mp->offset, &n)) |
126 | return; | 126 | return; |
127 | mp->offset += n; | 127 | mp->offset += n; |
... | @@ -152,7 +152,7 @@ static scm_sizet | ... | @@ -152,7 +152,7 @@ static scm_sizet |
152 | mu_port_free (SCM port) | 152 | mu_port_free (SCM port) |
153 | { | 153 | { |
154 | mu_port_close (port); | 154 | mu_port_close (port); |
155 | return sizeof (struct mu_port); /*FIXME: approximate */ | 155 | return 0; |
156 | } | 156 | } |
157 | 157 | ||
158 | static int | 158 | static int | ... | ... |
-
Please register or sign in to post a comment