From 8cab88f64f3fafaa02181cff4437707ed1b5f787 Mon Sep 17 00:00:00 2001 From: Angel Ortega Date: Mon, 8 Oct 2007 12:16:21 +0200 Subject: [PATCH] More coding style changes. --- mpsl_c.c | 2 +- mpsl_f.c | 142 +++++++++++++++++++++++++++++++-------------------------------- mpsl_m.c | 8 ++-- 3 files changed, 76 insertions(+), 76 deletions(-) diff --git a/mpsl_c.c b/mpsl_c.c index 26525a3..3e198d5 100644 --- a/mpsl_c.c +++ b/mpsl_c.c @@ -496,7 +496,7 @@ O_TYPE mpsl_exec_i(O_ARGS) /* if aborted, do nothing */ if (mpsl_abort) - return(NULL); + return NULL; /* reference code, arguments and local symbol table */ mpdm_ref(c); diff --git a/mpsl_f.c b/mpsl_f.c index 7cba6b8..ca1808f 100644 --- a/mpsl_f.c +++ b/mpsl_f.c @@ -57,67 +57,67 @@ #define RA2 RA(2) #define RA3 RA(3) -static mpdm_t F_size(mpdm_t a) { return (MPDM_I(mpdm_size(A0))); } -static mpdm_t F_clone(mpdm_t a) { return (mpdm_clone(A0)); } -static mpdm_t F_dump(mpdm_t a) { mpdm_dump(A0); return (NULL); } -static mpdm_t F_dumper(mpdm_t a) { return (mpdm_dumper(A0)); } -static mpdm_t F_cmp(mpdm_t a) { return (MPDM_I(mpdm_cmp(A0, A1))); } - -static mpdm_t F_is_array(mpdm_t a) { return (mpsl_boolean(MPDM_IS_ARRAY(A0))); } -static mpdm_t F_is_hash(mpdm_t a) { return (mpsl_boolean(MPDM_IS_HASH(A0))); } -static mpdm_t F_is_exec(mpdm_t a) { return (mpsl_boolean(MPDM_IS_EXEC(A0))); } - -static mpdm_t F_splice(mpdm_t a) { return (mpdm_splice(A0,A1,IA2,IA3)); } -static mpdm_t F_expand(mpdm_t a) { return (mpdm_expand(A0,IA1,IA2)); } -static mpdm_t F_collapse(mpdm_t a) { return (mpdm_collapse(A0,IA1,IA2)); } -static mpdm_t F_ins(mpdm_t a) { return (mpdm_ins(A0,A1,IA2)); } -static mpdm_t F_adel(mpdm_t a) { return (mpdm_adel(A0,IA1)); } -static mpdm_t F_shift(mpdm_t a) { return (mpdm_shift(A0)); } -static mpdm_t F_push(mpdm_t a) { return (mpdm_push(A0,A1)); } -static mpdm_t F_pop(mpdm_t a) { return (mpdm_pop(A0)); } -static mpdm_t F_queue(mpdm_t a) { return (mpdm_queue(A0,A1,IA2)); } -static mpdm_t F_seek(mpdm_t a) { return (MPDM_I(mpdm_seek(A0,A1,IA2))); } -static mpdm_t F_sort(mpdm_t a) { return (mpdm_sort_cb(A0,1,A1)); } -static mpdm_t F_split(mpdm_t a) { return (mpdm_split(A0,A1)); } -static mpdm_t F_join(mpdm_t a) { return (mpdm_join(A0,A1)); } - -static mpdm_t F_hsize(mpdm_t a) { return (MPDM_I(mpdm_hsize(A0))); } -static mpdm_t F_exists(mpdm_t a) { return (mpsl_boolean(mpdm_exists(A0, A1))); } -static mpdm_t F_hdel(mpdm_t a) { return (mpdm_hdel(A0, A1)); } -static mpdm_t F_keys(mpdm_t a) { return (mpdm_keys(A0)); } - -static mpdm_t F_open(mpdm_t a) { return (mpdm_open(A0, A1)); } -static mpdm_t F_close(mpdm_t a) { return (mpdm_close(A0)); } -static mpdm_t F_read(mpdm_t a) { return (mpdm_read(A0)); } -static mpdm_t F_write(mpdm_t a) { return (MPDM_I(mpdm_write(A0,A1))); } -static mpdm_t F_getchar(mpdm_t a) { return (mpdm_getchar(A0)); } -static mpdm_t F_putchar(mpdm_t a) { return (mpdm_putchar(A0, A1)); } -static mpdm_t F_fseek(mpdm_t a) { return (MPDM_I(mpdm_fseek(A0, IA1, IA2))); } -static mpdm_t F_ftell(mpdm_t a) { return (MPDM_I(mpdm_ftell(A0))); } - -static mpdm_t F_unlink(mpdm_t a) { return (mpsl_boolean(mpdm_unlink(A0))); } -static mpdm_t F_stat(mpdm_t a) { return (mpdm_stat(A0)); } -static mpdm_t F_chmod(mpdm_t a) { return (MPDM_I(mpdm_chmod(A0,A1))); } -static mpdm_t F_chown(mpdm_t a) { return (MPDM_I(mpdm_chown(A0,A1,A2))); } -static mpdm_t F_glob(mpdm_t a) { return (mpdm_glob(A0)); } -static mpdm_t F_encoding(mpdm_t a) { return (MPDM_I(mpdm_encoding(A0))); } -static mpdm_t F_popen(mpdm_t a) { return (mpdm_popen(A0, A1)); } -static mpdm_t F_pclose(mpdm_t a) { return (mpdm_pclose(A0)); } - -static mpdm_t F_regex(mpdm_t a) { return (mpdm_regex(A0,A1,IA2)); } -static mpdm_t F_sregex(mpdm_t a) { return (mpdm_sregex(A0,A1,A2,IA3)); } - -static mpdm_t F_gettext(mpdm_t a) { return (mpdm_gettext(A0)); } -static mpdm_t F_gettext_domain(mpdm_t a) { return (MPDM_I(mpdm_gettext_domain(A0, A1))); } - -static mpdm_t F_load(mpdm_t a) { return (mpdm_exec(mpsl_compile_file(A0), NULL)); } -static mpdm_t F_error(mpdm_t a) { return (mpsl_error(A0)); } -static mpdm_t F_sweep(mpdm_t a) { mpdm_sweep(IA0); return (NULL); } - -static mpdm_t F_uc(mpdm_t a) { return (mpdm_ulc(A0, 1)); } -static mpdm_t F_lc(mpdm_t a) { return (mpdm_ulc(A0, 0)); } - -static mpdm_t F_time(mpdm_t a) { return (MPDM_I(time(NULL))); } +static mpdm_t F_size(mpdm_t a) { return MPDM_I(mpdm_size(A0)); } +static mpdm_t F_clone(mpdm_t a) { return mpdm_clone(A0); } +static mpdm_t F_dump(mpdm_t a) { mpdm_dump(A0); return NULL; } +static mpdm_t F_dumper(mpdm_t a) { return mpdm_dumper(A0); } +static mpdm_t F_cmp(mpdm_t a) { return MPDM_I(mpdm_cmp(A0, A1)); } + +static mpdm_t F_is_array(mpdm_t a) { return mpsl_boolean(MPDM_IS_ARRAY(A0)); } +static mpdm_t F_is_hash(mpdm_t a) { return mpsl_boolean(MPDM_IS_HASH(A0)); } +static mpdm_t F_is_exec(mpdm_t a) { return mpsl_boolean(MPDM_IS_EXEC(A0)); } + +static mpdm_t F_splice(mpdm_t a) { return mpdm_splice(A0,A1,IA2,IA3); } +static mpdm_t F_expand(mpdm_t a) { return mpdm_expand(A0,IA1,IA2); } +static mpdm_t F_collapse(mpdm_t a) { return mpdm_collapse(A0,IA1,IA2); } +static mpdm_t F_ins(mpdm_t a) { return mpdm_ins(A0,A1,IA2); } +static mpdm_t F_adel(mpdm_t a) { return mpdm_adel(A0,IA1); } +static mpdm_t F_shift(mpdm_t a) { return mpdm_shift(A0); } +static mpdm_t F_push(mpdm_t a) { return mpdm_push(A0,A1); } +static mpdm_t F_pop(mpdm_t a) { return mpdm_pop(A0); } +static mpdm_t F_queue(mpdm_t a) { return mpdm_queue(A0,A1,IA2); } +static mpdm_t F_seek(mpdm_t a) { return MPDM_I(mpdm_seek(A0,A1,IA2)); } +static mpdm_t F_sort(mpdm_t a) { return mpdm_sort_cb(A0,1,A1); } +static mpdm_t F_split(mpdm_t a) { return mpdm_split(A0,A1); } +static mpdm_t F_join(mpdm_t a) { return mpdm_join(A0,A1); } + +static mpdm_t F_hsize(mpdm_t a) { return MPDM_I(mpdm_hsize(A0)); } +static mpdm_t F_exists(mpdm_t a) { return mpsl_boolean(mpdm_exists(A0, A1)); } +static mpdm_t F_hdel(mpdm_t a) { return mpdm_hdel(A0, A1); } +static mpdm_t F_keys(mpdm_t a) { return mpdm_keys(A0); } + +static mpdm_t F_open(mpdm_t a) { return mpdm_open(A0, A1); } +static mpdm_t F_close(mpdm_t a) { return mpdm_close(A0); } +static mpdm_t F_read(mpdm_t a) { return mpdm_read(A0); } +static mpdm_t F_write(mpdm_t a) { return MPDM_I(mpdm_write(A0,A1)); } +static mpdm_t F_getchar(mpdm_t a) { return mpdm_getchar(A0); } +static mpdm_t F_putchar(mpdm_t a) { return mpdm_putchar(A0, A1); } +static mpdm_t F_fseek(mpdm_t a) { return MPDM_I(mpdm_fseek(A0, IA1, IA2)); } +static mpdm_t F_ftell(mpdm_t a) { return MPDM_I(mpdm_ftell(A0)); } + +static mpdm_t F_unlink(mpdm_t a) { return mpsl_boolean(mpdm_unlink(A0)); } +static mpdm_t F_stat(mpdm_t a) { return mpdm_stat(A0); } +static mpdm_t F_chmod(mpdm_t a) { return MPDM_I(mpdm_chmod(A0,A1)); } +static mpdm_t F_chown(mpdm_t a) { return MPDM_I(mpdm_chown(A0,A1,A2)); } +static mpdm_t F_glob(mpdm_t a) { return mpdm_glob(A0); } +static mpdm_t F_encoding(mpdm_t a) { return MPDM_I(mpdm_encoding(A0)); } +static mpdm_t F_popen(mpdm_t a) { return mpdm_popen(A0, A1); } +static mpdm_t F_pclose(mpdm_t a) { return mpdm_pclose(A0); } + +static mpdm_t F_regex(mpdm_t a) { return mpdm_regex(A0,A1,IA2); } +static mpdm_t F_sregex(mpdm_t a) { return mpdm_sregex(A0,A1,A2,IA3); } + +static mpdm_t F_gettext(mpdm_t a) { return mpdm_gettext(A0); } +static mpdm_t F_gettext_domain(mpdm_t a) { return MPDM_I(mpdm_gettext_domain(A0, A1)); } + +static mpdm_t F_load(mpdm_t a) { return mpdm_exec(mpsl_compile_file(A0), NULL); } +static mpdm_t F_error(mpdm_t a) { return mpsl_error(A0); } +static mpdm_t F_sweep(mpdm_t a) { mpdm_sweep(IA0); return NULL; } + +static mpdm_t F_uc(mpdm_t a) { return mpdm_ulc(A0, 1); } +static mpdm_t F_lc(mpdm_t a) { return mpdm_ulc(A0, 0); } + +static mpdm_t F_time(mpdm_t a) { return MPDM_I(time(NULL)); } static mpdm_t F_eval(mpdm_t a) { @@ -126,7 +126,7 @@ static mpdm_t F_eval(mpdm_t a) a = mpdm_clone(a); c = mpdm_adel(a, 0); - return (mpsl_eval(c, a)); + return mpsl_eval(c, a); } static mpdm_t F_sprintf(mpdm_t a) @@ -141,7 +141,7 @@ static mpdm_t F_sprintf(mpdm_t a) if ((v = mpdm_aget(a, 0)) != NULL && MPDM_IS_ARRAY(v)) a = v; - return (mpdm_sprintf(f, a)); + return mpdm_sprintf(f, a); } @@ -151,7 +151,7 @@ static mpdm_t F_print(mpdm_t a) for (n = 0; n < mpdm_size(a); n++) mpdm_write_wcs(stdout, mpdm_string(A(n))); - return (NULL); + return NULL; } @@ -162,7 +162,7 @@ static mpdm_t F_chr(mpdm_t a) tmp[0] = (wchar_t) mpdm_ival(mpdm_aget(a, 0)); tmp[1] = L'\0'; - return (MPDM_S(tmp)); + return MPDM_S(tmp); } @@ -176,7 +176,7 @@ static mpdm_t F_ord(mpdm_t a) ret = (int) *ptr; } - return (MPDM_I(ret)); + return MPDM_I(ret); } @@ -188,7 +188,7 @@ static mpdm_t F_map(mpdm_t a) /* map NULL to NULL */ if (set == NULL) - return (NULL); + return NULL; out = mpdm_ref(MPDM_A(mpdm_size(set))); @@ -209,7 +209,7 @@ static mpdm_t F_map(mpdm_t a) mpdm_aset(out, mpdm_hget(key, mpdm_aget(set, n)), n); } - return (mpdm_unref(out)); + return mpdm_unref(out); } @@ -243,7 +243,7 @@ static mpdm_t F_grep(mpdm_t a) } } - return (mpdm_size(mpdm_unref(out)) == 0 ? NULL : out); + return mpdm_size(mpdm_unref(out)) == 0 ? NULL : out; } static mpdm_t F_getenv(mpdm_t a) @@ -253,7 +253,7 @@ static mpdm_t F_getenv(mpdm_t a) if (ptr != NULL) ptr = getenv(ptr); - return (MPDM_MBS(ptr)); + return MPDM_MBS(ptr); } @@ -405,7 +405,7 @@ int mpsl_startup(void) mpdm_hset_s(m, L"LC", MPDM_H(0)); mpdm_hset_s(m, L"CORE", c); - return (0); + return 0; } diff --git a/mpsl_m.c b/mpsl_m.c index 4d9cdba..d858af7 100644 --- a/mpsl_m.c +++ b/mpsl_m.c @@ -56,7 +56,7 @@ int mpsl_main(int argc, char *argv[]) printf("Usage: mpsl [-d] [-e 'script' | script.mpsl ]\n\n"); - return (0); + return 0; } else if (strcmp(argv[0], "-d") == 0) @@ -71,7 +71,7 @@ int mpsl_main(int argc, char *argv[]) /* next argument is a script name; open it */ if ((script = fopen(argv[0], "r")) == NULL) { fprintf(stderr, "Can't open '%s'\n", argv[0]); - return (1); + return 1; } } @@ -107,11 +107,11 @@ int mpsl_main(int argc, char *argv[]) mpsl_shutdown(); - return (ret); + return ret; } int main(int argc, char *argv[]) { - return (mpsl_main(argc, argv)); + return mpsl_main(argc, argv); } -- 2.11.4.GIT