diff --git a/modules/src/em_mes/C_ms_com.c b/modules/src/em_mes/C_ms_com.c index b29bbf6d5..43e496199 100644 --- a/modules/src/em_mes/C_ms_com.c +++ b/modules/src/em_mes/C_ms_com.c @@ -6,6 +6,7 @@ #include #include +void C_ms_com(str) char *str; { diff --git a/modules/src/em_mes/C_ms_ego.c b/modules/src/em_mes/C_ms_ego.c index 0acdb088a..f720b5d19 100644 --- a/modules/src/em_mes/C_ms_ego.c +++ b/modules/src/em_mes/C_ms_ego.c @@ -6,6 +6,7 @@ #include #include +void C_ms_ego(hint, offs, siz, regno) int hint, regno; arith offs, siz; diff --git a/modules/src/em_mes/C_ms_emx.c b/modules/src/em_mes/C_ms_emx.c index a888ff95b..65152af2f 100644 --- a/modules/src/em_mes/C_ms_emx.c +++ b/modules/src/em_mes/C_ms_emx.c @@ -6,6 +6,7 @@ #include #include +void C_ms_emx(wsiz, psiz) arith wsiz, psiz; { diff --git a/modules/src/em_mes/C_ms_err.c b/modules/src/em_mes/C_ms_err.c index 95a3517d5..918ec4046 100644 --- a/modules/src/em_mes/C_ms_err.c +++ b/modules/src/em_mes/C_ms_err.c @@ -6,6 +6,7 @@ #include #include +void C_ms_err() { C_mes_begin(ms_err); diff --git a/modules/src/em_mes/C_ms_flt.c b/modules/src/em_mes/C_ms_flt.c index 8f849f671..eee8a4452 100644 --- a/modules/src/em_mes/C_ms_flt.c +++ b/modules/src/em_mes/C_ms_flt.c @@ -6,6 +6,7 @@ #include #include +void C_ms_flt() { C_mes_begin(ms_flt); diff --git a/modules/src/em_mes/C_ms_gto.c b/modules/src/em_mes/C_ms_gto.c index 583d73115..7c18c036d 100644 --- a/modules/src/em_mes/C_ms_gto.c +++ b/modules/src/em_mes/C_ms_gto.c @@ -6,6 +6,7 @@ #include #include +void C_ms_gto() { C_mes_begin(ms_gto); diff --git a/modules/src/em_mes/C_ms_opt.c b/modules/src/em_mes/C_ms_opt.c index d70a945dd..4e9d2e0de 100644 --- a/modules/src/em_mes/C_ms_opt.c +++ b/modules/src/em_mes/C_ms_opt.c @@ -6,6 +6,7 @@ #include #include +void C_ms_opt() { C_mes_begin(ms_opt); diff --git a/modules/src/em_mes/C_ms_par.c b/modules/src/em_mes/C_ms_par.c index 61b90585b..1475480a4 100644 --- a/modules/src/em_mes/C_ms_par.c +++ b/modules/src/em_mes/C_ms_par.c @@ -6,6 +6,7 @@ #include #include +void C_ms_par(nparams) arith nparams; { diff --git a/modules/src/em_mes/C_ms_reg.c b/modules/src/em_mes/C_ms_reg.c index 628e91ab7..f8651a05b 100644 --- a/modules/src/em_mes/C_ms_reg.c +++ b/modules/src/em_mes/C_ms_reg.c @@ -6,6 +6,7 @@ #include #include +void C_ms_reg(offs, siz, class, prior) arith offs, siz; int class, prior; diff --git a/modules/src/em_mes/C_ms_src.c b/modules/src/em_mes/C_ms_src.c index 651c44863..a738d058a 100644 --- a/modules/src/em_mes/C_ms_src.c +++ b/modules/src/em_mes/C_ms_src.c @@ -6,6 +6,7 @@ #include #include +void C_ms_src(nlines, filnam) int nlines; char *filnam; diff --git a/modules/src/em_mes/C_ms_stb.c b/modules/src/em_mes/C_ms_stb.c index 94fd406c1..9c46823a7 100644 --- a/modules/src/em_mes/C_ms_stb.c +++ b/modules/src/em_mes/C_ms_stb.c @@ -6,6 +6,7 @@ #include #include +void C_ms_stb_cst(s, e1, e2, e3) char *s; int e1, e2; @@ -19,6 +20,7 @@ C_ms_stb_cst(s, e1, e2, e3) C_mes_end(); } +void C_ms_stb_dlb(s, e1, e2, l, off) char *s; int e1, e2; @@ -33,6 +35,7 @@ C_ms_stb_dlb(s, e1, e2, l, off) C_mes_end(); } +void C_ms_stb_dnam(s, e1, e2, l, off) char *s; int e1, e2; @@ -47,6 +50,7 @@ C_ms_stb_dnam(s, e1, e2, l, off) C_mes_end(); } +void C_ms_stb_ilb(s, e1, e2, l) char *s; int e1, e2; @@ -60,6 +64,7 @@ C_ms_stb_ilb(s, e1, e2, l) C_mes_end(); } +void C_ms_stb_pnam(s, e1, e2, p) char *s; int e1, e2; diff --git a/modules/src/em_mes/C_ms_std.c b/modules/src/em_mes/C_ms_std.c index 675c38d3d..1ccc4d012 100644 --- a/modules/src/em_mes/C_ms_std.c +++ b/modules/src/em_mes/C_ms_std.c @@ -6,6 +6,7 @@ #include #include +void C_ms_std(s, e1, l) char *s; int e1; diff --git a/modules/src/em_mes/em_mes.3 b/modules/src/em_mes/em_mes.3 index 5133d7384..84b4a7890 100644 --- a/modules/src/em_mes/em_mes.3 +++ b/modules/src/em_mes/em_mes.3 @@ -6,65 +6,67 @@ em_mes \- EM-message generating routines .nf .B #include .PP -.B C_ms_err() +.B void C_ms_err() .PP -.B C_ms_opt() +.B void C_ms_opt() .PP -.B C_ms_emx(wsiz, psiz) +.B void C_ms_emx(wsiz, psiz) .B arith wsiz, psiz; .PP .B #include -.B C_ms_reg(offs, siz, class, prior) +.B void C_ms_reg(offs, siz, class, prior) .B arith offs, siz; .B int class, prior; .PP -.B C_ms_src(nlines, filnam) +.B void C_ms_src(nlines, filnam) .B int nlines; .B char *filnam; .PP -.B C_ms_flt() +.B void C_ms_flt() .PP -.B C_ms_com(str) +.B void C_ms_com(str) .B char *str; .PP -.B C_ms_par(nparams) +.B void C_ms_par(nparams) .B arith nparams; .PP .B #include -.B C_ms_ego(hint, offs, siz, regno) +.B void C_ms_ego(hint, offs, siz, regno) .B int hint, regno; .B arith offs, siz; .PP -.B C_ms_gto() +.B void C_ms_gto() .PP -.B C_ms_stb_cst(s, e1, e2, e3) +.B void C_ms_stb_cst(s, e1, e2, e3) .B char *s; .B int e1, e2; .B arith e3; .PP -.B C_ms_stb_dlb(s, e1, e2, l, off) +.B void C_ms_stb_dlb(s, e1, e2, l, off) .B char *s; .B int e1, e2; .B label l; .B arith off; .PP -.B C_ms_stb_dnam(s, e1, e2, l, off) +.B void C_ms_stb_dnam(s, e1, e2, l, off) .B char *s; .B int e1, e2; .B char *l; .B arith off; .PP -.B C_ms_stb_ilb(s, e1, e2, l) +.B void C_ms_stb_ilb(s, e1, e2, l) .B char *s; .B int e1, e2; .B label l; .PP -.B C_ms_stb_pnam(s, e1, e2, p) +.B void C_ms_stb_pnam(s, e1, e2, p) .B char *s; .B int e1, e2; .B char *p; .PP -.B C_ms_lin(l) +.B void C_ms_std(s, e1, l) +.B char *s; +.B int e1; .B int l; .fi .SH DESCRIPTION @@ -157,7 +159,7 @@ can be invoked to indicate that a procedure uses a non-local goto. The .B C_ms_stb and -.B C_ms_lin +.B C_ms_std routines produce a message that a back-end can use for (debugger) symbol table entries. .SH FILES @@ -173,8 +175,7 @@ em_code(3) em_code(3), read_em(3) .SH DIAGNOSTICS None of the functions return a value. -.SH BUGS -The +.SH REMARKS +There is no .BR C_ms_ext () -routine has not yet been implemented, since this message uses -a variable number of arguments. +routine, since this message uses a variable number of arguments. diff --git a/modules/src/em_mes/proto.make b/modules/src/em_mes/proto.make index 1266e828f..5914bd5c8 100644 --- a/modules/src/em_mes/proto.make +++ b/modules/src/em_mes/proto.make @@ -45,13 +45,13 @@ libem_mesCE.$(LIBSUF): rm -f *.$(SUF) install: all + -mkdir $(MOD_DIR)/lib cp libem_mes.$(LIBSUF) $(MOD_DIR)/lib/libem_mes.$(LIBSUF) cp libem_mesCE.$(LIBSUF) $(MOD_DIR)/lib/libem_mesCE.$(LIBSUF) cp libem_mesO.$(LIBSUF) $(MOD_DIR)/lib/libem_mesO.$(LIBSUF) $(RANLIB) $(MOD_DIR)/lib/libem_mes.$(LIBSUF) $(RANLIB) $(MOD_DIR)/lib/libem_mesCE.$(LIBSUF) $(RANLIB) $(MOD_DIR)/lib/libem_mesO.$(LIBSUF) - cp $(SRC_DIR)/em_mes.3 $(MOD_DIR)/man/em_mes.3 if [ $(DO_MACHINE_INDEP) = y ] ; \ then mk_manpage $(SRC_DIR)/em_mes.3 $(TARGET_HOME) ; \ fi @@ -60,7 +60,6 @@ cmp: all -cmp libem_mes.$(LIBSUF) $(MOD_DIR)/lib/libem_mes.$(LIBSUF) -cmp libem_mesCE.$(LIBSUF) $(MOD_DIR)/lib/libem_mesCE.$(LIBSUF) -cmp libem_mesO.$(LIBSUF) $(MOD_DIR)/lib/libem_mesO.$(LIBSUF) - -cmp $(SRC_DIR)/em_mes.3 $(MOD_DIR)/man/em_mes.3 pr: @pr $(SRC_DIR)/proto.make $(SRC) diff --git a/modules/src/em_opt/.distr b/modules/src/em_opt/.distr index 4cf77c027..d11f07afd 100644 --- a/modules/src/em_opt/.distr +++ b/modules/src/em_opt/.distr @@ -16,3 +16,4 @@ parser.h patterns pseudo.r syntax.l +em_codeO.h diff --git a/modules/src/em_opt/aux.c b/modules/src/em_opt/aux.c index b7dcf4dc2..3fe747e8d 100644 --- a/modules/src/em_opt/aux.c +++ b/modules/src/em_opt/aux.c @@ -16,12 +16,14 @@ OO_rotate(w,amount) return(((w<> (8*OO_WSIZE-amount))&lowmask)); } +int OO_signsame(a,b) arith a, b; { return( (a ^ b) >= 0); } +int OO_sfit(val,nbits) arith val, nbits; { @@ -29,12 +31,14 @@ OO_sfit(val,nbits) return(((val&mask) == 0) | (val&mask)==mask); } +int OO_ufit(val, nbits) arith val, nbits; { return((val&(~((1L << (nbits - 1)) - 1))) == 0); } +int OO_extsame(a1,a2) register p_instr a1, a2; { @@ -57,6 +61,7 @@ OO_extsame(a1,a2) } } +int OO_namsame(a1,a2) register p_instr a1, a2; { diff --git a/modules/src/em_opt/em_codeO.h b/modules/src/em_opt/em_codeO.h new file mode 100644 index 000000000..6c4aea713 --- /dev/null +++ b/modules/src/em_opt/em_codeO.h @@ -0,0 +1,270 @@ +#define C_insertpart O_insertpart +#define C_beginpart O_beginpart +#define C_endpart O_endpart +#define C_aar O_aar +#define C_aar_narg O_aar_narg +#define C_adf O_adf +#define C_adf_narg O_adf_narg +#define C_adi O_adi +#define C_adi_narg O_adi_narg +#define C_adp O_adp +#define C_ads O_ads +#define C_ads_narg O_ads_narg +#define C_adu O_adu +#define C_adu_narg O_adu_narg +#define C_and O_and +#define C_and_narg O_and_narg +#define C_asp O_asp +#define C_ass O_ass +#define C_ass_narg O_ass_narg +#define C_beq O_beq +#define C_bge O_bge +#define C_bgt O_bgt +#define C_ble O_ble +#define C_blm O_blm +#define C_bls O_bls +#define C_bls_narg O_bls_narg +#define C_blt O_blt +#define C_bne O_bne +#define C_bra O_bra +#define C_bss_cst O_bss_cst +#define C_bss_fcon O_bss_fcon +#define C_bss_pnam O_bss_pnam +#define C_bss_ucon O_bss_ucon +#define C_cai O_cai +#define C_cal O_cal +#define C_cff O_cff +#define C_cfi O_cfi +#define C_cfu O_cfu +#define C_cif O_cif +#define C_cii O_cii +#define C_ciu O_ciu +#define C_close O_close +#define C_cmf O_cmf +#define C_cmf_narg O_cmf_narg +#define C_cmi O_cmi +#define C_cmi_narg O_cmi_narg +#define C_cmp O_cmp +#define C_cms O_cms +#define C_cms_narg O_cms_narg +#define C_cmu O_cmu +#define C_cmu_narg O_cmu_narg +#define C_com O_com +#define C_com_narg O_com_narg +#define C_con_cst O_con_cst +#define C_con_fcon O_con_fcon +#define C_con_pnam O_con_pnam +#define C_con_scon O_con_scon +#define C_con_ucon O_con_ucon +#define C_csa O_csa +#define C_csa_narg O_csa_narg +#define C_csb O_csb +#define C_csb_narg O_csb_narg +#define C_cst O_cst +#define C_cuf O_cuf +#define C_cui O_cui +#define C_cuu O_cuu +#define C_dch O_dch +#define C_dec O_dec +#define C_dee O_dee +#define C_del O_del +#define C_df_dlb O_df_dlb +#define C_df_dnam O_df_dnam +#define C_df_ilb O_df_ilb +#define C_dlb O_dlb +#define C_dnam O_dnam +#define C_dup O_dup +#define C_dus O_dus +#define C_dus_narg O_dus_narg +#define C_dvf O_dvf +#define C_dvf_narg O_dvf_narg +#define C_dvi O_dvi +#define C_dvi_narg O_dvi_narg +#define C_dvu O_dvu +#define C_dvu_narg O_dvu_narg +#define C_end O_end +#define C_end_narg O_end_narg +#define C_exc O_exc +#define C_exg O_exg +#define C_exg_narg O_exg_narg +#define C_exp O_exp +#define C_fcon O_fcon +#define C_fef O_fef +#define C_fef_narg O_fef_narg +#define C_fif O_fif +#define C_fif_narg O_fif_narg +#define C_fil O_fil +#define C_gto O_gto +#define C_hol_cst O_hol_cst +#define C_hol_fcon O_hol_fcon +#define C_hol_pnam O_hol_pnam +#define C_hol_ucon O_hol_ucon +#define C_icon O_icon +#define C_ilb O_ilb +#define C_inc O_inc +#define C_ine O_ine +#define C_init O_init +#define C_inl O_inl +#define C_inn O_inn +#define C_inn_narg O_inn_narg +#define C_inp O_inp +#define C_ior O_ior +#define C_ior_narg O_ior_narg +#define C_lae O_lae +#define C_lal O_lal +#define C_lar O_lar +#define C_lar_narg O_lar_narg +#define C_ldc O_ldc +#define C_lde O_lde +#define C_ldf O_ldf +#define C_ldl O_ldl +#define C_lfr O_lfr +#define C_lil O_lil +#define C_lim O_lim +#define C_lin O_lin +#define C_lni O_lni +#define C_loc O_loc +#define C_loe O_loe +#define C_lof O_lof +#define C_loi O_loi +#define C_lol O_lol +#define C_lor O_lor +#define C_los O_los +#define C_los_narg O_los_narg +#define C_lpb O_lpb +#define C_lpi O_lpi +#define C_lxa O_lxa +#define C_lxl O_lxl +#define C_magic O_magic +#define C_mes_begin O_mes_begin +#define C_mes_end O_mes_end +#define C_mlf O_mlf +#define C_mlf_narg O_mlf_narg +#define C_mli O_mli +#define C_mli_narg O_mli_narg +#define C_mlu O_mlu +#define C_mlu_narg O_mlu_narg +#define C_mon O_mon +#define C_ngf O_ngf +#define C_ngf_narg O_ngf_narg +#define C_ngi O_ngi +#define C_ngi_narg O_ngi_narg +#define C_nop O_nop +#define C_open O_open +#define C_pnam O_pnam +#define C_pro O_pro +#define C_pro_narg O_pro_narg +#define C_rck O_rck +#define C_rck_narg O_rck_narg +#define C_ret O_ret +#define C_rmi O_rmi +#define C_rmi_narg O_rmi_narg +#define C_rmu O_rmu +#define C_rmu_narg O_rmu_narg +#define C_rol O_rol +#define C_rol_narg O_rol_narg +#define C_rom_cst O_rom_cst +#define C_rom_fcon O_rom_fcon +#define C_rom_pnam O_rom_pnam +#define C_rom_scon O_rom_scon +#define C_rom_ucon O_rom_ucon +#define C_ror O_ror +#define C_ror_narg O_ror_narg +#define C_rtt O_rtt +#define C_sar O_sar +#define C_sar_narg O_sar_narg +#define C_sbf O_sbf +#define C_sbf_narg O_sbf_narg +#define C_sbi O_sbi +#define C_sbi_narg O_sbi_narg +#define C_sbs O_sbs +#define C_sbs_narg O_sbs_narg +#define C_sbu O_sbu +#define C_sbu_narg O_sbu_narg +#define C_scon O_scon +#define C_sde O_sde +#define C_sdf O_sdf +#define C_sdl O_sdl +#define C_set O_set +#define C_set_narg O_set_narg +#define C_sig O_sig +#define C_sil O_sil +#define C_sim O_sim +#define C_sli O_sli +#define C_sli_narg O_sli_narg +#define C_slu O_slu +#define C_slu_narg O_slu_narg +#define C_sri O_sri +#define C_sri_narg O_sri_narg +#define C_sru O_sru +#define C_sru_narg O_sru_narg +#define C_ste O_ste +#define C_stf O_stf +#define C_sti O_sti +#define C_stl O_stl +#define C_str O_str +#define C_sts O_sts +#define C_sts_narg O_sts_narg +#define C_teq O_teq +#define C_tge O_tge +#define C_tgt O_tgt +#define C_tle O_tle +#define C_tlt O_tlt +#define C_tne O_tne +#define C_trp O_trp +#define C_ucon O_ucon +#define C_xor O_xor +#define C_xor_narg O_xor_narg +#define C_zeq O_zeq +#define C_zer O_zer +#define C_zer_narg O_zer_narg +#define C_zge O_zge +#define C_zgt O_zgt +#define C_zle O_zle +#define C_zlt O_zlt +#define C_zne O_zne +#define C_zre O_zre +#define C_zrf O_zrf +#define C_zrf_narg O_zrf_narg +#define C_zrl O_zrl + +#define C_hol_ilb O_hol_ilb +#define C_bss_dnam O_bss_dnam +#define C_bss_dlb O_bss_dlb +#define C_bss_icon O_bss_icon +#define C_bss_ilb O_bss_ilb +#define C_con_dnam O_con_dnam +#define C_con_dlb O_con_dlb +#define C_con_icon O_con_icon +#define C_con_ilb O_con_ilb +#define C_gto_dnam O_gto_dnam +#define C_lae_dnam O_lae_dnam +#define C_gto_dlb O_gto_dlb +#define C_ine_dnam O_ine_dnam +#define C_ine_dlb O_ine_dlb +#define C_rom_dnam O_rom_dnam +#define C_rom_dlb O_rom_dlb +#define C_ina_dnam O_ina_dnam +#define C_ina_dlb O_ina_dlb +#define C_rom_icon O_rom_icon +#define C_rom_ilb O_rom_ilb +#define C_ste_dnam O_ste_dnam +#define C_lae_dlb O_lae_dlb +#define C_ste_dlb O_ste_dlb +#define C_fil_dnam O_fil_dnam +#define C_fil_dlb O_fil_dlb +#define C_lde_dnam O_lde_dnam +#define C_lde_dlb O_lde_dlb +#define C_loe_dnam O_loe_dnam +#define C_loe_dlb O_loe_dlb +#define C_exa_dnam O_exa_dnam +#define C_exa_dlb O_exa_dlb +#define C_dee_dnam O_dee_dnam +#define C_sde_dnam O_sde_dnam +#define C_dee_dlb O_dee_dlb +#define C_sde_dlb O_sde_dlb +#define C_zre_dnam O_zre_dnam +#define C_zre_dlb O_zre_dlb +#define C_hol_dnam O_hol_dnam +#define C_hol_dlb O_hol_dlb +#define C_hol_icon O_hol_icon diff --git a/modules/src/em_opt/em_opt.3 b/modules/src/em_opt/em_opt.3 index 08291c8a9..290d35317 100644 --- a/modules/src/em_opt/em_opt.3 +++ b/modules/src/em_opt/em_opt.3 @@ -7,61 +7,61 @@ emopt \- EM code peephole optimizer interface for compilers .B #define PEEPHOLE .B #include .PP -.B O_init(wsize, psize) +.B void O_init(wsize, psize) .B arith wsize, psize; .PP .B int O_open(filename) -.B O_close() +.B void O_close() .B int O_busy() .B char *filename; .PP -.B O_magic() +.B void O_magic() .PP -.B O_df_dlb(l) -.B O_df_dnam(s) -.B O_df_ilb(l) +.B void O_df_dlb(l) +.B void O_df_dnam(s) +.B void O_df_ilb(l) .B label l; char *s; .PP -.B O_pro(s, l) -.B O_pro_narg(s) -.B O_end(l) -.B O_end_narg() +.B void O_pro(s, l) +.B void O_pro_narg(s) +.B void O_end(l) +.B void O_end_narg() .B char *s; arith l; .PP -.B O_exa_dlb(l) -.B O_exa_dnam(s) -.B O_exp(s) -.B O_ina_dlb(l) -.B O_ina_dnam(s) -.B O_inp(s) +.B void O_exa_dlb(l) +.B void O_exa_dnam(s) +.B void O_exp(s) +.B void O_ina_dlb(l) +.B void O_ina_dnam(s) +.B void O_inp(s) .B char *s; label l; .PP -.BI O_bss_ cstp () -.BI O_hol_ cstp () -.BI O_con_ cstp () -.BI O_rom_ cstp () +.BI "void O_bss_" cstp () +.BI "void O_hol_" cstp () +.BI "void O_con_" cstp () +.BI "void O_rom_" cstp () .PP .B #include -.B O_mes_begin(ms) -.BI O_ cstp () -.B O_mes_end() +.B void O_mes_begin(ms) +.BI "void O_" cstp () +.B void O_mes_end() .B int ms; .PP -.B O_exc(c1, c2) +.B void O_exc(c1, c2) .B arith c1, c2; .PP -.BI O_ mnem () -.BI O_ mnem _dlb() -.BI O_ mnem _dnam() -.BI O_ mnem _narg() +.BI "void O_" mnem () +.BI "void O_" mnem _dlb() +.BI "void O_" mnem _dnam() +.BI "void O_" mnem _narg() .PP -.B O_insertpart(id) +.B void O_insertpart(id) .B int id; .PP -.B O_beginpart(id) +.B void O_beginpart(id) .B int id; .PP -.B O_endpart(id) +.B void O_endpart(id) .B int id; .fi .SH DESCRIPTION diff --git a/modules/src/em_opt/findworst.c b/modules/src/em_opt/findworst.c index 50bf09f72..edf1c9a70 100644 --- a/modules/src/em_opt/findworst.c +++ b/modules/src/em_opt/findworst.c @@ -6,6 +6,9 @@ static char rcsidp3[] = "$Header$"; #define UPDATEWORST(backups) if(backups>mostbackups) mostbackups = backups; +PRIVATE int leftmatch(); +PRIVATE int rightmatch(); + findworst(patt,repl) struct mnems patt,repl; { diff --git a/modules/src/em_opt/initlex.c b/modules/src/em_opt/initlex.c index fc3675a39..d821d6d55 100644 --- a/modules/src/em_opt/initlex.c +++ b/modules/src/em_opt/initlex.c @@ -13,6 +13,8 @@ static char rcsidp2[] = "$Header$"; extern char em_flag[]; extern char em_mnem[][4]; +PRIVATE idinit(); + initlex() { register int i,j; diff --git a/modules/src/em_opt/makefuns.awk b/modules/src/em_opt/makefuns.awk index a7b175fea..31d25f516 100644 --- a/modules/src/em_opt/makefuns.awk +++ b/modules/src/em_opt/makefuns.awk @@ -2,6 +2,7 @@ BEGIN { FS = "|"; seenproc = 0; CC="${CMD}" + if (prototypes == "") prototypes = "prototypes" } /^%/ {} /^$/ {} @@ -18,7 +19,8 @@ BEGIN { nam = $1 printf "cat > O_%s.c << '--EOF--'\n",$1 print "#include \"nopt.h\"" - printf "O_%s(",$1 + printf "void O_%s(",$1 + prototype = "_PROTOTYPE(void O_" $1 ", (" nparms = split($2,parms,":"); for(p=1;p 1) { + prototype = prototype parms[1] printf "\t%s",parms[1] } + else { + prototype = prototype "void" + } for(p=1;p> prototypes if($3) { printf "{\n\t%s\n",$3 } diff --git a/modules/src/em_opt/mkstrct.c b/modules/src/em_opt/mkstrct.c index 0e8bbff9d..465007f3c 100644 --- a/modules/src/em_opt/mkstrct.c +++ b/modules/src/em_opt/mkstrct.c @@ -4,6 +4,7 @@ static char rcsid3[] = "$Header$"; #include "nopt.h" +void EM_mkop(p,opcode) register p_instr p; int opcode; @@ -13,6 +14,7 @@ EM_mkop(p,opcode) p->em_argtype = 0; } +void EM_mknarg(p,opcode) register p_instr p; int opcode; @@ -23,6 +25,7 @@ EM_mknarg(p,opcode) p->em_cst = 0; } +void EM_mkilb(p,opcode,lab) register p_instr p; int opcode; @@ -34,6 +37,7 @@ EM_mkilb(p,opcode,lab) p->em_ilb = lab; } +void EM_mknof(p,opcode,lab,off) register p_instr p; int opcode; @@ -47,6 +51,7 @@ EM_mknof(p,opcode,lab,off) p->em_off = off; } +void EM_mksof(p,opcode,name,off) register p_instr p; int opcode; @@ -60,6 +65,7 @@ EM_mksof(p,opcode,name,off) p->em_off = off; } +void EM_mkcst(p,opcode,cst) register p_instr p; int opcode; @@ -71,6 +77,7 @@ EM_mkcst(p,opcode,cst) p->em_cst = cst; } +void EM_mkpro(p,opcode,pnam) register p_instr p; int opcode; @@ -82,6 +89,7 @@ EM_mkpro(p,opcode,pnam) p->em_pnam = OO_freestr(pnam); } +void EM_mkdefilb(p,opcode,deflb) register p_instr p; int opcode; @@ -93,6 +101,7 @@ EM_mkdefilb(p,opcode,deflb) p->em_ilb = deflb; } +void EM_Nop(opcode) int opcode; { @@ -102,6 +111,7 @@ EM_Nop(opcode) p->em_argtype = 0; } +void EM_Nnarg(opcode) int opcode; { @@ -112,6 +122,7 @@ EM_Nnarg(opcode) p->em_cst = 0; } +void EM_Nilb(opcode,lab) int opcode; label lab; @@ -123,6 +134,7 @@ EM_Nilb(opcode,lab) p->em_ilb = lab; } +void EM_Nnof(opcode,lab,off) int opcode; label lab; @@ -136,6 +148,7 @@ EM_Nnof(opcode,lab,off) p->em_off = off; } +void EM_Nsof(opcode,name,off) int opcode; char *name; @@ -149,6 +162,7 @@ EM_Nsof(opcode,name,off) p->em_off = off; } +void EM_Ncst(opcode,cst) int opcode; arith cst; @@ -160,6 +174,7 @@ EM_Ncst(opcode,cst) p->em_cst = cst; } +void EM_Npro(opcode,pnam) int opcode; char *pnam; @@ -171,6 +186,7 @@ EM_Npro(opcode,pnam) p->em_pnam = OO_freestr(pnam); } +void EM_Ndefilb(opcode,deflb) int opcode; label deflb; @@ -182,6 +198,7 @@ EM_Ndefilb(opcode,deflb) p->em_ilb = deflb; } +void EM_Rop(opcode) int opcode; { @@ -191,6 +208,7 @@ EM_Rop(opcode) p->em_argtype = 0; } +void EM_Rnarg(opcode) int opcode; { @@ -201,6 +219,7 @@ EM_Rnarg(opcode) p->em_cst = 0; } +void EM_Rilb(opcode,lab) int opcode; label lab; @@ -212,6 +231,7 @@ EM_Rilb(opcode,lab) p->em_ilb = lab; } +void EM_Rnof(opcode,lab,off) int opcode; label lab; @@ -225,6 +245,7 @@ EM_Rnof(opcode,lab,off) p->em_off = off; } +void EM_Rsof(opcode,name,off) int opcode; char *name; @@ -238,6 +259,7 @@ EM_Rsof(opcode,name,off) p->em_off = off; } +void EM_Rcst(opcode,cst) int opcode; arith cst; @@ -249,6 +271,7 @@ EM_Rcst(opcode,cst) p->em_cst = cst; } +void EM_Rpro(opcode,pnam) int opcode; char *pnam; @@ -260,6 +283,7 @@ EM_Rpro(opcode,pnam) p->em_pnam = OO_freestr(pnam); } +void EM_Rdefilb(opcode,deflb) int opcode; label deflb; diff --git a/modules/src/em_opt/nopt.c b/modules/src/em_opt/nopt.c index d2ad453a1..e285aa2f8 100644 --- a/modules/src/em_opt/nopt.c +++ b/modules/src/em_opt/nopt.c @@ -46,6 +46,9 @@ int OO_wrstats = 1; /* pattern statistics output */ **************************/ #define BTSCPY(pp,qq,i,p,q,n) for(pp=(p),qq=(q),i=(n);i--;*pp++ = *qq++) +PRIVATE void allocmem(); + +void O_init(wsize,psize) arith wsize, psize; { @@ -56,6 +59,7 @@ O_init(wsize,psize) OO_PSIZE = psize; } +int O_open(fname) char *fname; { @@ -63,16 +67,19 @@ O_open(fname) return(C_open(fname)); } +void O_magic() { C_magic(); } +void O_close() { C_close(); } +void OO_dfa(last) register int last; { @@ -100,7 +107,7 @@ OO_dfa(last) } } -PRIVATE +PRIVATE void fatal(s,a) char *s; int a; @@ -111,7 +118,7 @@ fatal(s,a) sys_stop(S_EXIT); } -PRIVATE +PRIVATE void allocmem() { /* Allocate memory for queues on heap */ @@ -151,6 +158,7 @@ OO_freestr(str) return(res); } +void OO_flush() { /* @@ -197,6 +205,7 @@ OO_halfflush() return (OO_nxtpatt++); } +void OO_mkext(p,opcode,arg,off) register p_instr p; int opcode; @@ -218,6 +227,7 @@ OO_mkext(p,opcode,arg,off) } } +void OO_mkrepl(lrepl,diff,numbkup) int lrepl,diff,numbkup; { @@ -264,6 +274,7 @@ OO_mkrepl(lrepl,diff,numbkup) } #ifdef DEBUG +void dumpstate(mess) char *mess; { @@ -283,6 +294,7 @@ dumpstate(mess) fprintf(stderr,"\n"); } +void prtinst(p) p_instr p; { diff --git a/modules/src/em_opt/nopt.h b/modules/src/em_opt/nopt.h index 31aaca510..de9d15669 100644 --- a/modules/src/em_opt/nopt.h +++ b/modules/src/em_opt/nopt.h @@ -11,6 +11,7 @@ #include #include #include +#include #define MAXBUFFER 200 #define MAXSTRING 1000 @@ -52,13 +53,53 @@ extern arith OO_PSIZE; /* pointer length */ extern int OO_wrstats; /* statistics output */ #endif -extern char *OO_freestr(); -extern arith OO_rotate(); -extern arith OO_offset(); - #define CST(p) (p.em_cst) #define PNAM(p) (p.em_pnam) #define LAB(p) (p.em_ilb) #define DEFILB(p) (p.em_ilb) #define DEFINED(p) (p.em_argtype) +_PROTOTYPE(void EM_mkop, (p_instr, int)); +_PROTOTYPE(void EM_mknarg, (p_instr, int)); +_PROTOTYPE(void EM_mkilb, (p_instr, int, label)); +_PROTOTYPE(void EM_mknof, (p_instr, int, label, arith)); +_PROTOTYPE(void EM_mksof, (p_instr, int, char *, arith)); +_PROTOTYPE(void EM_mkcst, (p_instr, int, arith)); +_PROTOTYPE(void EM_mkpro, (p_instr, int, char *)); +_PROTOTYPE(void EM_mkdefilb, (p_instr, int, label)); +_PROTOTYPE(void EM_Nop, (int)); +_PROTOTYPE(void EM_Nnarg, (int)); +_PROTOTYPE(void EM_Nilb, (int, label)); +_PROTOTYPE(void EM_Nnof, (int, label, arith)); +_PROTOTYPE(void EM_Nsof, (int, char *, arith)); +_PROTOTYPE(void EM_Ncst, (int, arith)); +_PROTOTYPE(void EM_Npro, (int, char *)); +_PROTOTYPE(void EM_Ndefilb, (int, label)); +_PROTOTYPE(void EM_Rop, (int)); +_PROTOTYPE(void EM_Rnarg, (int)); +_PROTOTYPE(void EM_Rilb, (int, label)); +_PROTOTYPE(void EM_Rnof, (int, label, arith)); +_PROTOTYPE(void EM_Rsof, (int, char *, arith)); +_PROTOTYPE(void EM_Rcst, (int, arith)); +_PROTOTYPE(void EM_Rpro, (int, char *)); +_PROTOTYPE(void EM_Rdefilb, (int, label)); + +_PROTOTYPE(arith OO_rotate, (arith, arith)); +_PROTOTYPE(int OO_signsame, (arith, arith)); +_PROTOTYPE(int OO_sfit, (arith, arith)); +_PROTOTYPE(int OO_ufit, (arith, arith)); +_PROTOTYPE(int OO_extsame, (p_instr, p_instr)); +_PROTOTYPE(int OO_namsame, (p_instr, p_instr)); +_PROTOTYPE(arith OO_offset, (p_instr)); + +_PROTOTYPE(char *OO_freestr, (char *)); +_PROTOTYPE(void OO_dfa, (int)); +_PROTOTYPE(void OO_flush, (void)); +_PROTOTYPE(p_instr OO_halfflush, (void)); +_PROTOTYPE(void OO_mkext, (p_instr, int, p_instr, arith)); +_PROTOTYPE(void OO_mkrepl, (int, int, int)); + +#ifdef DEBUG +_PROTOTYPE(void dumpstate, (char *)); +_PROTOTYPE(void prtinst, (p_instr)); +#endif diff --git a/modules/src/em_opt/outputdfa.c b/modules/src/em_opt/outputdfa.c index c0efccef5..0b7bf6ef6 100644 --- a/modules/src/em_opt/outputdfa.c +++ b/modules/src/em_opt/outputdfa.c @@ -7,6 +7,19 @@ static char rcsidp5[] = "$Header$"; FILE *ofile; +PRIVATE openofile(); +PRIVATE installofile(); +PRIVATE UNLINK(); +PRIVATE RENAME(); +PRIVATE outdfa(); +PRIVATE outmnems(); +PRIVATE outdotrans(); +PRIVATE outoneaction(); +PRIVATE outrepl(); +PRIVATE outexp(); +PRIVATE outext(); +PRIVATE outop(); + outputnopt() { openofile("dfa.c"); diff --git a/modules/src/em_opt/proto.make b/modules/src/em_opt/proto.make index ac6643eaa..28c25cc0a 100644 --- a/modules/src/em_opt/proto.make +++ b/modules/src/em_opt/proto.make @@ -33,7 +33,7 @@ LIBCEOPT = libCEopt.$(LIBSUF) .SUFFIXES: .d .r -.r.d: ; CMD=$(CMD); export CMD; awk -f $(SRC_DIR)/makefuns.awk $*.r | sh -x +.r.d: ; CMD=$(CMD); export CMD; awk -f $(SRC_DIR)/makefuns.awk prototypes=/dev/null $*.r | sh -x touch $@ .SUFFIXES: .$(SUF) @@ -57,15 +57,17 @@ GENFILES = Lpars.h Lpars.c parserdummy parser.c syntax.c \ dfa.c dfa.c.new trans.c trans.c.new\ incalls.d incalls.r incalls.r.new pseudo.d pseudo.r -all: em_nopt $(LIBOPT) $(LIBCEOPT) +all: em_nopt $(LIBOPT) $(LIBCEOPT) prototypes install: all + -mkdir $(MOD_DIR)/lib + -mkdir $(MOD_DIR)/h cp $(LIBOPT) $(MOD_DIR)/lib/$(LIBOPT) $(RANLIB) $(MOD_DIR)/lib/$(LIBOPT) cp $(LIBCEOPT) $(MOD_DIR)/lib/$(LIBCEOPT) $(RANLIB) $(MOD_DIR)/lib/$(LIBCEOPT) - cp $(SRC_DIR)/em_opt.3 $(MOD_DIR)/man/em_opt.3 cp em_nopt $(TARGET_HOME)/lib.bin/em_nopt + cp prototypes $(MOD_DIR)/h/em_codeO.h if [ $(DO_MACHINE_INDEP) = y ] ; \ then mk_manpage $(SRC_DIR)/em_opt.3 $(TARGET_HOME) ; \ mk_manpage $(SRC_DIR)/em_nopt.6 $(TARGET_HOME) ; \ @@ -75,7 +77,8 @@ cmp: all -cmp $(LIBOPT) $(MOD_DIR)/lib/$(LIBOPT) -cmp $(LIBCEOPT) $(MOD_DIR)/lib/$(LIBCEOPT) -cmp em_nopt $(TARGET_HOME)/lib.bin/em_nopt - -cmp $(SRC_DIR)/em_opt.3 $(MOD_DIR)/man/em_opt.3 + -cmp prototypes $(MOD_DIR)/h/em_codeO.h + pr: @pr $(SRCS) @@ -88,7 +91,7 @@ lint: lintparser lintnopt clean: rm -f O_*.$(SUF) rm -f O_*.c - rm -f $(NOFILES) main.$(SUF) $(POFILES) + rm -f $(NOFILES) main.$(SUF) $(POFILES) prototypes rm -f $(GENFILES) parser em_nopt $(LIBOPT) $(LIBCEOPT) # How to build stand alone version of the optimizer @@ -132,6 +135,11 @@ $(LIBCEOPT): incalls.r -mv $(LIBOPT).saved $(LIBOPT) rm -f O_*.$(SUF) $(NOFILES) +prototypes: pseudo.r incalls.r + cp $(SRC_DIR)/em_codeO.h prototypes + echo >> prototypes + awk -f $(SRC_DIR)/makefuns.awk pseudo.r incalls.r > /dev/null + incalls.r: $(SRC_DIR)/patterns parser -$(UTIL_HOME)/lib.bin/cpp $(SRC_DIR)/patterns | $(HOWMUCH) >/tmp/patts parser 0 void -#endif flt_b64_sft(e,n) register struct flt_mantissa *e; register int n; diff --git a/modules/src/flt_arith/flt_add.c b/modules/src/flt_arith/flt_add.c index 0db127b0b..a1f27c9ef 100644 --- a/modules/src/flt_arith/flt_add.c +++ b/modules/src/flt_arith/flt_add.c @@ -7,9 +7,7 @@ #include "flt_misc.h" -#if __STDC__ > 0 void -#endif flt_add(e1,e2,e3) register flt_arith *e1,*e2,*e3; { @@ -77,9 +75,7 @@ flt_add(e1,e2,e3) flt_chk(e3); } -#if __STDC__ > 0 void -#endif flt_sub(e1,e2,e3) flt_arith *e1,*e2,*e3; { diff --git a/modules/src/flt_arith/flt_ar2flt.c b/modules/src/flt_arith/flt_ar2flt.c index 21e91a8af..d10e60598 100644 --- a/modules/src/flt_arith/flt_ar2flt.c +++ b/modules/src/flt_arith/flt_ar2flt.c @@ -8,9 +8,7 @@ #include "flt_misc.h" #include -#if __STDC__ > 0 void -#endif flt_arith2flt(n, e, uns) register arith n; register flt_arith *e; diff --git a/modules/src/flt_arith/flt_arith.3 b/modules/src/flt_arith/flt_arith.3 index b8b90e11a..2e6a5feb1 100644 --- a/modules/src/flt_arith/flt_arith.3 +++ b/modules/src/flt_arith/flt_arith.3 @@ -28,32 +28,32 @@ extern int flt_status; #define FLT_STRLEN 32 .PP -.B flt_add(e1, e2, e3) +.B void flt_add(e1, e2, e3) .B flt_arith *e1, *e2, *e3; .PP -.B flt_mul(e1, e2, e3) +.B void flt_mul(e1, e2, e3) .B flt_arith *e1, *e2, *e3; .PP -.B flt_sub(e1, e2, e3) +.B void flt_sub(e1, e2, e3) .B flt_arith *e1, *e2, *e3; .PP -.B flt_div(e1, e2, e3) +.B void flt_div(e1, e2, e3) .B flt_arith *e1, *e2, *e3; .PP -.B flt_umin(e) +.B void flt_umin(e) .B flt_arith *e; .PP -.B flt_modf(e1, intpart, fractpart) +.B void flt_modf(e1, intpart, fractpart) .B flt_arith *e1, *intpart, *fractpart; .PP .B int flt_cmp(e1, e2) .B flt_arith *e1, *e2; .PP -.B flt_str2flt(s, e) +.B void flt_str2flt(s, e) .B char *s; .B flt_arith *e; .PP -.B flt_flt2str(e, buf, bufsize) +.B void flt_flt2str(e, buf, bufsize) .B flt_arith *e; .B char *buf; .B int bufsize; @@ -61,7 +61,7 @@ extern int flt_status; .B int flt_status; .PP .B #include -.B flt_arith2flt(n, e, uns) +.B void flt_arith2flt(n, e, uns) .B arith n; .B flt_arith *e; .B int uns; @@ -70,7 +70,7 @@ extern int flt_status; .B flt_arith *e; .B int uns; .PP -.B flt_b64_sft(m, n) +.B void flt_b64_sft(m, n) .B struct flt_mantissa *m; .B int n; .SH DESCRIPTION diff --git a/modules/src/flt_arith/flt_arith.h b/modules/src/flt_arith/flt_arith.h index 3d31b3ded..baf9f33d1 100644 --- a/modules/src/flt_arith/flt_arith.h +++ b/modules/src/flt_arith/flt_arith.h @@ -7,6 +7,8 @@ #ifndef __FLT_INCLUDED__ #define __FLT_INCLUDED__ +#include "ansi.h" + #ifndef arith #define arith long #endif @@ -31,20 +33,17 @@ extern int flt_status; #define FLT_STRLEN 32 /* max length of result of flt_flt2str() */ -#if __STDC__ > 0 -void flt_add(flt_arith *, flt_arith *, flt_arith *); -void flt_sub(flt_arith *, flt_arith *, flt_arith *); -void flt_mul(flt_arith *, flt_arith *, flt_arith *); -void flt_div(flt_arith *, flt_arith *, flt_arith *); -void flt_modf(flt_arith *, flt_arith *, flt_arith *); -int flt_cmp(flt_arith *, flt_arith *); -void flt_str2flt(char *, flt_arith *); -void flt_flt2str(flt_arith *, char *, int); -void flt_arith2flt(arith, flt_arith *, int); -arith flt_flt2arith(flt_arith *, int); -void flt_b64_sft(struct flt_mantissa *, int); -void flt_umin(flt_arith *); -#else -arith flt_flt2arith(); -#endif +_PROTOTYPE(void flt_add, (flt_arith *, flt_arith *, flt_arith *)); +_PROTOTYPE(void flt_sub, (flt_arith *, flt_arith *, flt_arith *)); +_PROTOTYPE(void flt_mul, (flt_arith *, flt_arith *, flt_arith *)); +_PROTOTYPE(void flt_div, (flt_arith *, flt_arith *, flt_arith *)); +_PROTOTYPE(void flt_modf, (flt_arith *, flt_arith *, flt_arith *)); +_PROTOTYPE(int flt_cmp, (flt_arith *, flt_arith *)); +_PROTOTYPE(void flt_str2flt, (char *, flt_arith *)); +_PROTOTYPE(void flt_flt2str, (flt_arith *, char *, int)); +_PROTOTYPE(void flt_arith2flt, (arith, flt_arith *, int)); +_PROTOTYPE(arith flt_flt2arith, (flt_arith *, int)); +_PROTOTYPE(void flt_b64_sft, (struct flt_mantissa *, int)); +_PROTOTYPE(void flt_umin, (flt_arith *)); + #endif /* __FLT_INCLUDED__ */ diff --git a/modules/src/flt_arith/flt_chk.c b/modules/src/flt_arith/flt_chk.c index bfdd332fe..d0ad61187 100644 --- a/modules/src/flt_arith/flt_chk.c +++ b/modules/src/flt_arith/flt_chk.c @@ -8,9 +8,8 @@ #include "flt_misc.h" int flt_status = 0; -#if __STDC__ > 0 + void -#endif flt_chk(e) register flt_arith *e; { diff --git a/modules/src/flt_arith/flt_cmp.c b/modules/src/flt_arith/flt_cmp.c index e814aeaf0..12a1cca7d 100644 --- a/modules/src/flt_arith/flt_cmp.c +++ b/modules/src/flt_arith/flt_cmp.c @@ -5,7 +5,7 @@ /* $Header$ */ -#include "flt_misc.h" +#include "flt_misc.h" int flt_cmp(e1, e2) diff --git a/modules/src/flt_arith/flt_div.c b/modules/src/flt_arith/flt_div.c index dc8aea33f..0d7fbd1bf 100644 --- a/modules/src/flt_arith/flt_div.c +++ b/modules/src/flt_arith/flt_div.c @@ -6,9 +6,8 @@ /* $Header$ */ #include "flt_misc.h" -#if __STDC__ > 0 + void -#endif flt_div(e1,e2,e3) register flt_arith *e1,*e2,*e3; { diff --git a/modules/src/flt_arith/flt_misc.h b/modules/src/flt_arith/flt_misc.h index 467c6fbc9..7a25de582 100644 --- a/modules/src/flt_arith/flt_misc.h +++ b/modules/src/flt_arith/flt_misc.h @@ -21,10 +21,8 @@ #define flt_b64_add _flt_64add #define flt_split _flt_split -#if __STDC__ > 0 -int ucmp(long, long); -void flt_nrm(flt_arith *); -void flt_chk(flt_arith *); -int flt_b64_add(struct flt_mantissa *, struct flt_mantissa *); -void flt_split(flt_arith *, unsigned short *); -#endif +_PROTOTYPE(int ucmp, (long, long)); +_PROTOTYPE(void flt_nrm, (flt_arith *)); +_PROTOTYPE(void flt_chk, (flt_arith *)); +_PROTOTYPE(int flt_b64_add, (struct flt_mantissa *, struct flt_mantissa *)); +_PROTOTYPE(void flt_split, (flt_arith *, unsigned short *)); diff --git a/modules/src/flt_arith/flt_modf.c b/modules/src/flt_arith/flt_modf.c index 675c26b9e..511116d23 100644 --- a/modules/src/flt_arith/flt_modf.c +++ b/modules/src/flt_arith/flt_modf.c @@ -6,9 +6,8 @@ /* $Header$ */ #include "flt_misc.h" -#if __STDC__ > 0 + void -#endif flt_modf(e, ipart, fpart) register flt_arith *e, *ipart, *fpart; { diff --git a/modules/src/flt_arith/flt_mul.c b/modules/src/flt_arith/flt_mul.c index caac6b798..876e7a5a9 100644 --- a/modules/src/flt_arith/flt_mul.c +++ b/modules/src/flt_arith/flt_mul.c @@ -6,9 +6,8 @@ /* $Header$ */ #include "flt_misc.h" -#if __STDC__ > 0 + void -#endif flt_mul(e1,e2,e3) register flt_arith *e1,*e2,*e3; { diff --git a/modules/src/flt_arith/flt_nrm.c b/modules/src/flt_arith/flt_nrm.c index df6d75c66..c1ef9ac65 100644 --- a/modules/src/flt_arith/flt_nrm.c +++ b/modules/src/flt_arith/flt_nrm.c @@ -6,9 +6,8 @@ /* $Header$ */ #include "flt_misc.h" -#if __STDC__ > 0 + void -#endif flt_nrm(e) register flt_arith *e; { diff --git a/modules/src/flt_arith/flt_str2fl.c b/modules/src/flt_arith/flt_str2fl.c index f9936ba4d..4a7eef370 100644 --- a/modules/src/flt_arith/flt_str2fl.c +++ b/modules/src/flt_arith/flt_str2fl.c @@ -217,9 +217,8 @@ add_exponent(e, exp) if (!status) status = flt_status; flt_status = status; } -#if __STDC__ > 0 + void -#endif flt_str2flt(s, e) register char *s; register flt_arith *e; @@ -420,9 +419,8 @@ flt_ecvt(e, decpt, sign) } return buf; } -#if __STDC__ > 0 + void -#endif flt_flt2str(e, buf, bufsize) flt_arith *e; char *buf; diff --git a/modules/src/flt_arith/flt_umin.c b/modules/src/flt_arith/flt_umin.c index 182eb7fa9..4f375424e 100644 --- a/modules/src/flt_arith/flt_umin.c +++ b/modules/src/flt_arith/flt_umin.c @@ -6,9 +6,8 @@ /* $Header$ */ #include "flt_misc.h" -#if __STDC__ > 0 + void -#endif flt_umin(e) flt_arith *e; { diff --git a/modules/src/flt_arith/proto.make b/modules/src/flt_arith/proto.make index 910981224..dc7bbfdb3 100644 --- a/modules/src/flt_arith/proto.make +++ b/modules/src/flt_arith/proto.make @@ -43,10 +43,11 @@ $(LIBFLT): $(OBJ) $(RANLIB) $(LIBFLT) install: all + -mkdir $(MOD_DIR)/lib + -mkdir $(MOD_DIR)/h cp $(LIBFLT) $(MOD_DIR)/lib/$(LIBFLT) $(RANLIB) $(MOD_DIR)/lib/$(LIBFLT) cp $(SRC_DIR)/flt_arith.h $(MOD_DIR)/h/flt_arith.h - cp $(SRC_DIR)/flt_arith.3 $(MOD_DIR)/man/flt_arith.3 if [ $(DO_MACHINE_INDEP) = y ] ; \ then mk_manpage $(SRC_DIR)/flt_arith.3 $(TARGET_HOME) ; \ fi @@ -54,7 +55,6 @@ install: all cmp: all -cmp $(LIBFLT) $(MOD_DIR)/lib/$(LIBFLT) -cmp $(SRC_DIR)/flt_arith.h $(MOD_DIR)/h/flt_arith.h - -cmp $(SRC_DIR)/flt_arith.3 $(MOD_DIR)/man/flt_arith.3 pr: @pr $(SRC_DIR)/proto.make $(SRC) diff --git a/modules/src/flt_arith/split.c b/modules/src/flt_arith/split.c index d5c0344c1..7c4bf2f9e 100644 --- a/modules/src/flt_arith/split.c +++ b/modules/src/flt_arith/split.c @@ -1,9 +1,8 @@ /* $Header$ */ #include "flt_misc.h" -#if __STDC__ > 0 + void -#endif flt_split(e, p) register flt_arith *e; register unsigned short *p; diff --git a/modules/src/idf/idf.3 b/modules/src/idf/idf.3 index b77a2a627..14f0b00d2 100644 --- a/modules/src/idf/idf.3 +++ b/modules/src/idf/idf.3 @@ -4,7 +4,7 @@ init_idf, str2idf, findidf\ \-\ a namelist module .SH SYNOPSIS .PP -.B init_idf() +.B void init_idf() .PP .B struct idf *str2idf(tag, cpy) .br diff --git a/modules/src/idf/idf_pkg.body b/modules/src/idf/idf_pkg.body index 19c2fb5ec..4b71bfaaa 100644 --- a/modules/src/idf/idf_pkg.body +++ b/modules/src/idf/idf_pkg.body @@ -17,9 +17,12 @@ static struct idf *IDF_hashtable[IDF_HASHSIZE]; (variable, selector, structure tag, etc.). */ -#if __STDC__ -static struct idf *IDF_new(char *, int, int); -#endif +_PROTOTYPE(static struct idf *IDF_new, (char *, int, int)); + +void +init_idf() +{ +} static struct idf * IDF_new(tg, size, cpy) @@ -64,6 +67,7 @@ IDF_new(tg, size, cpy) } #ifdef IDF_DEBUG +void hash_stat() { register int i; @@ -87,6 +91,7 @@ hash_stat() print("End hash table tally\n"); } +void idfappfun(fun, opt) int (*fun)(); int opt; diff --git a/modules/src/idf/idf_pkg.spec b/modules/src/idf/idf_pkg.spec index 7fe7dbcda..6fbefd184 100644 --- a/modules/src/idf/idf_pkg.spec +++ b/modules/src/idf/idf_pkg.spec @@ -1,6 +1,8 @@ /* $Header$ */ /* IDENTIFIER DESCRIPTOR */ +#include + /* This a generic package for maintaining a name list */ /* Instantiation parameters, supplied by #define, are : @@ -23,9 +25,9 @@ struct idf { /* init_idf() - Initializes the namelist. Empty for now. + Initializes the namelist. */ -#define init_idf() +_PROTOTYPE(void init_idf, (void)); /* struct idf * str2idf(tg, cp) char *tg; @@ -38,10 +40,6 @@ struct idf { If cp < 0, the string is not entered, but only looked for. */ -#if __STDC__ > 0 -struct idf *str2idf(char *, int); -#else -extern struct idf * str2idf(); -#endif +_PROTOTYPE(struct idf *str2idf, (char *, int)); #define findidf(tg) str2idf(tg, -1) diff --git a/modules/src/idf/proto.make b/modules/src/idf/proto.make index a3035664f..d80c46cad 100644 --- a/modules/src/idf/proto.make +++ b/modules/src/idf/proto.make @@ -8,9 +8,9 @@ MOD_DIR = $(TARGET_HOME)/modules all: install: all + -mkdir $(MOD_DIR)/pkg cp $(SRC_DIR)/idf_pkg.body $(MOD_DIR)/pkg/idf_pkg.body cp $(SRC_DIR)/idf_pkg.spec $(MOD_DIR)/pkg/idf_pkg.spec - cp $(SRC_DIR)/idf.3 $(MOD_DIR)/man/idf.3 if [ $(DO_MACHINE_INDEP) = y ] ; \ then mk_manpage $(SRC_DIR)/idf.3 $(TARGET_HOME) ; \ fi @@ -18,7 +18,6 @@ install: all cmp: all -cmp $(SRC_DIR)/idf_pkg.body $(MOD_DIR)/pkg/idf_pkg.body -cmp $(SRC_DIR)/idf_pkg.spec $(MOD_DIR)/pkg/idf_pkg.spec - -cmp $(SRC_DIR)/idf.3 $(MOD_DIR)/man/idf.3 pr: @pr $(SRC_DIR)/proto.make $(SRC_DIR)/idf_pkg.spec $(SRC_DIR)/idf_pkg.body