diff --git a/.editorconfig b/.editorconfig index bd2580a27..8d472f23f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,3 +10,7 @@ insert_final_newline = true # Part of readline test that needs file without final newline [modules/libcom/test/multiline-input.txt] insert_final_newline = false + +# Enforce consistent space indent style in source code +[*.{c,cc,cpp,h,hpp,pl,py,yml}] +indent_style = space diff --git a/modules/ca/src/client/cadef.h b/modules/ca/src/client/cadef.h index a112021c3..154d447cc 100644 --- a/modules/ca/src/client/cadef.h +++ b/modules/ca/src/client/cadef.h @@ -272,13 +272,13 @@ LIBCA_API unsigned epicsStdCall ca_write_access (chid chan); */ enum channel_state { /// valid chid, IOC not found or unavailable - cs_never_conn, + cs_never_conn, /// valid chid, IOC was found, but unavailable (previously connected to server) - cs_prev_conn, + cs_prev_conn, /// valid chid, IOC was found, still available - cs_conn, + cs_conn, /// channel deleted by user - cs_closed + cs_closed }; /** \brief Returns an enumerated type indicating the current state of the specified IO channel. diff --git a/modules/database/src/std/dev/devBiSoft.c b/modules/database/src/std/dev/devBiSoft.c index 07f48c4c7..201817960 100644 --- a/modules/database/src/std/dev/devBiSoft.c +++ b/modules/database/src/std/dev/devBiSoft.c @@ -37,7 +37,7 @@ epicsExportAddress(dset, devBiSoft); static long init_record(dbCommon *pcommon) { - biRecord *prec = (biRecord *)pcommon; + biRecord *prec = (biRecord *)pcommon; if (recGblInitConstantLink(&prec->inp, DBF_ENUM, &prec->val)) prec->udf = FALSE; diff --git a/modules/database/src/std/dev/devBiSoftCallback.c b/modules/database/src/std/dev/devBiSoftCallback.c index 4d33230bc..bf2511a7b 100644 --- a/modules/database/src/std/dev/devBiSoftCallback.c +++ b/modules/database/src/std/dev/devBiSoftCallback.c @@ -154,7 +154,7 @@ static long init(int pass) static long init_record(dbCommon *pcommon) { - biRecord *prec = (biRecord *)pcommon; + biRecord *prec = (biRecord *)pcommon; if (recGblInitConstantLink(&prec->inp, DBR_ENUM, &prec->val)) prec->udf = FALSE; diff --git a/modules/database/src/std/dev/devBiSoftRaw.c b/modules/database/src/std/dev/devBiSoftRaw.c index 0f1ab2fdd..f4427502b 100644 --- a/modules/database/src/std/dev/devBiSoftRaw.c +++ b/modules/database/src/std/dev/devBiSoftRaw.c @@ -37,7 +37,7 @@ epicsExportAddress(dset, devBiSoftRaw); static long init_record(dbCommon *pcommon) { - biRecord *prec = (biRecord *)pcommon; + biRecord *prec = (biRecord *)pcommon; recGblInitConstantLink(&prec->inp, DBF_ULONG, &prec->rval); diff --git a/modules/database/src/std/dev/devMbbiDirectSoft.c b/modules/database/src/std/dev/devMbbiDirectSoft.c index 643904f47..2d02eee80 100644 --- a/modules/database/src/std/dev/devMbbiDirectSoft.c +++ b/modules/database/src/std/dev/devMbbiDirectSoft.c @@ -37,7 +37,7 @@ epicsExportAddress(dset, devMbbiDirectSoft); static long init_record(dbCommon *pcommon) { - mbbiDirectRecord *prec = (mbbiDirectRecord *)pcommon; + mbbiDirectRecord *prec = (mbbiDirectRecord *)pcommon; if (recGblInitConstantLink(&prec->inp, DBR_ULONG, &prec->val)) prec->udf = FALSE; diff --git a/modules/database/src/std/dev/devMbbiDirectSoftCallback.c b/modules/database/src/std/dev/devMbbiDirectSoftCallback.c index 77c1b91eb..a100de23e 100644 --- a/modules/database/src/std/dev/devMbbiDirectSoftCallback.c +++ b/modules/database/src/std/dev/devMbbiDirectSoftCallback.c @@ -154,7 +154,7 @@ static long init(int pass) static long init_record(dbCommon *pcommon) { - mbbiDirectRecord *prec = (mbbiDirectRecord *)pcommon; + mbbiDirectRecord *prec = (mbbiDirectRecord *)pcommon; if (recGblInitConstantLink(&prec->inp, DBR_ULONG, &prec->val)) prec->udf = FALSE; diff --git a/modules/database/src/std/dev/devMbbiDirectSoftRaw.c b/modules/database/src/std/dev/devMbbiDirectSoftRaw.c index 84650fb9f..1edc420ea 100644 --- a/modules/database/src/std/dev/devMbbiDirectSoftRaw.c +++ b/modules/database/src/std/dev/devMbbiDirectSoftRaw.c @@ -37,7 +37,7 @@ epicsExportAddress(dset, devMbbiDirectSoftRaw); static long init_record(dbCommon *pcommon) { - mbbiDirectRecord *prec = (mbbiDirectRecord *)pcommon; + mbbiDirectRecord *prec = (mbbiDirectRecord *)pcommon; recGblInitConstantLink(&prec->inp, DBF_ULONG, &prec->rval); diff --git a/modules/database/src/std/dev/devMbbiSoft.c b/modules/database/src/std/dev/devMbbiSoft.c index fa48a8697..7f3fa4e99 100644 --- a/modules/database/src/std/dev/devMbbiSoft.c +++ b/modules/database/src/std/dev/devMbbiSoft.c @@ -37,7 +37,7 @@ epicsExportAddress(dset, devMbbiSoft); static long init_record(dbCommon *pcommon) { - mbbiRecord *prec = (mbbiRecord *)pcommon; + mbbiRecord *prec = (mbbiRecord *)pcommon; if (recGblInitConstantLink(&prec->inp, DBF_ENUM, &prec->val)) prec->udf = FALSE; diff --git a/modules/database/src/std/dev/devMbbiSoftCallback.c b/modules/database/src/std/dev/devMbbiSoftCallback.c index aa6cfc4a0..ca704c6a6 100644 --- a/modules/database/src/std/dev/devMbbiSoftCallback.c +++ b/modules/database/src/std/dev/devMbbiSoftCallback.c @@ -154,7 +154,7 @@ static long init(int pass) static long init_record(dbCommon *pcommon) { - mbbiRecord *prec = (mbbiRecord *)pcommon; + mbbiRecord *prec = (mbbiRecord *)pcommon; if (recGblInitConstantLink(&prec->inp, DBR_ENUM, &prec->val)) prec->udf = FALSE; diff --git a/modules/database/src/std/dev/devMbbiSoftRaw.c b/modules/database/src/std/dev/devMbbiSoftRaw.c index 823fa8f30..3521bb848 100644 --- a/modules/database/src/std/dev/devMbbiSoftRaw.c +++ b/modules/database/src/std/dev/devMbbiSoftRaw.c @@ -37,7 +37,7 @@ epicsExportAddress(dset, devMbbiSoftRaw); static long init_record(dbCommon *pcommon) { - mbbiRecord *prec = (mbbiRecord *)pcommon; + mbbiRecord *prec = (mbbiRecord *)pcommon; recGblInitConstantLink(&prec->inp, DBF_ULONG, &prec->rval); diff --git a/modules/database/src/std/dev/devMbboDirectSoftRaw.c b/modules/database/src/std/dev/devMbboDirectSoftRaw.c index f5dee6be0..876ec65fb 100644 --- a/modules/database/src/std/dev/devMbboDirectSoftRaw.c +++ b/modules/database/src/std/dev/devMbboDirectSoftRaw.c @@ -23,7 +23,7 @@ static long init_record(dbCommon *pcommon) { - mbboDirectRecord *prec = (mbboDirectRecord *)pcommon; + mbboDirectRecord *prec = (mbboDirectRecord *)pcommon; if (prec->nobt == 0) prec->mask = 0xffffffff; diff --git a/modules/database/src/std/dev/devSoft.dbd b/modules/database/src/std/dev/devSoft.dbd index 2d7a64be3..dc19d2774 100644 --- a/modules/database/src/std/dev/devSoft.dbd +++ b/modules/database/src/std/dev/devSoft.dbd @@ -55,9 +55,9 @@ device(stringout,CONSTANT,devSoSoftCallback,"Async Soft Channel") device(ai, INST_IO,devTimestampAI,"Soft Timestamp") device(stringin,INST_IO,devTimestampSI,"Soft Timestamp") -device(ai, INST_IO,devAiGeneralTime,"General Time") -device(bo, INST_IO,devBoGeneralTime,"General Time") -device(longin, INST_IO,devLiGeneralTime,"General Time") +device(ai, INST_IO,devAiGeneralTime,"General Time") +device(bo, INST_IO,devBoGeneralTime,"General Time") +device(longin, INST_IO,devLiGeneralTime,"General Time") device(stringin,INST_IO,devSiGeneralTime,"General Time") device(lso,INST_IO,devLsoStdio,"stdio") diff --git a/modules/database/src/std/rec/aiRecord.c b/modules/database/src/std/rec/aiRecord.c index 683ab6a82..45d0239da 100644 --- a/modules/database/src/std/rec/aiRecord.c +++ b/modules/database/src/std/rec/aiRecord.c @@ -119,7 +119,7 @@ static long init_record(struct dbCommon *pcommon, int pass) } if (pdset->common.init_record) { - long status = pdset->common.init_record(pcommon); + long status = pdset->common.init_record(pcommon); if (prec->linr == menuConvertSLOPE) { prec->eoff = eoff; prec->eslo = eslo; diff --git a/modules/database/src/std/rec/biRecord.c b/modules/database/src/std/rec/biRecord.c index 86fac01a5..941ac563b 100644 --- a/modules/database/src/std/rec/biRecord.c +++ b/modules/database/src/std/rec/biRecord.c @@ -76,7 +76,7 @@ rset biRSET={ put_enum_str, get_graphic_double, get_control_double, - get_alarm_double + get_alarm_double }; epicsExportAddress(rset,biRSET); @@ -105,7 +105,7 @@ static long init_record(struct dbCommon *pcommon, int pass) return(S_dev_missingSup); } if( pdset->common.init_record ) { - if((status=(*pdset->common.init_record)(pcommon))) return(status); + if((status=(*pdset->common.init_record)(pcommon))) return(status); } prec->mlst = prec->val; prec->lalm = prec->val; diff --git a/modules/database/src/std/rec/int64inRecord.c b/modules/database/src/std/rec/int64inRecord.c index c4cd30c4c..5128b5886 100644 --- a/modules/database/src/std/rec/int64inRecord.c +++ b/modules/database/src/std/rec/int64inRecord.c @@ -111,7 +111,7 @@ static long init_record(dbCommon *pcommon, int pass) return(S_dev_missingSup); } if (pdset->common.init_record) { - if ((status = pdset->common.init_record(pcommon))) return status; + if ((status = pdset->common.init_record(pcommon))) return status; } prec->mlst = prec->val; prec->alst = prec->val; @@ -122,7 +122,7 @@ static long init_record(dbCommon *pcommon, int pass) static long process(dbCommon *pcommon) { int64inRecord *prec = (int64inRecord*)pcommon; - int64indset *pdset = (int64indset *)(prec->dset); + int64indset *pdset = (int64indset *)(prec->dset); long status; unsigned char pact=prec->pact; epicsTimeStamp timeLast; diff --git a/modules/database/src/template/top/exampleApp/src/dev_APPNAME_Version.c b/modules/database/src/template/top/exampleApp/src/dev_APPNAME_Version.c index b16c3c1d4..46f38bdcb 100644 --- a/modules/database/src/template/top/exampleApp/src/dev_APPNAME_Version.c +++ b/modules/database/src/template/top/exampleApp/src/dev_APPNAME_Version.c @@ -37,6 +37,6 @@ static long read_string(lsiRecord *prec) } static lsidset dev_CSAFEAPPNAME_Version = { - {5, NULL, NULL, NULL, NULL}, read_string + {5, NULL, NULL, NULL, NULL}, read_string }; epicsExportAddress(dset,dev_CSAFEAPPNAME_Version); diff --git a/modules/database/src/tools/dbdToMD.pl b/modules/database/src/tools/dbdToMD.pl index 50524ce1e..3dd499dd8 100644 --- a/modules/database/src/tools/dbdToMD.pl +++ b/modules/database/src/tools/dbdToMD.pl @@ -102,16 +102,16 @@ $SIG{__DIE__} = sub { }; sub make_fragment { - my $fragment = $_[1]; - $fragment =~ s/\W+/-/g; - $fragment = lc($fragment); - $_[1] = $fragment; + my $fragment = $_[1]; + $fragment =~ s/\W+/-/g; + $fragment = lc($fragment); + $_[1] = $fragment; } my $podRst = EPICS::PodMD->new( - perldoc_url_prefix => '', - perldoc_fragment_format => make_fragment, - markdown_fragment_format => make_fragment, + perldoc_url_prefix => '', + perldoc_fragment_format => make_fragment, + markdown_fragment_format => make_fragment, ); # Parse the Pod text from the root DBD object diff --git a/modules/libcom/RTEMS/posix/rtems_init.c b/modules/libcom/RTEMS/posix/rtems_init.c index f75ab33de..0aef8bf13 100644 --- a/modules/libcom/RTEMS/posix/rtems_init.c +++ b/modules/libcom/RTEMS/posix/rtems_init.c @@ -90,7 +90,7 @@ #ifndef RTEMS_LEGACY_STACK // setup own ntp-client to get time #include "epicsNtp.h" -epicsEventId dhcpDone; +epicsEventId dhcpDone; #endif /* these settings are needed by the rtems startup @@ -507,11 +507,11 @@ static void rtshellCallFunc(const iocshArgBuf *args) { rtems_shell_cmd_t *cmd = rtems_shell_lookup_cmd(args[0].sval); int ret; - + if (!cmd) { fprintf(stderr, "ERR: No such command\n"); iocshSetError(-1); - + } else { fflush(stdout); fflush(stderr); @@ -768,7 +768,7 @@ dhcpcd_hook_handler(rtems_dhcpcd_hook *hook, char *const *env) printf("\n"); for (;NULL != *env;++env) { printf("dhcpcd ---> '%s'\n", *env); - + for(const struct dhcp_vars_t* var = dhcp_vars; var->name; var++) { size_t namelen = strlen(var->name); @@ -811,8 +811,8 @@ dhcpcd_hook_handler(rtems_dhcpcd_hook *hook, char *const *env) } static rtems_dhcpcd_hook dhcpcd_hook = { - .name = "ioc boot", - .handler = dhcpcd_hook_handler + .name = "ioc boot", + .handler = dhcpcd_hook_handler }; static void @@ -869,7 +869,7 @@ default_network_dhcpcd(void) rv = close(fd); assert(rv == 0); } - + sc = rtems_dhcpcd_start(NULL); assert(sc == RTEMS_SUCCESSFUL); } @@ -944,10 +944,10 @@ rtems_telnetd_config_table rtems_telnetd_config = { void * POSIX_Init ( void *argument __attribute__((unused))) { - int result; - char *argv[3] = { NULL, NULL, NULL }; - rtems_status_code sc; - struct timespec now; + int result; + char *argv[3] = { NULL, NULL, NULL }; + rtems_status_code sc; + struct timespec now; char timeBuff[100]; initConsole (); @@ -1004,7 +1004,7 @@ POSIX_Init ( void *argument __attribute__((unused))) /* * Create a reasonable environment */ - + putenv ("TERM=xterm"); putenv ("IOCSH_HISTSIZE=20"); @@ -1063,13 +1063,13 @@ POSIX_Init ( void *argument __attribute__((unused))) // wait for dhcp done ... should be if SYNCDHCP is used epicsEventWaitStatus stat; printf("\n ---- Waiting for DHCP ...\n"); - stat = epicsEventWaitWithTimeout(dhcpDone, 600); + stat = epicsEventWaitWithTimeout(dhcpDone, 600); if (stat == epicsEventOK) - epicsEventDestroy(dhcpDone); + epicsEventDestroy(dhcpDone); else if (stat == epicsEventWaitTimeout) printf("\n ---- DHCP timed out!\n"); else - printf("\n ---- dhcpDone Event Unknown state %d\n", stat); + printf("\n ---- dhcpDone Event Unknown state %d\n", stat); const char* ifconfg_args[] = { "ifconfig", NULL diff --git a/modules/libcom/src/osi/os/RTEMS-posix/osdPoolStatus.c b/modules/libcom/src/osi/os/RTEMS-posix/osdPoolStatus.c index 5b202fd1d..5d0a889bd 100644 --- a/modules/libcom/src/osi/os/RTEMS-posix/osdPoolStatus.c +++ b/modules/libcom/src/osi/os/RTEMS-posix/osdPoolStatus.c @@ -19,12 +19,12 @@ * */ LIBCOM_API int epicsStdCall osiSufficentSpaceInPool ( size_t contiguousBlockSize ) { - rtems_malloc_statistics_t s; - unsigned long n; + rtems_malloc_statistics_t s; + unsigned long n; - malloc_get_statistics(&s); - n = s.space_available - (unsigned long)(s.lifetime_allocated - s.lifetime_freed); - return (n > (50000 + contiguousBlockSize)); + malloc_get_statistics(&s); + n = s.space_available - (unsigned long)(s.lifetime_allocated - s.lifetime_freed); + return (n > (50000 + contiguousBlockSize)); } #else diff --git a/modules/libcom/test/epicsStringTest.c b/modules/libcom/test/epicsStringTest.c index be5600b87..08ede829b 100644 --- a/modules/libcom/test/epicsStringTest.c +++ b/modules/libcom/test/epicsStringTest.c @@ -198,17 +198,17 @@ void testStrTok(void) static void testEpicsStrPrintEscaped(void) -{ +{ const char *filename; FILE *testFile; FILE *readOnly; #ifdef __rtems__ /* ensure there is a writable area */ - mkdir( "/tmp", S_IRWXU ); - filename = "/tmp/testEpicsStrPrintEscaped"; + mkdir( "/tmp", S_IRWXU ); + filename = "/tmp/testEpicsStrPrintEscaped"; #else - filename = "testEpicsStrPrintEscaped"; + filename = "testEpicsStrPrintEscaped"; #endif diff --git a/src/template/ext/makeBaseExt.pl b/src/template/ext/makeBaseExt.pl index 5b5a1df0a..a8c660ed4 100644 --- a/src/template/ext/makeBaseExt.pl +++ b/src/template/ext/makeBaseExt.pl @@ -18,7 +18,7 @@ $eEXTTYPE = $ENV{EPICS_MBE_DEF_EXT_TYPE}; $eTOP = $ENV{EPICS_MBE_TEMPLATE_TOP}; $eBASE = $ENV{EPICS_MBE_BASE}; -get_commandline_opts(); # Read and check options +get_commandline_opts(); # Read and check options $extname = "@ARGV"; @@ -37,14 +37,14 @@ sub ReplaceLineHook { return $_[0]; } # Empty string: Don't copy this file sub ReplaceFilename { # (filename) my($file) = $_[0]; - $file =~ s|.*/CVS/?.*||; # Ignore CVS files - if ($ext) { # exttypenameExt itself is dynamic, too - $file =~ s|/$exttypename|/$extdir|; - $file =~ s|/$extdir/configure|/configure/$exttype|; + $file =~ s|.*/CVS/?.*||; # Ignore CVS files + if ($ext) { # exttypenameExt itself is dynamic, too + $file =~ s|/$exttypename|/$extdir|; + $file =~ s|/$extdir/configure|/configure/$exttype|; } $file =~ s|_EXTNAME_|$extname|; $file =~ s|_EXTTYPE_|$exttype|; - # We don't want the Replace overrides + # We don't want the Replace overrides $file =~ s|.*/$extdir/Replace.pl$||; $file = ReplaceFilenameHook($file); # Call the user-defineable hook return $file; @@ -76,10 +76,10 @@ if (-r "$top/$exttypename/Replace.pl") { opendir TOPDIR, "$top" or die "Can't open $top: $!"; foreach $f ( grep !/^\.\.?$|^[^\/]*(Ext)/, readdir TOPDIR ) { if (-f "$f") { - CopyFile("$top/$f") unless (-e "$f"); + CopyFile("$top/$f") unless (-e "$f"); } else { - $note = yes if ("$f" eq "src" && -e "$f"); - find(\&FCopyTree, "$top/$f") unless (-e "$f"); + $note = yes if ("$f" eq "src" && -e "$f"); + find(\&FCopyTree, "$top/$f") unless (-e "$f"); } } closedir TOPDIR; @@ -93,19 +93,19 @@ foreach $ext ( @ARGV ) { ($extname = $ext) =~ s/Ext$//; $extdir = $extname; if (-d "src/$extdir") { - print "Extension $extname is already there!\n"; - next; + print "Extension $extname is already there!\n"; + next; } print "Creating template structure " - . "for $extname (of type $exttypename)\n" if $Debug; + . "for $extname (of type $exttypename)\n" if $Debug; find(\&FCopyTree, "$top/$exttypename/"); if ($note) { - print "\nNOTE: You must add the line \"DIRS += $extname\" to src/Makefile.\n\n"; - } + print "\nNOTE: You must add the line \"DIRS += $extname\" to src/Makefile.\n\n"; + } } $cwd = $cwdsave; -exit 0; # END OF SCRIPT +exit 0; # END OF SCRIPT # # Get commandline options and check for validity @@ -118,58 +118,58 @@ sub get_commandline_opts { #no args # Locate epics_base my ($command) = UnixPath($0); - if ($opt_b) { # first choice is -b base - $epics_base = UnixPath($opt_b); + if ($opt_b) { # first choice is -b base + $epics_base = UnixPath($opt_b); } elsif (-r "configure/RELEASE") { # second choice is configure/RELEASE - open(IN, "configure/RELEASE") or die "Cannot open configure/RELEASE"; - while () { - chomp; - s/EPICS_BASE\s*=\s*// and $epics_base = UnixPath($_), break; - } - close IN; + open(IN, "configure/RELEASE") or die "Cannot open configure/RELEASE"; + while () { + chomp; + s/EPICS_BASE\s*=\s*// and $epics_base = UnixPath($_), break; + } + close IN; } elsif ($eBASE) { # third choice is env var EPICS_MBE_BASE $epics_base = UnixPath($eBASE); } elsif ($command =~ m|/bin/|) { # assume script was called with full path to base - $epics_base = $command; - $epics_base =~ s|(/.*)/bin/.*makeBaseExt.*|$1|; + $epics_base = $command; + $epics_base =~ s|(/.*)/bin/.*makeBaseExt.*|$1|; } "$epics_base" or Cleanup(1, "Cannot find EPICS base"); # Locate template top directory - if ($opt_T) { # first choice is -T templ-top - $top = UnixPath($opt_T); + if ($opt_T) { # first choice is -T templ-top + $top = UnixPath($opt_T); } elsif (-r "configure/RELEASE") { # second choice is configure/RELEASE - open(IN, "configure/RELEASE") or die "Cannot open configure/RELEASE"; - while () { - chomp; - s/TEMPLATE_TOP\s*=\s*// and $top = UnixPath($_), break; - } - close IN; + open(IN, "configure/RELEASE") or die "Cannot open configure/RELEASE"; + while () { + chomp; + s/TEMPLATE_TOP\s*=\s*// and $top = UnixPath($_), break; + } + close IN; } if("$top" eq "") { - if ($eTOP) { # third choice is $ENV{EPICS_MBE_TEMPL_TOP} - $top = UnixPath($eTOP); - } else { # use templates from EPICS base - $top = $epics_base . "/templates/makeBaseExt/top"; - } + if ($eTOP) { # third choice is $ENV{EPICS_MBE_TEMPL_TOP} + $top = UnixPath($eTOP); + } else { # use templates from EPICS base + $top = $epics_base . "/templates/makeBaseExt/top"; + } } "$top" or Cleanup(1, "Cannot find template top directory"); # Print extension type list? if ($opt_l) { - ListExtTypes(); - exit 0; # finished for -l command + ListExtTypes(); + exit 0; # finished for -l command } # Extension template type if ($opt_t) { # first choice is -t type - $exttype = $opt_t; + $exttype = $opt_t; } elsif ($eEXTTYPE) { # second choice is $ENV{EPICS_DEFAULT_EXT_TYPE} - $exttype = $eEXTTYPE; + $exttype = $eEXTTYPE; } elsif (-r "$top/defaultExt") {# third choice is (a link) in the $top dir - $exttype = "default"; + $exttype = "default"; } elsif (-r "$top/exampleExt") {# fourth choice is (a link) in the $top dir - $exttype = "example"; + $exttype = "example"; } $exttype =~ s/Ext$//; "$exttype" or Cleanup(1, "Cannot find default extension type"); @@ -177,16 +177,16 @@ sub get_commandline_opts { #no args # Valid $exttypename? unless (-r "$top/$exttypename") { - print "Template for extension type '$exttype' is unreadable or does not exist.\n"; - ListExtTypes(); - exit 1; + print "Template for extension type '$exttype' is unreadable or does not exist.\n"; + ListExtTypes(); + exit 1; } print "\nCommand line / environment options validated:\n" - . " Templ-Top: $top\n" - . "Templ-Type: $exttype\n" - . "Templ-Name: $exttypename\n" - . "EPICS-Base: $epics_base\n\n" if $Debug; + . " Templ-Top: $top\n" + . "Templ-Type: $exttype\n" + . "Templ-Name: $exttypename\n" + . "EPICS-Base: $epics_base\n\n" if $Debug; } @@ -196,9 +196,9 @@ sub get_commandline_opts { #no args sub ListExtTypes { # no args print "Valid extension types are:\n"; foreach $name (<$top/*Ext>) { - $name =~ s|$top/||; - $name =~ s|Ext||; - printf "\t$name\n" if ($name && -r "$top/$name" . "Ext"); + $name =~ s|$top/||; + $name =~ s|Ext||; + printf "\t$name\n" if ($name && -r "$top/$name" . "Ext"); } } @@ -210,30 +210,30 @@ sub CopyFile { # (source) $target = ReplaceFilename($source); if ($target) { - $target =~ s|$top/||; - open(INP, "<$source") and open(OUT, ">$target") - or die "$! Copying $source -> $target"; + $target =~ s|$top/||; + open(INP, "<$source") and open(OUT, ">$target") + or die "$! Copying $source -> $target"; - print "Copying file $source -> $target\n" if $Debug; - while () { - print OUT ReplaceLine($_); - } - close INP; close OUT; + print "Copying file $source -> $target\n" if $Debug; + while () { + print OUT ReplaceLine($_); + } + close INP; close OUT; } } - + # # Find() callback for file or structure copy # sub FCopyTree { - chdir $cwd; # Sigh + chdir $cwd; # Sigh if (-d $File::Find::name - and ($dir = ReplaceFilename($File::Find::name))) { - $dir =~ s|$top/||; - print "Creating directory $dir\n" if $Debug; - mkpath($dir); + and ($dir = ReplaceFilename($File::Find::name))) { + $dir =~ s|$top/||; + print "Creating directory $dir\n" if $Debug; + mkpath($dir); } else { - CopyFile($File::Find::name); + CopyFile($File::Find::name); } chdir $File::Find::dir; } @@ -245,7 +245,7 @@ sub Cleanup { # (return-code [ messsage-line1, line 2, ... ]) my ($rtncode, @message) = @_; foreach $line ( @message ) { - print "$line\n"; + print "$line\n"; } print <"; - $user = ; - chomp $user; + print "I cannot figure out your user name.\n"; + print "What shall you be called ?\n"; + print ">"; + $user = ; + chomp $user; } die "No user name" unless $user; return $user; diff --git a/src/template/ext/top/exampleExt/caExample.c b/src/template/ext/top/exampleExt/caExample.c index dcda8e3af..c4b197c15 100644 --- a/src/template/ext/top/exampleExt/caExample.c +++ b/src/template/ext/top/exampleExt/caExample.c @@ -12,12 +12,12 @@ int main(int argc,char **argv) { - double data; - chid mychid; + double data; + chid mychid; if(argc != 2) { - fprintf(stderr,"usage: caExample pvname\n"); - exit(1); + fprintf(stderr,"usage: caExample pvname\n"); + exit(1); } SEVCHK(ca_context_create(ca_disable_preemptive_callback),"ca_context_create"); SEVCHK(ca_create_channel(argv[1],NULL,NULL,10,&mychid),"ca_create_channel failure");