From 930b86e9238fbfbcdcbeb4dd09809566d02c78ac Mon Sep 17 00:00:00 2001 From: "hyunghwan.chung" Date: Mon, 5 Feb 2018 09:20:30 +0000 Subject: [PATCH] touched up code a little bit --- moo/lib/err.c | 4 ++-- moo/lib/logfmtv.h | 2 +- moo/lib/main.c | 4 ++-- moo/lib/moo.h | 30 +++++++++++++++--------------- moo/lib/obj.c | 2 +- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/moo/lib/err.c b/moo/lib/err.c index 23b217c..a6dcea8 100644 --- a/moo/lib/err.c +++ b/moo/lib/err.c @@ -48,7 +48,7 @@ static moo_ooch_t errstr_15[] = {'i','n','t','e','r','r','u','p','t','e','d','\0 static moo_ooch_t errstr_16[] = {'p','i','p','e',' ','e','r','r','o','r','\0'}; static moo_ooch_t errstr_17[] = {'r','e','s','o','u','r','c','e',' ','t','e','m','p','o','r','a','r','i','l','y',' ','u','n','a','v','a','i','l','a','b','l','e','\0'}; static moo_ooch_t errstr_18[] = {'b','a','d',' ','s','y','s','t','e','m',' ','h','a','n','d','l','e','\0'}; -static moo_ooch_t errstr_19[] = {'d','a','t','a',' ','t','o','o',' ','l','a','r','g','e','\0'}; +static moo_ooch_t errstr_19[] = {'*','*','*',' ','u','n','d','e','f','i','n','e','d',' ','e','r','r','o','r',' ','*','*','*','\0'}; static moo_ooch_t errstr_20[] = {'m','e','s','s','a','g','e',' ','r','e','c','e','i','v','e','r',' ','e','r','r','o','r','\0'}; static moo_ooch_t errstr_21[] = {'m','e','s','s','a','g','e',' ','s','e','n','d','i','n','g',' ','e','r','r','o','r','\0'}; static moo_ooch_t errstr_22[] = {'w','r','o','n','g',' ','n','u','m','b','e','r',' ','o','f',' ','a','r','g','u','m','e','n','t','s','\0'}; @@ -57,7 +57,7 @@ static moo_ooch_t errstr_24[] = {'b','y','t','e','-','c','o','d','e',' ','f','u' static moo_ooch_t errstr_25[] = {'d','i','c','t','i','o','n','a','r','y',' ','f','u','l','l','\0'}; static moo_ooch_t errstr_26[] = {'p','r','o','c','e','s','s','o','r',' ','f','u','l','l','\0'}; static moo_ooch_t errstr_27[] = {'t','o','o',' ','m','a','n','y',' ','s','e','m','a','p','h','o','r','e','s','\0'}; -static moo_ooch_t errstr_28[] = {'s','e','m','a','p','h','o','r','e',' ','l','i','s','t',' ','f','u','l','l','\0'}; +static moo_ooch_t errstr_28[] = {'*','*','*',' ','u','n','d','e','f','i','n','e','d',' ','e','r','r','o','r',' ','*','*','*','\0'}; static moo_ooch_t errstr_29[] = {'d','i','v','i','d','e',' ','b','y',' ','z','e','r','o','\0'}; static moo_ooch_t errstr_30[] = {'I','/','O',' ','e','r','r','o','r','\0'}; static moo_ooch_t errstr_31[] = {'e','n','c','o','d','i','n','g',' ','c','o','n','v','e','r','s','i','o','n',' ','e','r','r','o','r','\0'}; diff --git a/moo/lib/logfmtv.h b/moo/lib/logfmtv.h index 8589274..dfe9785 100644 --- a/moo/lib/logfmtv.h +++ b/moo/lib/logfmtv.h @@ -553,7 +553,7 @@ reswitch: } case 'O': /* object - ignore precision, width, adjustment */ - print_object (moo, data->mask, va_arg (ap, moo_oop_t), outbfmt); + print_object (moo, data->mask, va_arg(ap, moo_oop_t), outbfmt); break; #if 0 diff --git a/moo/lib/main.c b/moo/lib/main.c index 6d3fde0..004a392 100644 --- a/moo/lib/main.c +++ b/moo/lib/main.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #if !defined(__DOS__) && defined(HAVE_PTHREAD) && defined(HAVE_STRERROR_R) @@ -58,6 +57,7 @@ # include # include # include +# include /* fake XPOLLXXX values */ # define XPOLLIN (1 << 0) @@ -102,6 +102,7 @@ # include # endif +# include # include # include @@ -758,7 +759,6 @@ static void log_write (moo_t* moo, moo_oow_t mask, const moo_ooch_t* msg, moo_oo if (mask & MOO_LOG_STDOUT) logfd = 1; else { - logfd = xtn->logfd; if (logfd <= -1) return; } diff --git a/moo/lib/moo.h b/moo/lib/moo.h index 1469fa0..337cc72 100644 --- a/moo/lib/moo.h +++ b/moo/lib/moo.h @@ -925,7 +925,7 @@ typedef enum moo_vmprim_opendl_flag_t moo_vmprim_opendl_flag_t; typedef void* (*moo_vmprim_dlopen_t) (moo_t* moo, const moo_ooch_t* name, int flags); typedef void (*moo_vmprim_dlclose_t) (moo_t* moo, void* handle); -typedef void* (*moo_vmprim_dlsym_t) (moo_t* moo, void* handle, const moo_ooch_t* name); +typedef void* (*moo_vmprimt_dlgetsym_t) (moo_t* moo, void* handle, const moo_ooch_t* name); typedef void (*moo_log_write_t) (moo_t* moo, moo_oow_t mask, const moo_ooch_t* msg, moo_oow_t len); typedef void (*moo_syserrstrb_t) (moo_t* moo, int syserr, moo_bch_t* buf, moo_oow_t len); @@ -971,21 +971,21 @@ typedef void (*moo_vmprim_sleep_t) ( struct moo_vmprim_t { - moo_vmprim_dlopen_t dl_open; - moo_vmprim_dlclose_t dl_close; - moo_vmprim_dlsym_t dl_getsym; - moo_log_write_t log_write; - moo_syserrstrb_t syserrstrb; - moo_syserrstru_t syserrstru; + moo_vmprim_dlopen_t dl_open; + moo_vmprim_dlclose_t dl_close; + moo_vmprimt_dlgetsym_t dl_getsym; + moo_log_write_t log_write; + moo_syserrstrb_t syserrstrb; + moo_syserrstru_t syserrstru; - moo_vmprim_startup_t vm_startup; - moo_vmprim_cleanup_t vm_cleanup; - moo_vmprim_gettime_t vm_gettime; - moo_vmprim_muxadd_t vm_muxadd; - moo_vmprim_muxdel_t vm_muxdel; - moo_vmprim_muxmod_t vm_muxmod; - moo_vmprim_muxwait_t vm_muxwait; - moo_vmprim_sleep_t vm_sleep; + moo_vmprim_startup_t vm_startup; + moo_vmprim_cleanup_t vm_cleanup; + moo_vmprim_gettime_t vm_gettime; + moo_vmprim_muxadd_t vm_muxadd; + moo_vmprim_muxdel_t vm_muxdel; + moo_vmprim_muxmod_t vm_muxmod; + moo_vmprim_muxwait_t vm_muxwait; + moo_vmprim_sleep_t vm_sleep; }; typedef struct moo_vmprim_t moo_vmprim_t; diff --git a/moo/lib/obj.c b/moo/lib/obj.c index 9c0163c..588a938 100644 --- a/moo/lib/obj.c +++ b/moo/lib/obj.c @@ -31,7 +31,7 @@ void* moo_allocbytes (moo_t* moo, moo_oow_t size) moo_uint8_t* ptr; #if !defined(NDEBUG) - if ((moo->option.trait &MOO_DEBUG_GC) && !(moo->option.trait & MOO_NOGC)) moo_gc (moo); + if ((moo->option.trait & MOO_DEBUG_GC) && !(moo->option.trait & MOO_NOGC)) moo_gc (moo); #endif ptr = moo_allocheapmem (moo, moo->curheap, size);