diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-08-27 17:33:23 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-08-27 17:37:22 +0300 |
commit | 9506122207b36171edf34624a73e4936efc979ae (patch) | |
tree | 0efabeba371daf17b1a9e743b22b79154557f671 /mfd/prog.c | |
parent | 42ad006244081ffb2a115283afb7fda7cfb63eb3 (diff) | |
download | mailfromd-9506122207b36171edf34624a73e4936efc979ae.tar.gz mailfromd-9506122207b36171edf34624a73e4936efc979ae.tar.bz2 |
Fix diagnostic and help messages.
1. Option descriptions in `--help' output do not constitute
conceptual sentences. Therefore, they should not begin
with a capital letter, nor end with a final point.
2. According to standards.texi, a diagnostic message in a
non-interactive program "should not begin with a capital letter
when it follows a program name and/or file name, because that
isn't the beginning of a sentence. (The sentence conceptually
starts at the beginning of the line.) Also, it should not end
with a period."
Affected files:
* gacopyz/gacopyz.c
* gacopyz/proc.c
* gacopyz/server.c
* gacopyz/smfi.c
* mfd/bi_db.m4
* mfd/bi_dns.m4
* mfd/bi_io.m4
* mfd/bi_ipaddr.m4
* mfd/bi_mail.m4
* mfd/bi_other.m4
* mfd/bi_poll.m4
* mfd/bi_sa.m4
* mfd/bi_string.m4
* mfd/cache.c
* mfd/db.c
* mfd/dnscache.c
* mfd/drivers.c
* mfd/engine.c
* mfd/gram.y
* mfd/lex.l
* mfd/main.c
* mfd/mu_dbm.c
* mfd/optab.opc
* mfd/prog.c
* mfd/rate.c
* mfd/symtab.c
* mtasim/mtasim.c
* mtasim/openat-die.c
* pies/pies.c
* pies/progman.c
* pmult/pmult.c
* smap/smap.c
* tests/ashadow.at
* tests/bctx00.at
* tests/fctx00.at
* tests/hdr-gete.at
* tests/invcidr.at
* tests/invcidr2.at
* tests/shadow.at
Diffstat (limited to 'mfd/prog.c')
-rw-r--r-- | mfd/prog.c | 61 |
1 files changed, 31 insertions, 30 deletions
@@ -71,7 +71,7 @@ code_init() pmax = CODE_INITIAL; prog = calloc(pmax, sizeof prog[0]); if (!prog) { - mu_error(_("Not enough memory to compile the program")); + mu_error(_("not enough memory")); exit(1); } } @@ -92,7 +92,7 @@ code_reserve(size_t count) pmax += incr * CODE_INCREMENT; prog = realloc(prog, pmax*sizeof prog[0]); if (!prog) { - mu_error(_("Not enough memory to compile the program")); + mu_error(_("not enough memory")); exit(1); } } @@ -107,7 +107,7 @@ code_instr(const instr_t ptr) pmax += CODE_INCREMENT; prog = realloc(prog, pmax*sizeof prog[0]); if (!prog) { - mu_error(_("Not enough memory to compile the program")); + mu_error(_("not enough memory")); exit(1); } } @@ -179,7 +179,7 @@ enable_module_trace(char *name) return; } - mu_error(_("No such module: %s"), name); + mu_error(_("no such module: %s"), name); } void @@ -193,7 +193,7 @@ disable_module_trace(char *name) return; } - mu_error(_("No such module: %s"), name); + mu_error(_("no such module: %s"), name); } void @@ -454,8 +454,9 @@ expand_dataseg(eval_environ_t env, size_t count, const char *errtext) (datasize + env->stack_size - env->tos) * sizeof newds[0]); env_fixup_autos(env, offset); - mu_error(_("Warning: stack segment expanded, new size=%lu"), - (unsigned long) env->stack_size); + mu_diag_output(MU_DIAG_WARNING, + _("stack segment expanded, new size=%lu"), + (unsigned long) env->stack_size); return 0; } @@ -482,8 +483,8 @@ void runtime_stack_trace(eval_environ_t env) { size_t base; - - mu_error(_("Stack trace:")); + + mu_error(_("stack trace:")); for (base = env->base; base < datasize + env->stack_size - 4; base = (size_t) env->dataseg[base + 1] + base + 1) { int i; @@ -522,7 +523,7 @@ runtime_stack_trace(eval_environ_t env) (unsigned long) pc, name); } - mu_error(_("Stack trace finishes")); + mu_error(_("stack trace finishes")); } void @@ -608,7 +609,7 @@ push(eval_environ_t env, STKVAL val) (unsigned long) env->tos, (unsigned long) env->toh); expand_dataseg(env, 1, - _("Out of stack space; increase #pragma stacksize")); + _("out of stack space; increase #pragma stacksize")); } env->dataseg[env->tos--] = val; } @@ -617,7 +618,7 @@ STKVAL pop(eval_environ_t env) { if (env->tos == datasize + env->stack_size - 1) - runtime_error(env, _("Stack underflow")); + runtime_error(env, _("stack underflow")); return env->dataseg[++env->tos]; } @@ -627,7 +628,7 @@ heap_reserve_words(eval_environ_t env, size_t words) size_t off = env->toh; if (env->toh + words > env->tos) expand_dataseg(env, words, - _("Heap overrun; increase #pragma stacksize")); + _("heap overrun; increase #pragma stacksize")); env->toh += words; return off; } @@ -645,7 +646,7 @@ heap_tempspace(eval_environ_t env, size_t size) if (env->toh + words > env->tos) expand_dataseg(env, words, - _("Heap overrun; increase #pragma stacksize")); + _("heap overrun; increase #pragma stacksize")); return env->dataseg + env->toh; } @@ -681,7 +682,7 @@ heap_obstack_grow(eval_environ_t env, void *ptr, size_t size) if (env->tos - env->toh < words + B2STACK(env->temp_size)) expand_dataseg(env, words, - _("Memory chunk too big to fit into heap")); + _("memory chunk too big to fit into heap")); ret = (char*) env_data_ref(env, env->temp_start) + env->temp_size; if (ptr) memmove(ret, ptr, size); @@ -860,11 +861,11 @@ instr_backref(eval_environ_t env) /* FIXME: Try to throw exception first: env_throw(env, mf_no_regex); */ - runtime_error(env, _("No previous regular expression")); + runtime_error(env, _("no previous regular expression")); } if (n > env->matchcount) { /* FIXME: See above */ - runtime_error(env, _("Invalid back-reference number")); + runtime_error(env, _("invalid back-reference number")); } if (env->matches[n].rm_so == -1) { @@ -949,7 +950,7 @@ instr_symbol(eval_environ_t env) if (PROG_TRACE_ENGINE) prog_trace(env, "SYMBOL %s", symbol); if (!s) - env_throw(env, mfe_macroundef, _("Macro not defined: %s"), + env_throw(env, mfe_macroundef, _("macro not defined: %s"), symbol); if (PROG_TRACE_ENGINE) @@ -1320,7 +1321,7 @@ instr_regmatch(eval_environ_t env) sizeof(env->matches[0]) * (env->matchcount + 1)); if (!p) - runtime_error(env, _("Not enough memory")); + runtime_error(env, _("not enough memory")); env->matches = p; env->matchsize = env->matchcount + 1; } @@ -1659,7 +1660,7 @@ instr_throw(eval_environ_t env) advance_pc(env, 1); adjust_stack(env, 1); if (n > mf_exception_count) - runtime_error(env, _("Invalid exception number: %lu"), n); + runtime_error(env, _("invalid exception number: %lu"), n); env_throw_0(env, (mf_status) n, off); } @@ -2026,7 +2027,7 @@ eval_environment(eval_environ_t env, prog_counter_t start) static void env_vsprintf_error(const char *fmt, va_list ap) { - mu_error(_("Out of memory while formatting error message:")); + mu_error(_("out of memory while formatting error message:")); mu_verror(fmt, ap); } @@ -2180,13 +2181,13 @@ env_capture_start(eval_environ_t env) rc = mu_temp_file_stream_create(&env->stream, NULL); if (rc) { - mu_error(_("%sCannot create temporary stream: %s"), + mu_error(_("%scannot create temporary stream: %s"), mailfromd_msgid(env->ctx), mu_strerror(rc)); return 1; } rc = mu_stream_open(env->stream); if (rc) { - mu_error(_("%sCannot open temporary stream: %s"), + mu_error(_("%scannot open temporary stream: %s"), mailfromd_msgid(env->ctx), mu_strerror(rc)); mu_stream_destroy(&env->stream, mu_stream_get_owner(env->stream)); @@ -2222,7 +2223,7 @@ env_capture_write(eval_environ_t env, const char *buf, size_t size) if (env->reposition) { rc = mu_stream_seek(env->stream, 0, SEEK_END); if (rc) { - mu_error(_("%sTemporary stream seek failed: %s"), + mu_error(_("%stemporary stream seek failed: %s"), mailfromd_msgid(env->ctx), mu_strerror(rc)); mu_stream_close(env->stream); @@ -2238,7 +2239,7 @@ env_capture_write(eval_environ_t env, const char *buf, size_t size) size_t len = mem_search(buf, '\r', size); rc = mu_stream_sequential_write(env->stream, buf, len); if (rc) { - mu_error(_("%sTemporary stream write failed: %s"), + mu_error(_("%stemporary stream write failed: %s"), mailfromd_msgid(env->ctx), mu_strerror(rc)); mu_stream_close(env->stream); @@ -2346,12 +2347,12 @@ env_get_builtin_priv(eval_environ_t env, int id) { if (id < 0 || id >= builtin_priv_count) runtime_error(env, - _("Unknown built-in private data requested (%d)"), + _("unknown built-in private data requested (%d)"), id); if (!env->bi_priv_array) { if (builtin_priv_count == 0) runtime_error(env, - _("No built-in private data registered")); + _("no built-in private data registered")); env->bi_priv_array = xcalloc(builtin_priv_count, sizeof env->bi_priv_array[0]); } @@ -2359,7 +2360,7 @@ env_get_builtin_priv(eval_environ_t env, int id) env->bi_priv_array[id] = bi_priv[id].init(); if (!env->bi_priv_array[id]) runtime_error(env, - _("Initial allocation for built-in " + _("initial allocation for built-in " "private data #%d failed"), id); } return env->bi_priv_array[id]; @@ -2395,14 +2396,14 @@ create_environment(SMFICTX *ctx, struct eval_environ *env = calloc(1, sizeof *env); if (!env) { - mu_error(_("Not enough memory")); + mu_error(_("not enough memory")); exit(1); } env->stack_size = stack_size; env->dataseg = calloc(stack_size + datasize, sizeof env->dataseg[0]); if (!env->dataseg) { - mu_error(_("Not enough memory")); + mu_error(_("not enough memory")); exit(1); } |