From cc5948ad0b0ce45b37dd5f8e9d4e63fdaf9546f3 Mon Sep 17 00:00:00 2001 From: zimoch Date: Fri, 17 Jul 2015 13:24:37 +0000 Subject: [PATCH] If ai uses no conversion, transport long i/o to and from val directly. This preverves more bits on 64 bit systems than going through the 32 bit rval field. --- src/devaiStream.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/devaiStream.c b/src/devaiStream.c index 02ae6dd..c22887a 100644 --- a/src/devaiStream.c +++ b/src/devaiStream.c @@ -20,6 +20,7 @@ #include "devStream.h" #include +#include #include static long readData (dbCommon *record, format_t *format) @@ -45,6 +46,11 @@ static long readData (dbCommon *record, format_t *format) { long rval; if (streamScanf (record, format, &rval)) return ERROR; + if (ai->linr == menuConvertNO_CONVERSION) + { + ai->val = (double) rval; + return DO_NOT_CONVERT; + } ai->rval = rval; return OK; } @@ -67,6 +73,10 @@ static long writeData (dbCommon *record, format_t *format) } case DBF_LONG: { + if (ai->linr == menuConvertNO_CONVERSION) + { + return streamPrintf (record, format, (long) ai->val); + } return streamPrintf (record, format, (long) ai->rval); } }