Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify Makefile, fix compiler warnings, clean up #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 1 addition & 2 deletions EzcaArray.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,6 @@ struct event_handler_args args;
/* int *pint; */
short *ps;
long *plong;
int count;
chandata *pchandata;
struct dbrtemp { chandata *pchan;
int rtype;
Expand All @@ -593,7 +592,7 @@ struct event_handler_args args;

temparg = (struct dbrtemp *)args.usr;
pchandata = (chandata *)ca_puser(args.chid);
count = ca_element_count(pchandata->chid);
ca_element_count(pchandata->chid);

#ifdef ACCESS_SECURITY
if (args.status == ECA_NORMAL) {
Expand Down
27 changes: 2 additions & 25 deletions EzcaFunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,30 +48,7 @@ epicsShareDef struct caGlobals epicsShareFunc CA = {
void epicsShareAPI Ezca_sleep_time(t)
double t; /* wait in seconds can be decimal*/
{
#ifdef BASE_3_14
epicsThreadSleep(t);
#else

/* usleep isn't ANSI-C/POSIX
*/
unsigned u;
#if defined(HP_UX)
sleep((unsigned int)t);
#elif defined(VMS)
LIB$WAIT(t);
#elif defined(SGI)
sleep((unsigned int)t);
#elif defined(SOLARIS)
usleep((unsigned int)t);
#elif defined(_WIN32)
u = 1000 * t;
Sleep(u);
#else
u = 1000000 * t;
usleep(u);
#endif

#endif
}


Expand All @@ -83,7 +60,7 @@ int epicsShareAPI Ezca_find_dev(name,pchandata)
char *name;
chandata **pchandata;
{
int status,command_error;
int command_error;

/* populate hash table here return the address */

Expand All @@ -98,7 +75,7 @@ int status,command_error;

if ((*pchandata)->type != TYPENOTCONN) return (CA_SUCCESS);

status = ca_pend_io(CA.PEND_IO_TIME);
ca_pend_io(CA.PEND_IO_TIME);

(*pchandata)->type = ca_field_type((*pchandata)->chid);
(*pchandata)->state = ca_state((*pchandata)->chid);
Expand Down
2 changes: 1 addition & 1 deletion EzcaHash.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static int TT[256] = {
static int hash7(s)
char *s;
{
int i,len;
size_t i,len;
int h,h0,h1;
char *str;

Expand Down
6 changes: 2 additions & 4 deletions EzcaMonitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ void Ezca_monitorValueChangeEvent(args)
struct event_handler_args args;
{
chandata *pchandata;
double time;

pchandata = (chandata *)args.usr;

Expand All @@ -185,7 +184,7 @@ struct event_handler_args args;
pchandata->event = 1;
pchandata->stamp = ((struct dbr_time_double *)args.dbr)->stamp;
if (CA.devprflag > 1) {
time = Ezca_iocClockTime(&pchandata->stamp);
Ezca_iocClockTime(&pchandata->stamp);
fprintf(stderr,"New: name=%s, value=%f, stat=%d, sevr=%d, event=%d\n",
ca_name(pchandata->chid),
pchandata->value, pchandata->status,
Expand All @@ -209,7 +208,6 @@ void Ezca_monitorStringChangeEvent(args)
struct event_handler_args args;
{
chandata *pchandata;
double time;

pchandata = (chandata *)args.usr;

Expand All @@ -230,7 +228,7 @@ struct event_handler_args args;
pchandata->event = 1;
pchandata->stamp = ((struct dbr_time_string *)args.dbr)->stamp;
if (CA.devprflag > 1) {
time = Ezca_iocClockTime(&pchandata->stamp);
Ezca_iocClockTime(&pchandata->stamp);
fprintf(stderr,"NewString: name=%s, value=%s, stat=%d, sevr=%d, event=%d\n",
ca_name(pchandata->chid),
pchandata->string, pchandata->status,
Expand Down
6 changes: 2 additions & 4 deletions EzcaQueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ void Ezca_queueValueChangeCallback(args)
struct event_handler_args args;
{
chandata *pchandata;
double time;

pchandata = (chandata *)args.usr;

Expand All @@ -85,7 +84,7 @@ struct event_handler_args args;

pchandata->stamp = ((struct dbr_time_double *)args.dbr)->stamp;
if (CA.devprflag > 1) {
time = Ezca_iocClockTime(&pchandata->stamp);
Ezca_iocClockTime(&pchandata->stamp);
fprintf(stderr,"New: name=%s, value=%f, stat=%d, sevr=%d, event=%d\n",
ca_name(pchandata->chid),
pchandata->value, pchandata->status,
Expand Down Expand Up @@ -118,7 +117,6 @@ struct event_handler_args args;
{
chandata *pchandata;
int ne;
double time;

pchandata = (chandata *)args.usr;

Expand All @@ -140,7 +138,7 @@ struct event_handler_args args;

pchandata->stamp = ((struct dbr_time_double *)args.dbr)->stamp;
if (CA.devprflag > 1) {
time = Ezca_iocClockTime(&pchandata->stamp);
Ezca_iocClockTime(&pchandata->stamp);
fprintf(stderr,"New: name=%s, value=%f, stat=%d, sevr=%d, event=%d\n",
ca_name(pchandata->chid),
pchandata->value, pchandata->status,
Expand Down
10 changes: 6 additions & 4 deletions EzcaScan.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include <dbDefs.h>
#include <cadef.h>
#include <epicsThread.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
Expand Down Expand Up @@ -65,7 +66,6 @@ void Ezca_scanValueChangeCallback(struct event_handler_args args)
{
chandata *pchan;
chandata *pchandata;
double time;
int num,nonames,i;

pchan = (chandata *)args.usr;
Expand All @@ -89,7 +89,7 @@ void Ezca_scanValueChangeCallback(struct event_handler_args args)

pchan->stamp = ((struct dbr_time_double *)args.dbr)->stamp;
if (CA.devprflag > 1) {
time = Ezca_iocClockTime(&pchan->stamp);
Ezca_iocClockTime(&pchan->stamp);
fprintf(stderr,"New: name=%s, value=%f, stat=%d, sevr=%d, event=%d\n",
ca_name(pchan->chid),
pchan->value, pchan->status,
Expand Down Expand Up @@ -148,6 +148,7 @@ int epicsShareAPI Ezca_scanAdd(int npts,int nonames,char *pv,char **pvnames)
}
else return(1); /* already monitored return 1 */
}
return command_error;
}

/******************************************************
Expand Down Expand Up @@ -267,7 +268,7 @@ scan process
******************************************************/
int epicsShareAPI Ezca_scanGetMonitor(char *pvName,double *vals)
{
int i,command_error=0,num,ii=0;
int i,num,ii=0;
evid temp_evid;
chandata *pchan;
chandata *pchandata;
Expand All @@ -289,7 +290,8 @@ int epicsShareAPI Ezca_scanGetMonitor(char *pvName,double *vals)
temp_evid = pchan->evid;
if (pchan->state != cs_conn)
{
command_error = CA_FAIL;
epicsMutexUnlock(pchan->mutexId);
return CA_FAIL;
}
else if (temp_evid )
{
Expand Down
36 changes: 0 additions & 36 deletions EzcaScan.def

This file was deleted.

19 changes: 0 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,12 @@ INC += EzcaScan.h

USR_CFLAGS = -DACCESS_SECURITY

ifdef WIN32
# Use the following line if building ezca to be called from
# Visual Basic or other languages
#SHARED_LIBRARIES=YES
# Use the following line to build EzcaScan and ezcaIDL as
# standlone DLLs, i.e. without the need for ezca.dll in the path.
SHARED_LIBRARIES=NO
else
SHARED_LIBRARIES=YES
endif

LIBRARY_HOST := EzcaScan
EzcaScan_SRCS = EzcaFunc.c EzcaHash.c EzcaArray.c EzcaUtil.c \
EzcaMonitor.c EzcaScan.c EzcaQueue.c

EzcaFunc_CPPFLAGS += -DBASE_3_14

EzcaScan_LIBS += ezca ca Com
EzcaScan_SYS_LIBS_WIN32 = ws2_32 advapi32 user32

#PROD_LIBS += EzcaScan ezca ca Com

#PROD_HOST = caget caput
#caget_SRCS = caget.c
#caput_SRCS = caput.c

include $(TOP)/configure/RULES

Loading