Skip to content
Snippets Groups Projects
Commit 380d80b1 authored by Douglas Guptill's avatar Douglas Guptill
Browse files

playing in desperation

parent 081eb187
No related branches found
No related tags found
No related merge requests found
......@@ -3,8 +3,9 @@
static struct node
{ int key; struct node *next; };
static struct node *head, *z, *t;
stackinit() {stackinit_();}
stackinit_()
/* stackinit_() {stackinit();} */
stackinit()
{
head = (struct node *) malloc(sizeof *head);
z = (struct node *) malloc(sizeof *z);
......@@ -12,8 +13,9 @@
z->next = z;
z->key = 0;
}
push (p) int *p; {push_(p);}
push_(p)
/* push_(p) int *p; {push(p);} */
push(p)
int *p;
{
int v;
......@@ -22,23 +24,26 @@
t->key = v; t->next = head->next;
head->next =t;
}
pop (x) int *x; {pop_(x);}
pop_(x)
/* pop_(x) int *x; {pop(x);} */
pop(x)
int *x;
{
t = head->next; head->next = t->next;
*x = t->key;
free(t);
}
stackempty (i) int *i; {stackempty_(i);}
stackempty_(i)
/* stackempty_(i) int *i; {stackempty(i);} */
stackempty(i)
int *i;
{
*i = 0;
if(head->next == z) *i = 1;
}
stackflush () {stackflush_();}
stackflush_()
/* stackflush_() {stackflush();} */
stackflush()
{
free(head);
free(z);
......
......@@ -5,7 +5,7 @@
static struct node *heada, *za, *ta;
static struct node *headb, *zb, *tb;
stackpairinit_() {stackpairinit();}
/* stackpairinit_() {stackpairinit();} */
stackpairinit ()
{
heada = (struct node *) malloc(sizeof *heada);
......@@ -21,7 +21,7 @@
zb->key = 0;
}
stackpairflush_() {stackpairflush();}
/* stackpairflush_() {stackpairflush();} */
stackpairflush ()
{
free(heada);
......@@ -30,7 +30,7 @@
free(zb);
}
pushpair_(pa, pb) int *pa; int *pb; {pushpair(pa, pb);}
/* pushpair_(pa, pb) int *pa; int *pb; {pushpair(pa, pb);} */
pushpair (pa, pb)
int *pa;
int *pb;
......@@ -48,7 +48,7 @@
headb->next =tb;
}
poppair_(xa,xb) int *xa; int *xb; {poppair(xa,xb);}
/* poppair_(xa,xb) int *xa; int *xb; {poppair(xa,xb);} */
poppair (xa,xb)
int *xa;
int *xb;
......@@ -61,7 +61,7 @@
free(tb);
}
stackpairempty_(i) int *i; {stackpairempty(i);}
/* stackpairempty_(i) int *i; {stackpairempty(i);} */
stackpairempty (i)
int *i;
{
......
......@@ -1046,20 +1046,20 @@ return(v);
----------------------------------------------------------------*/
/* Not used...won't compile...function name and variable name identical */
/*
dvda_ (a,b,m,n,mmax,nmax,idim,dvda,code)
int *n, *m, *mmax, *nmax, *idim, *code;
float *a, *b;
float *dvda;
dvda_ (a,b,m,n,mmax,nmax,idim,result,code)
int *n, *m, *mmax, *nmax, *idim, *code;
float *a, *b;
float *result;
{
dvda(a,b,m,n,mmax,nmax,idim,dvda,code);
dvda(a,b,m,n,mmax,nmax,idim,result,code);
}
dvda (a,b,m,n,mmax,nmax,idim,dvda,code)
dvda (a,b,m,n,mmax,nmax,idim,result,code)
int *n, *m, *mmax, *nmax, *idim, *code;
float *a, *b;
float *dvda;
float *result;
{
......@@ -1070,11 +1070,11 @@ float *temp;
jval = 1;
tdim = *idim - 1;
*dvda=cdvda(a,b,m,n,mmax,nmax,&tdim,temp,&jval,code);
*result=cdvda(a,b,m,n,mmax,nmax,&tdim,temp,&jval,code);
free(temp);
}
*/
/*--------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment