From dff504f879b35be67d0de1145110911e83d236ed Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Fri, 12 Sep 2014 16:06:33 -0700 Subject: [PATCH] Jets? --- g/j.c | 17 +++++++++++++++-- g/m.c | 14 ++++++++++++++ g/n.c | 4 ++++ g/t.c | 2 -- v/main.c | 3 ++- 5 files changed, 35 insertions(+), 5 deletions(-) diff --git a/g/j.c b/g/j.c index 8202734cb..a21cdb12c 100644 --- a/g/j.c +++ b/g/j.c @@ -108,6 +108,8 @@ _cj_kick_a(u3_noun cor, u3_cs_hood* hud_u, c3_l axe_l) if ( 0 == ham_u->fun_f ) { return u3_none; } + // printf("kick_a: %s\n", ham_u->fcs_c); + return u3_none; // XX: support tot and ice flags, and validator // @@ -133,6 +135,8 @@ _cj_kick_b(u3_noun cor, c3_l jax_l, c3_l axe_l) u3_cs_core* cop_u = &u3D.ray_u[jax_l]; u3_cs_hood* hud_u = cop_u->hud_u; + printf("kick: %s\n", cop_u->cos_c); + while ( 1 ) { if ( 0 == hud_u ) { break; } if ( mug_l != hud_u->mug_l ) { hud_u = hud_u->nex_u; continue; } @@ -149,7 +153,9 @@ u3_cj_hook(u3_noun cor, { u3_noun bat = u3h(cor); c3_l jax_l = u3_cj_find(bat); - + + printf("hook: %s\n", tam_c); + if ( 0 == jax_l ) { return 0; } else { u3_cs_core* cop_u = &u3D.ray_u[jax_l]; @@ -223,6 +229,9 @@ _cj_axis(u3_noun fol) { u3_noun p_fol, q_fol, r_fol; + while ( u3_so(u3du(fol)) && (10 == u3h(fol)) ) + { fol = u3t(u3t(fol)); } + if ( u3_ne(u3_cr_trel(fol, &p_fol, &q_fol, &r_fol)) ) { if ( u3_ne(u3_cr_cell(fol, &p_fol, &q_fol)) || (0 != p_fol) || @@ -402,6 +411,10 @@ u3_cj_mine(u3_noun clu, printf("mine: chum: %s\n", nam_c); + while ( u3_so(u3du(q_clu)) && (10 == u3h(q_clu)) ) { + q_clu = u3t(u3t(q_clu)); + } + if ( u3_ne(u3du(q_clu)) ) { printf("mine: bad b\r\n"); u3z(clu); return cor; } @@ -410,7 +423,7 @@ u3_cj_mine(u3_noun clu, } else { if ( (0 != u3h(q_clu)) ) - { printf("mine: bad c\r\n"); u3z(clu); return cor; } + { printf("mine: bad c\r\n"); u3z(clu); return cor; c3_assert(0); } if ( u3_ne(u3_co_is_cat(axe_l = u3t(q_clu))) ) { printf("mine: bad d\r\n"); u3z(clu); return cor; } } diff --git a/g/m.c b/g/m.c index 90c15f083..2531f5b37 100644 --- a/g/m.c +++ b/g/m.c @@ -204,6 +204,18 @@ u3_cm_dump(void) } } +/* _cm_punt(): crudely print trace. +*/ +static void +_cm_punt(void) +{ + u3_noun xat; + + for ( xat = u3R->bug.tax; xat; xat = u3t(xat) ) { + u3_cm_p("&", u3h(xat)); + } +} + /* u3_cm_bail(): bail out. Does not return. ** ** Bail motes: @@ -228,6 +240,8 @@ u3_cm_bail(c3_m how_m) str_c[4] = 0; printf("bail: %s\n", str_c); + _cm_punt(); + assert(0); if ( c3__meme == how_m ) { u3_cm_dump(); diff --git a/g/n.c b/g/n.c index 5b3c72f61..ab64f1e7f 100644 --- a/g/n.c +++ b/g/n.c @@ -235,6 +235,10 @@ u3_cn_nock_on(u3_noun bus, u3_noun fol) u3_noun b_gal, c_gal; u3_cx_cell(gal, &b_gal, &c_gal); + if ( u3_ne(u3_co_is_cat(b_gal)) ) { + u3_cm_p("bad axe", fol); + } + { u3_noun seb = u3_cn_nock_on(bus, u3k(c_gal)); u3_noun pro = u3_cj_kick(seb, b_gal); diff --git a/g/t.c b/g/t.c index f0665af38..1fc41f75b 100644 --- a/g/t.c +++ b/g/t.c @@ -9,8 +9,6 @@ void u3_ct_push(u3_noun mon) { - u3_cm_p("push", mon); - u3R->bug.tax = u3nc(mon, u3R->bug.tax); } diff --git a/v/main.c b/v/main.c index f35443070..d683b1890 100644 --- a/v/main.c +++ b/v/main.c @@ -284,8 +284,9 @@ main(c3_i argc, { struct timeval tim_tv; u3_noun now; - c3_c pas_c[2048]; + c3_c pas_c[2049]; + // snprintf(pas_c, 2048, "%s/.urb/dummy.pill", u3_Host.cpu_c); snprintf(pas_c, 2048, "%s/.urb/urbit.pill", u3_Host.cpu_c); gettimeofday(&tim_tv, 0); now = u3_time_in_tv(&tim_tv);