diff options
author | Thomas White <taw@physics.org> | 2019-06-17 11:17:33 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2019-06-19 10:56:40 +0200 |
commit | 6ff483dc7730979f7a888b2dec6ac702dcbecf55 (patch) | |
tree | 9fe4fe4a001a9726c1362f2378fe61d9f21ce252 /libcrystfel | |
parent | c5ab9ad56d759ee6c22ed46dc4831196cbf98b12 (diff) |
Const-cleanliness
Diffstat (limited to 'libcrystfel')
-rw-r--r-- | libcrystfel/src/cell.c | 14 | ||||
-rw-r--r-- | libcrystfel/src/cell.h | 6 | ||||
-rw-r--r-- | libcrystfel/src/crystal.c | 6 | ||||
-rw-r--r-- | libcrystfel/src/crystal.h | 1 |
4 files changed, 17 insertions, 10 deletions
diff --git a/libcrystfel/src/cell.c b/libcrystfel/src/cell.c index 250da801..6b1d58c7 100644 --- a/libcrystfel/src/cell.c +++ b/libcrystfel/src/cell.c @@ -293,10 +293,10 @@ void cell_set_unique_axis(UnitCell *cell, char unique_axis) /************************* Getter helper functions ****************************/ -static int cell_crystallographic_to_cartesian(UnitCell *cell, - double *ax, double *ay, double *az, - double *bx, double *by, double *bz, - double *cx, double *cy, double *cz) +static int cell_crystallographic_to_cartesian(const UnitCell *cell, + double *ax, double *ay, double *az, + double *bx, double *by, double *bz, + double *cx, double *cy, double *cz) { double tmp, V, cosalphastar, cstar; @@ -415,7 +415,7 @@ static int cell_invert(double ax, double ay, double az, /********************************** Getters ***********************************/ -int cell_get_parameters(UnitCell *cell, double *a, double *b, double *c, +int cell_get_parameters(const UnitCell *cell, double *a, double *b, double *c, double *alpha, double *beta, double *gamma) { double ax, ay, az, bx, by, bz, cx, cy, cz; @@ -478,7 +478,7 @@ int cell_get_parameters(UnitCell *cell, double *a, double *b, double *c, } -int cell_get_cartesian(UnitCell *cell, +int cell_get_cartesian(const UnitCell *cell, double *ax, double *ay, double *az, double *bx, double *by, double *bz, double *cx, double *cy, double *cz) @@ -519,7 +519,7 @@ int cell_get_cartesian(UnitCell *cell, } -int cell_get_reciprocal(UnitCell *cell, +int cell_get_reciprocal(const UnitCell *cell, double *asx, double *asy, double *asz, double *bsx, double *bsy, double *bsz, double *csx, double *csy, double *csz) diff --git a/libcrystfel/src/cell.h b/libcrystfel/src/cell.h index 15e13707..4bbc1be2 100644 --- a/libcrystfel/src/cell.h +++ b/libcrystfel/src/cell.h @@ -111,15 +111,15 @@ extern void cell_set_cartesian(UnitCell *cell, extern void cell_set_parameters(UnitCell *cell, double a, double b, double c, double alpha, double beta, double gamma); -extern int cell_get_parameters(UnitCell *cell, double *a, double *b, double *c, +extern int cell_get_parameters(const UnitCell *cell, double *a, double *b, double *c, double *alpha, double *beta, double *gamma); -extern int cell_get_cartesian(UnitCell *cell, +extern int cell_get_cartesian(const UnitCell *cell, double *ax, double *ay, double *az, double *bx, double *by, double *bz, double *cx, double *cy, double *cz); -extern int cell_get_reciprocal(UnitCell *cell, +extern int cell_get_reciprocal(const UnitCell *cell, double *asx, double *asy, double *asz, double *bsx, double *bsy, double *bsz, double *csx, double *csy, double *csz); diff --git a/libcrystfel/src/crystal.c b/libcrystfel/src/crystal.c index ee02e1af..f6e881de 100644 --- a/libcrystfel/src/crystal.c +++ b/libcrystfel/src/crystal.c @@ -191,6 +191,12 @@ struct image *crystal_get_image(Crystal *cryst) } +const struct image *crystal_get_image_const(const Crystal *cryst) +{ + return cryst->image; +} + + double crystal_get_osf(Crystal *cryst) { return cryst->osf; diff --git a/libcrystfel/src/crystal.h b/libcrystfel/src/crystal.h index 0358dc8b..f246ab35 100644 --- a/libcrystfel/src/crystal.h +++ b/libcrystfel/src/crystal.h @@ -69,6 +69,7 @@ extern int crystal_get_user_flag(Crystal *cryst); extern double crystal_get_osf(Crystal *cryst); extern double crystal_get_Bfac(Crystal *cryst); extern struct image *crystal_get_image(Crystal *cryst); +extern const struct image *crystal_get_image_const(const Crystal *cryst); extern double crystal_get_mosaicity(Crystal *cryst); extern const char *crystal_get_notes(Crystal *cryst); extern void crystal_get_det_shift(Crystal *cryst, |