From dd19b34bd0f06fbfc2aca500e83a2d51ac890247 Mon Sep 17 00:00:00 2001 From: Douglas Guptill <douglas.guptill@dal.ca> Date: Thu, 21 May 2009 20:15:56 +0000 Subject: [PATCH] Ooops --- NN/stackpair.c | 116 ++++++++++++++++++++++++------------------------ NN/stackpair.cc | 58 ------------------------ 2 files changed, 58 insertions(+), 116 deletions(-) delete mode 100644 NN/stackpair.cc diff --git a/NN/stackpair.c b/NN/stackpair.c index eb54959b..ad426822 100644 --- a/NN/stackpair.c +++ b/NN/stackpair.c @@ -1,58 +1,58 @@ - static struct node - { int key; struct node *next; }; - static struct node *heada, *za, *ta; - static struct node *headb, *zb, *tb; - stackpairinit_() - { - heada = (struct node *) malloc(sizeof *heada); - za = (struct node *) malloc(sizeof *za); - heada->next = za; heada->key=0; - za->next = za; - za->key = 0; - - headb = (struct node *) malloc(sizeof *headb); - zb = (struct node *) malloc(sizeof *zb); - headb->next = zb; headb->key=0; - zb->next = zb; - zb->key = 0; - } - stackpairflush_() - { - free(heada); - free(headb); - free(za); - free(zb); - } - pushpair_(pa, pb) - int *pa; - int *pb; - { - int va; - int vb; - va = *pa; - ta = (struct node *) malloc(sizeof *ta); - ta->key = va; ta->next = heada->next; - heada->next =ta; - - vb = *pb; - tb = (struct node *) malloc(sizeof *tb); - tb->key = vb; tb->next = headb->next; - headb->next =tb; - } - poppair_(xa,xb) - int *xa; - int *xb; - { - ta = heada->next; heada->next = ta->next; - *xa = ta->key; - free(ta); - tb = headb->next; headb->next = tb->next; - *xb = tb->key; - free(tb); - } - stackpairempty_(i) - int *i; - { - *i = 0; - if(heada->next == za) *i = 1; - } + static struct node + { int key; struct node *next; }; + static struct node *heada, *za, *ta; + static struct node *headb, *zb, *tb; + stackpairinit() + { + heada = (struct node *) malloc(sizeof *heada); + za = (struct node *) malloc(sizeof *za); + heada->next = za; heada->key=0; + za->next = za; + za->key = 0; + + headb = (struct node *) malloc(sizeof *headb); + zb = (struct node *) malloc(sizeof *zb); + headb->next = zb; headb->key=0; + zb->next = zb; + zb->key = 0; + } + stackpairflush() + { + free(heada); + free(headb); + free(za); + free(zb); + } + pushpair(pa, pb) + int *pa; + int *pb; + { + int va; + int vb; + va = *pa; + ta = (struct node *) malloc(sizeof *ta); + ta->key = va; ta->next = heada->next; + heada->next =ta; + + vb = *pb; + tb = (struct node *) malloc(sizeof *tb); + tb->key = vb; tb->next = headb->next; + headb->next =tb; + } + poppair(xa,xb) + int *xa; + int *xb; + { + ta = heada->next; heada->next = ta->next; + *xa = ta->key; + free(ta); + tb = headb->next; headb->next = tb->next; + *xb = tb->key; + free(tb); + } + stackpairempty(i) + int *i; + { + *i = 0; + if(heada->next == za) *i = 1; + } diff --git a/NN/stackpair.cc b/NN/stackpair.cc deleted file mode 100644 index ad426822..00000000 --- a/NN/stackpair.cc +++ /dev/null @@ -1,58 +0,0 @@ - static struct node - { int key; struct node *next; }; - static struct node *heada, *za, *ta; - static struct node *headb, *zb, *tb; - stackpairinit() - { - heada = (struct node *) malloc(sizeof *heada); - za = (struct node *) malloc(sizeof *za); - heada->next = za; heada->key=0; - za->next = za; - za->key = 0; - - headb = (struct node *) malloc(sizeof *headb); - zb = (struct node *) malloc(sizeof *zb); - headb->next = zb; headb->key=0; - zb->next = zb; - zb->key = 0; - } - stackpairflush() - { - free(heada); - free(headb); - free(za); - free(zb); - } - pushpair(pa, pb) - int *pa; - int *pb; - { - int va; - int vb; - va = *pa; - ta = (struct node *) malloc(sizeof *ta); - ta->key = va; ta->next = heada->next; - heada->next =ta; - - vb = *pb; - tb = (struct node *) malloc(sizeof *tb); - tb->key = vb; tb->next = headb->next; - headb->next =tb; - } - poppair(xa,xb) - int *xa; - int *xb; - { - ta = heada->next; heada->next = ta->next; - *xa = ta->key; - free(ta); - tb = headb->next; headb->next = tb->next; - *xb = tb->key; - free(tb); - } - stackpairempty(i) - int *i; - { - *i = 0; - if(heada->next == za) *i = 1; - } -- GitLab