--- ray/src/hd/rholo3.c 2003/04/23 00:52:33 3.35 +++ ray/src/hd/rholo3.c 2003/07/21 22:30:18 3.40 @@ -1,10 +1,12 @@ #ifndef lint -static const char RCSid[] = "$Id: rholo3.c,v 3.35 2003/04/23 00:52:33 greg Exp $"; +static const char RCSid[] = "$Id: rholo3.c,v 3.40 2003/07/21 22:30:18 schorsch Exp $"; #endif /* * Routines for tracking beam compuatations */ +#include + #include "rholo.h" #include "view.h" @@ -75,7 +77,7 @@ register PACKHEAD *b0, *b1; } -int +void dispbeam(b, hb) /* display a holodeck beam */ register BEAM *b; register HDBEAMI *hb; @@ -92,7 +94,7 @@ register HDBEAMI *hb; CHECK(p==NULL, SYSTEM, "out of memory in dispbeam"); } /* assign packet fields */ - bcopy((char *)hdbray(b), (char *)packra(p), b->nrm*sizeof(RAYVAL)); + memcpy((void *)packra(p), (void *)hdbray(b), b->nrm*sizeof(RAYVAL)); p->nr = p->nc = b->nrm; for (p->hd = 0; hdlist[p->hd] != hb->h; p->hd++) if (hdlist[p->hd] == NULL) @@ -118,9 +120,9 @@ int nents; /* search for common members */ for (csm = clist+nents; csm-- > clist; ) csm->nc = -1; - qsort((char *)clist, nents, sizeof(PACKHEAD), beamidcmp); + qsort((void *)clist, nents, sizeof(PACKHEAD), beamidcmp); for (i = 0; i < complen; i++) { - csm = (PACKHEAD *)bsearch((char *)(complist+i), (char *)clist, + csm = (PACKHEAD *)bsearch((void *)(complist+i), (void *)clist, nents, sizeof(PACKHEAD), beamidcmp); if (csm == NULL) continue; @@ -166,7 +168,7 @@ int nents; complist = (PACKHEAD *)malloc(nents*sizeof(PACKHEAD)); if (complist == NULL) goto memerr; - bcopy((char *)clist, (char *)complist, nents*sizeof(PACKHEAD)); + memcpy((void *)complist, (void *)clist, nents*sizeof(PACKHEAD)); break; case BS_ADD: /* add to computation set */ case BS_MAX: /* maximum of quantities */ @@ -174,7 +176,7 @@ int nents; if (nents <= 0) return; sortcomplist(); /* sort updated list & new entries */ - qsort((char *)clist, nents, sizeof(PACKHEAD), beamcmp); + qsort((void *)clist, nents, sizeof(PACKHEAD), beamcmp); /* what can't we satisfy? */ for (i = nents, csm = clist; i-- && csm->nr > csm->nc; csm++) ; @@ -260,7 +262,7 @@ int bi; ambient_list() /* compute ambient beam list */ { - int4 wtotal, minrt; + int32 wtotal, minrt; double frac; int i; register int j, k; @@ -308,7 +310,7 @@ FILE *fp; char *err; BEAMLIST blist; - copystruct(&curview, &stdview); + curview = stdview; while (nextview(&curview, fp) != EOF) { if ((err = setview(&curview)) != NULL) { error(WARNING, err); @@ -355,10 +357,10 @@ int n1, n2; else if (!n2) cmp = -1; else cmp = beamcmp(cl1, cl2); if (cmp > 0) { - copystruct(cdest, cl2); + *cdest = *cl2; cl2++; n2--; } else { - copystruct(cdest, cl1); + *cdest = *cl1; cl1++; n1--; } cdest++; @@ -387,12 +389,12 @@ sortcomplist() /* fix our list order */ #endif } if (lastin < 0 || listpos*4 >= complen*3) - qsort((char *)complist, complen, sizeof(PACKHEAD), beamcmp); + qsort((void *)complist, complen, sizeof(PACKHEAD), beamcmp); else if (listpos) { /* else sort and merge sublist */ list2 = (PACKHEAD *)malloc(listpos*sizeof(PACKHEAD)); CHECK(list2==NULL, SYSTEM, "out of memory in sortcomplist"); - bcopy((char *)complist,(char *)list2,listpos*sizeof(PACKHEAD)); - qsort((char *)list2, listpos, sizeof(PACKHEAD), beamcmp); + memcpy((void *)list2,(void *)complist,listpos*sizeof(PACKHEAD)); + qsort((void *)list2, listpos, sizeof(PACKHEAD), beamcmp); mergeclists(complist, list2, listpos, complist+listpos, complen-listpos); free((void *)list2);