Skip to content

Commit

Permalink
Merge pull request #1710 from g5t/issue-1709
Browse files Browse the repository at this point in the history
[Fix] missing pointer dereferences
  • Loading branch information
willend authored Sep 24, 2024
2 parents 112eea5 + 2dda6ad commit 3c5bb8e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mcstas-comps/optics/Derotator.comp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ TRACE
Rotation R;

/* Name of Rotation uservar */
char* Rot_varptr = COMP_GETPAR3(Rotator, rotator, rot_var);
char* Rot_varptr = *COMP_GETPAR3(Rotator, rotator, rot_var);

/* Invert rotation matrix for use in derotation */
rot_transpose((Rotation*)particle_getvar_void(_particle, Rot_varptr, NULL),R);
rot_transpose(*(Rotation *) particle_getvar_void(_particle, Rot_varptr, NULL), R);

/* apply rotation to centered coordinates */
Coords tmp = coords_set(x,y,z);
coords_get(rot_apply(R, tmp), &x, &y, &z);
Expand Down
1 change: 1 addition & 0 deletions mcstas-comps/optics/Rotator.comp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ if (nu != 0 || phase != 0) { /* rotate neutron w/r to position of component */

%}


MCDISPLAY
%{
int ih;
Expand Down

0 comments on commit 3c5bb8e

Please sign in to comment.