diff --git a/us_somo/develop/src/us_hydrodyn_asab1.cpp b/us_somo/develop/src/us_hydrodyn_asab1.cpp index 016311c4b..8b07cac59 100644 --- a/us_somo/develop/src/us_hydrodyn_asab1.cpp +++ b/us_somo/develop/src/us_hydrodyn_asab1.cpp @@ -434,7 +434,7 @@ us_hydrodyn_asab1_main(vector use_active_atoms, { printf("\n\n- Insert the ASA threshold level in Angstroms^2 [usually 10] : "); - if ( scanf("%f", &asalevel) ) {}; + if ( 1 == scanf("%f", &asalevel) ) {}; // em("s1"); initarray(); // em("s2"); @@ -458,7 +458,7 @@ us_hydrodyn_asab1_main(vector use_active_atoms, while (min_asa < 0.0) { printf("\n\nASA RE-CHECK - Insert the minimum ASA %% threshold level [0-99] : "); - if ( scanf("%f", &min_asa) ) {}; + if ( 1 == scanf("%f", &min_asa) ) {}; if ((min_asa < 0.0) | (min_asa > 99.0)) min_asa = (float) -1.0; } @@ -1661,24 +1661,24 @@ init() init1_mol = us_fopen("test", "r"); init1_mol1 = us_fopen("provaly2", "r"); - if ( fscanf(init1_mol, "%d", &nat) ) {}; - if ( fscanf(init1_mol, "%f", &raggio) ) {}; - if ( fscanf(init1_mol, "%s", ragcol) ) {}; + if ( 1 == fscanf(init1_mol, "%d", &nat) ) {}; + if ( 1 == fscanf(init1_mol, "%f", &raggio) ) {}; + if ( 1 == fscanf(init1_mol, "%s", ragcol) ) {}; init1_rmc = us_fopen(ragcol, "r"); /* opening the file containing the radii, masses and colors */ for (i = 0; i < nat; i++) { - if ( fscanf(init1_mol, "%f", &(dt[i].x)) ) {}; - if ( fscanf(init1_mol, "%f", &(dt[i].y)) ) {}; - if ( fscanf(init1_mol, "%f", &(dt[i].z)) ) {}; - if ( fscanf(init1_rmc, "%f", &(dt[i].r)) ) {}; - if ( fscanf(init1_rmc, "%d", &(dt[i].m)) ) {}; - if ( fscanf(init1_rmc, "%d", &(dt[i].col)) ) {}; + if ( 1 == fscanf(init1_mol, "%f", &(dt[i].x)) ) {}; + if ( 1 == fscanf(init1_mol, "%f", &(dt[i].y)) ) {}; + if ( 1 == fscanf(init1_mol, "%f", &(dt[i].z)) ) {}; + if ( 1 == fscanf(init1_rmc, "%f", &(dt[i].r)) ) {}; + if ( 1 == fscanf(init1_rmc, "%d", &(dt[i].m)) ) {}; + if ( 1 == fscanf(init1_rmc, "%d", &(dt[i].col)) ) {}; //fscanf(init1_mol1, "%s", &(dt[i].elm)); //fscanf(init1_mol1, "%s", &(dt[i].amin)); - if ( fscanf(init1_mol1, "%4c", &(dt[i].elm[0])) ) {}; - if ( fscanf(init1_mol1, "%4c", &(dt[i].amin[0])) ) {}; + if ( 1 == fscanf(init1_mol1, "%4c", &(dt[i].elm[0])) ) {}; + if ( 1 == fscanf(init1_mol1, "%4c", &(dt[i].amin[0])) ) {}; } fclose(init1_mol); @@ -1975,7 +1975,7 @@ initarray() // em("i3_6"); for (i = 0; i < 56; i++) { - if ( fscanf(init3_pippa, "%d", &nat) ) {}; + if ( 1 == fscanf(init3_pippa, "%d", &nat) ) {}; arr1[i] = (float) nat; } fclose(init3_pippa); @@ -1998,13 +1998,13 @@ initarray() { pulisci(); printf("\n\n\tInsert the PDB filename : "); - if ( scanf("%s", nome) ) {}; + if ( 1 == scanf("%s", nome) ) {}; init3_brook = us_fopen(nome, "r"); } printf("\n\n\t%s", "Output files: Enter '0' for default (provaly, provaly1, provaly2, asaris)"); printf("\n\t%s", " '1' for new filenames\n\n\t\t\t-->"); - if ( scanf("%d", &fe2) ) {}; + if ( 1 == scanf("%d", &fe2) ) {}; getchar(); if (fe2 == 0) { @@ -2039,7 +2039,7 @@ initarray() { a10: printf("\n\t** Insert the root output filename :___ "); - if ( scanf("%s", outfile) ) {}; + if ( 1 == scanf("%s", outfile) ) {}; getchar(); strcpy(outris, outfile); @@ -2082,7 +2082,7 @@ initarray() printf("\t 1) Overwrite existing file(s)\n"); printf("\t 2) Create new files\n\n"); printf("\t** Select (1/2) :___ "); - if ( scanf("%d", &fe3) ) {}; + if ( 1 == scanf("%d", &fe3) ) {}; getchar(); fclose(new_mol); fclose(new_mol1); @@ -2103,12 +2103,12 @@ initarray() } a50: - if ( fscanf(init3_brook, "%6s", arr_temp) ) {}; + if ( 1 == fscanf(init3_brook, "%6s", arr_temp) ) {}; if (strcmp(arr_temp, "END") == 0) goto a200; /* printf("\n%s\t%s\n","pluto arr_temp",arr_temp); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); */ if ((strncmp(arr_temp, "ATOM", 6) == 0) || (strncmp(arr_temp, "HETATM", 6) == 0)) @@ -2119,7 +2119,7 @@ initarray() a150: /* printf("\n%s\t%s\n","pluto arr_temp",arr_temp); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); */ if (strncmp(arr_temp, "ATOM", 6) == 0) flagr1 = 0; @@ -2136,7 +2136,7 @@ initarray() } /* printf("\n%s\n","qui arrivo"); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); */ if (strcmp(arr_temp, "END") == 0) @@ -2165,7 +2165,7 @@ readline(int ind) dd += ind; for (j = 0; j < 24; j++) { - if ( fscanf(init3_brook, "%c", &(stringa[j])) ) {}; + if ( 1 == fscanf(init3_brook, "%c", &(stringa[j])) ) {}; } nat++; @@ -2173,7 +2173,7 @@ readline(int ind) if ( sscanf(stringa + 7, "%s", dd->elm) ) {}; /* printf("\n%s\t%s\n","dd->elm ",dd->elm); printf("\n%s\t%d\n","flagr1 atom",flagr1); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); */ if (flagr1 != 1) @@ -2181,7 +2181,7 @@ readline(int ind) if ( sscanf(stringa + 12, "%s", dd->amin) ) {}; /* printf("\n%s\t%s\n","dd->amin ",dd->amin); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); */ dd->descr[9] = 0; @@ -2197,7 +2197,7 @@ readline(int ind) { if ( sscanf(stringa + 11, "%s", dd->amin) ) {}; /* printf("\n%s\t%s\n","carb dd->amin ",dd->amin); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); */ dd->descr[9] = 0; @@ -2208,14 +2208,14 @@ readline(int ind) stringa[11 + j] = '_'; dd->descr[j] = stringa[11 + j]; /* printf("\n%s\t%s\n","carb dd->desc ",dd->descr); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); */ } } - if ( fscanf(init3_brook, "%f", &(dd->x)) ) {}; - if ( fscanf(init3_brook, "%f", &(dd->y)) ) {}; - if ( fscanf(init3_brook, "%f", &(dd->z)) ) {}; + if ( 1 == fscanf(init3_brook, "%f", &(dd->x)) ) {}; + if ( 1 == fscanf(init3_brook, "%f", &(dd->y)) ) {}; + if ( 1 == fscanf(init3_brook, "%f", &(dd->z)) ) {}; /* printf("\n%s\t%f\n","dd->x ",dd->x); printf("\n%s\t%f\n","dd->y ",dd->y); @@ -2230,22 +2230,22 @@ readline(int ind) /* printf("\n%s\t%s\n","dd->elm ",dd->elm); printf("\n%s\t%f\n","dd->r ",dd->r); printf("\n%s\t%d\n","dd->m ",dd->m); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); */ - if ( fscanf(init3_brook, "%[^\n]%*c", arr_temp) ) {}; + if ( 1 == fscanf(init3_brook, "%[^\n]%*c", arr_temp) ) {}; ind++; corr = ind; /* printf("\n%s\t%d\n","corr= ",corr); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); */ - if ( fscanf(init3_brook, "%6s", arr_temp) ) {}; + if ( 1 == fscanf(init3_brook, "%6s", arr_temp) ) {}; /* printf("\n%s\t%s\n","zeppo arr_temp",arr_temp); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); */ /* if(strcmp(arr_temp,"ATOM")==0) */ if ((strncmp(arr_temp, "ATOM", 6) == 0) || (strncmp(arr_temp, "HETATM", 6) == 0)) @@ -2272,18 +2272,18 @@ readline(int ind) dd+=ind; for(j=0;j<26;j++) { - if ( fscanf(init3_brook,"%c",&(stringa[j])) ) {}; + if ( 1 == fscanf(init3_brook,"%c",&(stringa[j])) ) {}; } nat++; if ( sscanf(stringa+7,"%s",dd->elm) ) {}; printf("\n%s\t%s\n","carb dd->elm ",dd->elm); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); if ( sscanf(stringa+11,"%s",dd->amin); ) {}; printf("\n%s\t%s\n","carb dd->amin ",dd->amin); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); dd->descr[9]=0; @@ -2294,13 +2294,13 @@ readline(int ind) stringa[11+j]='_'; dd->descr[j]=stringa[11+j]; printf("\n%s\t%s\n","carb dd->desc ",dd->descr); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); } - if ( fscanf(init3_brook,"%f",&(dd->x)); ) {}; - if ( fscanf(init3_brook,"%f",&(dd->y)); ) {}; - if ( fscanf(init3_brook,"%f",&(dd->z)); ) {}; + if ( 1 == fscanf(init3_brook,"%f",&(dd->x)); ) {}; + if ( 1 == fscanf(init3_brook,"%f",&(dd->y)); ) {}; + if ( 1 == fscanf(init3_brook,"%f",&(dd->z)); ) {}; printf("\n%s\t%f\n","carb dd->x ",dd->x); printf("\n%s\t%f\n","carb dd->y ",dd->y); printf("\n%s\t%f\n","carb dd->z ",dd->z); @@ -2313,12 +2313,12 @@ readline(int ind) printf("%s\t%f\n",dd->elm,flrad); - if ( fscanf(init3_brook,"%[^\n]%*c",arr_temp) ) {}; + if ( 1 == fscanf(init3_brook,"%[^\n]%*c",arr_temp) ) {}; ind++; corr=ind; - if ( fscanf(init3_brook,"%6s",arr_temp); ) {}; + if ( 1 == fscanf(init3_brook,"%6s",arr_temp); ) {}; if(strncmp(arr_temp,"HETATM", 6)==0) sim=1; @@ -3011,12 +3011,12 @@ assignrad(int xx) else if (strcmp(dd->amin, "ARG") == 0) /* N3H1 */ { /* printf("qui arrivo arg"); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); */ flrad = (float) 1.64; dd->m = 15; /* printf("qui arrivo arg flrad= %f\n",flrad); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); */ } } @@ -3098,7 +3098,7 @@ assigntab(int xx) dd += xx; /* printf("rbulk= %d\trprobe= %f\n",rbulk,rprobe); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); */ if (rbulk == 0) @@ -3517,15 +3517,15 @@ assigntab(int xx) } /* printf("%s%s\t%s%f\n","dd->amin= ",dd->amin,"dd->tab= ",dd->tab); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); break; printf("%s%s\t%s%f\n","dd->amin= ",dd->amin,"dd->tab= ",dd->tab); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); */ } /* printf("%s%s\t%s%f\n","dd->amin= ",dd->amin,"dd->tab= ",dd->tab); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); */ } @@ -3608,19 +3608,19 @@ ordcol() ordcol_ord = us_fopen("plotter", "rb"); ord1 = us_fopen("plotter1", "ab"); - if ( fscanf(ordcol_ord, "%s", key) ) {}; + if ( 1 == fscanf(ordcol_ord, "%s", key) ) {}; fprintf(ord1, "%s%c", key, ' '); if (form1 == 0) { - if ( fscanf(ordcol_ord, "%s", key) ) {}; + if ( 1 == fscanf(ordcol_ord, "%s", key) ) {}; fprintf(ord1, "%s\n", key); } for (i = 1; i < 9; i++) { rewind(ordcol_ord); - if ( fscanf(ordcol_ord, "%s", key) ) {}; + if ( 1 == fscanf(ordcol_ord, "%s", key) ) {}; sp[0] = 'S'; sp[1] = 'P'; @@ -3655,13 +3655,13 @@ ordcol() while (conf(key, fine, 3) == 0) { while ((conf(key, sp, 3) == 0) && (conf(key, fine, 3) == 0)) { - if ( fscanf(ordcol_ord, "%s", key) ) {}; + if ( 1 == fscanf(ordcol_ord, "%s", key) ) {}; } if (conf(key, fine, 3) == 0) { fprintf(ord1, "%s\n", key); - if ( fscanf(ordcol_ord, "%s", key) ) {}; + if ( 1 == fscanf(ordcol_ord, "%s", key) ) {}; } } } @@ -3887,7 +3887,7 @@ formato() printf("\n"); printf("Wrong number!\n"); printf("Re-insert the step: "); - if ( scanf("%f", &passo) ) {}; + if ( 1 == scanf("%f", &passo) ) {}; } #if defined( DEBUG_ASA ) diff --git a/us_somo/develop/src/us_hydrodyn_supc.cpp b/us_somo/develop/src/us_hydrodyn_supc.cpp index e33b39f8e..f3565daa5 100644 --- a/us_somo/develop/src/us_hydrodyn_supc.cpp +++ b/us_somo/develop/src/us_hydrodyn_supc.cpp @@ -624,7 +624,7 @@ Gets_date(char *day, char *month, int *year, int *numday, char *hour) timer = time(NULL); tblock = localtime(&timer); strcpy(tempo, asctime(tblock)); - sscanf(tempo, "%s %s %d %s %s\n", day, month, numday, hour, anno); + if ( 5 == sscanf(tempo, "%s %s %d %s %s\n", day, month, numday, hour, anno) ) {}; /* annov=strtol(anno,NULL,0); */ anno[0] = anno[2]; anno[1] = anno[3]; @@ -988,7 +988,7 @@ us_hydrodyn_supc_main(hydro_results *hydro_results, intestazione(); printf("\n\n** Compiled for %d beads **\n\n", nmax); printf("\n\n\n** Insert number of models to analyze (max=100) :___ "); - scanf("%d", &num); + if ( 1 == scanf("%d", &num) ){}; getchar(); } @@ -997,14 +997,14 @@ us_hydrodyn_supc_main(hydro_results *hydro_results, printf("\n - Sequential files?\n"); printf(" 1) Yes\n 2) No\n\n"); printf(" Your choice ? (1/2) :__ "); - scanf("%d", &cdmolix); + if ( 1 == scanf("%d", &cdmolix) ){}; if (cdmolix == 1) { printf("\n-Enter filename prefix "); - scanf("%s", fil001); + if ( 1 == scanf("%s", fil001) ){}; getchar(); printf("\n-Enter first file number "); - scanf("%d", &num001); + if ( 1 == scanf("%d", &num001) ){}; numor = 1; } r1 = 'y'; @@ -1051,7 +1051,7 @@ us_hydrodyn_supc_main(hydro_results *hydro_results, intestazione(); printf("\n\n\n** Number of models to analyze:___ %d", num); printf("\n** Do you want the results printed to a file ? (y/n) :___ "); - scanf("%s", &r1); + if ( 1 == scanf("%s", &r1) ){}; getchar(); } } @@ -1061,7 +1061,7 @@ us_hydrodyn_supc_main(hydro_results *hydro_results, a50: flag_mem = 1; printf("\n** Insert the name of results' file :___ "); - scanf("%s", risultati); + if ( 1 == scanf("%s", risultati) ){}; getchar(); } @@ -1077,7 +1077,7 @@ us_hydrodyn_supc_main(hydro_results *hydro_results, printf(" 2) Overwrite existing file\n"); printf(" 3) Create new file\n\n"); printf("** Select (1/2/3) :___ "); - scanf("%d", &fe); + if ( 1 == scanf("%d", &fe) ){}; getchar(); fclose(new_mol); if (fe == 2) @@ -1091,7 +1091,7 @@ us_hydrodyn_supc_main(hydro_results *hydro_results, { goto a50; /* printf("** Insert the name of results file :___ "); - scanf("%s",risultati); + if ( 1 == scanf("%s",risultati) ){}; getchar(); */ } } @@ -1107,7 +1107,7 @@ us_hydrodyn_supc_main(hydro_results *hydro_results, printf("- - ) angstroms => nanometers [ Conversion factor = 0.1 ]\n\n"); printf("\n** Insert the conversion factor :___ "); - scanf("%f", &fconv); + if ( 1 == scanf("%f", &fconv) ){}; fconv1 = 1.0 / fconv; while ((cd != 1) && (cd != 2)) @@ -1116,7 +1116,7 @@ us_hydrodyn_supc_main(hydro_results *hydro_results, printf("\n- Reference System :\n\n"); printf(" 1) Cartesian Origin \n 2) Diffusion Center\n\n"); printf(" Select (1/2) :___ "); - scanf("%d", &cd); + if ( 1 == scanf("%d", &cd) ){}; getchar(); } @@ -1127,7 +1127,7 @@ us_hydrodyn_supc_main(hydro_results *hydro_results, printf(" 1) STICK boundary condition (6*M_PI*ETAo)\n"); printf(" 2) SLIP boundary condition (4*M_PI*ETAo)\n\n"); printf(" Select (1/2) :___ "); - scanf("%d", &cc); + if ( 1 == scanf("%d", &cc) ){}; getchar(); } @@ -1138,14 +1138,14 @@ us_hydrodyn_supc_main(hydro_results *hydro_results, printf(" 1) Automatic (Total volume of the beads)\n"); printf(" 2) Manual (From keyboard)\n\n"); printf(" Select (1/2) :___ "); - scanf("%d", &volcor); + if ( 1 == scanf("%d", &volcor) ){}; getchar(); } if (volcor == 2) { printf("\n\n\n- Insert value of the volume : "); - scanf("%f", &volcor1); + if ( 1 == scanf("%f", &volcor1) ){}; } while ((mascor != 1) && (mascor != 2)) @@ -1155,14 +1155,14 @@ us_hydrodyn_supc_main(hydro_results *hydro_results, printf(" 1) Automatic (Masses from file) \n"); printf(" 2) Manual (Total Mass from Keyboard)\n\n"); printf(" Select (1/2) :___ "); - scanf("%d", &mascor); + if ( 1 == scanf("%d", &mascor) ){}; getchar(); } if (mascor == 2) { printf("\n\n\n- Insert value of mass : "); - scanf("%f", &mascor1); + if ( 1 == scanf("%f", &mascor1) ){}; } while ((sfecalc != 1) && (sfecalc != 2)) @@ -1172,7 +1172,7 @@ us_hydrodyn_supc_main(hydro_results *hydro_results, printf(" 1) ALL beads\n"); printf(" 2) Color Code Selection (Beads Color Coded \"6\" will be excluded)\n\n"); printf(" Select (1/2) :___ "); - scanf("%d", &sfecalc); + if ( 1 == scanf("%d", &sfecalc) ){}; getchar(); if ((sfecalc == 2) && (volcor == 1)) { @@ -1186,7 +1186,7 @@ us_hydrodyn_supc_main(hydro_results *hydro_results, printf(" 2) The intrinsic viscosity correction only\n"); printf(" 3) Both corrections\n\n"); printf(" Select (0/1/2/3) :___ "); - scanf("%d", &colorsixf); + if ( 1 == scanf("%d", &colorsixf) ){}; getchar(); } @@ -1339,10 +1339,10 @@ us_hydrodyn_supc_main(hydro_results *hydro_results, printf("\n"); printf("The Model(s) do not exist!!!\n"); printf("Insert the models' correct prefix :___"); - if ( scanf("%s", molecola) ){}; + if ( 1 == scanf("%s", molecola) ){}; mol = us_fopen(molecola, "r"); } - if ( fscanf(mol, "%d", &nat) ) {}; + if ( 1 == fscanf(mol, "%d", &nat) ) {}; fclose(mol); if (k == 0) { @@ -1351,7 +1351,7 @@ us_hydrodyn_supc_main(hydro_results *hydro_results, while ((prima < 0) || (prima > (nat - 1))) { printf("%s", "** Insert FIRST BEAD # to be included:___"); - if ( scanf("%d", &prima) ) {}; + if ( 1 == scanf("%d", &prima) ) {}; getchar(); printf("\n"); } @@ -1359,7 +1359,7 @@ us_hydrodyn_supc_main(hydro_results *hydro_results, while ((ultima < prima) || (ultima > nat)) { printf("%s", "** Insert LAST BEAD # to be included:___"); - if ( scanf("%d", &ultima) ) {}; + if ( 1 == scanf("%d", &ultima) ) {}; getchar(); printf("\n"); } @@ -1395,7 +1395,7 @@ us_hydrodyn_supc_main(hydro_results *hydro_results, { printf("\n** Insert file name of the model to be analyzed :___ "); } - if ( scanf("%s", molecola) ) {}; + if ( 1 == scanf("%s", molecola) ) {}; getchar(); init_da_a(); @@ -1477,7 +1477,7 @@ us_hydrodyn_supc_main(hydro_results *hydro_results, } #if defined(CREATE_TOT_MOL) - if ( fscanf(tot_mol, "%f", &raflag) ) {}; + if ( 1 == fscanf(tot_mol, "%f", &raflag) ) {}; #else raflag = raggio_v[k]; #endif @@ -2150,7 +2150,7 @@ us_hydrodyn_supc_main(hydro_results *hydro_results, printf(" Select (0/1) : "); } - if ( scanf("%d", &scelta) ) {}; + if ( 1 == scanf("%d", &scelta) ) {}; getchar(); if (scelta == 1) @@ -2300,7 +2300,7 @@ vedimatrici() printf("\n 0) Back\n"); printf("\n Select(0/8) : "); - if ( scanf("%d", &mtt) ) {}; + if ( 1 == scanf("%d", &mtt) ) {}; getchar(); switch (mtt) @@ -4169,15 +4169,15 @@ out_inter() interout = us_fopen("ofraxon", "r"); - if ( fscanf(interout, "%d", &n) ) {}; - if ( fscanf(interout, "%f", &raggio) ) {}; - if ( fscanf(interout, "%s", ramaco) ) {}; + if ( 1 == fscanf(interout, "%d", &n) ) {}; + if ( 1 == fscanf(interout, "%f", &raggio) ) {}; + if ( 1 == fscanf(interout, "%s", ramaco) ) {}; for (i = 0; i < n; i++) { - if ( fscanf(interout, "%f", &dtn[i].x) ) {}; - if ( fscanf(interout, "%f", &dtn[i].y) ) {}; - if ( fscanf(interout, "%f", &dtn[i].z) ) {}; + if ( 1 == fscanf(interout, "%f", &dtn[i].x) ) {}; + if ( 1 == fscanf(interout, "%f", &dtn[i].y) ) {}; + if ( 1 == fscanf(interout, "%f", &dtn[i].z) ) {}; } #if defined(DEBUG_WW) @@ -4206,7 +4206,7 @@ mem_mol() char risp1, risp2, risp3; a100: printf("\n\n** Insert file name for coordinates :___ "); - if ( scanf("%s", nmolecola) ) {}; + if ( 1 == scanf("%s", nmolecola) ) {}; getchar(); new_mol1 = us_fopen(nmolecola, "r"); @@ -4216,7 +4216,7 @@ mem_mol() printf("\n"); printf("*** CAUTION : File already exists ! ***\n"); printf("** Do you want change the file name ? (y/n) :___ "); - if ( scanf("%s", &risp2) ) {}; + if ( 1 == scanf("%s", &risp2) ) {}; getchar(); fclose(new_mol1); if ((risp2 == 'y') || (risp2 == 'Y')) @@ -4226,7 +4226,7 @@ mem_mol() if (nat == numero_sfere) { printf("** Same File Name r_m_c ? (y/n) :___ "); - if ( scanf("%s", &risp1) ) {}; + if ( 1 == scanf("%s", &risp1) ) {}; getchar(); } @@ -4237,7 +4237,7 @@ mem_mol() { a150: printf("** Insert file name r_m_c :___ "); - if ( scanf("%s", nragcol) ) {}; + if ( 1 == scanf("%s", nragcol) ) {}; getchar(); new_mol1 = us_fopen(nragcol, "r"); @@ -4246,7 +4246,7 @@ mem_mol() printf("\n"); printf("*** CAUTION : File already exists ! ***\n"); printf("** Do you want change the file name ? (y/n) :___ "); - if ( scanf("%s", &risp3) ) {}; + if ( 1 == scanf("%s", &risp3) ) {}; getchar(); fclose(new_mol1); if ((risp3 == 'y') || (risp3 == 'Y')) @@ -4257,9 +4257,9 @@ mem_mol() else { mol = us_fopen(molecola, "r"); - if ( fscanf(mol, "%d", &n) ) {}; - if ( fscanf(mol, "%f", &raggio) ) {}; - if ( fscanf(mol, "%s", nragcol) ) {}; + if ( 1 == fscanf(mol, "%d", &n) ) {}; + if ( 1 == fscanf(mol, "%f", &raggio) ) {}; + if ( 1 == fscanf(mol, "%s", nragcol) ) {}; fclose(mol); raflag = raggio; // ?? == } @@ -4796,7 +4796,7 @@ relax_rigid_calc() #endif /* printf("\nValori ddr[0] ddr[1] ddr[2] : %Lf\t%Lf\t%Lf\n",ddr[0],ddr[1],ddr[2]); - if ( scanf("%s",&pluto1) ) {}; + if ( 1 == scanf("%s",&pluto1) ) {}; getchar(); */ for (a = 0; a < 3; a++) @@ -4818,7 +4818,7 @@ relax_rigid_calc() a = (int) 2.0; /* printf("\nCaso 1, valore a= %d\n",a); - if ( scanf("%s",&pluto1) ) {}; + if ( 1 == scanf("%s",&pluto1) ) {}; getchar(); */ } @@ -4834,7 +4834,7 @@ relax_rigid_calc() a = (int) 2.0; /* printf("\nCaso 2, valore a= %d\n",a); - if ( scanf("%s",&pluto1) ) {}; + if ( 1 == scanf("%s",&pluto1) ) {}; getchar(); */ } @@ -4850,7 +4850,7 @@ relax_rigid_calc() a = (int) 2.0; /* printf("\nCaso 3, valore a= %d\n",a); - if ( scanf("%s",&pluto1) ) {}; + if ( 1 == scanf("%s",&pluto1) ) {}; getchar(); */ } @@ -4892,7 +4892,7 @@ relax_rigid_calc() { /* printf("\nCaso 4, valore a= %d\n",a); - if ( scanf("%s",&pluto1) ) {}; + if ( 1 == scanf("%s",&pluto1) ) {}; getchar(); */ ddd[0] = ddr[0]; @@ -4975,7 +4975,7 @@ relax_rigid_calc() /* printf("\n%s%d%s%f\n","Tao[",a,"] = ",tao[a]); */ tao[a] = 1.0 / tao[a]; /* printf("\n%s%d%s%Lg\n","Tao[",a,"] = ",tao[a]); - if ( scanf("%s",&pluto1) ) {}; + if ( 1 == scanf("%s",&pluto1) ) {}; getchar(); */ } @@ -5198,12 +5198,12 @@ init_da_a() printf("\n"); printf("** The Model does NOT exist !!\n"); printf("** Insert the correct name :___"); - if ( scanf("%s", molecola) ) {}; + if ( 1 == scanf("%s", molecola) ) {}; mol = us_fopen(molecola, "r"); } - if ( fscanf(mol, "%d", &nat) ) {}; - if ( fscanf(mol, "%f", &raggio) ) {}; + if ( 1 == fscanf(mol, "%d", &nat) ) {}; + if ( 1 == fscanf(mol, "%f", &raggio) ) {}; fclose(mol); #endif @@ -5222,7 +5222,7 @@ init_da_a() while ((prima < 0) || (prima > (nat - 1))) { printf("%s", "** Insert FIRST BEAD # to be included :___ "); - if ( scanf("%d", &prima) ) {}; + if ( 1 == scanf("%d", &prima) ) {}; getchar(); printf("\n"); } @@ -5231,7 +5231,7 @@ init_da_a() while ((ultima < prima) || (ultima > nat)) { printf("%s", "** Insert LAST BEAD # to be included :___ "); - if ( scanf("%d", &ultima) ) {}; + if ( 1 == scanf("%d", &ultima) ) {}; getchar(); printf("\n"); } @@ -5266,11 +5266,11 @@ initarray(int k) memset(temp, 0, 34); #if defined(CREATE_TOT_MOL) - if ( fscanf(tot_mol, "%s", molecola) ) {}; + if ( 1 == fscanf(tot_mol, "%s", molecola) ) {}; strcpy(ricorda, molecola); - if ( fscanf(tot_mol, "%d", &nat) ) {}; - if ( fscanf(tot_mol, "%d", &prima) ) {}; - if ( fscanf(tot_mol, "%d", &ultima) ) {}; + if ( 1 == fscanf(tot_mol, "%d", &nat) ) {}; + if ( 1 == fscanf(tot_mol, "%d", &prima) ) {}; + if ( 1 == fscanf(tot_mol, "%d", &ultima) ) {}; #else strcpy(molecola, molecola_v[k].toLatin1().data()); strcpy(ricorda, molecola); @@ -5307,8 +5307,8 @@ initarray(int k) #if defined(DEBUG_FILES) mol = us_fopen(molecola, "r"); - if ( fscanf(mol, "%d", &nat) ) {}; - if ( fscanf(mol, "%f", &raggio) ) {}; + if ( 1 == fscanf(mol, "%d", &nat) ) {}; + if ( 1 == fscanf(mol, "%f", &raggio) ) {}; printf("!! opening molecola == '%s' nat == %d raggio == %f\n", molecola, nat, raggio); #endif @@ -5316,18 +5316,18 @@ initarray(int k) if (raggio == 0.0) /* Variable hydrated radii only */ { - if ( fscanf(mol, "%s", ragcol) ) {}; + if ( 1 == fscanf(mol, "%s", ragcol) ) {}; rmc = us_fopen(ragcol, "r"); for (i = 0; i < nat; i++) { - if ( fscanf(mol, "%f", &dt[i].x) ) {}; - if ( fscanf(mol, "%f", &dt[i].y) ) {}; - if ( fscanf(mol, "%f", &dt[i].z) ) {}; - if ( fscanf(rmc, "%f", &dt[i].r) ) {}; - if ( fscanf(rmc, "%f", &dt[i].m) ) {}; - if ( fscanf(rmc, "%d", &dt[i].col) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].x) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].y) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].z) ) {}; + if ( 1 == fscanf(rmc, "%f", &dt[i].r) ) {}; + if ( 1 == fscanf(rmc, "%f", &dt[i].m) ) {}; + if ( 1 == fscanf(rmc, "%d", &dt[i].col) ) {}; } #if defined(DEBUG_WW) for (i = 0; i < nat; i++) { @@ -5348,19 +5348,19 @@ initarray(int k) if (raggio == -1.0) /* Variable hydrated and unhydrated radii */ { - if ( fscanf(mol, "%s", ragcol) ) {}; + if ( 1 == fscanf(mol, "%s", ragcol) ) {}; rmc = us_fopen(ragcol, "r"); for (i = 0; i < nat; i++) { - if ( fscanf(mol, "%f", &dt[i].x) ) {}; - if ( fscanf(mol, "%f", &dt[i].y) ) {}; - if ( fscanf(mol, "%f", &dt[i].z) ) {}; - if ( fscanf(rmc, "%f", &dt[i].r) ) {}; - if ( fscanf(rmc, "%f", &dt[i].ru) ) {}; - if ( fscanf(rmc, "%f", &dt[i].m) ) {}; - if ( fscanf(rmc, "%d", &dt[i].col) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].x) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].y) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].z) ) {}; + if ( 1 == fscanf(rmc, "%f", &dt[i].r) ) {}; + if ( 1 == fscanf(rmc, "%f", &dt[i].ru) ) {}; + if ( 1 == fscanf(rmc, "%f", &dt[i].m) ) {}; + if ( 1 == fscanf(rmc, "%d", &dt[i].col) ) {}; } fclose(rmc); goto a1200; @@ -5370,9 +5370,9 @@ initarray(int k) { #if defined(DEBUG_FILES) - if ( fscanf(mol, "%s", ragcol) ) {}; + if ( 1 == fscanf(mol, "%s", ragcol) ) {}; - if ( fscanf(mol, "%f", &partvol) ) {}; + if ( 1 == fscanf(mol, "%f", &partvol) ) {}; printf("!! partvol %f vbar %f %s %f\n", partvol, (*model_vector)[model_idx[active_model]].vbar, us_hydrodyn->misc.compute_vbar ? "computed-vbar" : "user vbar", @@ -5447,12 +5447,12 @@ initarray(int k) { float fx, fy, fz, fr, fm; int fc; - if ( fscanf(mol, "%f", &fx) ) {}; - if ( fscanf(mol, "%f", &fy) ) {}; - if ( fscanf(mol, "%f", &fz) ) {}; - if ( fscanf(rmc, "%f", &fr) ) {}; - if ( fscanf(rmc, "%f", &fm) ) {}; - if ( fscanf(rmc, "%d", &fc) ) {}; + if ( 1 == fscanf(mol, "%f", &fx) ) {}; + if ( 1 == fscanf(mol, "%f", &fy) ) {}; + if ( 1 == fscanf(mol, "%f", &fz) ) {}; + if ( 1 == fscanf(rmc, "%f", &fr) ) {}; + if ( 1 == fscanf(rmc, "%f", &fm) ) {}; + if ( 1 == fscanf(rmc, "%d", &fc) ) {}; printf("!!(%f %f %f) %f %f %f %f %f %d\n", (*bead_models)[model_idx[active_model]][active_idx[active_model][i]].bead_coordinate.axis[0], dt[i].x, fx, @@ -5480,21 +5480,21 @@ initarray(int k) if (raggio == -3.0) /* Variable hydrated and unhydrated radii and psv */ { - if ( fscanf(mol, "%s", ragcol) ) {}; + if ( 1 == fscanf(mol, "%s", ragcol) ) {}; - if ( fscanf(mol, "%f", &partvol) ) {}; + if ( 1 == fscanf(mol, "%f", &partvol) ) {}; rmc = us_fopen(ragcol, "r"); for (i = 0; i < nat; i++) { - if ( fscanf(mol, "%f", &dt[i].x) ) {}; - if ( fscanf(mol, "%f", &dt[i].y) ) {}; - if ( fscanf(mol, "%f", &dt[i].z) ) {}; - if ( fscanf(rmc, "%f", &dt[i].r) ) {}; - if ( fscanf(rmc, "%f", &dt[i].ru) ) {}; - if ( fscanf(rmc, "%f", &dt[i].m) ) {}; - if ( fscanf(rmc, "%d", &dt[i].col) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].x) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].y) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].z) ) {}; + if ( 1 == fscanf(rmc, "%f", &dt[i].r) ) {}; + if ( 1 == fscanf(rmc, "%f", &dt[i].ru) ) {}; + if ( 1 == fscanf(rmc, "%f", &dt[i].m) ) {}; + if ( 1 == fscanf(rmc, "%d", &dt[i].col) ) {}; } fclose(rmc); @@ -5504,20 +5504,20 @@ initarray(int k) if (raggio == -4.0) /* Variable hydrated radii and bead-aminoacids correspondence */ { - if ( fscanf(mol, "%s", ragcol) ) {}; + if ( 1 == fscanf(mol, "%s", ragcol) ) {}; rmc = us_fopen(ragcol, "r"); for (i = 0; i < nat; i++) { - if ( fscanf(mol, "%f", &dt[i].x) ) {}; - if ( fscanf(mol, "%f", &dt[i].y) ) {}; - if ( fscanf(mol, "%f", &dt[i].z) ) {}; - if ( fscanf(rmc, "%f", &dt[i].r) ) {}; - if ( fscanf(rmc, "%f", &dt[i].m) ) {}; - if ( fscanf(rmc, "%d", &dt[i].col) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].x) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].y) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].z) ) {}; + if ( 1 == fscanf(rmc, "%f", &dt[i].r) ) {}; + if ( 1 == fscanf(rmc, "%f", &dt[i].m) ) {}; + if ( 1 == fscanf(rmc, "%d", &dt[i].col) ) {}; dt[i].cor = (char *) malloc(10 * sizeof(char)); - if ( fscanf(rmc, "%s", dt[i].cor) ) {}; + if ( 1 == fscanf(rmc, "%s", dt[i].cor) ) {}; } fclose(rmc); @@ -5527,22 +5527,22 @@ initarray(int k) if (raggio == -5.0) /* Variable hydrated radii, bead-aminoacids correspondence and psv */ { - if ( fscanf(mol, "%s", ragcol) ) {}; + if ( 1 == fscanf(mol, "%s", ragcol) ) {}; - if ( fscanf(mol, "%f", &partvol) ) {}; + if ( 1 == fscanf(mol, "%f", &partvol) ) {}; rmc = us_fopen(ragcol, "r"); for (i = 0; i < nat; i++) { - if ( fscanf(mol, "%f", &dt[i].x) ) {}; - if ( fscanf(mol, "%f", &dt[i].y) ) {}; - if ( fscanf(mol, "%f", &dt[i].z) ) {}; - if ( fscanf(rmc, "%f", &dt[i].r) ) {}; - if ( fscanf(rmc, "%f", &dt[i].m) ) {}; - if ( fscanf(rmc, "%d", &dt[i].col) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].x) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].y) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].z) ) {}; + if ( 1 == fscanf(rmc, "%f", &dt[i].r) ) {}; + if ( 1 == fscanf(rmc, "%f", &dt[i].m) ) {}; + if ( 1 == fscanf(rmc, "%d", &dt[i].col) ) {}; dt[i].cor = (char *) malloc(10 * sizeof(char)); - if ( fscanf(rmc, "%s", dt[i].cor) ) {}; + if ( 1 == fscanf(rmc, "%s", dt[i].cor) ) {}; } fclose(rmc); @@ -5554,9 +5554,9 @@ initarray(int k) vt = 1; for (i = 0; i < nat; i++) { - if ( fscanf(mol, "%f", &dt[i].x) ) {}; - if ( fscanf(mol, "%f", &dt[i].y) ) {}; - if ( fscanf(mol, "%f", &dt[i].z) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].x) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].y) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].z) ) {}; dt[i].r = raggio; dt[i].m = (float) 1.0; dt[i].col = 1; @@ -6192,7 +6192,7 @@ sigmarRcalc1() QString hydro_msg = ""; interm = 0.0; /* printf("%d%d\n\n volcor,colorsixf",volcor," ",colorsixf); - if ( scanf("%d",&test) ) {}; + if ( 1 == scanf("%d",&test) ) {}; getchar(); */ if ((volcor == 1) && ((colorsixf == 1) || (colorsixf == 3))) { interm = interm1; /* total vol. of beads, buried included */ @@ -6289,7 +6289,7 @@ overlap() (sqrt(dist) - (dt[i].r + dt[j].r))); #if defined(USE_MAIN) printf("\n** Do you want to proceed anyway? (y/n) "); - if ( scanf("%s", &r5) ) {}; + if ( 1 == scanf("%s", &r5) ) {}; getchar(); if ((r5 == 'y') || (r5 == 'Y')) { @@ -7083,7 +7083,7 @@ main() do { printf("\n\n\n** Insert number of beads to use? : "); - if ( scanf("%d", &use_nmax) ) {}; + if ( 1 == scanf("%d", &use_nmax) ) {}; } while (use_nmax < 1); us_hydro_supc_main(use_nmax); diff --git a/us_somo/develop/src/us_saxs_util_asab1.cpp b/us_somo/develop/src/us_saxs_util_asab1.cpp index 8471b5fc8..71dd86001 100644 --- a/us_somo/develop/src/us_saxs_util_asab1.cpp +++ b/us_somo/develop/src/us_saxs_util_asab1.cpp @@ -557,7 +557,7 @@ us_saxs_util_asab1_main(vector use_active_atoms, dd2 += (l - 1); /* printf("\n%d\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n",l,"dd1->descr, dd1->elm, azoto, carbonio0, carbonio1, carbonio2: ",dd1->descr,dd1->elm,azoto,carbonio0,carbonio1,carbonio2); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); */ /* if(strcmp(dd1->elm,azoto)!=0) @@ -566,7 +566,7 @@ us_saxs_util_asab1_main(vector use_active_atoms, { printf("\n%s\n","Ora passo"); - if ( scanf("%d",&topolino); ) {}; + if ( 1 == scanf("%d",&topolino); ) {}; if(dt[l-1].tab<.001) perc=100*asamin/((float) .001); @@ -590,7 +590,7 @@ us_saxs_util_asab1_main(vector use_active_atoms, /* printf("\n%s\n","Ora passo"); printf("\n%d\t%s%d%s\t%f\t%s\t%f\n",l-1,"dt[",l-1,"].tab: ",dt[l-1].tab,"asamin: ",asamin); - if ( scanf("%d",&topolino); ) {}; + if ( 1 == scanf("%d",&topolino); ) {}; getchar(); */ if (dt[l - 1].tab < .001) @@ -637,7 +637,7 @@ us_saxs_util_asab1_main(vector use_active_atoms, dd1 = dt; dd1 += l; /* printf("\n%d\t%s\t%s\t%s\t%d\t%s\t%s\n",l,"dd1->elm: ",dd1->elm,"dd1->col: ",dd1->col,"dd1->descr: ",dd1->descr); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); */ if (strcmp(dd1->elm, "CA") == 0) { @@ -645,7 +645,7 @@ us_saxs_util_asab1_main(vector use_active_atoms, indCA = l; /* printf("\n%s\n","Ora passo in asapep CA"); printf("\n%s\t%d\t%s\t%f\t%s\t%f\n","indCA= ",indCA,"asapep: ",asapep,"asa[l]",asa[l]); - if ( scanf("%d",&topolino); ) {}; + if ( 1 == scanf("%d",&topolino); ) {}; getchar(); */ } @@ -655,7 +655,7 @@ us_saxs_util_asab1_main(vector use_active_atoms, indC = l; /* printf("\n%s\n","Ora passo in asapep C"); printf("\n%s\t%d\t%s\t%f\t%s\t%f\n","indC= ",indC,"asapep: ",asapep,"asa[l]",asa[l]); - if ( scanf("%d",&topolino); ) {}; + if ( 1 == scanf("%d",&topolino); ) {}; getchar(); */ } if (strcmp(dd1->elm, "O") == 0) @@ -664,14 +664,14 @@ us_saxs_util_asab1_main(vector use_active_atoms, indO = l; /* printf("\n%s\n","Ora passo in asapep O"); printf("\n%s\t%d\t%s\t%f\t%s\t%f\n","indO= ",indO,"asapep: ",asapep,"asa[l]",asa[l]); - if ( scanf("%d",&topolino); ) {}; + if ( 1 == scanf("%d",&topolino); ) {}; getchar(); */ } if (strcmp(dd1->elm, "N") == 0) { /* printf("\n%s\n","Ora passo in N "); - if ( scanf("%d",&topolino); ) {}; + if ( 1 == scanf("%d",&topolino); ) {}; getchar(); */ dd2 = dt; if (strcmp(dd1->amin, "PRO") != 0) /* IF NOT A PROLINE, COUNTING "N" FOR THE ASA */ @@ -680,7 +680,7 @@ us_saxs_util_asab1_main(vector use_active_atoms, /* printf("\n%s\n","Ora passo in N no PRO"); printf("\n%d\t%s\t%s\t%s\t%s\n",l,"dd1->amin, azoto, carbonio0: ",dd1->amin,azoto,carbonio0); printf("\n%s\t%d\t%s\t%f\t%s\t%f\n","indO= ",indO,"asapep: ",asapep,"asa[l]",asa[l]); - if ( scanf("%d",&topolino); ) {}; + if ( 1 == scanf("%d",&topolino); ) {}; getchar(); */ if (asapep <= asalevel) { @@ -700,14 +700,14 @@ us_saxs_util_asab1_main(vector use_active_atoms, /* printf("\n%d\t%s\t%s\t%s\t%d\t%s\t%s\n",indO,"dd2->elm: ",dd2->elm,"dd2->col: ",dd2->col,"dd2->descr: ",dd2->descr); */ dd1->col = 10; /* printf("\n%d\t%s\t%s\t%s\t%d\t%s\t%s\n",indO,"dd1->elm: ",dd1->elm,"dd1->col: ",dd1->col,"dd1->descr: ",dd1->descr); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); */ } } else { /* printf("\n%s\n","Ora passo N PRO"); - if ( scanf("%d",&topolino); ) {}; + if ( 1 == scanf("%d",&topolino); ) {}; getchar(); */ if (asapep <= asalevel) { @@ -811,7 +811,7 @@ us_saxs_util_asab1_main(vector use_active_atoms, { fprintf(mol1, "%d\n", 10); /* printf("\n%d\t%s\t%s\t%s\t%d\t%s\t%s\n",i,"Minni dd2->elm: ",dd2->elm,"dd2->col: ",dd2->col,"dd2->descr: ",dd2->descr); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); */ } else @@ -830,7 +830,7 @@ us_saxs_util_asab1_main(vector use_active_atoms, { fprintf(mol1, "%d\n", 10); /* printf("\n%d\t%s\t%s\t%s\t%d\t%s\t%s\n",i,"Pluto dd2->elm: ",dd2->elm,"dd2->col: ",dd2->col,"dd2->descr: ",dd2->descr); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); */ } else @@ -844,7 +844,7 @@ us_saxs_util_asab1_main(vector use_active_atoms, { fprintf(mol1, "%d\n", 6); /* printf("\n%d\t%s\t%s\t%s\t%d\t%s\t%s\n",i,"Pippo dd2->elm: ",dd2->elm,"dd2->col: ",dd2->col,"dd2->descr: ",dd2->descr); - if ( scanf("%s",pluto) ) {}; + if ( 1 == scanf("%s",pluto) ) {}; getchar(); */ } } @@ -1507,7 +1507,7 @@ init2() { /* pulisci(); */ printf("\n\n\t%s", "Insert the bead model filename: "); - if ( scanf("%s", nome) ) {}; + if ( 1 == scanf("%s", nome) ) {}; init2_mol = us_fopen(nome, "r"); } @@ -1517,7 +1517,7 @@ init2() /* pulisci(); */ a50: printf("\n\n\t%s", "Insert the re-checked bead model filename: "); - if ( scanf("%s", ridotto) ) {}; + if ( 1 == scanf("%s", ridotto) ) {}; init2_mol1 = us_fopen(ridotto, "r"); if (init2_mol1 != NULL) { @@ -1527,7 +1527,7 @@ init2() printf("\t 1) Overwrite existing file\n"); printf("\t 2) Create new file\n\n"); printf("\t** Select (1/2) :___ "); - if ( scanf("%d", &fe) ) {}; + if ( 1 == scanf("%d", &fe) ) {}; getchar(); fclose(init2_mol1); if (fe == 1) @@ -1564,7 +1564,7 @@ init2() printf("\t 1) Overwrite existing .rmc file\n"); printf("\t 2) Create new .rmc file\n\n"); printf("\t** Select (1/2) :___ "); - if ( scanf("%d", &fe1) ) {}; + if ( 1 == scanf("%d", &fe1) ) {}; getchar(); fclose(init2_mol1); if (fe1 == 1) @@ -1574,7 +1574,7 @@ init2() if (fe1 == 2) { printf("\n\n\t%s", "Insert the filename for the rmc file of the re-checked bead model: "); - if ( scanf("%s", ridotto_rmc) ) {}; + if ( 1 == scanf("%s", ridotto_rmc) ) {}; goto a55; } } @@ -1612,21 +1612,21 @@ init2() #if defined(NOT_USED) for (i = 0; i < nat; i++) { - if ( fscanf(init2_mol, "%f", &(dt[i].x)) ) {}; - if ( fscanf(init2_mol, "%f", &(dt[i].y)) ) {}; - if ( fscanf(init2_mol, "%f", &(dt[i].z)) ) {}; - if ( fscanf(init2_rmc, "%f", &(dt[i].r)) ) {}; + if ( 1 == fscanf(init2_mol, "%f", &(dt[i].x)) ) {}; + if ( 1 == fscanf(init2_mol, "%f", &(dt[i].y)) ) {}; + if ( 1 == fscanf(init2_mol, "%f", &(dt[i].z)) ) {}; + if ( 1 == fscanf(init2_rmc, "%f", &(dt[i].r)) ) {}; (dt[i].r) += rprobe; - if ( fscanf(init2_rmc, "%d", &(dt[i].m)) ) {}; - if ( fscanf(init2_rmc, "%d", &(dt[i].col)) ) {}; + if ( 1 == fscanf(init2_rmc, "%d", &(dt[i].m)) ) {}; + if ( 1 == fscanf(init2_rmc, "%d", &(dt[i].col)) ) {}; if (flag1 != 1) { - if ( fscanf(init2_mol1, "%s", &(dt[i].elm)) ) {}; - if ( fscanf(init2_mol1, "%s", &(dt[i].amin)) ) {}; - if ( fscanf(init2_mol1, "%s", &(dt[i].descr)) ) {}; + if ( 1 == fscanf(init2_mol1, "%s", &(dt[i].elm)) ) {}; + if ( 1 == fscanf(init2_mol1, "%s", &(dt[i].amin)) ) {}; + if ( 1 == fscanf(init2_mol1, "%s", &(dt[i].descr)) ) {}; } if ((raggio >= ((float) -4.1)) && (raggio <= ((float) -3.9))) - if ( fscanf(init2_rmc, "%s", &(dt[i].descr)) ) {}; + if ( 1 == fscanf(init2_rmc, "%s", &(dt[i].descr)) ) {}; if (maxz < (dd->z + dd->r)) maxz = dd->z + dd->r; @@ -2986,19 +2986,19 @@ ordcol() ordcol_ord = us_fopen("plotter", "rb"); ord1 = us_fopen("plotter1", "ab"); - if ( fscanf(ordcol_ord, "%s", key) ) {}; + if ( 1 == fscanf(ordcol_ord, "%s", key) ) {}; fprintf(ord1, "%s%c", key, ' '); if (form1 == 0) { - if ( fscanf(ordcol_ord, "%s", key) ) {}; + if ( 1 == fscanf(ordcol_ord, "%s", key) ) {}; fprintf(ord1, "%s\n", key); } for (i = 1; i < 9; i++) { rewind(ordcol_ord); - if ( fscanf(ordcol_ord, "%s", key) ) {}; + if ( 1 == fscanf(ordcol_ord, "%s", key) ) {}; sp[0] = 'S'; sp[1] = 'P'; @@ -3033,13 +3033,13 @@ ordcol() while (conf(key, fine, 3) == 0) { while ((conf(key, sp, 3) == 0) && (conf(key, fine, 3) == 0)) { - if ( fscanf(ordcol_ord, "%s", key) ) {}; + if ( 1 == fscanf(ordcol_ord, "%s", key) ) {}; } if (conf(key, fine, 3) == 0) { fprintf(ord1, "%s\n", key); - if ( fscanf(ordcol_ord, "%s", key) ) {}; + if ( 1 == fscanf(ordcol_ord, "%s", key) ) {}; } } } @@ -3261,7 +3261,7 @@ formato() printf("\n"); printf("Wrong number!\n"); printf("Re-insert the step: "); - if ( scanf("%f", &passo) ) {}; + if ( 1 == scanf("%f", &passo) ) {}; } printf("\n\n%s%.0f\n\n", "Number of resulting iterations: ", ceil(fabs(maxz - minz) / passo)); diff --git a/us_somo/develop/src/us_saxs_util_hydro_supc_hydro.cpp b/us_somo/develop/src/us_saxs_util_hydro_supc_hydro.cpp index 31b26247b..f6d53da83 100644 --- a/us_somo/develop/src/us_saxs_util_hydro_supc_hydro.cpp +++ b/us_somo/develop/src/us_saxs_util_hydro_supc_hydro.cpp @@ -615,7 +615,7 @@ Gets_date(char *day, char *month, int *year, int *numday, char *hour) timer = time(NULL); tblock = localtime(&timer); strcpy(tempo, asctime(tblock)); - if ( sscanf(tempo, "%s %s %d %s %s\n", day, month, numday, hour, anno) ) {}; + if ( 5 == sscanf(tempo, "%s %s %d %s %s\n", day, month, numday, hour, anno) ) {}; /* annov=strtol(anno,NULL,0); */ anno[0] = anno[2]; anno[1] = anno[3]; @@ -903,7 +903,7 @@ us_hydrodyn_supc_main_hydro(bool use_bead_model_from_file, intestazione(); //printf("\n\n** Compiled for %d beads **\n\n", nmax); //printf("\n\n\n** Insert number of models to analyze (max=100) :___ "); - if ( scanf("%d", &num) ) {}; + if ( 1 == scanf("%d", &num) ) {}; getchar(); } @@ -912,14 +912,14 @@ us_hydrodyn_supc_main_hydro(bool use_bead_model_from_file, //printf("\n - Sequential files?\n"); //printf(" 1) Yes\n 2) No\n\n"); //printf(" Your choice ? (1/2) :__ "); - if ( scanf("%d", &cdmolix) ) {}; + if ( 1 == scanf("%d", &cdmolix) ) {}; if (cdmolix == 1) { //printf("\n-Enter filename prefix "); - if ( scanf("%s", fil001) ) {}; + if ( 1 == scanf("%s", fil001) ) {}; getchar(); //printf("\n-Enter first file number "); - if ( scanf("%d", &num001) ) {}; + if ( 1 == scanf("%d", &num001) ) {}; numor = 1; } r1 = 'y'; @@ -966,7 +966,7 @@ us_hydrodyn_supc_main_hydro(bool use_bead_model_from_file, intestazione(); //printf("\n\n\n** Number of models to analyze:___ %d", num); //printf("\n** Do you want the results printed to a file ? (y/n) :___ "); - if ( scanf("%s", &r1) ) {}; + if ( 1 == scanf("%s", &r1) ) {}; getchar(); } } @@ -976,7 +976,7 @@ us_hydrodyn_supc_main_hydro(bool use_bead_model_from_file, a50: flag_mem = 1; //printf("\n** Insert the name of results' file :___ "); - if ( scanf("%s", risultati) ) {}; + if ( 1 == scanf("%s", risultati) ) {}; getchar(); } @@ -992,7 +992,7 @@ us_hydrodyn_supc_main_hydro(bool use_bead_model_from_file, //printf(" 2) Overwrite existing file\n"); //printf(" 3) Create new file\n\n"); //printf("** Select (1/2/3) :___ "); - if ( scanf("%d", &fe) ) {}; + if ( 1 == scanf("%d", &fe) ) {}; getchar(); fclose(new_mol); if (fe == 2) @@ -1006,7 +1006,7 @@ us_hydrodyn_supc_main_hydro(bool use_bead_model_from_file, { goto a50; /* printf("** Insert the name of results file :___ "); - if ( scanf("%s",risultati) ) {}; + if ( 1 == scanf("%s",risultati) ) {}; getchar(); */ } } @@ -1022,7 +1022,7 @@ us_hydrodyn_supc_main_hydro(bool use_bead_model_from_file, //printf("- - ) angstroms => nanometers [ Conversion factor = 0.1 ]\n\n"); //printf("\n** Insert the conversion factor :___ "); - if ( scanf("%f", &fconv) ) {}; + if ( 1 == scanf("%f", &fconv) ) {}; fconv1 = 1.0 / fconv; while ((cd != 1) && (cd != 2)) @@ -1031,7 +1031,7 @@ us_hydrodyn_supc_main_hydro(bool use_bead_model_from_file, //printf("\n- Reference System :\n\n"); //printf(" 1) Cartesian Origin \n 2) Diffusion Center\n\n"); //printf(" Select (1/2) :___ "); - if ( scanf("%d", &cd) ) {}; + if ( 1 == scanf("%d", &cd) ) {}; getchar(); } @@ -1042,7 +1042,7 @@ us_hydrodyn_supc_main_hydro(bool use_bead_model_from_file, //printf(" 1) STICK boundary condition (6*M_PI*ETAo)\n"); //printf(" 2) SLIP boundary condition (4*M_PI*ETAo)\n\n"); //printf(" Select (1/2) :___ "); - if ( scanf("%d", &cc) ) {}; + if ( 1 == scanf("%d", &cc) ) {}; getchar(); } @@ -1053,14 +1053,14 @@ us_hydrodyn_supc_main_hydro(bool use_bead_model_from_file, //printf(" 1) Automatic (Total volume of the beads)\n"); //printf(" 2) Manual (From keyboard)\n\n"); //printf(" Select (1/2) :___ "); - if ( scanf("%d", &volcor) ) {}; + if ( 1 == scanf("%d", &volcor) ) {}; getchar(); } if (volcor == 2) { //printf("\n\n\n- Insert value of the volume : "); - if ( scanf("%f", &volcor1) ) {}; + if ( 1 == scanf("%f", &volcor1) ) {}; } while ((mascor != 1) && (mascor != 2)) @@ -1070,14 +1070,14 @@ us_hydrodyn_supc_main_hydro(bool use_bead_model_from_file, //printf(" 1) Automatic (Masses from file) \n"); //printf(" 2) Manual (Total Mass from Keyboard)\n\n"); //printf(" Select (1/2) :___ "); - if ( scanf("%d", &mascor) ) {}; + if ( 1 == scanf("%d", &mascor) ) {}; getchar(); } if (mascor == 2) { //printf("\n\n\n- Insert value of mass : "); - if ( scanf("%f", &mascor1) ) {}; + if ( 1 == scanf("%f", &mascor1) ) {}; } while ((sfecalc != 1) && (sfecalc != 2)) @@ -1087,7 +1087,7 @@ us_hydrodyn_supc_main_hydro(bool use_bead_model_from_file, //printf(" 1) ALL beads\n"); //printf(" 2) Color Code Selection (Beads Color Coded \"6\" will be excluded)\n\n"); //printf(" Select (1/2) :___ "); - if ( scanf("%d", &sfecalc) ) {}; + if ( 1 == scanf("%d", &sfecalc) ) {}; getchar(); if ((sfecalc == 2) && (volcor == 1)) { @@ -1101,7 +1101,7 @@ us_hydrodyn_supc_main_hydro(bool use_bead_model_from_file, //printf(" 2) The intrinsic viscosity correction only\n"); //printf(" 3) Both corrections\n\n"); //printf(" Select (0/1/2/3) :___ "); - if ( scanf("%d", &colorsixf) ) {}; + if ( 1 == scanf("%d", &colorsixf) ) {}; getchar(); } @@ -1239,10 +1239,10 @@ us_hydrodyn_supc_main_hydro(bool use_bead_model_from_file, //printf("\n"); //printf("The Model(s) do not exist!!!\n"); //printf("Insert the models' correct prefix :___"); - if ( scanf("%s", molecola) ) {}; + if ( 1 == scanf("%s", molecola) ) {}; mol = us_fopen(molecola, "r"); } - if ( fscanf(mol, "%d", &nat) ) {}; + if ( 1 == fscanf(mol, "%d", &nat) ) {}; fclose(mol); if (k == 0) { @@ -1251,7 +1251,7 @@ us_hydrodyn_supc_main_hydro(bool use_bead_model_from_file, while ((prima < 0) || (prima > (nat - 1))) { //printf("%s", "** Insert FIRST BEAD # to be included:___"); - if ( scanf("%d", &prima) ) {}; + if ( 1 == scanf("%d", &prima) ) {}; getchar(); //printf("\n"); } @@ -1259,7 +1259,7 @@ us_hydrodyn_supc_main_hydro(bool use_bead_model_from_file, while ((ultima < prima) || (ultima > nat)) { //printf("%s", "** Insert LAST BEAD # to be included:___"); - if ( scanf("%d", &ultima) ) {}; + if ( 1 == scanf("%d", &ultima) ) {}; getchar(); //printf("\n"); } @@ -1295,7 +1295,7 @@ us_hydrodyn_supc_main_hydro(bool use_bead_model_from_file, { //printf("\n** Insert file name of the model to be analyzed :___ "); } - if ( scanf("%s", molecola) ) {}; + if ( 1 == scanf("%s", molecola) ) {}; getchar(); init_da_a(); @@ -1436,7 +1436,7 @@ us_hydrodyn_supc_main_hydro(bool use_bead_model_from_file, // } #if defined(CREATE_TOT_MOL) - if ( fscanf(tot_mol, "%f", &raflag) ) {}; + if ( 1 == fscanf(tot_mol, "%f", &raflag) ) {}; #else raflag = raggio_v[k]; #endif @@ -2265,7 +2265,7 @@ us_hydrodyn_supc_main_hydro(bool use_bead_model_from_file, //printf(" Select (0/1) : "); } - if ( scanf("%d", &scelta) ) {}; + if ( 1 == scanf("%d", &scelta) ) {}; getchar(); if (scelta == 1) @@ -2439,7 +2439,7 @@ vedimatrici() printf("\n 0) Back\n"); printf("\n Select(0/8) : "); - if ( scanf("%d", &mtt) ) {}; + if ( 1 == scanf("%d", &mtt) ) {}; getchar(); switch (mtt) @@ -4213,15 +4213,15 @@ out_inter() interout = us_fopen("ofraxon", "r"); - if ( fscanf(interout, "%d", &n) ) {}; - if ( fscanf(interout, "%f", &raggio) ) {}; - if ( fscanf(interout, "%s", ramaco) ) {}; + if ( 1 == fscanf(interout, "%d", &n) ) {}; + if ( 1 == fscanf(interout, "%f", &raggio) ) {}; + if ( 1 == fscanf(interout, "%s", ramaco) ) {}; for (i = 0; i < n; i++) { - if ( fscanf(interout, "%f", &dtn[i].x) ) {}; - if ( fscanf(interout, "%f", &dtn[i].y) ) {}; - if ( fscanf(interout, "%f", &dtn[i].z) ) {}; + if ( 1 == fscanf(interout, "%f", &dtn[i].x) ) {}; + if ( 1 == fscanf(interout, "%f", &dtn[i].y) ) {}; + if ( 1 == fscanf(interout, "%f", &dtn[i].z) ) {}; } #if defined(DEBUG_WW) @@ -4250,7 +4250,7 @@ mem_mol() char risp1, risp2, risp3; a100: // printf("\n\n** Insert file name for coordinates :___ "); - if ( scanf("%s", nmolecola) ) {}; + if ( 1 == scanf("%s", nmolecola) ) {}; getchar(); new_mol1 = us_fopen(nmolecola, "r"); @@ -4260,7 +4260,7 @@ mem_mol() // printf("\n"); // printf("*** CAUTION : File already exists ! ***\n"); // printf("** Do you want change the file name ? (y/n) :___ "); - if ( scanf("%s", &risp2) ) {}; + if ( 1 == scanf("%s", &risp2) ) {}; getchar(); fclose(new_mol1); if ((risp2 == 'y') || (risp2 == 'Y')) @@ -4270,7 +4270,7 @@ mem_mol() if (nat == numero_sfere) { //printf("** Same File Name r_m_c ? (y/n) :___ "); - if ( scanf("%s", &risp1) ) {}; + if ( 1 == scanf("%s", &risp1) ) {}; getchar(); } @@ -4281,7 +4281,7 @@ mem_mol() { a150: //printf("** Insert file name r_m_c :___ "); - if ( scanf("%s", nragcol) ) {}; + if ( 1 == scanf("%s", nragcol) ) {}; getchar(); new_mol1 = us_fopen(nragcol, "r"); @@ -4290,7 +4290,7 @@ mem_mol() // printf("\n"); // printf("*** CAUTION : File already exists ! ***\n"); // printf("** Do you want change the file name ? (y/n) :___ "); - if ( scanf("%s", &risp3) ) {}; + if ( 1 == scanf("%s", &risp3) ) {}; getchar(); fclose(new_mol1); if ((risp3 == 'y') || (risp3 == 'Y')) @@ -4301,9 +4301,9 @@ mem_mol() else { mol = us_fopen(molecola, "r"); - if ( fscanf(mol, "%d", &n) ) {}; - if ( fscanf(mol, "%f", &raggio) ) {}; - if ( fscanf(mol, "%s", nragcol) ) {}; + if ( 1 == fscanf(mol, "%d", &n) ) {}; + if ( 1 == fscanf(mol, "%f", &raggio) ) {}; + if ( 1 == fscanf(mol, "%s", nragcol) ) {}; fclose(mol); raflag = raggio; // ?? == } @@ -4851,7 +4851,7 @@ relax_rigid_calc() // #endif /* printf("\nValori ddr[0] ddr[1] ddr[2] : %Lf\t%Lf\t%Lf\n",ddr[0],ddr[1],ddr[2]); - if ( scanf("%s",&pluto1) ) {}; + if ( 1 == scanf("%s",&pluto1) ) {}; getchar(); */ for (a = 0; a < 3; a++) @@ -4873,7 +4873,7 @@ relax_rigid_calc() a = (int) 2.0; /* printf("\nCaso 1, valore a= %d\n",a); - if ( scanf("%s",&pluto1) ) {}; + if ( 1 == scanf("%s",&pluto1) ) {}; getchar(); */ } @@ -4889,7 +4889,7 @@ relax_rigid_calc() a = (int) 2.0; /* printf("\nCaso 2, valore a= %d\n",a); - if ( scanf("%s",&pluto1) ) {}; + if ( 1 == scanf("%s",&pluto1) ) {}; getchar(); */ } @@ -4905,7 +4905,7 @@ relax_rigid_calc() a = (int) 2.0; /* printf("\nCaso 3, valore a= %d\n",a); - if ( scanf("%s",&pluto1) ) {}; + if ( 1 == scanf("%s",&pluto1) ) {}; getchar(); */ } @@ -4947,7 +4947,7 @@ relax_rigid_calc() { /* printf("\nCaso 4, valore a= %d\n",a); - if ( scanf("%s",&pluto1) ) {}; + if ( 1 == scanf("%s",&pluto1) ) {}; getchar(); */ ddd[0] = ddr[0]; @@ -5030,7 +5030,7 @@ relax_rigid_calc() /* printf("\n%s%d%s%f\n","Tao[",a,"] = ",tao[a]); */ tao[a] = 1.0 / tao[a]; /* printf("\n%s%d%s%Lg\n","Tao[",a,"] = ",tao[a]); - if ( scanf("%s",&pluto1) ) {}; + if ( 1 == scanf("%s",&pluto1) ) {}; getchar(); */ } @@ -5223,12 +5223,12 @@ init_da_a() // printf("\n"); // printf("** The Model does NOT exist !!\n"); // printf("** Insert the correct name :___"); - if ( scanf("%s", molecola) ) {}; + if ( 1 == scanf("%s", molecola) ) {}; mol = us_fopen(molecola, "r"); } - if ( fscanf(mol, "%d", &nat) ) {}; - if ( fscanf(mol, "%f", &raggio) ) {}; + if ( 1 == fscanf(mol, "%d", &nat) ) {}; + if ( 1 == fscanf(mol, "%f", &raggio) ) {}; fclose(mol); #endif @@ -5247,7 +5247,7 @@ init_da_a() while ((prima < 0) || (prima > (nat - 1))) { // printf("%s", "** Insert FIRST BEAD # to be included :___ "); - if ( scanf("%d", &prima) ) {}; + if ( 1 == scanf("%d", &prima) ) {}; getchar(); // printf("\n"); } @@ -5256,7 +5256,7 @@ init_da_a() while ((ultima < prima) || (ultima > nat)) { // printf("%s", "** Insert LAST BEAD # to be included :___ "); - if ( scanf("%d", &ultima) ) {}; + if ( 1 == scanf("%d", &ultima) ) {}; getchar(); // printf("\n"); } @@ -5291,11 +5291,11 @@ initarray(int k) memset(temp, 0, 34); #if defined(CREATE_TOT_MOL) - if ( fscanf(tot_mol, "%s", molecola) ) {}; + if ( 1 == fscanf(tot_mol, "%s", molecola) ) {}; strcpy(ricorda, molecola); - if ( fscanf(tot_mol, "%d", &nat) ) {}; - if ( fscanf(tot_mol, "%d", &prima) ) {}; - if ( fscanf(tot_mol, "%d", &ultima) ) {}; + if ( 1 == fscanf(tot_mol, "%d", &nat) ) {}; + if ( 1 == fscanf(tot_mol, "%d", &prima) ) {}; + if ( 1 == fscanf(tot_mol, "%d", &ultima) ) {}; #else strcpy(molecola, molecola_v[k].toLatin1().data()); strcpy(ricorda, molecola); @@ -5341,8 +5341,8 @@ initarray(int k) #if defined(DEBUG_FILES) mol = us_fopen(molecola, "r"); - if ( fscanf(mol, "%d", &nat) ) {}; - if ( fscanf(mol, "%f", &raggio) ) {}; + if ( 1 == fscanf(mol, "%d", &nat) ) {}; + if ( 1 == fscanf(mol, "%f", &raggio) ) {}; printf("!! opening molecola == '%s' nat == %d raggio == %f\n", molecola, nat, raggio); #endif @@ -5350,18 +5350,18 @@ initarray(int k) if (raggio == 0.0) /* Variable hydrated radii only */ { - if ( fscanf(mol, "%s", ragcol) ) {}; + if ( 1 == fscanf(mol, "%s", ragcol) ) {}; rmc = us_fopen(ragcol, "r"); for (i = 0; i < nat; i++) { - if ( fscanf(mol, "%f", &dt[i].x) ) {}; - if ( fscanf(mol, "%f", &dt[i].y) ) {}; - if ( fscanf(mol, "%f", &dt[i].z) ) {}; - if ( fscanf(rmc, "%f", &dt[i].r) ) {}; - if ( fscanf(rmc, "%f", &dt[i].m) ) {}; - if ( fscanf(rmc, "%d", &dt[i].col) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].x) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].y) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].z) ) {}; + if ( 1 == fscanf(rmc, "%f", &dt[i].r) ) {}; + if ( 1 == fscanf(rmc, "%f", &dt[i].m) ) {}; + if ( 1 == fscanf(rmc, "%d", &dt[i].col) ) {}; } #if defined(DEBUG_WW) for (i = 0; i < nat; i++) { @@ -5382,19 +5382,19 @@ initarray(int k) if (raggio == -1.0) /* Variable hydrated and unhydrated radii */ { - if ( fscanf(mol, "%s", ragcol) ) {}; + if ( 1 == fscanf(mol, "%s", ragcol) ) {}; rmc = us_fopen(ragcol, "r"); for (i = 0; i < nat; i++) { - if ( fscanf(mol, "%f", &dt[i].x) ) {}; - if ( fscanf(mol, "%f", &dt[i].y) ) {}; - if ( fscanf(mol, "%f", &dt[i].z) ) {}; - if ( fscanf(rmc, "%f", &dt[i].r) ) {}; - if ( fscanf(rmc, "%f", &dt[i].ru) ) {}; - if ( fscanf(rmc, "%f", &dt[i].m) ) {}; - if ( fscanf(rmc, "%d", &dt[i].col) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].x) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].y) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].z) ) {}; + if ( 1 == fscanf(rmc, "%f", &dt[i].r) ) {}; + if ( 1 == fscanf(rmc, "%f", &dt[i].ru) ) {}; + if ( 1 == fscanf(rmc, "%f", &dt[i].m) ) {}; + if ( 1 == fscanf(rmc, "%d", &dt[i].col) ) {}; } fclose(rmc); goto a1200; @@ -5404,9 +5404,9 @@ initarray(int k) { #if defined(DEBUG_FILES) - if ( fscanf(mol, "%s", ragcol) ) {}; + if ( 1 == fscanf(mol, "%s", ragcol) ) {}; - if ( fscanf(mol, "%f", &partvol) ) {}; + if ( 1 == fscanf(mol, "%f", &partvol) ) {}; printf("!! partvol %f vbar %f %s %f\n", partvol, (*model_vector)[model_idx[active_model]].vbar, misc_int.compute_vbar ? "computed-vbar" : "user vbar", @@ -5493,12 +5493,12 @@ initarray(int k) { float fx, fy, fz, fr, fm; int fc; - if ( fscanf(mol, "%f", &fx) ) {}; - if ( fscanf(mol, "%f", &fy) ) {}; - if ( fscanf(mol, "%f", &fz) ) {}; - if ( fscanf(rmc, "%f", &fr) ) {}; - if ( fscanf(rmc, "%f", &fm) ) {}; - if ( fscanf(rmc, "%d", &fc) ) {}; + if ( 1 == fscanf(mol, "%f", &fx) ) {}; + if ( 1 == fscanf(mol, "%f", &fy) ) {}; + if ( 1 == fscanf(mol, "%f", &fz) ) {}; + if ( 1 == fscanf(rmc, "%f", &fr) ) {}; + if ( 1 == fscanf(rmc, "%f", &fm) ) {}; + if ( 1 == fscanf(rmc, "%d", &fc) ) {}; printf("!!(%f %f %f) %f %f %f %f %f %d\n", (*bead_models)[model_idx[active_model]][active_idx[active_model][i]].bead_coordinate.axis[0], dt[i].x, fx, @@ -5526,21 +5526,21 @@ initarray(int k) if (raggio == -3.0) /* Variable hydrated and unhydrated radii and psv */ { - if ( fscanf(mol, "%s", ragcol) ) {}; + if ( 1 == fscanf(mol, "%s", ragcol) ) {}; - if ( fscanf(mol, "%f", &partvol) ) {}; + if ( 1 == fscanf(mol, "%f", &partvol) ) {}; rmc = us_fopen(ragcol, "r"); for (i = 0; i < nat; i++) { - if ( fscanf(mol, "%f", &dt[i].x) ) {}; - if ( fscanf(mol, "%f", &dt[i].y) ) {}; - if ( fscanf(mol, "%f", &dt[i].z) ) {}; - if ( fscanf(rmc, "%f", &dt[i].r) ) {}; - if ( fscanf(rmc, "%f", &dt[i].ru) ) {}; - if ( fscanf(rmc, "%f", &dt[i].m) ) {}; - if ( fscanf(rmc, "%d", &dt[i].col) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].x) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].y) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].z) ) {}; + if ( 1 == fscanf(rmc, "%f", &dt[i].r) ) {}; + if ( 1 == fscanf(rmc, "%f", &dt[i].ru) ) {}; + if ( 1 == fscanf(rmc, "%f", &dt[i].m) ) {}; + if ( 1 == fscanf(rmc, "%d", &dt[i].col) ) {}; } fclose(rmc); @@ -5550,20 +5550,20 @@ initarray(int k) if (raggio == -4.0) /* Variable hydrated radii and bead-aminoacids correspondence */ { - if ( fscanf(mol, "%s", ragcol) ) {}; + if ( 1 == fscanf(mol, "%s", ragcol) ) {}; rmc = us_fopen(ragcol, "r"); for (i = 0; i < nat; i++) { - if ( fscanf(mol, "%f", &dt[i].x) ) {}; - if ( fscanf(mol, "%f", &dt[i].y) ) {}; - if ( fscanf(mol, "%f", &dt[i].z) ) {}; - if ( fscanf(rmc, "%f", &dt[i].r) ) {}; - if ( fscanf(rmc, "%f", &dt[i].m) ) {}; - if ( fscanf(rmc, "%d", &dt[i].col) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].x) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].y) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].z) ) {}; + if ( 1 == fscanf(rmc, "%f", &dt[i].r) ) {}; + if ( 1 == fscanf(rmc, "%f", &dt[i].m) ) {}; + if ( 1 == fscanf(rmc, "%d", &dt[i].col) ) {}; dt[i].cor = (char *) malloc(10 * sizeof(char)); - if ( fscanf(rmc, "%s", dt[i].cor) ) {}; + if ( 1 == fscanf(rmc, "%s", dt[i].cor) ) {}; } fclose(rmc); @@ -5573,22 +5573,22 @@ initarray(int k) if (raggio == -5.0) /* Variable hydrated radii, bead-aminoacids correspondence and psv */ { - if ( fscanf(mol, "%s", ragcol) ) {}; + if ( 1 == fscanf(mol, "%s", ragcol) ) {}; - if ( fscanf(mol, "%f", &partvol) ) {}; + if ( 1 == fscanf(mol, "%f", &partvol) ) {}; rmc = us_fopen(ragcol, "r"); for (i = 0; i < nat; i++) { - if ( fscanf(mol, "%f", &dt[i].x) ) {}; - if ( fscanf(mol, "%f", &dt[i].y) ) {}; - if ( fscanf(mol, "%f", &dt[i].z) ) {}; - if ( fscanf(rmc, "%f", &dt[i].r) ) {}; - if ( fscanf(rmc, "%f", &dt[i].m) ) {}; - if ( fscanf(rmc, "%d", &dt[i].col) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].x) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].y) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].z) ) {}; + if ( 1 == fscanf(rmc, "%f", &dt[i].r) ) {}; + if ( 1 == fscanf(rmc, "%f", &dt[i].m) ) {}; + if ( 1 == fscanf(rmc, "%d", &dt[i].col) ) {}; dt[i].cor = (char *) malloc(10 * sizeof(char)); - if ( fscanf(rmc, "%s", dt[i].cor) ) {}; + if ( 1 == fscanf(rmc, "%s", dt[i].cor) ) {}; } fclose(rmc); @@ -5600,9 +5600,9 @@ initarray(int k) vt = 1; for (i = 0; i < nat; i++) { - if ( fscanf(mol, "%f", &dt[i].x) ) {}; - if ( fscanf(mol, "%f", &dt[i].y) ) {}; - if ( fscanf(mol, "%f", &dt[i].z) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].x) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].y) ) {}; + if ( 1 == fscanf(mol, "%f", &dt[i].z) ) {}; dt[i].r = raggio; dt[i].m = (float) 1.0; dt[i].col = 1; @@ -6296,7 +6296,7 @@ sigmarRcalc1() interm = 0.0; /* printf("%d%d\n\n volcor,colorsixf",volcor," ",colorsixf); - if ( scanf("%d",&test) ) {}; + if ( 1 == scanf("%d",&test) ) {}; getchar(); */ if ((volcor == 1) && ((colorsixf == 1) || (colorsixf == 3))) interm = interm1; /* total vol. of beads, buried included */ @@ -6385,7 +6385,7 @@ overlap() // (sqrt(dist) - (dt[i].r + dt[j].r))); #if defined(USE_MAIN) // printf("\n** Do you want to proceed anyway? (y/n) "); - if ( scanf("%s", &r5) ) {}; + if ( 1 == scanf("%s", &r5) ) {}; getchar(); if ((r5 == 'y') || (r5 == 'Y')) { @@ -7169,7 +7169,7 @@ main() do { // printf("\n\n\n** Insert number of beads to use? : "); - if ( scanf("%d", &use_nmax) ) {}; + if ( 1 == scanf("%d", &use_nmax) ) {}; } while (use_nmax < 1); us_hydro_supc_main(use_nmax);