From 58a47ba425f94fb7b69681bdfa3f463f653ffc57 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Thu, 26 Feb 2009 04:35:22 +0000 Subject: [PATCH] cleaned up code --- qse/include/qse/awk/std.h | 10 +++++----- qse/lib/awk/Awk.cpp | 5 +++-- qse/lib/awk/std.c | 8 ++++---- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/qse/include/qse/awk/std.h b/qse/include/qse/awk/std.h index 3084c08e..3660d092 100644 --- a/qse/include/qse/awk/std.h +++ b/qse/include/qse/awk/std.h @@ -1,5 +1,5 @@ /* - * $Id: std.h 75 2009-02-22 14:10:34Z hyunghwan.chung $ + * $Id: std.h 84 2009-02-25 10:35:22Z hyunghwan.chung $ * Copyright 2006-2009 Chung, Hyung-Hwan. @@ -76,7 +76,7 @@ typedef struct qse_awk_parsestd_out_t qse_awk_parsestd_out_t; /******/ #define QSE_AWK_RTX_OPENSTD_STDIO (qse_awk_rtx_openstd_stdio) -extern const qse_char_t* qse_awk_rtx_openstd_stdio[]; +extern const qse_char_t*const qse_awk_rtx_openstd_stdio[]; #ifdef __cplusplus @@ -132,9 +132,9 @@ int qse_awk_parsestd ( * SYNOPSIS */ qse_awk_rtx_t* qse_awk_rtx_openstd ( - qse_awk_t* awk, - const qse_char_t*const* icf, - const qse_char_t*const* ocf + qse_awk_t* awk, + const qse_char_t*const icf[], + const qse_char_t*const ocf[] ); /******/ diff --git a/qse/lib/awk/Awk.cpp b/qse/lib/awk/Awk.cpp index ca5b5224..80081f93 100644 --- a/qse/lib/awk/Awk.cpp +++ b/qse/lib/awk/Awk.cpp @@ -1,5 +1,5 @@ /* - * $Id: Awk.cpp 75 2009-02-22 14:10:34Z hyunghwan.chung $ + * $Id: Awk.cpp 84 2009-02-25 10:35:22Z hyunghwan.chung $ * Copyright 2006-2009 Chung, Hyung-Hwan. @@ -1413,8 +1413,9 @@ int Awk::run (const char_t** args, size_t nargs) qse_awk_rtx_close (rtx); } - if (runarg != QSE_NULL) + if (nargs > 0) { + QSE_ASSERT (runarg != QSE_NULL); while (i > 0) qse_awk_free (awk, runarg[--i].ptr); qse_awk_free (awk, runarg); } diff --git a/qse/lib/awk/std.c b/qse/lib/awk/std.c index 2d4c18b0..81c7017e 100644 --- a/qse/lib/awk/std.c +++ b/qse/lib/awk/std.c @@ -1,5 +1,5 @@ /* - * $Id: std.c 75 2009-02-22 14:10:34Z hyunghwan.chung $ + * $Id: std.c 84 2009-02-25 10:35:22Z hyunghwan.chung $ * Copyright 2006-2009 Chung, Hyung-Hwan. @@ -89,7 +89,7 @@ typedef struct rxtn_t } rxtn_t; -const qse_char_t* qse_awk_rtx_openstd_stdio[] = +const qse_char_t*const qse_awk_rtx_openstd_stdio[] = { QSE_T(""), QSE_NULL @@ -875,8 +875,8 @@ static qse_ssize_t awk_rio_console ( qse_awk_rtx_t* qse_awk_rtx_openstd ( qse_awk_t* awk, - const qse_char_t*const* icf, - const qse_char_t*const* ocf) + const qse_char_t*const icf[], + const qse_char_t*const ocf[]) { qse_awk_rtx_t* rtx; qse_awk_rio_t rio;