summaryrefslogtreecommitdiffabout
path: root/src/main.c
authorSergey Poznyakoff <gray@gnu.org.ua>2015-04-25 12:56:53 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2015-04-27 07:56:46 (GMT)
commitb6173eeaf3311d9de26d530d5ff07fdf6ddddcad (patch) (side-by-side diff)
tree43e02edb931587b91f5f84300e2ace32ef1abad9 /src/main.c
parent06509efd56988c83af61dd132ff080725c42ae2e (diff)
downloadmailfromd-b6173eeaf3311d9de26d530d5ff07fdf6ddddcad.tar.gz
mailfromd-b6173eeaf3311d9de26d530d5ff07fdf6ddddcad.tar.bz2
Avoid casts between pointers and integers (prog & runtime).
* src/prog.h (mf_stkval): New data type. (STKVAL): Redefine as union mf_stkval. (mft_ptr,mft_str,mft_int) (mft_uint,mft_long,mft_ulong) (mft_size,mft_string,mft_number): New data types. (mf_cat,mf_c_val): New macros. (instr_t): Moved from mailfromd.h (mf_code_cell): New union (mf_code_cell_t): New typedef. (mf_cell_instr,mf_cell_value) (mf_cell_c_value): New macros (code_peek): Moved from mailfromd.h. Change return type; (code_immediate,code_put): Moved from mailfromd.h. Change signature. (code_op,code_instr,code_exmask) (code_get_counter,dump_code,fixup_code): Moved from mailfromd.h. (prog): Change type. * src/prog.c: Use mf_c_val to extract C values from STKVAL. (get_immediate): Return STKVAL. (prog): Change type (code_cell): New function. (code_instr): Rewrite using code_cell (code_immediate): Likewise. Change argument type. (code_exmask): Use proper typecast. (code_put): Change argument type. (code_peek): Change return type. (runtime_stack_trace): Use mf_cell_instr to access instruction pointer. * src/mailfromd.h (yyerror): Change signature. (instr_t): Move to prog.h (code_put,code_peek,code_reserve) (code_immediate,code_op,code_instr) (code_exmask,code_get_counter) (dump_code,fixup_code): Move to prog.h * src/exclist.c: Use mf_c_val * src/gram.y (yyerror): Change signature. (mailfromd_run): Use mf_c_val to extract actual value. * doc/functions.texi (body_has_nulls): Fix return type. * src/builtin/snarf.m4 (__mf_defun): Define __MF_RETTYPE__ (MF_RETURN): Take optional second argument (return type). Decide what push function to use and what type to cast the value to depending on its value and that of __MF_RETTYPE__. (MF_RETURN_STRING): Remove. (MF_RETURN_OBSTACK): Explicitly declare return type as STKVAL. (MF_VAR_REF): Take two or three arguments (second one declaring value type). (MF_ALLOC_HEAP_TEMP): (MF_VAR_STRING): Update. (END): Popdef __MF_RETTYPE__. * src/builtin/body.bi: Use MF_RETURN. (body_has_nulls): Fix return type. * src/builtin/burst.bi: Use MF_RETURN. * src/builtin/callout.bi: Likewise. * src/builtin/ctype.bi: Likewise. * src/builtin/curhdr.bi: Likewise. * src/builtin/db.bi: Likewise. * src/builtin/debug.bi: Likewise. * src/builtin/dns.bi: Likewise. * src/builtin/email.bi: Likewise. * src/builtin/geoip.bi: Likewise. * src/builtin/getopt.bi: Likewise. * src/builtin/gettext.bi: Likewise. * src/builtin/io.bi: Likewise. * src/builtin/ipaddr.bi: Likewise. * src/builtin/macro.bi: Likewise. * src/builtin/msg.bi: Likewise. * src/builtin/sa.bi: Likewise. * src/builtin/spf.bi: Likewise. * src/builtin/string.bi: Likewise. * src/builtin/system.bi: Likewise. * src/builtin/vars.bi: Likewise. * src/drivers.c: Use proper typecasts when calling code_* functions. * src/optab.opc (scan_code): Use mf_cell_c_value to inspect prog[].
Diffstat (limited to 'src/main.c') (more/less context) (ignore whitespace changes)
0 files changed, 0 insertions, 0 deletions

Return to:

Send suggestions and report system problems to the System administrator.