diff --git a/require-ess/src/asprintf.c b/require-ess/src/asprintf.c index 4981b74f52e5e0a13d40d3e852b6ba36467d9aa6..68495340b16db505a80cee2f33ab59830de0d695 100644 --- a/require-ess/src/asprintf.c +++ b/require-ess/src/asprintf.c @@ -29,7 +29,7 @@ int vasprintf(char** pbuffer, const char* format, va_list ap) #ifdef va_copy va_end(ap2); #endif - + if (len <= 0) { fprintf(stderr, "vasprintf: error calculating needed size\n"); diff --git a/require-ess/src/dbLoadTemplate.h b/require-ess/src/dbLoadTemplate.h index 0e96e749eff46db37156d669e01332ec8fbd72b8..509047b8e815015c49b662bee460300826182b29 100644 --- a/require-ess/src/dbLoadTemplate.h +++ b/require-ess/src/dbLoadTemplate.h @@ -4,7 +4,7 @@ * Copyright (c) 2002 The Regents of the University of California, as * Operator of Los Alamos National Laboratory. * EPICS BASE is distributed subject to a Software License Agreement found -* in file LICENSE that is included with this distribution. +* in file LICENSE that is included with this distribution. \*************************************************************************/ /* dbLoadTemplate.h */ diff --git a/require-ess/src/dbLoadTemplate.y b/require-ess/src/dbLoadTemplate.y index 04cd202642535c71d869c7fed4912fa50049cc6a..aeb8e1332d4ab9680ab5c76690e69c9cea4b8690 100644 --- a/require-ess/src/dbLoadTemplate.y +++ b/require-ess/src/dbLoadTemplate.y @@ -4,7 +4,7 @@ * Copyright (c) 2006 UChicago, as Operator of Argonne * National Laboratory. * EPICS BASE is distributed subject to a Software License Agreement found -* in file LICENSE that is included with this distribution. +* in file LICENSE that is included with this distribution. \*************************************************************************/ /* for vasprintf */ @@ -47,7 +47,7 @@ extern void dbLoadRecords(const char*, const char*); #endif #if (EPICS_VERSION*10000+EPICS_REVISION*100+EPICS_MODIFICATION>=31600) -#define dbmfStrdup(s) dbmfStrdup((char*)s) +#define dbmfStrdup(s) dbmfStrdup((char*)s) #endif static int line_num; @@ -348,9 +348,9 @@ variable_definition: WORD EQUALS WORD ; %% - + #include "dbLoadTemplate_lex.c" - + static int yyerror(char* str) { if (str) @@ -369,7 +369,7 @@ int dbLoadTemplate(const char *sub_file, const char *cmd_collect, const char *pa int i; line_num = 1; - + if (!sub_file || !*sub_file) { fprintf(stderr, "must specify variable substitution file\n"); return -1; diff --git a/require-ess/src/dbLoadTemplate_lex.l b/require-ess/src/dbLoadTemplate_lex.l index 7dc673d7cb7b45acd0324351fc613aa237d4691e..10d160a6f2bf331646b77193dd28c55b714a7212 100644 --- a/require-ess/src/dbLoadTemplate_lex.l +++ b/require-ess/src/dbLoadTemplate_lex.l @@ -2,7 +2,7 @@ * Copyright (c) 2006 UChicago, as Operator of Argonne * National Laboratory. * EPICS BASE is distributed subject to a Software License Agreement found -* in file LICENSE that is included with this distribution. +* in file LICENSE that is included with this distribution. \*************************************************************************/ newline "\n" diff --git a/require-ess/src/expr.c b/require-ess/src/expr.c index 38ae8fe3ca851e3cf321e698e3fa5edc34f98313..9c8ac42d4b01ed3ababe56130a978941288e891c 100644 --- a/require-ess/src/expr.c +++ b/require-ess/src/expr.c @@ -77,7 +77,7 @@ static long ipow(long base, long exp) { long val; if (exp == 2) return base*base; - if (exp == 3) return base*base*base; + if (exp == 3) return base*base*base; if (exp == 1) return base; if (exp == 0) return 1; if (exp < 0) return 0; @@ -114,7 +114,7 @@ struct {char str[4]; int pr;} ops[] = { enum op { op_none, - op_pow, + op_pow, op_mul,op_div,op_mod, op_plus,op_minus, op_lshift,op_urshift,op_rshift, diff --git a/require-ess/src/runScript.c b/require-ess/src/runScript.c index 0595b72bc61e7182afae0f20f8a39411a0f5a110..e771e2ae3b1d9b6beac8ee071baa50fe97c42fb2 100644 --- a/require-ess/src/runScript.c +++ b/require-ess/src/runScript.c @@ -46,13 +46,13 @@ int runScript(const char* filename, const char* args) int status = 0; char* old_MODULE = NULL; char* old_MODULE_DIR = NULL; - + if (!filename) { fprintf(stderr, "Usage: runScript filename [macro=value,...]\n"); return -1; } - + if (macCreateHandle(&mac,(const char*[]){ "", "environ", NULL, NULL }) != 0) goto error; macSuppressWarning(mac, 1); @@ -80,7 +80,7 @@ int runScript(const char* filename, const char* args) char* fullname; const char* path = getenv("SCRIPT_PATH"); int dirlen; - + for (dirname = path; dirname != NULL; dirname = end) { end = strchr(dirname, OSI_PATH_LIST_SEPARATOR[0]); @@ -90,7 +90,7 @@ int runScript(const char* filename, const char* args) else dirlen = (int)strlen(dirname); if (dirlen == 0) continue; /* ignore empty path elements */ if (dirname[dirlen-1] == OSI_PATH_SEPARATOR[0]) dirlen--; - asprintf(&fullname, "%.*s" OSI_PATH_SEPARATOR "%s", + asprintf(&fullname, "%.*s" OSI_PATH_SEPARATOR "%s", dirlen, dirname, filename); if (runScriptDebug) printf("runScript: trying %s\n", fullname); @@ -101,7 +101,7 @@ int runScript(const char* filename, const char* args) } } if (file == NULL) { perror(filename); return errno; } - + /* save some environments variables */ SAVEENV(MODULE); SAVEENV(MODULE_DIR); @@ -136,7 +136,7 @@ int runScript(const char* filename, const char* args) p = line_exp; while (isspace((unsigned char)*p)) p++; if (*p == 0 || *p == '#') continue; - + /* find local variable assignments */ if ((x = strpbrk(p, "=(, \t\n\r")) != NULL && *x=='=') { @@ -186,7 +186,7 @@ void afterInitHook(initHookState state) { struct cmditem *item; - if (state != + if (state != #ifdef INCinitHooksh /* old: without iocPause etc */ initHookAfterInterruptAccept @@ -223,7 +223,7 @@ static struct cmditem *newItem(char* cmd, int type) { fprintf(stderr, "afterInit can only be used before iocInit\n"); return NULL; - } + } if (first_time) { first_time = 0; @@ -246,7 +246,7 @@ int afterInit(char* cmd, char* a1, char* a2, char* a3, char* a4, char* a5, char* { struct cmditem *item = newItem(cmd, 0); if (!item) return -1; - + item->x.a[0] = cmd; item->x.a[1] = a1; item->x.a[2] = a2; @@ -271,7 +271,7 @@ static const iocshFuncDef runScriptDef = { &(iocshArg) { "filename", iocshArgString }, &(iocshArg) { "substitutions", iocshArgString }, }}; - + static void runScriptFunc(const iocshArgBuf *args) { runScript(args[0].sval, args[1].sval); @@ -281,7 +281,7 @@ static const iocshFuncDef afterInitDef = { "afterInit", 1, (const iocshArg *[]) { &(iocshArg) { "commandline", iocshArgArgv }, }}; - + static void afterInitFunc(const iocshArgBuf *args) { int i, n; diff --git a/require-ess/src/strdup.c b/require-ess/src/strdup.c index bc708537b7ef72bc5f6c57bc581eb371b5fd549c..310518e44f77d6fc7e42fe3e334b7b1cc7c976f2 100644 --- a/require-ess/src/strdup.c +++ b/require-ess/src/strdup.c @@ -12,7 +12,7 @@ char *strndup(const char *s, size_t n) { size_t l; char *d; - + l = strlen(s); if (n > l) n = l; d = malloc(n+1); diff --git a/require-ess/src/version.h b/require-ess/src/version.h index f404c8de797ac7181b8d4707c77bccc516c2b279..185c2c53ae5c97428fd69d26aa4e243e55839276 100644 --- a/require-ess/src/version.h +++ b/require-ess/src/version.h @@ -9,4 +9,4 @@ typedef struct semver_t { void cleanup_semver(semver_t *s); -int parse_semver(const char *version, semver_t *s); \ No newline at end of file +int parse_semver(const char *version, semver_t *s); diff --git a/require-ess/test/testscript b/require-ess/test/testscript index 4e262c1790f15b4ec5e521038eb220538d927fff..b4b2d4caa8108e590618348cac8224f36e5d8adb 100644 --- a/require-ess/test/testscript +++ b/require-ess/test/testscript @@ -12,7 +12,7 @@ x=10+3, 10-3, 10*3, 10/3, 10%3, 10**3 x=7**-2 7**-1 7**0 7**1 7**2 7**3 7**4 7**5 7**6 # $(x) should be: 0 0 1 7 49 343 2401 16807 117649 -x=%x -10<<2, %x -10>>2, %x -10>>>2 +x=%x -10<<2, %x -10>>2, %x -10>>>2 # $(x) should be: ffffffffffffffd8, fffffffffffffffd, 3ffffffffffffffd x=%x 0xaa & 0x0f, %x 0xaa | 0x0f, %x 0xaa ^ 0x0f @@ -27,7 +27,7 @@ x=20<20 20<=20 20==20 20>=20 20>20 20<=>20 20<?20 20>?20 20?<20 20?>20 x=20<10 20<=10 20==10 20>=10 20>10 20<=>10 20<?10 20>?10 20?<10 20?>10 # $(x) should be: 0 0 0 1 1 1 10 20 1 0 -x= (0|0)(0|1)(1|0)(1|1) (0&0)(0&1)(1&0)(1&1) (0^0)(0^1)(1^0)(1^1) +x= (0|0)(0|1)(1|0)(1|1) (0&0)(0&1)(1&0)(1&1) (0^0)(0^1)(1^0)(1^1) # $(x) should be: 0111 0001 0110 x=1*2*3+4*5*6-7-8 diff --git a/require-ess/tools/README.md b/require-ess/tools/README.md index 4794efebda5a3c536db8687bc37b1caa2037e066..f22f0c81db58de52199d22a6dd766e6478893e73 100644 --- a/require-ess/tools/README.md +++ b/require-ess/tools/README.md @@ -16,4 +16,3 @@ $ iocsh.bash e3_local/cmds/iocStats.cmd In this case, ```E3_CMD_TOP``` is defined as ```"${HOME}/e3_local/cmds"``` ```E3_IOCSH_TOP``` is defined as ```"${HOME}"``` - diff --git a/require-ess/tools/expandDBD.tcl b/require-ess/tools/expandDBD.tcl index bf9ae8f7c0e974c99c1288773ff60b5d3d5b8a4b..3cd4bc7893d3bc1db7366239d013df196f022b89 100755 --- a/require-ess/tools/expandDBD.tcl +++ b/require-ess/tools/expandDBD.tcl @@ -38,7 +38,7 @@ proc opendbd {name} { scanmatch $global_context {^[ \t]*(#|%|$)} { continue -} +} if {$recordtypes} { scanmatch $global_context {include[ \t]+"?((.*)Record.dbd)"?} { @@ -96,7 +96,7 @@ proc includeFile {context filename} { #puts "#include $filename from $FileName($matchInfo(handle))" scanfile $context $file close $file -} +} foreach filename $argv { global filesDone quiet