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

Cleanup whitespace #31

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
1 change: 0 additions & 1 deletion p2pApp/chancache.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,3 @@ struct ChannelCache
};

#endif // CHANCACHE_H

24 changes: 12 additions & 12 deletions pdbApp/pvif.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,23 @@ long copyDBF2PVD(const epics::pvData::shared_vector<const void>& buf,
const epics::pvData::PVStringArray::const_svector& choices);

union dbrbuf {
epicsInt8 dbf_CHAR;
epicsUInt8 dbf_UCHAR;
epicsInt16 dbf_SHORT;
epicsUInt16 dbf_USHORT;
epicsEnum16 dbf_ENUM;
epicsInt32 dbf_LONG;
epicsUInt32 dbf_ULONG;
epicsFloat32 dbf_FLOAT;
epicsFloat64 dbf_DOUBLE;
epicsInt8 dbf_CHAR;
epicsUInt8 dbf_UCHAR;
epicsInt16 dbf_SHORT;
epicsUInt16 dbf_USHORT;
epicsEnum16 dbf_ENUM;
epicsInt32 dbf_LONG;
epicsUInt32 dbf_ULONG;
epicsFloat32 dbf_FLOAT;
epicsFloat64 dbf_DOUBLE;

#ifdef EPICS_VERSION_INT
# if EPICS_VERSION_INT>=VERSION_INT(3,16,1,0)
epicsInt64 dbf_INT64;
epicsUInt64 dbf_UINT64;
epicsInt64 dbf_INT64;
epicsUInt64 dbf_UINT64;
# endif
#endif
char dbf_STRING[MAX_STRING_SIZE];
char dbf_STRING[MAX_STRING_SIZE];
};

struct QSRV_API DBCH {
Expand Down
204 changes: 102 additions & 102 deletions pdbApp/softMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

/* Copyed from EPICS Base 3.16 branch */

/* Author: Andrew Johnson Date: 2003-04-08 */
/* Author: Andrew Johnson Date: 2003-04-08 */

/* Usage:
* softIoc [-D softIoc.dbd] [-h] [-S] [-s] [-a ascf]
* [-m macro=value,macro2=value2] [-d file.db]
* [-x prefix] [st.cmd]
* [-m macro=value,macro2=value2] [-d file.db]
* [-x prefix] [st.cmd]
*
* If used the -D option must come first, and specify the
* path to the softIoc.dbd file. The compile-time install
Expand Down Expand Up @@ -114,133 +114,133 @@ int main(int argc, char *argv[])
char *dbd_file = const_cast<char*>(base_dbd);
char *macros = NULL;
char xmacro[PVNAME_STRINGSZ + 4];
int startIocsh = 1; /* default = start shell */
int startIocsh = 1; /* default = start shell */
int loadedDb = 0;

arg0 = strrchr(*argv, '/');
if (!arg0) {
arg0 = *argv;
arg0 = *argv;
} else {
++arg0; /* skip the '/' */
++arg0; /* skip the '/' */
}

--argc, ++argv;

/* Do this here in case the dbd file not available */
if (argc>0 && **argv=='-' && (*argv)[1]=='h') {
usage(EXIT_SUCCESS);
usage(EXIT_SUCCESS);
}

if (argc>1 && **argv=='-' && (*argv)[1]=='D') {
dbd_file = *++argv;
argc -= 2;
++argv;
dbd_file = *++argv;
argc -= 2;
++argv;
}

if (dbLoadDatabase(dbd_file, NULL, NULL)) {
epicsExit(EXIT_FAILURE);
epicsExit(EXIT_FAILURE);
}

softIocPVA_registerRecordDeviceDriver(pdbbase);
registryFunctionAdd("exit", (REGISTRYFUNCTION) exitSubroutine);

while (argc>1 && **argv == '-') {
switch ((*argv)[1]) {
case 'a':
if (macros) asSetSubstitutions(macros);
asSetFilename(*++argv);
--argc;
break;
case 'd':
if (dbLoadRecords(*++argv, macros)) {
epicsExit(EXIT_FAILURE);
}
loadedDb = 1;
--argc;
break;
case 'h':
usage(EXIT_SUCCESS);
case 'm':
macros = *++argv;
--argc;
break;
case 'S':
startIocsh = 0;
break;
case 's':
break;
case 'x':
epicsSnprintf(xmacro, sizeof xmacro, "IOC=%s", *++argv);
if (dbLoadRecords(exit_db, xmacro)) {
epicsExit(EXIT_FAILURE);
}
loadedDb = 1;
--argc;
break;
default:
printf("%s: option '%s' not recognized\n", arg0, *argv);
usage(EXIT_FAILURE);
}
--argc;
++argv;
switch ((*argv)[1]) {
case 'a':
if (macros) asSetSubstitutions(macros);
asSetFilename(*++argv);
--argc;
break;

case 'd':
if (dbLoadRecords(*++argv, macros)) {
epicsExit(EXIT_FAILURE);
}
loadedDb = 1;
--argc;
break;

case 'h':
usage(EXIT_SUCCESS);

case 'm':
macros = *++argv;
--argc;
break;

case 'S':
startIocsh = 0;
break;

case 's':
break;

case 'x':
epicsSnprintf(xmacro, sizeof xmacro, "IOC=%s", *++argv);
if (dbLoadRecords(exit_db, xmacro)) {
epicsExit(EXIT_FAILURE);
}
loadedDb = 1;
--argc;
break;

default:
printf("%s: option '%s' not recognized\n", arg0, *argv);
usage(EXIT_FAILURE);
}
--argc;
++argv;
}

if (argc>0 && **argv=='-') {
switch((*argv)[1]) {
case 'a':
case 'd':
case 'm':
case 'x':
printf("%s: missing argument to option '%s'\n", arg0, *argv);
usage(EXIT_FAILURE);
case 'h':
usage(EXIT_SUCCESS);
case 'S':
startIocsh = 0;
break;
case 's':
break;
default:
printf("%s: option '%s' not recognized\n", arg0, *argv);
usage(EXIT_FAILURE);
}
--argc;
++argv;
switch((*argv)[1]) {
case 'a':
case 'd':
case 'm':
case 'x':
printf("%s: missing argument to option '%s'\n", arg0, *argv);
usage(EXIT_FAILURE);

case 'h':
usage(EXIT_SUCCESS);

case 'S':
startIocsh = 0;
break;

case 's':
break;

default:
printf("%s: option '%s' not recognized\n", arg0, *argv);
usage(EXIT_FAILURE);
}
--argc;
++argv;
}

if (loadedDb) {
iocInit();
epicsThreadSleep(0.2);
iocInit();
epicsThreadSleep(0.2);
}

/* run user's startup script */
if (argc>0) {
if (iocsh(*argv)) epicsExit(EXIT_FAILURE);
epicsThreadSleep(0.2);
loadedDb = 1; /* Give it the benefit of the doubt... */
if (iocsh(*argv)) epicsExit(EXIT_FAILURE);
epicsThreadSleep(0.2);
loadedDb = 1; /* Give it the benefit of the doubt... */
}

/* start an interactive shell if it was requested */
if (startIocsh) {
iocsh(NULL);
iocsh(NULL);
} else {
if (loadedDb) {
epicsThreadExitMain();
} else {
printf("%s: Nothing to do!\n", arg0);
usage(EXIT_FAILURE);
}
if (loadedDb) {
epicsThreadExitMain();
} else {
printf("%s: Nothing to do!\n", arg0);
usage(EXIT_FAILURE);
}
}
epicsExit(EXIT_SUCCESS);
/*Note that the following statement will never be executed*/
Expand Down