From 7598994ba43405d2a9f7659d608883c0047d13da Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Tue, 18 Nov 2014 02:49:03 -0800 Subject: [PATCH] More calx adjustments. --- i/n/j.h | 30 +++++++++++++++--------------- n/j.c | 8 ++++++-- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/i/n/j.h b/i/n/j.h index e410ed189c..c1488262ba 100644 --- a/i/n/j.h +++ b/i/n/j.h @@ -10,9 +10,9 @@ ++ bosh ,@uvH :: local battery hash ++ batt ,* :: battery ++ calf :: - $: jax=,@ud :: jet index + $: jax=,@ud :: hot core index pax=,@ud :: parent axis or 0 - hap=(map ,@ud ,@ud) :: axis/jet + hap=(map ,@ud ,@ud) :: axis/hot arm index == :: ++ calx (trel calf cope club) :: cached by battery ++ clog (pair cope (map batt club)) :: identity record @@ -32,33 +32,33 @@ /* u3j_harm: jet arm. */ typedef struct _u3j_harm { - c3_c* fcs_c; // `.axe` or name + c3_c* fcs_c; // `.axe` or name u3_noun (*fun_f)(u3_noun); // compute or 0 / semitransfer // c3_o (*val_f)(u3_noun); // validate or 0 / retain - c3_o ice; // perfect (don't test) - c3_o tot; // total (never punts) - c3_o liv; // live (enabled) - c3_l axe_l; // computed/discovered axis - struct _u3j_core* cop_u; // containing core + c3_o ice; // perfect (don't test) + c3_o tot; // total (never punts) + c3_o liv; // live (enabled) + c3_l axe_l; // computed/discovered axis + struct _u3j_core* cop_u; // containing core } u3j_harm; /* u3j_core: driver definition. */ typedef struct _u3j_core { c3_c* cos_c; // control string - struct _u3j_harm* arm_u; // blank-terminated static list - struct _u3j_core* dev_u; // blank-terminated static list - struct _u3j_core* par_u; // dynamic parent pointer - c3_l axe_l; // axis to parent - c3_l jax_l; // index in global dashboard + struct _u3j_harm* arm_u; // blank-terminated static list + struct _u3j_core* dev_u; // blank-terminated static list + struct _u3j_core* par_u; // dynamic parent pointer + c3_l axe_l; // axis to parent + c3_l jax_l; // index in global dashboard } u3j_core; /* u3e_dash, u3_Dash, u3D: jet dashboard singleton */ typedef struct _u3e_dash { u3j_core* dev_u; // null-terminated static list - c3_l len_l; // dynamic array length - c3_l all_l; // allocated length + c3_l len_l; // dynamic array length + c3_l all_l; // allocated length u3j_core* ray_u; // dynamic array by axis } u3j_dash; diff --git a/n/j.c b/n/j.c index f16366cb32..6d3416a8a1 100644 --- a/n/j.c +++ b/n/j.c @@ -726,10 +726,14 @@ _cj_hook_in(u3_noun cor, { u3_noun p_cax, q_cax, r_cax; u3_noun jax, pax, mop, huc, hap; + u3_noun p_mop, q_mop, r_mop; u3x_trel(cax, &p_cax, &q_cax, &r_cax); u3x_trel(p_cax, &jax, &pax, &hap); mop = q_cax; + u3x_trel(mop, &p_mop, &q_mop, &r_mop); + c3_assert(pax == q_mop); + huc = u3t(r_cax); { c3_l jax_l = jax; @@ -739,9 +743,9 @@ _cj_hook_in(u3_noun cor, if ( u3_none == fol ) { // The caller wants a deeper core. // - if ( 0 == pax ) { return u3m_bail(c3__fail); } + if ( 0 == q_mop ) { return u3m_bail(c3__fail); } else { - u3_noun inn = u3k(u3x_at(pax, cor)); + u3_noun inn = u3k(u3x_at(q_mop, cor)); u3z(cax); u3z(cor); return _cj_hook_in(inn, tam_c, jet_o);