Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exploreApp/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include $(TOP)/configure/CONFIG

USR_CPPFLAGS += -I$(TOP)/common

PROD_SYS_LIBS_WIN32 += ws2_32 advapi32 user32
USR_SYS_LIBS_WIN32 += ws2_32 advapi32 user32

# explore app doesn't build with older vxworks (eg. tornado22)
# don't build at all until someone asks
Expand Down
36 changes: 20 additions & 16 deletions exploreApp/src/devexplore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ struct priv {
template<typename VAL>
VAL read(epicsUInt32 off=0) const
{
epicsUInt32 OV(readraw<VAL>(off));
epicsUInt32 OV(readraw<epicsUInt32>(off));
if(vmask) OV &= vmask;
OV >>= vshift;
return OV;
Expand All @@ -152,7 +152,7 @@ struct priv {
unsigned i;
for(i=0; i<count && addr<end; i++, addr+=step)
{
epicsUInt32 OV = read<VAL>(addr);
epicsUInt32 OV = read<epicsUInt32>(addr);
*val++ = castval<VAL,epicsUInt32>::op(OV);
}
return i;
Expand Down Expand Up @@ -408,14 +408,14 @@ long explore_read_real_val(REC *prec)
Guard G(pvt->lock);
ival = pun.ival = pvt->read<epicsUInt32>();
}
epicsFloat64 dval = pun.fval;
dval += prec->roff;
if(prec->aslo) dval *= prec->aslo;
dval += prec->aoff;
if(prec->eslo) dval *= prec->eslo;
dval += prec->eoff;

pun.fval += prec->roff;
if(prec->aslo) pun.fval *= prec->aslo;
pun.fval += prec->aoff;
if(prec->eslo) pun.fval *= prec->eslo;
pun.fval += prec->eoff;

prec->val = pun.fval;
prec->val = dval;

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

pun.fval -= prec->eoff;
if(prec->eslo) pun.fval /= prec->eslo;
pun.fval -= prec->aoff;
if(prec->aslo) pun.fval /= prec->aslo;
pun.fval -= prec->roff;
dval -= prec->eoff;
if(prec->eslo) dval /= prec->eslo;
dval -= prec->aoff;
if(prec->aslo) dval /= prec->aslo;
dval -= prec->roff;
pun.fval = (epicsFloat32)dval;

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

} // namespace

extern "C" {

#define SUP(NAME, REC, OP, DIR, SIZE, END) static dset6<REC##Record> NAME = \
{6, NULL, NULL, &explore_init_record_##OP<REC##Record,SIZE,END>, NULL, &explore_##DIR##_##OP<REC##Record>, NULL}; \
epicsExportAddress(dset, NAME)
Expand Down Expand Up @@ -637,3 +640,4 @@ SUP(devExploreWfWriteU16MSB, write, 2, priv::BE);
SUP(devExploreWfWriteU32NAT, write, 4, priv::NAT);
SUP(devExploreWfWriteU32LSB, write, 4, priv::LE);
SUP(devExploreWfWriteU32MSB, write, 4, priv::BE);
} // extern "C"
8 changes: 7 additions & 1 deletion exploreApp/src/devexplore_frib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
*/
// FRIB specific operations

#define NOMINMAX
#include <algorithm>
#include <list>
#include <vector>
#include <memory>
Expand All @@ -18,6 +20,7 @@
#include <dbScan.h>
#include <epicsThread.h>
#include <recGbl.h>
#include <dbAccess.h>
#include <waveformRecord.h>
#include <longoutRecord.h>
#include <mbbiRecord.h>
Expand Down Expand Up @@ -161,7 +164,7 @@ struct flashProg : public epicsThreadRunable {
assert((file.size()%16u==0));

const epicsUInt32 fstart = flash_offset,
fend = flash_offset + std::min(file.size(), (size_t)flash_size);
fend = flash_offset + std::min((epicsUInt32)file.size(), flash_size);

epicsUInt32 id = read32(REG_LOCKOUT);
if(id!=0xF1A54001)
Expand Down Expand Up @@ -440,6 +443,9 @@ struct dset6 {

} // namespace

extern "C" {
DSET(devExploreFRIBFlashWf, &init_record_common, NULL, &load_bitfile_wf);
DSET(devExploreFRIBFlashLo, &init_record_common, NULL, &startstop_lo);
DSET(devExploreFRIBFlashMbbi, &init_record_common, &status_get_iointr_info, &status_mbbi);
} // extern "C"

2 changes: 1 addition & 1 deletion exploreApp/src/testexplore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct Channel {
val.resize(nReq);
}
void put_int32(const std::vector<epicsUInt32>& val) {
if(dbChannelPutField(chan, DBF_ULONG, &val[0], val.size()))
if(dbChannelPutField(chan, DBF_ULONG, &val[0], (long)val.size()))
testAbort("get %s fails", dbChannelName(chan));
}
};
Expand Down
5 changes: 5 additions & 0 deletions pciApp/devLibPCI.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
#define strdup(x) ({char*s=malloc(strlen(x)+1);s?strcpy(s,x):s;})
#endif

#ifdef _WIN32
/* Windows uses different name for strtok_r */
#define strtok_r strtok_s
#endif

int devPCIDebug = 0;

static ELLLIST pciDrivers;
Expand Down
2 changes: 1 addition & 1 deletion pciApp/os/Linux/devLibPCIOSD.c
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ linuxDevPCIFindCB(
static const char* fd2filename(int fd, char* buffer, size_t buffersize)
{
char procfile[32];
size_t n;
ssize_t n;

sprintf(procfile, "/proc/self/fd/%d", fd);
n = readlink(procfile, buffer, buffersize-1);
Expand Down
4 changes: 2 additions & 2 deletions vmeApp/vmesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ int validate_widths(epicsUInt32 addr, int amod, int dmod, int count, volatile vo
return 1;
}

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

return 0;
}
Expand Down Expand Up @@ -182,7 +182,7 @@ static
void vmesh_handler(void *raw)
{
volatile epicsUInt8 *ent = raw;
unsigned vect = ent-vmeautodisable;
unsigned char vect = (unsigned char)(ent-vmeautodisable);
char msg[] = "VME IRQ on vector 0xXY\n";
unsigned I = sizeof(msg)-3;

Expand Down