From 35ac9924ac0b4994ef4ea875d01dd4ece29a0f91 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sun, 12 Feb 2012 13:31:27 +0000 Subject: [PATCH] fixed a few line to remove compile-time warnings --- qse/include/qse/cmn/tio.h | 11 ++++++++++- qse/lib/cmn/env.c | 2 +- qse/lib/cmn/main.c | 2 +- qse/lib/cmn/sio.c | 2 +- qse/lib/cmn/tio-put.c | 2 +- qse/lib/cmn/tio.c | 5 +++++ 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/qse/include/qse/cmn/tio.h b/qse/include/qse/cmn/tio.h index 4832bf73..290691ca 100644 --- a/qse/include/qse/cmn/tio.h +++ b/qse/include/qse/cmn/tio.h @@ -166,12 +166,21 @@ int qse_tio_fini ( ); /** - * The qse_tio_geterrnum() function return an error code. + * The qse_tio_geterrnum() function returns the current error code. */ qse_tio_errnum_t qse_tio_geterrnum ( qse_tio_t* tio ); +/** + * The qse_tio_geterrnum() function changes the current error code. + * typically from within the I/O handler attached. + */ +void qse_tio_seterrnum ( + qse_tio_t* tio, + qse_tio_errnum_t errnum +); + /** * The qse_tio_getcmgr() function returns the character manager. */ diff --git a/qse/lib/cmn/env.c b/qse/lib/cmn/env.c index d8da553c..e0c9bfe4 100644 --- a/qse/lib/cmn/env.c +++ b/qse/lib/cmn/env.c @@ -500,7 +500,7 @@ static int insert_sys_wcs (qse_env_t* env, const qse_wchar_t* name) #endif } -static insert_sys_mbs (qse_env_t* env, const qse_mchar_t* name) +static int insert_sys_mbs (qse_env_t* env, const qse_mchar_t* name) { #if defined(QSE_ENV_CHAR_IS_WCHAR) /* convert mchar to wchar */ diff --git a/qse/lib/cmn/main.c b/qse/lib/cmn/main.c index b241bf0a..8f2fd5ec 100644 --- a/qse/lib/cmn/main.c +++ b/qse/lib/cmn/main.c @@ -19,7 +19,7 @@ */ #include -#include +#include #include "mem.h" int qse_runmain ( diff --git a/qse/lib/cmn/sio.c b/qse/lib/cmn/sio.c index 2dd50bba..09003b33 100644 --- a/qse/lib/cmn/sio.c +++ b/qse/lib/cmn/sio.c @@ -172,7 +172,7 @@ int qse_sio_init ( if (qse_tio_attachin (&sio->tio.io, file_input, sio->inbuf, QSE_COUNTOF(sio->inbuf)) <= -1 || qse_tio_attachout (&sio->tio.io, file_output, sio->outbuf, QSE_COUNTOF(sio->outbuf)) <= -1) { - if (sio->errnum = QSE_SIO_ENOERR) + if (sio->errnum == QSE_SIO_ENOERR) sio->errnum = tio_errnum_to_sio_errnum (&sio->tio.io); qse_tio_fini (&sio->tio.io); qse_fio_fini (&sio->u.file); diff --git a/qse/lib/cmn/tio-put.c b/qse/lib/cmn/tio-put.c index 533b1c61..d38464a7 100644 --- a/qse/lib/cmn/tio-put.c +++ b/qse/lib/cmn/tio-put.c @@ -19,7 +19,7 @@ */ #include -#include +#include qse_ssize_t qse_tio_writembs ( qse_tio_t* tio, const qse_mchar_t* mptr, qse_size_t mlen) diff --git a/qse/lib/cmn/tio.c b/qse/lib/cmn/tio.c index a0029a0c..416eacad 100644 --- a/qse/lib/cmn/tio.c +++ b/qse/lib/cmn/tio.c @@ -92,6 +92,11 @@ qse_tio_errnum_t qse_tio_geterrnum (qse_tio_t* tio) return tio->errnum; } +void qse_tio_seterrnum (qse_tio_t* tio, qse_tio_errnum_t errnum) +{ + tio->errnum = errnum; +} + qse_cmgr_t* qse_tio_getcmgr (qse_tio_t* tio) { return tio->cmgr;