Skip to content
Snippets Groups Projects
Commit 2ec247f3 authored by Anders Lindh Olsson's avatar Anders Lindh Olsson :8ball:
Browse files

Apply pre-commit

parent bbc76373
No related branches found
No related tags found
1 merge request!68Apply pre-commit
Pipeline #101109 passed
......@@ -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");
......
......@@ -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 */
......
......@@ -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;
......
......@@ -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"
......
......@@ -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,
......
......@@ -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;
......
......@@ -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);
......
......@@ -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);
......@@ -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
......
......@@ -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}"```
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment