@@ -548,10 +548,10 @@ int stringPM::load_agents(char *fn, char *fntab, int test, int verbose){
548548 l_spp *s;
549549
550550 // TODO: Should be passing 'code' into this, not 'lab'..
551- pag = make_ag (lab );// ,1);
551+ pag = make_ag (code );// ,1);
552552
553553 pag->S =(char *) malloc (maxl0*sizeof (char ));
554- pag-> label = code;
554+
555555 memset (pag->S ,0 ,maxl0*sizeof (char ));
556556
557557 if (strlen (label) > maxl0){
@@ -749,14 +749,12 @@ void stringPM::print_spp_count(FILE *fp,int style, int state){
749749
750750void stringPM::get_spp_count (int state){
751751
752- // char fn[128];
753- s_ag *pa;
754752 int nag,*done;
755753 int *spno, *spct, nspp = count_spp ();
756754
757755 nag = nagents (nowhead,-1 );
758756
759- l_spp *pA ;
757+ l_spp *pSpp ;
760758
761759 done = (int *) malloc (nag*sizeof (int ));
762760 memset (done,0 ,nag*sizeof (int ));
@@ -767,14 +765,14 @@ void stringPM::get_spp_count(int state){
767765 memset (spct,0 ,nspp*sizeof (int ));
768766
769767 // Set the spl->count param to zero
770- for (pA =spl->species ;pA !=NULL ;pA=pA ->next ){
771- pA ->count = 0 ;
768+ for (pSpp =spl->species ;pSpp !=NULL ;pSpp=pSpp ->next ){
769+ pSpp ->count = 0 ;
772770 }
773771
774772
775773 s_ag *p;
776774 for (p = nowhead;p!=NULL ;p=p->next ){
777- if (state==-1 || pa ->status == state){
775+ if (state==-1 || p ->status == state){
778776 p->spp ->count ++;
779777 }
780778 }
@@ -1006,7 +1004,7 @@ s_ag * stringPM::rand_ag(s_ag *head, int state){
10061004 * parameters:
10071005 *
10081006 * alab: a single-character label for the string (e.g. 'C')
1009- * randpos: unused ...
1007+ *
10101008 */
10111009s_ag * stringPM::make_ag (int alab){
10121010
@@ -2969,6 +2967,8 @@ int stringPM::load_comass(char *fn, int verbose){
29692967 mass = (int *) malloc (blosum->N * sizeof (int ));
29702968
29712969 if ((fp=fopen (fn," r" ))!=NULL ){
2970+
2971+ // todo: do something with the error...
29722972 finderr=read_param_int (fp," MASS" ,&massval,verbose);
29732973 fclose (fp);
29742974 // Load the massvalue into the mass table;
@@ -2985,11 +2985,8 @@ int stringPM::load_comass(char *fn, int verbose){
29852985
29862986
29872987int stringPM::set_mass (int *param){
2988- // int massval = 2000;
2989- FILE *fp;
2990- int finderr;
2988+
29912989 int i;
2992- int massval;
29932990
29942991 mass = (int *) malloc (blosum->N * sizeof (int ));
29952992
@@ -3329,8 +3326,8 @@ int stringPM::energetic_exec_step(s_ag *act, s_ag *pass){//pset *p,char *s1, swt
33293326
33303327
33313328
3332- return 1 ;
3333- // return finished;
3329+ // return 1;
3330+ return finished;
33343331}
33353332
33363333
@@ -3394,7 +3391,6 @@ int stringPM::energetic_testbind(s_ag *pag){
33943391
33953392void stringPM::energetic_make_next (){
33963393 s_ag *pag,*bag;
3397- s_bind bb;
33983394 int changed;
33993395 while (nowhead!=NULL ){
34003396
@@ -3404,7 +3400,6 @@ void stringPM::energetic_make_next(){
34043400
34053401 // extract any partner:
34063402 bag = NULL ;
3407- bb = pag->status ;
34083403 switch (pag->status ){
34093404 case B_UNBOUND:
34103405 break ;
@@ -4257,15 +4252,12 @@ int stringPM::Network_cleave(s_ag *act){
42574252
42584253
42594254
4260-
4255+ /* Used to calculate a network...needs work */
42614256int stringPM::Network_exec_step (s_ag *act, s_ag *pass){
42624257
42634258 int finished=0 ;
42644259 char *tmp; // Holds the modifier, where needed
4265- // s_ag *c;
4266- // int cpy;
42674260 int dac=0 ;
4268- int safe_append=1 ;
42694261
42704262 switch (*(act->i [act->it ])){
42714263
@@ -4377,7 +4369,6 @@ int stringPM::Network_exec_step(s_ag *act, s_ag *pass){
43774369 // unbind_ag(act);
43784370 // unbind_ag(pass);
43794371 finished = 1 ;
4380- safe_append=0 ; // extract_ag(&nowhead,p);
43814372 }
43824373 break ;
43834374
@@ -4405,8 +4396,7 @@ int stringPM::Network_exec_step(s_ag *act, s_ag *pass){
44054396// print_exec(stdout,act,pass);
44064397// #endif
44074398
4408- return 1 ;
4409- // return finished;
4399+ return finished;
44104400}
44114401
44124402void stringPM::get_spp_network (char *fn){
@@ -4592,7 +4582,7 @@ void stringPM::set_epochs(){
45924582int stringPM::share_agents (s_ag **hp){
45934583
45944584 s_ag *pa,**head,*tmp,*aa,*tmphead;
4595- int ntot=0 ,herect=0 ,therect=0 ,*pct,*nact ;
4585+ int ntot=0 ,herect=0 ,therect=0 ;
45964586 float rno;
45974587
45984588 tmphead = *hp;
@@ -4606,12 +4596,10 @@ int stringPM::share_agents(s_ag **hp){
46064596 if ((rno = rand0to1 ()) < 0.5 ){
46074597 head = hp;
46084598 therect++;
4609- nact = &therect;
46104599 }
46114600 else {
46124601 head = &nowhead;
46134602 herect++;
4614- nact = &herect;
46154603 }
46164604
46174605 // Move it and any partners.
@@ -4632,7 +4620,6 @@ int stringPM::share_agents(s_ag **hp){
46324620 }
46334621
46344622 if (aa){
4635- *pct++;
46364623 ntot++;
46374624 if (tmp==aa)
46384625 tmp=tmp->next ;
@@ -4764,7 +4751,7 @@ int stringPM::print_conf(FILE *fp){
47644751 USING /n/staff/sjh/current/ewSTRING/SMconfigs/instr_set1.mis
47654752*/
47664753 fprintf (fp," %%%%%%AUTOMATICALLY GENERATED Stringmol CONFIG FILE\n " );
4767- fprintf (fp," %%%%%%Generated at time: %d \n\n " ,extit);
4754+ fprintf (fp," %%%%%%Generated at time: %ld \n\n " ,extit);
47684755 fprintf (fp," %%%%%%CELL PARAMETERS\n " );
47694756 fprintf (fp," CELLRAD %d\n " ,(int ) cellrad);
47704757 fprintf (fp," AGRAD %d\n " ,(int ) agrad);
0 commit comments