Skip to content

Commit a1fb0d4

Browse files
committed
Revert...
1 parent c1a604b commit a1fb0d4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

mcstas-comps/samples/Isotropic_Sqw.comp

+3-5
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,7 @@ struct Sqw_Data_struct *Sqw_readfile(
13811381
Sqw->compname, file, Sqw->type=='c' ? "coh" : "inc");
13821382
);
13831383

1384-
double *w_file2full=malloc(w_bins*sizeof(double)); /* lookup table for fast file -> Sqw_full allocation */
1384+
double w_file2full[w_bins]; /* lookup table for fast file -> Sqw_full allocation */
13851385

13861386
for (index_w=0; index_w < w_bins; w_file2full[index_w++]=0);
13871387

@@ -1422,7 +1422,7 @@ struct Sqw_Data_struct *Sqw_readfile(
14221422
w_file2full[index_w] = index_w_file;
14231423
}
14241424

1425-
double *q_file2full=malloc(w_bins*sizeof(double));
1425+
double q_file2full[q_bins];
14261426
for (index_q=0; index_q < q_bins; q_file2full[index_q++]=0);
14271427

14281428
for (index_q=0; index_q < q_bins; index_q++) {
@@ -1478,9 +1478,7 @@ struct Sqw_Data_struct *Sqw_readfile(
14781478

14791479
/* free memory and store limits for new full Sqw table */
14801480
Table_Free_Array(Table_Array);
1481-
free(q_file2full);
1482-
free(w_file2full);
1483-
1481+
14841482
/* if only one S(q,w) side is given, it is symmetrised by mirroring, then M1=0 */
14851483

14861484
/* (5) test if the Sqw_full is classical or not by computing the 1st moment (=0 for classical) */

0 commit comments

Comments
 (0)