From f6b8e0eae4374f339487a33e3e4fe5462d5816e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 25 Nov 2017 10:16:00 +0100 Subject: New upstream version 2.0.0 --- spectro/dtp22.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) mode change 100644 => 100755 spectro/dtp22.c (limited to 'spectro/dtp22.c') diff --git a/spectro/dtp22.c b/spectro/dtp22.c old mode 100644 new mode 100755 index 37249f0..34a8506 --- 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 */ -- cgit v1.2.3