Skip to content

Commit aae2dc0

Browse files
committed
Run uservar init fct at this scope (cppcheck hint)
1 parent bb0c6a9 commit aae2dc0

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

mccode/nlib/share/mcstas-r.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ _class_particle mcsetstate(double x, double y, double z, double vx, double vy, d
8080
mcneutron._mctmp_a = mcneutron._mctmp_b = mcneutron._mctmp_c = 0;
8181
// what about mcneutron._logic ?
8282
mcneutron._logic.dummy=1;
83+
// init uservars via cogen'd-function
84+
particle_uservar_init(&mcneutron);
85+
8386
return(mcneutron);
8487
} /* mcsetstate */
8588

mccode/xlib/share/mcxtrace-r.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ _class_particle mcsetstate(double x, double y, double z, double kx, double ky, d
5959
mcphoton._restore = 0;
6060
mcphoton._scattered = 0;
6161

62+
// init uservars via cogen'd-function
63+
particle_uservar_init(&mcphoton);
64+
6265
return(mcphoton);
6366
} /* mcsetstate */
6467

0 commit comments

Comments
 (0)