summaryrefslogtreecommitdiff
path: root/spectro/dtp22.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-12-01 10:32:14 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-12-01 10:32:14 +0100
commit4097e27114d227692d53c5d28487e12a3833cd24 (patch)
treed5c2a62c4db97de94f92150340612c64d3997669 /spectro/dtp22.c
parentf8a0a4e1c775a90c313cb83201eec4cea4e9a7da (diff)
parent5514d94483c98e3320b202b1bb882023a7d12027 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'spectro/dtp22.c')
-rwxr-xr-x[-rw-r--r--]spectro/dtp22.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/spectro/dtp22.c b/spectro/dtp22.c
index 37249f0..34a8506 100644..100755
--- a/spectro/dtp22.c
+++ b/spectro/dtp22.c
@@ -51,6 +51,7 @@
#include "sa_config.h"
#include "numsup.h"
#endif /* !SALONEINSTLIB */
+#include "cgats.h"
#include "xspect.h"
#include "insttypes.h"
#include "conv.h"
@@ -97,9 +98,7 @@ extract_ec(char *s) {
if (*p == '>')
break;
}
- if ( (p-3) < s
- || p[0] != '>'
- || p[-3] != '<')
+ if ((p-3) < s || p[0] != '>' || p[-3] != '<')
return -1;
tt[0] = p[-2];
tt[1] = p[-1];
@@ -517,8 +516,8 @@ instClamping clamp) { /* NZ if clamp XYZ/Lab to be +ve */
}
}
} else { /* Inst error or switch activated */
- if (strlen(buf) >= 4
- && buf[0] == '<' && isdigit(buf[1]) && isdigit(buf[2]) && buf[3] == '>') {
+ if ((strlen(buf) >= 4
+ && buf[0] == '<' && isdigit(buf[1]) && isdigit(buf[2]) && buf[3] == '>')) {
if ((ev = dtp22_interp_code((inst *)p, extract_ec(buf))) != inst_ok) {
dtp22_command(p, "CE\r", buf, MAX_MES_SIZE, 0.5);
dtp22_command(p, "2PB\r", buf, MAX_MES_SIZE, 0.5);
@@ -747,8 +746,8 @@ char id[CALIDLEN] /* Condition identifier (ie. white reference ID) */
}
}
} else { /* Inst error or switch activated */
- if (strlen(buf) >= 4
- && buf[0] == '<' && isdigit(buf[1]) && isdigit(buf[2]) && buf[3] == '>') {
+ if ((strlen(buf) >= 4
+ && buf[0] == '<' && isdigit(buf[1]) && isdigit(buf[2]) && buf[3] == '>')) {
if ((ev = dtp22_interp_code((inst *)p, extract_ec(buf))) != inst_ok) {
dtp22_command(p, "CE\r", buf, MAX_MES_SIZE, 0.5);
if (ev != inst_ok)
@@ -1145,7 +1144,7 @@ extern dtp22 *new_dtp22(icoms *icom, instType itype) {
p->del = dtp22_del;
p->icom = icom;
- p->itype = itype;
+ p->dtype = itype;
p->mode = inst_mode_none;
p->need_cal = 1; /* Do a white calibration each time we open the device */