This commit is contained in:
C. Guy Yarvin 2014-09-12 16:06:33 -07:00
parent a04b915cd7
commit dff504f879
5 changed files with 35 additions and 5 deletions

15
g/j.c
View File

@ -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 ) { if ( 0 == ham_u->fun_f ) {
return u3_none; return u3_none;
} }
// printf("kick_a: %s\n", ham_u->fcs_c);
return u3_none;
// XX: support tot and ice flags, and validator // 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_core* cop_u = &u3D.ray_u[jax_l];
u3_cs_hood* hud_u = cop_u->hud_u; u3_cs_hood* hud_u = cop_u->hud_u;
printf("kick: %s\n", cop_u->cos_c);
while ( 1 ) { while ( 1 ) {
if ( 0 == hud_u ) { break; } if ( 0 == hud_u ) { break; }
if ( mug_l != hud_u->mug_l ) { hud_u = hud_u->nex_u; continue; } if ( mug_l != hud_u->mug_l ) { hud_u = hud_u->nex_u; continue; }
@ -150,6 +154,8 @@ u3_cj_hook(u3_noun cor,
u3_noun bat = u3h(cor); u3_noun bat = u3h(cor);
c3_l jax_l = u3_cj_find(bat); c3_l jax_l = u3_cj_find(bat);
printf("hook: %s\n", tam_c);
if ( 0 == jax_l ) { return 0; } if ( 0 == jax_l ) { return 0; }
else { else {
u3_cs_core* cop_u = &u3D.ray_u[jax_l]; 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; 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_trel(fol, &p_fol, &q_fol, &r_fol)) ) {
if ( u3_ne(u3_cr_cell(fol, &p_fol, &q_fol)) || if ( u3_ne(u3_cr_cell(fol, &p_fol, &q_fol)) ||
(0 != p_fol) || (0 != p_fol) ||
@ -402,6 +411,10 @@ u3_cj_mine(u3_noun clu,
printf("mine: chum: %s\n", nam_c); 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)) ) if ( u3_ne(u3du(q_clu)) )
{ printf("mine: bad b\r\n"); u3z(clu); return cor; } { printf("mine: bad b\r\n"); u3z(clu); return cor; }
@ -410,7 +423,7 @@ u3_cj_mine(u3_noun clu,
} }
else { else {
if ( (0 != u3h(q_clu)) ) 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))) ) if ( u3_ne(u3_co_is_cat(axe_l = u3t(q_clu))) )
{ printf("mine: bad d\r\n"); u3z(clu); return cor; } { printf("mine: bad d\r\n"); u3z(clu); return cor; }
} }

14
g/m.c
View File

@ -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. /* u3_cm_bail(): bail out. Does not return.
** **
** Bail motes: ** Bail motes:
@ -228,6 +240,8 @@ u3_cm_bail(c3_m how_m)
str_c[4] = 0; str_c[4] = 0;
printf("bail: %s\n", str_c); printf("bail: %s\n", str_c);
_cm_punt();
assert(0); assert(0);
if ( c3__meme == how_m ) { if ( c3__meme == how_m ) {
u3_cm_dump(); u3_cm_dump();

4
g/n.c
View File

@ -235,6 +235,10 @@ u3_cn_nock_on(u3_noun bus, u3_noun fol)
u3_noun b_gal, c_gal; u3_noun b_gal, c_gal;
u3_cx_cell(gal, &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 seb = u3_cn_nock_on(bus, u3k(c_gal));
u3_noun pro = u3_cj_kick(seb, b_gal); u3_noun pro = u3_cj_kick(seb, b_gal);

2
g/t.c
View File

@ -9,8 +9,6 @@
void void
u3_ct_push(u3_noun mon) u3_ct_push(u3_noun mon)
{ {
u3_cm_p("push", mon);
u3R->bug.tax = u3nc(mon, u3R->bug.tax); u3R->bug.tax = u3nc(mon, u3R->bug.tax);
} }

View File

@ -284,8 +284,9 @@ main(c3_i argc,
{ {
struct timeval tim_tv; struct timeval tim_tv;
u3_noun now; 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); snprintf(pas_c, 2048, "%s/.urb/urbit.pill", u3_Host.cpu_c);
gettimeofday(&tim_tv, 0); gettimeofday(&tim_tv, 0);
now = u3_time_in_tv(&tim_tv); now = u3_time_in_tv(&tim_tv);