Skip to content

Commit b985d89

Browse files
authored
Merge c4e03e0 into b91de84
2 parents b91de84 + c4e03e0 commit b985d89

File tree

6 files changed

+36
-21
lines changed

6 files changed

+36
-21
lines changed

exploreApp/src/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ include $(TOP)/configure/CONFIG
77

88
USR_CPPFLAGS += -I$(TOP)/common
99

10-
PROD_SYS_LIBS_WIN32 += ws2_32 advapi32 user32
10+
USR_SYS_LIBS_WIN32 += ws2_32 advapi32 user32
1111

1212
# explore app doesn't build with older vxworks (eg. tornado22)
1313
# don't build at all until someone asks

exploreApp/src/devexplore.cpp

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ struct priv {
138138
template<typename VAL>
139139
VAL read(epicsUInt32 off=0) const
140140
{
141-
epicsUInt32 OV(readraw<VAL>(off));
141+
epicsUInt32 OV(readraw<epicsUInt32>(off));
142142
if(vmask) OV &= vmask;
143143
OV >>= vshift;
144144
return OV;
@@ -152,7 +152,7 @@ struct priv {
152152
unsigned i;
153153
for(i=0; i<count && addr<end; i++, addr+=step)
154154
{
155-
epicsUInt32 OV = read<VAL>(addr);
155+
epicsUInt32 OV = read<epicsUInt32>(addr);
156156
*val++ = castval<VAL,epicsUInt32>::op(OV);
157157
}
158158
return i;
@@ -408,14 +408,14 @@ long explore_read_real_val(REC *prec)
408408
Guard G(pvt->lock);
409409
ival = pun.ival = pvt->read<epicsUInt32>();
410410
}
411+
epicsFloat64 dval = pun.fval;
412+
dval += prec->roff;
413+
if(prec->aslo) dval *= prec->aslo;
414+
dval += prec->aoff;
415+
if(prec->eslo) dval *= prec->eslo;
416+
dval += prec->eoff;
411417

412-
pun.fval += prec->roff;
413-
if(prec->aslo) pun.fval *= prec->aslo;
414-
pun.fval += prec->aoff;
415-
if(prec->eslo) pun.fval *= prec->eslo;
416-
pun.fval += prec->eoff;
417-
418-
prec->val = pun.fval;
418+
prec->val = dval;
419419

420420
if(prec->tpro>1) {
421421
errlogPrintf("%s: read %08x -> %08x -> VAL=%g\n", prec->name, (unsigned)pvt->offset, (unsigned)ival, prec->val);
@@ -430,13 +430,14 @@ long explore_write_real_val(REC *prec)
430430
{
431431
TRY {
432432
punny32 pun;
433-
pun.fval = prec->val;
433+
epicsFloat64 dval = prec->val;
434434

435-
pun.fval -= prec->eoff;
436-
if(prec->eslo) pun.fval /= prec->eslo;
437-
pun.fval -= prec->aoff;
438-
if(prec->aslo) pun.fval /= prec->aslo;
439-
pun.fval -= prec->roff;
435+
dval -= prec->eoff;
436+
if(prec->eslo) dval /= prec->eslo;
437+
dval -= prec->aoff;
438+
if(prec->aslo) dval /= prec->aslo;
439+
dval -= prec->roff;
440+
pun.fval = (epicsFloat32)dval;
440441

441442
if(prec->tpro>1) {
442443
errlogPrintf("%s: write %08x <- %08x <- VAL=%g\n", prec->name, (unsigned)pvt->offset, (unsigned)pun.ival, prec->val);
@@ -485,7 +486,7 @@ long explore_write_wf(waveformRecord *prec)
485486
{
486487
TRY {
487488
Guard G(pvt->lock);
488-
unsigned nwritten = -1;
489+
unsigned nwritten = 0;
489490
switch(prec->ftvl) {
490491
case menuFtypeCHAR :
491492
case menuFtypeUCHAR : nwritten = pvt->writeArray((epicsUInt8*) prec->bptr, prec->nord); break;
@@ -527,6 +528,8 @@ struct dset6 {
527528

528529
} // namespace
529530

531+
extern "C" {
532+
530533
#define SUP(NAME, REC, OP, DIR, SIZE, END) static dset6<REC##Record> NAME = \
531534
{6, NULL, NULL, &explore_init_record_##OP<REC##Record,SIZE,END>, NULL, &explore_##DIR##_##OP<REC##Record>, NULL}; \
532535
epicsExportAddress(dset, NAME)
@@ -637,3 +640,4 @@ SUP(devExploreWfWriteU16MSB, write, 2, priv::BE);
637640
SUP(devExploreWfWriteU32NAT, write, 4, priv::NAT);
638641
SUP(devExploreWfWriteU32LSB, write, 4, priv::LE);
639642
SUP(devExploreWfWriteU32MSB, write, 4, priv::BE);
643+
} // extern "C"

exploreApp/src/devexplore_frib.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
*/
55
// FRIB specific operations
66

7+
#define NOMINMAX
8+
#include <algorithm>
79
#include <list>
810
#include <vector>
911
#include <memory>
@@ -18,6 +20,7 @@
1820
#include <dbScan.h>
1921
#include <epicsThread.h>
2022
#include <recGbl.h>
23+
#include <dbAccessDefs.h>
2124
#include <waveformRecord.h>
2225
#include <longoutRecord.h>
2326
#include <mbbiRecord.h>
@@ -161,7 +164,7 @@ struct flashProg : public epicsThreadRunable {
161164
assert((file.size()%16u==0));
162165

163166
const epicsUInt32 fstart = flash_offset,
164-
fend = flash_offset + std::min(file.size(), (size_t)flash_size);
167+
fend = flash_offset + std::min((epicsUInt32)file.size(), flash_size);
165168

166169
epicsUInt32 id = read32(REG_LOCKOUT);
167170
if(id!=0xF1A54001)
@@ -440,6 +443,9 @@ struct dset6 {
440443

441444
} // namespace
442445

446+
extern "C" {
443447
DSET(devExploreFRIBFlashWf, &init_record_common, NULL, &load_bitfile_wf);
444448
DSET(devExploreFRIBFlashLo, &init_record_common, NULL, &startstop_lo);
445449
DSET(devExploreFRIBFlashMbbi, &init_record_common, &status_get_iointr_info, &status_mbbi);
450+
} // extern "C"
451+

exploreApp/src/testexplore.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct Channel {
5050
val.resize(nReq);
5151
}
5252
void put_int32(const std::vector<epicsUInt32>& val) {
53-
if(dbChannelPutField(chan, DBF_ULONG, &val[0], val.size()))
53+
if(dbChannelPutField(chan, DBF_ULONG, &val[0], (long)val.size()))
5454
testAbort("get %s fails", dbChannelName(chan));
5555
}
5656
};

pciApp/devLibPCI.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@
3939
#define strdup(x) ({char*s=malloc(strlen(x)+1);s?strcpy(s,x):s;})
4040
#endif
4141

42+
#ifdef _WIN32
43+
/* Windows uses different name for strtok_r */
44+
#define strtok_r strtok_s
45+
#endif
46+
4247
int devPCIDebug = 0;
4348

4449
static ELLLIST pciDrivers;

vmeApp/vmesh.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ int validate_widths(epicsUInt32 addr, int amod, int dmod, int count, volatile vo
6767
return 1;
6868
}
6969

70-
epicsPrintf("Mapped to 0x%08lx\n",(unsigned long)*mptr);
70+
epicsPrintf("Mapped to 0x%p\n",*mptr);
7171

7272
return 0;
7373
}
@@ -182,7 +182,7 @@ static
182182
void vmesh_handler(void *raw)
183183
{
184184
volatile epicsUInt8 *ent = raw;
185-
unsigned vect = ent-vmeautodisable;
185+
unsigned char vect = (unsigned char)(ent-vmeautodisable);
186186
char msg[] = "VME IRQ on vector 0xXY\n";
187187
unsigned I = sizeof(msg)-3;
188188

0 commit comments

Comments
 (0)