aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src
diff options
context:
space:
mode:
Diffstat (limited to 'libcrystfel/src')
-rw-r--r--libcrystfel/src/cell.c2
-rw-r--r--libcrystfel/src/cell.h2
-rw-r--r--libcrystfel/src/index.c2
-rw-r--r--libcrystfel/src/index.h3
-rw-r--r--libcrystfel/src/mosflm.c7
5 files changed, 9 insertions, 7 deletions
diff --git a/libcrystfel/src/cell.c b/libcrystfel/src/cell.c
index 31d3b9b1..b6ea010b 100644
--- a/libcrystfel/src/cell.c
+++ b/libcrystfel/src/cell.c
@@ -694,7 +694,7 @@ static int same_vector(struct cvec a, struct cvec b)
/* Attempt to make 'cell' fit into 'template' somehow */
UnitCell *match_cell(UnitCell *cell, UnitCell *template, int verbose,
- float *tols, int reduce)
+ const float *tols, int reduce)
{
signed int n1l, n2l, n3l;
double asx, asy, asz;
diff --git a/libcrystfel/src/cell.h b/libcrystfel/src/cell.h
index cbe84772..bd2719dd 100644
--- a/libcrystfel/src/cell.h
+++ b/libcrystfel/src/cell.h
@@ -118,7 +118,7 @@ extern UnitCell *rotate_cell(UnitCell *in, double omega, double phi,
extern void cell_print(UnitCell *cell);
extern UnitCell *match_cell(UnitCell *cell, UnitCell *tempcell, int verbose,
- float *ltl, int reduce);
+ const float *ltl, int reduce);
extern UnitCell *match_cell_ab(UnitCell *cell, UnitCell *tempcell);
diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c
index f4bc9d6c..102a5312 100644
--- a/libcrystfel/src/index.c
+++ b/libcrystfel/src/index.c
@@ -167,7 +167,7 @@ void map_all_peaks(struct image *image)
void index_pattern(struct image *image, UnitCell *cell, IndexingMethod *indm,
int cellr, int verbose, IndexingPrivate **ipriv,
- int config_insane, float *ltl)
+ int config_insane, const float *ltl)
{
int i;
int n = 0;
diff --git a/libcrystfel/src/index.h b/libcrystfel/src/index.h
index c4e15f09..9d23f3fb 100644
--- a/libcrystfel/src/index.h
+++ b/libcrystfel/src/index.h
@@ -74,7 +74,8 @@ extern void map_all_peaks(struct image *image);
extern void index_pattern(struct image *image, UnitCell *cell,
IndexingMethod *indm, int cellr, int verbose,
- IndexingPrivate **priv, int config_insane, float *ltl);
+ IndexingPrivate **priv, int config_insane,
+ const float *ltl);
extern void cleanup_indexing(IndexingPrivate **priv);
diff --git a/libcrystfel/src/mosflm.c b/libcrystfel/src/mosflm.c
index 410b779a..ed118aa4 100644
--- a/libcrystfel/src/mosflm.c
+++ b/libcrystfel/src/mosflm.c
@@ -379,7 +379,6 @@ static int mosflm_readable(struct image *image, struct mosflm_data *mosflm)
rval = read(mosflm->pty, mosflm->rbuffer+mosflm->rbufpos,
mosflm->rbuflen-mosflm->rbufpos);
-
if ( (rval == -1) || (rval == 0) ) return 1;
mosflm->rbufpos += rval;
@@ -436,7 +435,6 @@ static int mosflm_readable(struct image *image, struct mosflm_data *mosflm)
break;
case MOSFLM_INPUT_PROMPT :
-
mosflm_send_next(image, mosflm);
endbit_length = i+7;
break;
@@ -513,6 +511,7 @@ void run_mosflm(struct image *image, UnitCell *cell)
remove(mosflm->newmatfile);
mosflm->pid = forkpty(&mosflm->pty, NULL, NULL, NULL);
+
if ( mosflm->pid == -1 ) {
ERROR("Failed to fork for MOSFLM\n");
free(mosflm);
@@ -545,6 +544,7 @@ void run_mosflm(struct image *image, UnitCell *cell)
mosflm->step = 1; /* This starts the "initialisation" procedure */
mosflm->finished_ok = 0;
+
do {
fd_set fds;
@@ -559,7 +559,7 @@ void run_mosflm(struct image *image, UnitCell *cell)
sval = select(mosflm->pty+1, &fds, NULL, NULL, &tv);
- if ( sval == -1 ) {
+ if ( sval == -1 ) {
int err = errno;
ERROR("select() failed: %s\n", strerror(err));
rval = 1;
@@ -570,6 +570,7 @@ void run_mosflm(struct image *image, UnitCell *cell)
rval = 1;
}
+
} while ( !rval );
close(mosflm->pty);