aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-07-30 10:16:37 +0200
committerThomas White <taw@physics.org>2020-07-30 10:17:12 +0200
commite14e413957b0c1e357167f43f129a6ef39ef5051 (patch)
treec26d0a6235091010138a9313bf2cfb8924903610
parentf9a6d5ea442e074d1e61585b572837f80e2ddac9 (diff)
Eliminate duplicate symbols
This makes searching easier, and also permits Meson's unity build mode.
-rw-r--r--libcrystfel/src/datatemplate.c22
-rw-r--r--libcrystfel/src/felix.c12
-rw-r--r--libcrystfel/src/image-hdf5.c24
-rw-r--r--libcrystfel/src/image.c12
-rw-r--r--libcrystfel/src/integer_matrix.c15
-rw-r--r--libcrystfel/src/integration.c10
-rw-r--r--libcrystfel/src/mosflm.c11
-rw-r--r--libcrystfel/src/peaks.c10
-rw-r--r--libcrystfel/src/pinkindexer.c13
-rw-r--r--libcrystfel/src/rational.c14
-rw-r--r--libcrystfel/src/reflist.c11
-rw-r--r--libcrystfel/src/taketwo.c12
-rw-r--r--libcrystfel/src/utils.c10
-rw-r--r--libcrystfel/src/utils.h2
-rw-r--r--libcrystfel/src/xds.c8
-rw-r--r--libcrystfel/src/xgandalf.c12
-rw-r--r--src/post-refinement.c8
-rw-r--r--src/scaling.c8
18 files changed, 112 insertions, 102 deletions
diff --git a/libcrystfel/src/datatemplate.c b/libcrystfel/src/datatemplate.c
index cc028025..2459f946 100644
--- a/libcrystfel/src/datatemplate.c
+++ b/libcrystfel/src/datatemplate.c
@@ -826,7 +826,7 @@ static int parse_toplevel(DataTemplate *dt,
}
-static int num_path_placeholders(const char *str)
+static int dt_num_path_placeholders(const char *str)
{
size_t i, len;
int n_pl;
@@ -1037,9 +1037,9 @@ DataTemplate *data_template_new_from_string(const char *string_in)
return NULL;
}
- num_data_pl = num_path_placeholders(dt->panels[i].data);
- num_mask_pl = num_path_placeholders(dt->panels[i].mask);
- num_satmap_pl = num_path_placeholders(dt->panels[i].satmap);
+ num_data_pl = dt_num_path_placeholders(dt->panels[i].data);
+ num_mask_pl = dt_num_path_placeholders(dt->panels[i].mask);
+ num_satmap_pl = dt_num_path_placeholders(dt->panels[i].satmap);
/* This is because the "data" path will be used to expand
* the path to generate the event list */
@@ -1122,19 +1122,19 @@ DataTemplate *data_template_new_from_string(const char *string_in)
reject = 1;
}
- if ( num_path_placeholders(p->data) != num_data_pl ) {
+ if ( dt_num_path_placeholders(p->data) != num_data_pl ) {
ERROR("Data locations for all panels must "
"have the same number of placeholders\n");
reject = 1;
}
- if ( num_path_placeholders(p->mask) != num_mask_pl ) {
+ if ( dt_num_path_placeholders(p->mask) != num_mask_pl ) {
ERROR("Mask locations for all panels must "
"have the same number of placeholders\n");
reject = 1;
}
- if ( num_path_placeholders(p->satmap) != num_satmap_pl ) {
+ if ( dt_num_path_placeholders(p->satmap) != num_satmap_pl ) {
ERROR("Satmap locations for all panels must "
"have the same number of placeholders\n");
reject = 1;
@@ -1392,7 +1392,7 @@ static double unit_string_to_unit(const char *str)
}
-static double get_length(const char *from)
+static double dt_get_length(const char *from)
{
double units;
char *sp;
@@ -1456,7 +1456,7 @@ struct detgeom *data_template_to_detgeom(const DataTemplate *dt)
/* NB cnx,cny are in pixels, cnz is in m */
detgeom->panels[i].cnx = dt->panels[i].cnx;
detgeom->panels[i].cny = dt->panels[i].cny;
- detgeom->panels[i].cnz = get_length(dt->panels[i].cnz_from);
+ detgeom->panels[i].cnz = dt_get_length(dt->panels[i].cnz_from);
/* Apply offset (in m) and then convert cnz from
* m to pixels */
@@ -1484,7 +1484,7 @@ struct detgeom *data_template_to_detgeom(const DataTemplate *dt)
}
-static int num_placeholders(const struct panel_template *p)
+static int dt_num_placeholders(const struct panel_template *p)
{
int i;
int n_pl = 0;
@@ -1514,7 +1514,7 @@ int data_template_get_slab_extents(const DataTemplate *dt,
return 1;
}
- if ( num_placeholders(p) > 0 ) {
+ if ( dt_num_placeholders(p) > 0 ) {
/* Not slabby */
return 1;
}
diff --git a/libcrystfel/src/felix.c b/libcrystfel/src/felix.c
index 4f6372f4..524e68a7 100644
--- a/libcrystfel/src/felix.c
+++ b/libcrystfel/src/felix.c
@@ -800,7 +800,7 @@ const char *felix_probe(UnitCell *cell)
}
-static void show_help()
+static void felix_show_help()
{
printf("Parameters for the Felix indexing algorithm:\n"
" --felix-domega Degree range of omega (moscaicity) to consider.\n"
@@ -832,7 +832,8 @@ static void show_help()
}
-static error_t parse_arg(int key, char *arg, struct argp_state *state)
+static error_t felix_parse_arg(int key, char *arg,
+ struct argp_state *state)
{
struct felix_options **opts_ptr = state->input;
float tmp;
@@ -855,7 +856,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state)
break;
case 1 :
- show_help();
+ felix_show_help();
return EINVAL;
case 2 :
@@ -939,7 +940,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state)
}
-static struct argp_option options[] = {
+static struct argp_option felix_options[] = {
{"help-felix", 1, NULL, OPTION_NO_USAGE,
"Show options for Felix indexing algorithm", 99},
@@ -958,4 +959,5 @@ static struct argp_option options[] = {
};
-struct argp felix_argp = { options, parse_arg, NULL, NULL, NULL, NULL, NULL };
+struct argp felix_argp = { felix_options, felix_parse_arg,
+ NULL, NULL, NULL, NULL, NULL };
diff --git a/libcrystfel/src/image-hdf5.c b/libcrystfel/src/image-hdf5.c
index fac79e99..c03bf2d2 100644
--- a/libcrystfel/src/image-hdf5.c
+++ b/libcrystfel/src/image-hdf5.c
@@ -204,7 +204,7 @@ int *read_dim_parts(const char *ev_orig, int *pn_dvals)
}
-static int num_path_placeholders(const char *pattern)
+static int imh_num_path_placeholders(const char *pattern)
{
size_t l, i;
int n_pl_exp = 0;
@@ -242,7 +242,7 @@ char *substitute_path(const char *ev, const char *pattern)
plvals = read_path_parts(ev, &n_plvals);
if ( plvals == NULL ) return NULL;
- n_pl_exp = num_path_placeholders(pattern);
+ n_pl_exp = imh_num_path_placeholders(pattern);
if ( n_plvals != n_pl_exp ) {
ERROR("Wrong number of path placeholders: "
@@ -315,7 +315,7 @@ static void make_placeholder_skip(signed int *dt_dims,
}
-static int num_placeholders(const struct panel_template *p)
+static int imh_num_placeholders(const struct panel_template *p)
{
int i;
int n_pl = 0;
@@ -408,7 +408,7 @@ static int load_hdf5_hyperslab(struct panel_template *p,
/* Does the array have the expected number of dimensions? */
total_dt_dims = total_dimensions(p);
- plh_dt_dims = num_placeholders(p);
+ plh_dt_dims = imh_num_placeholders(p);
if ( ndims != total_dt_dims ) {
/* If the dimensions match after excluding
* placeholders, it's OK - probably a static mask
@@ -1230,7 +1230,7 @@ struct ev_list
};
-static int add_to_list(struct ev_list *list, char *ev_str)
+static int add_ev_to_list(struct ev_list *list, char *ev_str)
{
if ( list->n_events == list->max_events ) {
char **new_events = realloc(list->events,
@@ -1366,7 +1366,7 @@ static int rec_expand_paths(hid_t gh, struct ev_list *list,
addme = demunge_event(ev_str_new);
if ( addme != NULL ) {
- add_to_list(list, addme);
+ add_ev_to_list(list, addme);
free(addme);
}
free(ev_str_new);
@@ -1448,7 +1448,7 @@ static int rec_expand_dims(struct ev_list *list,
if ( n_placeholder_dims == 1 ) {
for ( i=0; i<placeholder_sizes[0]; i++ ) {
snprintf(dim_ev, 16, "%s/%i", path_ev, i);
- if ( add_to_list(list, dim_ev) ) return 1;
+ if ( add_ev_to_list(list, dim_ev) ) return 1;
}
} else {
@@ -1520,10 +1520,10 @@ char **image_hdf5_expand_frames(const DataTemplate *dtempl,
/* If the DataTemplate already says that one frame will be
* found per file, short-circuit this whole affair */
- if ( (num_placeholders(&dtempl->panels[0]) == 0)
- && (num_path_placeholders(dtempl->panels[0].data) == 0) )
+ if ( (imh_num_placeholders(&dtempl->panels[0]) == 0)
+ && (imh_num_path_placeholders(dtempl->panels[0].data) == 0) )
{
- add_to_list(&full_evs, "//");
+ add_ev_to_list(&full_evs, "//");
*pn_frames = full_evs.n_events;
return full_evs.events;
}
@@ -1632,7 +1632,7 @@ char **image_hdf5_expand_frames(const DataTemplate *dtempl,
&n_evs_this_path);
for ( j=0; j<n_evs_this_path; j++ ) {
- add_to_list(&full_evs, evs_this_path[j]);
+ add_ev_to_list(&full_evs, evs_this_path[j]);
free(evs_this_path[j]);
}
@@ -1641,7 +1641,7 @@ char **image_hdf5_expand_frames(const DataTemplate *dtempl,
} else {
/* Easy case with no dims to expand */
- add_to_list(&full_evs, path_evs[i]);
+ add_ev_to_list(&full_evs, path_evs[i]);
}
diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c
index 1780526b..68234a33 100644
--- a/libcrystfel/src/image.c
+++ b/libcrystfel/src/image.c
@@ -340,8 +340,8 @@ static char *get_value_and_units(struct image *image, const char *from,
}
-static double get_length(struct image *image, const char *from,
- double default_scale)
+static double im_get_length(struct image *image, const char *from,
+ double default_scale)
{
char *units;
double value;
@@ -445,7 +445,9 @@ void create_detgeom(struct image *image, const DataTemplate *dtempl)
/* NB cnx,cny are in pixels, cnz is in m */
detgeom->panels[i].cnx = dtempl->panels[i].cnx;
detgeom->panels[i].cny = dtempl->panels[i].cny;
- detgeom->panels[i].cnz = get_length(image, dtempl->panels[i].cnz_from, 1e-3);
+ detgeom->panels[i].cnz = im_get_length(image,
+ dtempl->panels[i].cnz_from,
+ 1e-3);
/* Apply offset (in m) and then convert cnz from
* m to pixels */
@@ -453,8 +455,8 @@ void create_detgeom(struct image *image, const DataTemplate *dtempl)
detgeom->panels[i].cnz /= detgeom->panels[i].pixel_pitch;
/* Apply overall shift (already in m) */
- shift_x = get_length(image, dtempl->shift_x_from, 1.0);
- shift_y = get_length(image, dtempl->shift_y_from, 1.0);
+ shift_x = im_get_length(image, dtempl->shift_x_from, 1.0);
+ shift_y = im_get_length(image, dtempl->shift_y_from, 1.0);
if ( !isnan(shift_x) ) {
detgeom->panels[i].cnx += shift_x;
diff --git a/libcrystfel/src/integer_matrix.c b/libcrystfel/src/integer_matrix.c
index 43f41eeb..f54acea5 100644
--- a/libcrystfel/src/integer_matrix.c
+++ b/libcrystfel/src/integer_matrix.c
@@ -253,8 +253,9 @@ void intmat_zero(IntegerMatrix *m)
}
-static IntegerMatrix *delete_row_and_column(const IntegerMatrix *m,
- unsigned int di, unsigned int dj)
+static IntegerMatrix *intmat_delete_row_and_column(const IntegerMatrix *m,
+ unsigned int di,
+ unsigned int dj)
{
IntegerMatrix *n;
unsigned int i, j;
@@ -280,13 +281,13 @@ static IntegerMatrix *delete_row_and_column(const IntegerMatrix *m,
}
-static signed int cofactor(const IntegerMatrix *m,
- unsigned int i, unsigned int j)
+static signed int intmat_cofactor(const IntegerMatrix *m,
+ unsigned int i, unsigned int j)
{
IntegerMatrix *n;
signed int t, C;
- n = delete_row_and_column(m, i, j);
+ n = intmat_delete_row_and_column(m, i, j);
if ( n == NULL ) {
fprintf(stderr, "Failed to allocate matrix.\n");
return 0;
@@ -324,7 +325,7 @@ signed int intmat_det(const IntegerMatrix *m)
i = 0; /* Fixed */
for ( j=0; j<m->cols; j++ ) {
- det += intmat_get(m, i, j) * cofactor(m, i, j);
+ det += intmat_get(m, i, j) * intmat_cofactor(m, i, j);
}
@@ -343,7 +344,7 @@ static IntegerMatrix *intmat_cofactors(const IntegerMatrix *m)
for ( i=0; i<n->rows; i++ ) {
for ( j=0; j<n->cols; j++ ) {
- intmat_set(n, i, j, cofactor(m, i, j));
+ intmat_set(n, i, j, intmat_cofactor(m, i, j));
}
}
diff --git a/libcrystfel/src/integration.c b/libcrystfel/src/integration.c
index 8f81dc10..4a66363b 100644
--- a/libcrystfel/src/integration.c
+++ b/libcrystfel/src/integration.c
@@ -1533,16 +1533,6 @@ int integrate_rings_once(Reflection *refl,
}
-static int compare_double(const void *av, const void *bv)
-{
- double a = *(double *)av;
- double b = *(double *)bv;
- if ( a > b ) return 1;
- if ( a < b ) return -1;
- return 0;
-}
-
-
static double estimate_resolution(UnitCell *cell, ImageFeatureList *flist)
{
int i;
diff --git a/libcrystfel/src/mosflm.c b/libcrystfel/src/mosflm.c
index ef282cbe..bacd345f 100644
--- a/libcrystfel/src/mosflm.c
+++ b/libcrystfel/src/mosflm.c
@@ -201,10 +201,11 @@ static void mosflm_parseline(const char *line, struct image *image,
}
-/* This is the opposite of spacegroup_for_lattice() below.
+/* This is the opposite of mosflm_spacegroup_for_lattice() below.
* Note that this is not general, just a set of rules for interpreting MOSFLM's
* output. */
-static LatticeType spacegroup_to_lattice(const char *sg, char *ua, char *cen)
+static LatticeType mosflm_spacegroup_to_lattice(const char *sg,
+ char *ua, char *cen)
{
LatticeType latt;
@@ -298,7 +299,7 @@ static int read_newmat(struct mosflm_data *mosflm, const char *filename,
return 1;
}
//STATUS("MOSFLM says '%s'\n", symm);
- latt = spacegroup_to_lattice(symm+5, &ua, &cen);
+ latt = mosflm_spacegroup_to_lattice(symm+5, &ua, &cen);
/* MOSFLM "A" matrix is multiplied by lambda, so fix this */
c = 1.0/image->lambda;
@@ -437,7 +438,7 @@ static void mosflm_sendline(const char *line, struct mosflm_data *mosflm)
/* Turn what we know about the unit cell into something which we can give to
* MOSFLM to make it give us only indexing results compatible with the cell. */
-static char *spacegroup_for_lattice(UnitCell *cell)
+static char *mosflm_spacegroup_for_lattice(UnitCell *cell)
{
LatticeType latt;
char centering;
@@ -530,7 +531,7 @@ static void mosflm_send_next(struct image *image, struct mosflm_data *mosflm)
mosflm_sendline("CRYSTAL R\n", mosflm);
}
- symm = spacegroup_for_lattice(mosflm->mp->template);
+ symm = mosflm_spacegroup_for_lattice(mosflm->mp->template);
snprintf(tmp, 255, "SYMM %s\n", symm);
//STATUS("Asking MOSFLM for '%s'\n", symm);
free(symm);
diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c
index 854eaf39..83239236 100644
--- a/libcrystfel/src/peaks.c
+++ b/libcrystfel/src/peaks.c
@@ -723,16 +723,6 @@ void validate_peaks(struct image *image, double min_snr,
}
-static int compare_double(const void *av, const void *bv)
-{
- double a = *(double *)av;
- double b = *(double *)bv;
- if ( a > b ) return 1;
- if ( a < b ) return -1;
- return 0;
-}
-
-
double estimate_peak_resolution(ImageFeatureList *peaks, double lambda,
struct detgeom *det)
{
diff --git a/libcrystfel/src/pinkindexer.c b/libcrystfel/src/pinkindexer.c
index 39913284..b6a33148 100644
--- a/libcrystfel/src/pinkindexer.c
+++ b/libcrystfel/src/pinkindexer.c
@@ -396,7 +396,7 @@ const char *pinkIndexer_probe(UnitCell *cell)
#endif /* HAVE_PINKINDEXER */
-static void show_help()
+static void pinkIndexer_show_help()
{
printf(
"Parameters for the PinkIndexer indexing algorithm:\n"
@@ -440,7 +440,8 @@ static void show_help()
}
-static error_t parse_arg(int key, char *arg, struct argp_state *state)
+static error_t pinkindexer_parse_arg(int key, char *arg,
+ struct argp_state *state)
{
float tmp, tmp2;
struct pinkIndexer_options **opts_ptr = state->input;
@@ -466,7 +467,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state)
break;
case 1 :
- show_help();
+ pinkIndexer_show_help();
return EINVAL;
case 2 :
@@ -576,7 +577,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state)
}
-static struct argp_option options[] = {
+static struct argp_option pinkindexer_options[] = {
{"help-pinkindexer", 1, NULL, OPTION_NO_USAGE,
"Show options for PinkIndexer indexing algorithm", 99},
@@ -617,4 +618,6 @@ static struct argp_option options[] = {
};
-struct argp pinkIndexer_argp = { options, parse_arg, NULL, NULL, NULL, NULL, NULL };
+struct argp pinkIndexer_argp = { pinkindexer_options,
+ pinkindexer_parse_arg,
+ NULL, NULL, NULL, NULL, NULL };
diff --git a/libcrystfel/src/rational.c b/libcrystfel/src/rational.c
index 05bca429..ee46a73b 100644
--- a/libcrystfel/src/rational.c
+++ b/libcrystfel/src/rational.c
@@ -640,8 +640,9 @@ void transform_fractional_coords_rtnl_inverse(const RationalMatrix *P,
}
-static RationalMatrix *delete_row_and_column(const RationalMatrix *m,
- unsigned int di, unsigned int dj)
+static RationalMatrix *rational_delete_row_and_column(const RationalMatrix *m,
+ unsigned int di,
+ unsigned int dj)
{
RationalMatrix *n;
unsigned int i, j;
@@ -667,13 +668,13 @@ static RationalMatrix *delete_row_and_column(const RationalMatrix *m,
}
-static Rational cofactor(const RationalMatrix *m,
- unsigned int i, unsigned int j)
+static Rational rational_cofactor(const RationalMatrix *m,
+ unsigned int i, unsigned int j)
{
RationalMatrix *n;
Rational t, C;
- n = delete_row_and_column(m, i, j);
+ n = rational_delete_row_and_column(m, i, j);
if ( n == NULL ) {
fprintf(stderr, "Failed to allocate matrix.\n");
return rtnl_zero();
@@ -708,7 +709,8 @@ Rational rtnl_mtx_det(const RationalMatrix *m)
det = rtnl_zero();
for ( j=0; j<m->cols; j++ ) {
Rational a;
- a = rtnl_mul(rtnl_mtx_get(m, i, j), cofactor(m, i, j));
+ a = rtnl_mul(rtnl_mtx_get(m, i, j),
+ rational_cofactor(m, i, j));
det = rtnl_add(det, a);
}
diff --git a/libcrystfel/src/reflist.c b/libcrystfel/src/reflist.c
index df8f24fc..d8741a2f 100644
--- a/libcrystfel/src/reflist.c
+++ b/libcrystfel/src/reflist.c
@@ -882,8 +882,11 @@ static Reflection *insert_node(Reflection *refl, Reflection *new)
}
-static void add_to_list(RefList *list, Reflection *new,
- signed int h, signed int k, signed int l)
+static void add_refl_to_list_real(RefList *list,
+ Reflection *new,
+ signed int h,
+ signed int k,
+ signed int l)
{
Reflection *f;
@@ -929,7 +932,7 @@ Reflection *add_refl(RefList *list, signed int h, signed int k, signed int l)
new = new_node(SERIAL(h, k, l));
if ( new == NULL ) return NULL;
- add_to_list(list, new, h, k, l);
+ add_refl_to_list_real(list, new, h, k, l);
return new;
}
@@ -948,7 +951,7 @@ void add_refl_to_list(Reflection *refl, RefList *list)
get_indices(refl, &h, &k, &l);
- add_to_list(list, refl, h, k, l);
+ add_refl_to_list_real(list, refl, h, k, l);
}
diff --git a/libcrystfel/src/taketwo.c b/libcrystfel/src/taketwo.c
index a67d372c..5b5bff59 100644
--- a/libcrystfel/src/taketwo.c
+++ b/libcrystfel/src/taketwo.c
@@ -2269,7 +2269,7 @@ const char *taketwo_probe(UnitCell *cell)
}
-static void show_help()
+static void taketwo_show_help()
{
printf("Parameters for the TakeTwo indexing algorithm:\n"
" --taketwo-member-threshold\n"
@@ -2284,7 +2284,8 @@ static void show_help()
}
-static error_t parse_arg(int key, char *arg, struct argp_state *state)
+static error_t taketwo_parse_arg(int key, char *arg,
+ struct argp_state *state)
{
struct taketwo_options **opts_ptr = state->input;
float tmp;
@@ -2301,7 +2302,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state)
break;
case 1 :
- show_help();
+ taketwo_show_help();
return EINVAL;
case 2 :
@@ -2348,7 +2349,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state)
}
-static struct argp_option options[] = {
+static struct argp_option taketwo_options[] = {
{"help-taketwo", 1, NULL, OPTION_NO_USAGE,
"Show options for TakeTwo indexing algorithm", 99},
@@ -2361,4 +2362,5 @@ static struct argp_option options[] = {
};
-struct argp taketwo_argp = { options, parse_arg, NULL, NULL, NULL, NULL, NULL };
+struct argp taketwo_argp = { taketwo_options, taketwo_parse_arg,
+ NULL, NULL, NULL, NULL, NULL };
diff --git a/libcrystfel/src/utils.c b/libcrystfel/src/utils.c
index 048180cf..8391fe95 100644
--- a/libcrystfel/src/utils.c
+++ b/libcrystfel/src/utils.c
@@ -803,6 +803,16 @@ char *load_entire_file(const char *filename)
}
+int compare_double(const void *av, const void *bv)
+{
+ double a = *(double *)av;
+ double b = *(double *)bv;
+ if ( a > b ) return 1;
+ if ( a < b ) return -1;
+ return 0;
+}
+
+
/* -------------------------- libcrystfel features ------------------------ */
int crystfel_has_peakfinder9()
diff --git a/libcrystfel/src/utils.h b/libcrystfel/src/utils.h
index be252672..51158e8b 100644
--- a/libcrystfel/src/utils.h
+++ b/libcrystfel/src/utils.h
@@ -267,6 +267,8 @@ extern struct quaternion random_quaternion(gsl_rng *rng);
extern int quaternion_valid(struct quaternion q);
extern struct rvec quat_rot(struct rvec q, struct quaternion z);
+extern int compare_double(const void *av, const void *bv);
+
/* Keep these ones inline, to avoid function call overhead */
static inline struct quaternion invalid_quaternion(void)
{
diff --git a/libcrystfel/src/xds.c b/libcrystfel/src/xds.c
index 03e01179..02610d5e 100644
--- a/libcrystfel/src/xds.c
+++ b/libcrystfel/src/xds.c
@@ -73,7 +73,7 @@ struct xds_private
};
-/* Essentially the reverse of spacegroup_for_lattice(), below */
+/* Essentially the reverse of xds_spacegroup_for_lattice(), below */
static int convert_spacegroup_number(int spg, LatticeType *lt, char *cen,
char *ua)
{
@@ -240,7 +240,7 @@ static void write_spot(struct image *image)
/* Turn what we know about the unit cell into something which we can give to
* XDS to make it give us only indexing results compatible with the cell. */
-static const char *spacegroup_for_lattice(UnitCell *cell)
+static const char *xds_spacegroup_for_lattice(UnitCell *cell)
{
LatticeType latt;
char centering;
@@ -335,7 +335,7 @@ static int write_inp(struct image *image, struct xds_private *xp)
if ( xp->indm & INDEXING_USE_LATTICE_TYPE ) {
fprintf(fh, "SPACE_GROUP_NUMBER= %s\n",
- spacegroup_for_lattice(xp->cell));
+ xds_spacegroup_for_lattice(xp->cell));
} else {
fprintf(fh, "SPACE_GROUP_NUMBER= 0\n");
}
@@ -461,7 +461,7 @@ void *xds_prepare(IndexingMethod *indm, UnitCell *cell)
return NULL;
}
- if ( (cell != NULL) && (spacegroup_for_lattice(cell) == NULL) ) {
+ if ( (cell != NULL) && (xds_spacegroup_for_lattice(cell) == NULL) ) {
ERROR("Don't know how to ask XDS for your cell.\n");
return NULL;
}
diff --git a/libcrystfel/src/xgandalf.c b/libcrystfel/src/xgandalf.c
index 9135c2f3..c66bff6c 100644
--- a/libcrystfel/src/xgandalf.c
+++ b/libcrystfel/src/xgandalf.c
@@ -346,7 +346,7 @@ const char *xgandalf_probe(UnitCell *cell)
#endif // HAVE_XGANDALF
-static void show_help()
+static void xgandalf_show_help()
{
printf("Parameters for the TakeTwo indexing algorithm:\n"
" --xgandalf-sampling-pitch\n"
@@ -378,7 +378,8 @@ static void show_help()
}
-static error_t parse_arg(int key, char *arg, struct argp_state *state)
+static error_t xgandalf_parse_arg(int key, char *arg,
+ struct argp_state *state)
{
struct xgandalf_options **opts_ptr = state->input;
@@ -397,7 +398,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state)
break;
case 1 :
- show_help();
+ xgandalf_show_help();
return EINVAL;
case 2 :
@@ -457,7 +458,7 @@ static error_t parse_arg(int key, char *arg, struct argp_state *state)
}
-static struct argp_option options[] = {
+static struct argp_option xgandalf_options[] = {
{"help-xgandalf", 1, NULL, OPTION_NO_USAGE,
"Show options for XGANDALF indexing algorithm", 99},
@@ -488,4 +489,5 @@ static struct argp_option options[] = {
};
-struct argp xgandalf_argp = { options, parse_arg, NULL, NULL, NULL, NULL, NULL };
+struct argp xgandalf_argp = { xgandalf_options, xgandalf_parse_arg,
+ NULL, NULL, NULL, NULL, NULL };
diff --git a/src/post-refinement.c b/src/post-refinement.c
index b3ce79c1..09438a82 100644
--- a/src/post-refinement.c
+++ b/src/post-refinement.c
@@ -753,7 +753,7 @@ struct refine_args
};
-struct queue_args
+struct pr_queue_args
{
int n_started;
int n_done;
@@ -780,7 +780,7 @@ static void refine_image(void *task, int id)
static void *get_image(void *vqargs)
{
struct refine_args *task;
- struct queue_args *qargs = vqargs;
+ struct pr_queue_args *qargs = vqargs;
task = malloc(sizeof(struct refine_args));
memcpy(task, &qargs->task_defaults, sizeof(struct refine_args));
@@ -796,7 +796,7 @@ static void *get_image(void *vqargs)
static void done_image(void *vqargs, void *task)
{
- struct queue_args *qa = vqargs;
+ struct pr_queue_args *qa = vqargs;
qa->n_done++;
@@ -811,7 +811,7 @@ void refine_all(Crystal **crystals, int n_crystals,
SymOpList *sym, SymOpList *amb, int scaleflags)
{
struct refine_args task_defaults;
- struct queue_args qargs;
+ struct pr_queue_args qargs;
task_defaults.full = full;
task_defaults.crystal = NULL;
diff --git a/src/scaling.c b/src/scaling.c
index 368c3ab5..864bab6f 100644
--- a/src/scaling.c
+++ b/src/scaling.c
@@ -57,7 +57,7 @@ struct scale_args
};
-struct queue_args
+struct scale_queue_args
{
int n_started;
int n_done;
@@ -77,7 +77,7 @@ static void scale_crystal(void *task, int id)
static void *get_crystal(void *vqargs)
{
struct scale_args *task;
- struct queue_args *qargs = vqargs;
+ struct scale_queue_args *qargs = vqargs;
task = malloc(sizeof(struct scale_args));
memcpy(task, &qargs->task_defaults, sizeof(struct scale_args));
@@ -92,7 +92,7 @@ static void *get_crystal(void *vqargs)
static void done_crystal(void *vqargs, void *task)
{
- struct queue_args *qa = vqargs;
+ struct scale_queue_args *qa = vqargs;
qa->n_done++;
progress_bar(qa->n_done, qa->n_crystals, "Scaling");
free(task);
@@ -124,7 +124,7 @@ static double total_log_r(Crystal **crystals, int n_crystals, RefList *full,
void scale_all(Crystal **crystals, int n_crystals, int nthreads, int scaleflags)
{
struct scale_args task_defaults;
- struct queue_args qargs;
+ struct scale_queue_args qargs;
double old_res, new_res;
int niter = 0;