diff --git a/.editorconfig b/.editorconfig index bd2580a27..034cc6064 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,3 +10,9 @@ 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 +# and remove all trailing spaces +[*.{c,cc,cpp,h,hpp,pl,py,yml}] +indent_style = space +trim_trailing_whitespace = true diff --git a/.github/workflows/ci-scripts-build.yml b/.github/workflows/ci-scripts-build.yml index c1e2b90d3..a8afb9b4a 100644 --- a/.github/workflows/ci-scripts-build.yml +++ b/.github/workflows/ci-scripts-build.yml @@ -178,8 +178,7 @@ jobs: - name: "Win-22 MSC-22" os: windows-2022 cmp: vs2022 - configuration: debug - extra: "CMD_CXXFLAGS=-analyze" + configuration: default - name: "Win-22 MSC-22, static" os: windows-2022 @@ -191,6 +190,7 @@ jobs: os: windows-2022 cmp: vs2022 configuration: debug + extra: "CMD_CXXFLAGS=-analyze" - name: "Win-22 MSC-22 c++14, debug" os: windows-2022 @@ -319,7 +319,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: true - + - name: Run... run: | env > env.list diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 09223d589..65fa4ce1b 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -44,7 +44,7 @@ jobs: sudo apt-get install --yes libreadline-dev - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@v4 with: languages: ${{ matrix.language }} config-file: ./.github/codeql/config.yml @@ -59,6 +59,6 @@ jobs: make -sj2 || echo '*** Ignoring build failure for CodeQL ***' - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@v4 with: category: "/language:${{ matrix.language }}" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..696375551 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,41 @@ +# Contribution Guidelines + +For bug fixes, please create new pull requests against the default (7.0) +branch. If the bug only affects a specific older release branch, target that +branch instead. + +For new features, please open an issue or discuss the idea on mailing lists +or in Matrix beforehand. + +## Maintaining Compatibility + +Build and test your changes on as many systems as possible. +Important operating systems are Linux, Windows, macOS, vxWorks and RTEMS. + +## Testing + +All new features must come with automated tests to verify their correctness. +This also helps to find out if future changes break existing features. + +EPICS Base comes with a testing framework which allows you to run IOCs, +set and read/compare values and more. + +See any of the existing tests within the repository for guidance on test +structure and dependencies. + +Add your tests to the appropriate test directory and ensure they are +included in the test Makefile. + +Your test should run (and succeed) when you execute: + +```bash +make runtests +``` + +CI will run these tests automatically. All checks must pass before a +pull request can be merged. + +## Review Process + +The core developer team will review your changes, suggest changes, highlight +issues or merge your code into EPICS Base. diff --git a/README.md b/README.md index 66c719c93..900650cc7 100644 --- a/README.md +++ b/README.md @@ -54,9 +54,13 @@ Run the `dbl` command to list the records it provides: epics> dbl first:BaseVersion first:exit -epics> +epics> ``` +## Contributing + +See [CONTRIBUTING.md](./CONTRIBUTING.md). + ## License EPICS Base is distributed subject to a Software License diff --git a/configure/CONFIG_COMMON b/configure/CONFIG_COMMON index c37b47238..1fc6bc6e4 100644 --- a/configure/CONFIG_COMMON +++ b/configure/CONFIG_COMMON @@ -337,7 +337,10 @@ COMPILE.cpp = $(CCC) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) #-------------------------------------------------- # C preprocessor command -PREPROCESS.cpp = $(CPP) $(CPPFLAGS) $(INCLUDES) $< > $@ +define PREPROCESS.cpp +$(CPP) $(CPPFLAGS) $(INCLUDES) $< > $@.stdout +$(MV) $@.stdout $@ +endef #-------------------------------------------------- # genVersion header defaults diff --git a/configure/RULES.Db b/configure/RULES.Db index ae023cee1..bc39357d4 100644 --- a/configure/RULES.Db +++ b/configure/RULES.Db @@ -124,7 +124,10 @@ ACF_CPPFLAGS = $(ACF_CPPFLAGS_$(GNU)) ACF_INCLUDES = -I. $(TARGET_INCLUDES) $(USR_INCLUDES)\ $(SRC_INCLUDES) -I$(INSTALL_DB) ACFDEPENDS_CMD = $(MKMF) -m $@ $(ACF_INCLUDES) $(COMMONDEP_TARGET) $< -ACF_CMD = $(CPP) $(ACF_CPPFLAGS) $(ACF_INCLUDES) $< > $@ +define ACF_CMD +$(CPP) $(ACF_CPPFLAGS) $(ACF_INCLUDES) $< > $@.stdout +$(MV) $@.stdout $@ +endef #--------------------------------------------------------------- # dependencies @@ -219,68 +222,82 @@ realclean: clean %Record.h$(DEP): $(COMMON_DIR)/%Record.dbd $(DBDTORECTYPEH_dep) @$(RM) $@ - @$(DBTORECORDTYPEH) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@ - @echo "$(COMMONDEP_TARGET): ../Makefile" >> $@ + @$(DBTORECORDTYPEH) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@.stdout + @echo "$(COMMONDEP_TARGET): ../Makefile" >> $@.stdout + @$(MV) $@.stdout $@ %Record.h$(DEP): %Record.dbd $(DBDTORECTYPEH_dep) @$(RM) $@ - @$(DBTORECORDTYPEH) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@ - @echo "$(COMMONDEP_TARGET): ../Makefile" >> $@ + @$(DBTORECORDTYPEH) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@.stdout + @echo "$(COMMONDEP_TARGET): ../Makefile" >> $@.stdout + @$(MV) $@.stdout $@ %Record.h$(DEP): ../%Record.dbd $(DBDTORECTYPEH_dep) @$(RM) $@ - @$(DBTORECORDTYPEH) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@ - @echo "$(COMMONDEP_TARGET): ../Makefile" >> $@ + @$(DBTORECORDTYPEH) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@.stdout + @echo "$(COMMONDEP_TARGET): ../Makefile" >> $@.stdout + @$(MV) $@.stdout $@ menu%.h$(DEP): $(COMMON_DIR)/menu%.dbd $(DBDTOMENUH_dep) @$(RM) $@ - @$(DBTOMENUH) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@ - @echo "$(COMMONDEP_TARGET): ../Makefile" >> $@ + @$(DBTOMENUH) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@.stdout + @echo "$(COMMONDEP_TARGET): ../Makefile" >> $@.stdout + @$(MV) $@.stdout $@ menu%.h$(DEP): menu%.dbd $(DBDTOMENUH_dep) @$(RM) $@ - @$(DBTOMENUH) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@ - @echo "$(COMMONDEP_TARGET): ../Makefile" >> $@ + @$(DBTOMENUH) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@.stdout + @echo "$(COMMONDEP_TARGET): ../Makefile" >> $@.stdout + @$(MV) $@.stdout $@ menu%.h$(DEP): ../menu%.dbd $(DBDTOMENUH_dep) @$(RM) $@ - @$(DBTOMENUH) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@ - @echo "$(COMMONDEP_TARGET): ../Makefile" >> $@ + @$(DBTOMENUH) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@.stdout + @echo "$(COMMONDEP_TARGET): ../Makefile" >> $@.stdout + @$(MV) $@.stdout $@ %.dbd$(DEP): %.dbd.pod @$(RM) $@ - @echo "$(COMMONDEP_TARGET): ../Makefile" > $@ + @echo "$(COMMONDEP_TARGET): ../Makefile" > $@.stdout + @$(MV) $@.stdout $@ %.dbd$(DEP): %Include.dbd @$(RM) $@ - @$(DBEXPAND) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@ - @echo "$(COMMONDEP_TARGET): ../Makefile" >> $@ + @$(DBEXPAND) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@.stdout + @echo "$(COMMONDEP_TARGET): ../Makefile" >> $@.stdout + @$(MV) $@.stdout $@ %.dbd$(DEP): ../%Include.dbd @$(RM) $@ - @$(DBEXPAND) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@ - @echo "$(COMMONDEP_TARGET): ../Makefile" >> $@ + @$(DBEXPAND) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $< > $@.stdout + @echo "$(COMMONDEP_TARGET): ../Makefile" >> $@.stdout + @$(MV) $@.stdout $@ %.dbd$(DEP): $($*_DBD) @$(RM) $@ - @$(DBEXPAND) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $($*_DBD) > $@ - @echo "$(COMMONDEP_TARGET): ../Makefile" >> $@ + @$(DBEXPAND) -D $(DBDFLAGS) -o $(COMMONDEP_TARGET) $($*_DBD) > $@.stdout + @echo "$(COMMONDEP_TARGET): ../Makefile" >> $@.stdout + @$(MV) $@.stdout $@ %.db$(DEP): %$(SUBST_SUFFIX) @$(RM) $@ - $(MSI3_15) -D $(DBFLAGS) -o $(COMMONDEP_TARGET) -S$< $(TEMPLATE_FILENAME) > $@ + $(MSI3_15) -D $(DBFLAGS) -o $(COMMONDEP_TARGET) -S$< $(TEMPLATE_FILENAME) > $@.stdout + @$(MV) $@.stdout $@ %.db$(DEP): ../%$(SUBST_SUFFIX) @$(RM) $@ - $(MSI3_15) -D $(DBFLAGS) -o $(COMMONDEP_TARGET) -S$< $(TEMPLATE_FILENAME) > $@ + $(MSI3_15) -D $(DBFLAGS) -o $(COMMONDEP_TARGET) -S$< $(TEMPLATE_FILENAME) > $@.stdout + @$(MV) $@.stdout $@ %.db$(DEP): %$(TEMPL_SUFFIX) @$(RM) $@ - $(MSI3_15) -D $(DBFLAGS) -o $(COMMONDEP_TARGET) $< > $@ + $(MSI3_15) -D $(DBFLAGS) -o $(COMMONDEP_TARGET) $< > $@.stdout + @$(MV) $@.stdout $@ %.db$(DEP): ../%$(TEMPL_SUFFIX) @$(RM) $@ - $(MSI3_15) -D $(DBFLAGS) -o $(COMMONDEP_TARGET) $< > $@ + $(MSI3_15) -D $(DBFLAGS) -o $(COMMONDEP_TARGET) $< > $@.stdout + @$(MV) $@.stdout $@ %.acf$(DEP): %.acs @$(RM) $@ @@ -483,8 +500,9 @@ $(COMMON_DIR)/%.html: ../%.pl $(PODTOHTML_dep) $(COMMON_DIR)/%.db: $(COMMON_DIR)/%.edf $(E2DB) $(E2DB_SYSFLAGS) $(E2DB_FLAGS) -n $*.VAR $< - @$(REPLACEVAR) < $*.VAR > $@ + @$(REPLACEVAR) < $*.VAR > $@.stdout @$(RM) $*.VAR + @$(MV) $@.stdout $@ $(COMMON_DIR)/%.db: %$(SUBST_SUFFIX) $(ECHO) "Inflating database from $< $(TEMPLATE_FILENAME)" diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index bc1ffc14b..ab7241a6a 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -351,12 +351,13 @@ $(LOADABLE_SHRLIBNAME): $(LOADABLE_SHRLIB_PREFIX)%$(LOADABLE_SHRLIB_SUFFIX): # C++ munching for VxWorks %.nm: %$(EXE) - @$(RM) $@ - $(NM) $< > $@ + $(NM) $< > $@.stdout + $(MV) $@.stdout $@ %.nm: %$(OBJ) @$(RM) $@ - $(NM) $< > $@ + $(NM) $< > $@.stdout + $(MV) $@.stdout $@ %_ctdt.c: %.nm $(TOOLS)/munch.pl @$(RM) $@ diff --git a/configure/RULES_MODULES b/configure/RULES_MODULES index 7ae8ffcbc..542a353fe 100644 --- a/configure/RULES_MODULES +++ b/configure/RULES_MODULES @@ -43,7 +43,8 @@ $(RELEASE_LOCAL): Makefile $(CONFIG)/CONFIG_SITE \ $(wildcard $(CONFIG)/CONFIG_SITE.local) $(ECHO) "Creating $@ with" $(ECHO) " $(PARENT_MODULE) = $(INSTALL_ABSOLUTE)" - @echo $(PARENT_MODULE) = $(INSTALL_ABSOLUTE)> $@ + @echo "$(PARENT_MODULE) = $(INSTALL_ABSOLUTE)" > $@.stdout + @$(MV) $@.stdout $@ .PHONY: RELEASE.host diff --git a/configure/os/CONFIG.Common.vxWorksCommon b/configure/os/CONFIG.Common.vxWorksCommon index 06bc8ec1e..383010eec 100644 --- a/configure/os/CONFIG.Common.vxWorksCommon +++ b/configure/os/CONFIG.Common.vxWorksCommon @@ -164,7 +164,10 @@ COMPILE.ctdt = $(CC) -c $(CPPFLAGS) $(CFLAGS_ctdt) $(INCLUDES) $(SOURCE_FLAG) #-------------------------------------------------- # C preprocessor command VXCPPFLAGS = $(filter-out $(OP_SYS_INCLUDE_CPPFLAGS),$(CPPFLAGS)) -PREPROCESS.cpp = $(CPP) $(VXCPPFLAGS) $(INCLUDES) $< > $@ +define PREPROCESS.cpp +$(CPP) $(VXCPPFLAGS) $(INCLUDES) $< > $@.stdout +$(MV) $@.stdout $@ +endef #-------------------------------------------------- # Use LEDLIB for command-line editing diff --git a/configure/os/CONFIG_SITE.Common.darwin-aarch64 b/configure/os/CONFIG_SITE.Common.darwin-aarch64 index 8d79eb16e..5cbbf3c72 100644 --- a/configure/os/CONFIG_SITE.Common.darwin-aarch64 +++ b/configure/os/CONFIG_SITE.Common.darwin-aarch64 @@ -7,3 +7,5 @@ # arm64 devices: Apple Silicon M1 ARCH_CLASS = arm64 + +CODE_CFLAGS = -mmacosx-version-min=14.0 diff --git a/documentation/Makefile b/documentation/Makefile index 059474016..6555ce278 100644 --- a/documentation/Makefile +++ b/documentation/Makefile @@ -21,107 +21,134 @@ RTD_SRC = $(COMMON_DIR)/rtd-src DOCS += README.md DOCS += ca-cli.md +DOCS += RELEASE_NOTES.md DOCS += ReleaseChecklist.md OLD_NOTES = $(wildcard ../RELEASE-*.md) DOCS += $(OLD_NOTES:../%=%) -ifneq ($(EPICS_DEV_SNAPSHOT),) - # Between releases the release target is disabled - DOCS += RELEASE_NOTES.md - REASON = EPICS_DEV_SNAPSHOT not empty +NOTES_FILE = RELEASE-$(EPICS_SHORT_VERSION).md +# NOTES_PATH works in both source and build directories +ifdef T_A + NOTES_PATH = ../$(NOTES_FILE) else - # Not a snapshot, user may be creating a new release - ifdef T_A - DOC = ../ - endif - # Could we be in the middle of anything? - NOTES_FILE = RELEASE-$(EPICS_SHORT_VERSION).md - NOTES_PATH = $(DOC)$(NOTES_FILE) - NOTES_GIT := $(firstword $(shell git status --porcelain $(NOTES_PATH))) - ifeq ($(NOTES_GIT),A) + NOTES_PATH = $(NOTES_FILE) +endif + +ifneq ($(EPICS_DEV_SNAPSHOT),) + # Between releases, our special release targets are disabled + REASON = EPICS_DEV_SNAPSHOT not empty + NOTES_PATH = +else + # Not a snapshot. User could be creating a new release, + # or this is a build of an already-tagged release. + + # Are we in the process of releasing? + NOTES_STAT := $(and $(wildcard $(TOP)/.git), $(shell which git), \ + $(firstword $(shell git status --porcelain $(NOTES_PATH)))) + ifeq ($(NOTES_STAT),A) # New file was added to the Git index; allow unrelease - else ifeq ($(NOTES_GIT),AD) + else ifeq ($(NOTES_STAT),AD) # File was added to the Git index but deleted; allow unrelease else ifeq ($(wildcard $(NOTES_PATH)),) - # No file yet, allow release - else - # File exists but isn't in Git - REASON := $(NOTES_FILE) exists but isn't in Git - NOTES_FILE = + # No file yet, "make release" creates it + else ifeq ($(NOTES_STAT),) + # File in repo, unchanged + REASON := file $(NOTES_FILE) exists NOTES_PATH = endif endif -NEW_DIR = ../new-notes -NEW_NOTES = $(wildcard $(NEW_DIR)/*.md) - include $(TOP)/configure/RULES +help: + @echo "Makefile targets for documentation:" + @echo " all - install some files (default)" + @echo " help - Print this list of make targets" + @echo " release - Create RELEASE-.md, add to git" + @echo " unrelease - Undo 'make release'" + @echo " doxygen - Generate Doxygen HTML output" + @echo " rtd - Install files used by read-the-docs" + @echo " sphinx - Run Sphinx for all release docs" + ifndef T_A + # Delegate these targets to the O.$(T_A) build directory release unrelease doxygen rtd sphinx: inc $(MAKE) -C O.$(EPICS_HOST_ARCH) $@ + else + # Special release target rules + MAKENOTES = ../make-notes.pl + NEW_DIR = ../new-notes + NEW_NOTES = $(wildcard $(NEW_DIR)/*.md) -MAKENOTES = ../make-notes.pl - -ifneq ($(NOTES_PATH),) - $(NOTES_PATH): $(NEW_NOTES) $(MAKENOTES) + ifneq ($(NOTES_PATH),) + $(NOTES_PATH): $(NEW_NOTES) $(MAKENOTES) @$(RM) $@ $(PERL) $(MAKENOTES) -o $@ -V $(EPICS_SHORT_VERSION) \ - -d $(abspath $(NEW_DIR)) - release-git: $(NOTES_PATH) + -d $(abspath $(NEW_DIR)) $(OLD_NOTES) + release-git: $(NOTES_PATH) $(if $(NEW_NOTES), \ git rm -q $(NEW_NOTES)) git add $< - release: $(INSTALL_DOC)/RELEASE_NOTES.md $(INSTALL_DOC)/$(NOTES_FILE) + release: $(INSTALL_DOC)/RELEASE_NOTES.md $(INSTALL_DOC)/$(NOTES_FILE) - unrelease: + unrelease: $(if $(wildcard $(NOTES_PATH)), \ git restore --staged $(NOTES_PATH); \ $(RM) $(NOTES_PATH)) git restore --staged $(NEW_DIR) git restore $(NEW_DIR) - REL_DEP = release-git $(NOTES_PATH) -else - REL_DEV = -D - release unrelease: + REL_DEPS = release-git $(NOTES_PATH) + else + DEV_FLAG = -D + release unrelease: $(error "make $@" not available, $(REASON)) -endif + endif -$(COMMON_DIR)/RELEASE_NOTES.md: $(REL_DEP) $(NEW_NOTES) $(MAKENOTES) + # Rules to create RELEASE_NOTES.md + ifeq ($(wildcard ../$(NOTES_FILE)),) + # No RELEASE-.md file, add new-notes to RELEASE_NOTES.md + $(COMMON_DIR)/RELEASE_NOTES.md: $(REL_DEPS) $(NEW_NOTES) $(MAKENOTES) @$(RM) $@ - $(PERL) $(MAKENOTES) -o $@ -V $(EPICS_SHORT_VERSION) $(REL_DEV) \ + $(PERL) $(MAKENOTES) -o $@ -V $(EPICS_SHORT_VERSION) $(DEV_FLAG) \ -d $(abspath $(NEW_DIR)) $(OLD_NOTES) $(NOTES_PATH) + else + # RELEASE-.md exists, we're building a tagged version + $(COMMON_DIR)/RELEASE_NOTES.md: ../$(NOTES_FILE) + @$(RM) $@ + $(PERL) $(MAKENOTES) -o $@ -V $(EPICS_SHORT_VERSION) $(OLD_NOTES) + endif -$(HEADER_MD_FILES): %_h.md: ../HEADER_h.md + $(HEADER_MD_FILES): %_h.md: ../HEADER_h.md $(EXPAND_TOOL) -t $(INSTALL_LOCATION) -DHEADER=$* $< $@ -$(API_RST_FILES): %-api.rst: ../%-API.rst + $(API_RST_FILES): %-api.rst: ../%-API.rst @$(RM) $@ @$(ECHO) Creating $@ @$(CP) $< $@ @$(foreach h, $($*_HEADERS), \ echo " $h_h.rst" >> $@;) -doxygen: Doxyfile + DOX = doxygen + doxygen: Doxyfile @$(MKDIR) $(RTD_SRC) $(DOXYGEN) -DOX = doxygen -# Use "make sphinx DOX=" to skip running doxygen -rtd: $(DOX) $(API_RST_FILES) $(HEADER_MD_FILES) + # Use "make sphinx DOX=" to skip running doxygen + RTD = rtd + rtd: $(DOX) $(API_RST_FILES) $(HEADER_MD_FILES) rsync -av --exclude=RELEASE-*.md $(INSTALL_DOC)/ $(RTD_SRC)/ rsync -av $(HEADER_MD_FILES) $(RTD_SRC)/ rsync -av $(API_RST_FILES) $(RTD_SRC)/ rsync -av ../index.rst ../conf.py $(RTD_SRC)/ -RTD = rtd -# Use "make sphinx RTD=" to skip earlier steps -sphinx: $(RTD) + # Use "make sphinx RTD=" to skip earlier steps + sphinx: $(RTD) cd $(COMMON_DIR); $(PYTHON) -m sphinx rtd-src readthedocs rsync -av $(COMMON_DIR)/readthedocs $(INSTALL_HTML)/ endif -.PHONY: release release-git unrelease doxygen rtd sphinx +.PHONY: release help release-git unrelease doxygen rtd sphinx +.NOTPARALLEL: release unrelease doxygen rtd sphinx diff --git a/documentation/Makefile.headers b/documentation/Makefile.headers index d892677e9..bc14cf525 100644 --- a/documentation/Makefile.headers +++ b/documentation/Makefile.headers @@ -13,7 +13,9 @@ libcom_HEADERS += bucketLib libcom_HEADERS += cantProceed libcom_HEADERS += compilerDependencies libcom_HEADERS += cvtFast +libcom_HEADERS += dbDefs libcom_HEADERS += dbmf +libcom_HEADERS += devLib libcom_HEADERS += devLibVME libcom_HEADERS += devLibVMEImpl libcom_HEADERS += ellLib @@ -66,17 +68,18 @@ ca_HEADERS += db_access database_HEADERS += callback database_HEADERS += chfPlugin +database_HEADERS += dbBase database_HEADERS += dbChannel database_HEADERS += dbCommon database_HEADERS += dbDefs database_HEADERS += dbEvent database_HEADERS += dbExtractArray database_HEADERS += dbLink +database_HEADERS += dbLock database_HEADERS += dbServer database_HEADERS += dbState database_HEADERS += dbStaticLib database_HEADERS += dbUnitTest -database_HEADERS += devLib database_HEADERS += devSup database_HEADERS += drvSup database_HEADERS += initHooks diff --git a/documentation/RELEASE-7.0.10.md b/documentation/RELEASE-7.0.10.md index e626bc0da..b91c548c8 100644 --- a/documentation/RELEASE-7.0.10.md +++ b/documentation/RELEASE-7.0.10.md @@ -424,7 +424,7 @@ Changes to this module since the previous release: Changes to this module since the previous release: -## Release 4.8.1 +#### Release 4.8.1 * Fix error message generation code. diff --git a/documentation/conf.py b/documentation/conf.py index bce2ff85e..6140087ca 100644 --- a/documentation/conf.py +++ b/documentation/conf.py @@ -28,7 +28,6 @@ author = "The EPICS Collaboration" # ones. extensions = [ - "hoverxref.extension", "breathe", "sphinx.ext.mathjax", "sphinx.ext.ifconfig", @@ -62,23 +61,6 @@ intersphinx_mapping = { "epics": ("https://docs.epics-controls.org/en/latest/", None), } intersphinx_disabled_reftypes = ["*"] -hoverxref_role_types = { - "hoverxref": "tooltip", - "ref": "modal", - "confval": "tooltip", - "mod": "modal", - "class": "modal", - "obj": "tooltip", -} - -hoverxref_intersphinx_types = { - "readthedocs": "modal", - "sphinx": "tooltip", -} - -hoverxref_domains = [ - "py", -] # Enabled Markdown extensions. # See here for what they do: diff --git a/documentation/make-notes.pl b/documentation/make-notes.pl index 018bd27c4..37c1271e4 100644 --- a/documentation/make-notes.pl +++ b/documentation/make-notes.pl @@ -98,17 +98,23 @@ as before, but the entries describing changes in those submodules since version 7.0.5 have been copied into the associated EPICS Release Notes files; they will also be manually added to new EPICS Release Notes published in the future. - -## EPICS Release $REL_VERS - __REL_INTRO__ -print $out <<"__NEW_INTRO__" if $opt_D && scalar @notes; -__This version of EPICS has not been released yet.__ -__When the changes described below get released, the version number used may be -different to the one given above.__ +print $out <<"__REL_VERS__" if $opt_d; +## EPICS Release $REL_VERS -The changes below have been merged into EPICS since the last published release. +__REL_VERS__ + +print $out <<"__NEW_VERS__" if $opt_D; +__This version of EPICS has not been released yet.__ +__The version number used for the next release may be +different to the one shown above.__ + +__NEW_VERS__ + +print $out <<"__NEW_INTRO__" if scalar @notes; +The changes described below have been merged into EPICS +since the last published release. __NEW_INTRO__ diff --git a/documentation/new-notes/PR-359.md b/documentation/new-notes/PR-359.md new file mode 100644 index 000000000..266823c07 --- /dev/null +++ b/documentation/new-notes/PR-359.md @@ -0,0 +1,11 @@ +### Fix undefined timestamp for NORD field + +When monitoring non-val fields such as `NORD` for several record types updates +are not sent out correctly resulting in incorrect timestamps. This fixes this +for the record types `aai`, `aao`, `subArray`. + +Note that support modules that already implement this in the device support +layer will need to be updated to avoid doubled monitor updates. If those modules +are to be built against older versions of EPICS base then they will need to use +the defined macros `AAO_POSTS_NORD`, `AAI_POSTS_NORD`, `SA_POSTS_NORD`, or +`WF_POSTS_NORD` as appropriate to detect this change. diff --git a/documentation/new-notes/PR-768.md b/documentation/new-notes/PR-768.md new file mode 100644 index 000000000..7815ee52b --- /dev/null +++ b/documentation/new-notes/PR-768.md @@ -0,0 +1,8 @@ +### iocInit wait for local CA links to connect + +PR [768](https://github.com/epics-base/epics-base/pull/768) + +During iocInit(), wait for local CA links to connect. +With this change, database authors can be certain that +any local CA link is connected prior to `initHookAfterIocRunning` +and `field(PINI, RUNNING)`. diff --git a/documentation/new-notes/PR-788.md b/documentation/new-notes/PR-788.md new file mode 100644 index 000000000..d5b83c296 --- /dev/null +++ b/documentation/new-notes/PR-788.md @@ -0,0 +1,21 @@ +### epicsThreadGetCPUs and callbackParallelThreads + +On systems that support it (e.g. recent Linux systems), `epicsThreadGetCPUs()` +now takes the current cpu affinity mask of the calling thread into acount. +That fixes the problem that an IOC which was started with a limited affinity +mask (e.g. using `taskset`) and that called `callbackParallelThreads` with an +argument of 0 in the startup script, had started more parallel callback +threads than it has CPU cores available. + +The iocsh function `callbackParallelThreads` now also accepts positive or +negative percentages for `count`, referring to the availabple number of cores +and always rounding the number of used cores down with a minimum of 1. + +#### Examples + +```text +# use up to 25% of available cpu cores for callback threads +callbackParallelThreads 25% +# keep at least 10% of available cpu cores unused for callback threads +callbackParallelThreads -10% +``` diff --git a/documentation/new-notes/README.txt b/documentation/new-notes/README.txt index f866e0ddc..613f72a42 100644 --- a/documentation/new-notes/README.txt +++ b/documentation/new-notes/README.txt @@ -7,23 +7,9 @@ Files here must be written in Markdown (see below) and have the extension '.md' at the end of their filename. This README.txt file is the only other file that should appear here. - -Generating RELEASE_NOTES.md ---------------------------- - -Running 'make' inside the Base documentation directory now generates a -file RELEASE_NOTES.md and installs it into the top-level doc directory. - -The file starts with a level-1 Markdown header and some introductory text. -If any new-notes files are present a level-2 header is added with a Release -version number and a -DEV suffix, followed by some notes explaining their -unreleased status. The new-notes filenames are lexically sorted and their -contents added in order, separated by an extra newline character. - -Finally a series of myst Markdown directives are added which will include all -the older RELEASE-.md files present in the documentation directory -into the published HTML version, sorted in version order with the newest first. - +Do not add new notes by editing the RELEASE-.md files in the Base +documentation directory or the O.Common/RELEASE_NOTES.md file that running +'make' generates. Writing a Release Notes entry ----------------------------- @@ -53,3 +39,19 @@ The file *must* start with a level-3 Markdown title for the entry, like this: Release note entries are not intended to provide full documentation of major features. For small features or changes though, they may provide all the information needed to understand and use the feature. + +Generating RELEASE_NOTES.md +--------------------------- + +Running 'make' inside the Base documentation directory now generates a +file RELEASE_NOTES.md and installs it into the top-level doc directory. + +The file starts with a level-1 Markdown header and some introductory text. +If any new-notes files are present a level-2 header is added with a Release +version number and a -DEV suffix, followed by some notes explaining their +unreleased status. The new-notes filenames are lexically sorted and their +contents added in order, separated by an extra newline character. + +Finally a series of myst Markdown directives are added which will include all +the older RELEASE-.md files present in the documentation directory +into the published HTML version, sorted in version order with the newest first. diff --git a/documentation/requirements.txt b/documentation/requirements.txt index f1d6f0bdb..590a13631 100644 --- a/documentation/requirements.txt +++ b/documentation/requirements.txt @@ -2,5 +2,4 @@ sphinx==7.2.6 myst-parser==2.0.0 breathe==4.35.0 sphinx_copybutton==0.5.2 -sphinx-hoverxref==1.3.0 sphinx-rtd-theme==2.0.0 diff --git a/modules/ca/src/client/access.cpp b/modules/ca/src/client/access.cpp index 19f62460f..859097676 100644 --- a/modules/ca/src/client/access.cpp +++ b/modules/ca/src/client/access.cpp @@ -956,7 +956,7 @@ const unsigned short dbr_value_size[LAST_BUFFER_TYPE+1] = { }; //extern "C" -const enum dbr_value_class dbr_value_class[LAST_BUFFER_TYPE+1] = { +const enum dbr_value_class_e dbr_value_class[LAST_BUFFER_TYPE+1] = { dbr_class_string, /* string max size */ dbr_class_int, /* short */ dbr_class_float, /* IEEE Float */ diff --git a/modules/ca/src/client/cacChannel.cpp b/modules/ca/src/client/cacChannel.cpp index a76d6e957..f086c9829 100644 --- a/modules/ca/src/client/cacChannel.cpp +++ b/modules/ca/src/client/cacChannel.cpp @@ -129,7 +129,7 @@ unsigned cacChannel::getHostName ( return 0u; } -unsigned cacChannel::getHostMinorProtocol ( +unsigned cacChannel::getHostMinorProtocol ( epicsGuard < epicsMutex > &) const throw () { epicsThreadOnce ( & cacChannelIdOnce, cacChannelSetup, 0); diff --git a/modules/ca/src/client/cadef.h b/modules/ca/src/client/cadef.h index a112021c3..d03328ed1 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. @@ -352,7 +352,7 @@ enum ca_preemptive_callback_select * * \sa ca_context_destroy() */ -LIBCA_API int epicsStdCall +LIBCA_API int epicsStdCall ca_context_create (enum ca_preemptive_callback_select select); /** \brief Detach from any CA context currently attached to the calling thread. @@ -1433,7 +1433,7 @@ LIBCA_API void epicsStdCall ca_signal_with_file_and_lineno * pFormat R printf dtyle format string (and optional arguments) * */ -LIBCA_API void epicsStdCall ca_signal_formated (long ca_status, const char *pfilenm, +LIBCA_API void epicsStdCall ca_signal_formated (long ca_status, const char *pfilenm, int lineno, const char *pFormat, ...); /** \brief Return a character string which contains the name of the host @@ -1457,11 +1457,11 @@ LIBCA_API const char * epicsStdCall ca_host_name (chid channel); * \param[out] bufLength The size of the pBuf buffer. * \returns The effective size of the written host name. */ -LIBCA_API unsigned epicsStdCall ca_get_host_name ( chid pChan, +LIBCA_API unsigned epicsStdCall ca_get_host_name ( chid pChan, char *pBuf, unsigned bufLength ); /** \brief Return the minor protocol version number used by the host to - * which a channel is currently connected. + * which a channel is currently connected. * * \param[in] pChan channel identifier * \returns The minor protocol version number. diff --git a/modules/ca/src/client/db_access.h b/modules/ca/src/client/db_access.h index 0fd9c5691..62d693bea 100644 --- a/modules/ca/src/client/db_access.h +++ b/modules/ca/src/client/db_access.h @@ -554,13 +554,13 @@ LIBCA_API extern const unsigned short dbr_value_size[]; #ifndef db_accessHFORdb_accessC /* class for each type's value */ -enum dbr_value_class { +enum dbr_value_class_e { dbr_class_int, dbr_class_float, dbr_class_string, dbr_class_max}; -LIBCA_API extern const enum dbr_value_class dbr_value_class[LAST_BUFFER_TYPE+1]; +LIBCA_API extern const enum dbr_value_class_e dbr_value_class[LAST_BUFFER_TYPE+1]; /* * ptr to value given a pointer to the structure and the DBR type diff --git a/modules/ca/src/client/iocinf.cpp b/modules/ca/src/client/iocinf.cpp index 8bd42f108..ba0ba4b38 100644 --- a/modules/ca/src/client/iocinf.cpp +++ b/modules/ca/src/client/iocinf.cpp @@ -103,7 +103,7 @@ extern "C" int epicsStdCall addAddrToChannelAccessAddressList /* * removeDuplicateAddresses () */ -extern "C" void epicsStdCall removeDuplicateAddresses +extern "C" void epicsStdCall removeDuplicateAddresses ( ELLLIST *pDestList, ELLLIST *pSrcList, int silent ) { ELLNODE *pRawNode; @@ -163,7 +163,7 @@ static void forcePort ( ELLLIST *pList, unsigned short port ) /* * configureChannelAccessAddressList () */ -extern "C" void epicsStdCall configureChannelAccessAddressList +extern "C" void epicsStdCall configureChannelAccessAddressList ( ELLLIST *pList, SOCKET sock, unsigned short port ) { ELLLIST tmpList; diff --git a/modules/ca/src/client/netiiu.cpp b/modules/ca/src/client/netiiu.cpp index 87ad704af..cc20e5c99 100644 --- a/modules/ca/src/client/netiiu.cpp +++ b/modules/ca/src/client/netiiu.cpp @@ -116,7 +116,7 @@ const char * netiiu::pHostName ( return pHostNameNetIIU; } -unsigned netiiu::getHostMinorProtocol ( +unsigned netiiu::getHostMinorProtocol ( epicsGuard < epicsMutex > & ) const throw () { return CA_UKN_MINOR_VERSION; diff --git a/modules/ca/src/client/netiiu.h b/modules/ca/src/client/netiiu.h index d21ed8428..9d26b2fe3 100644 --- a/modules/ca/src/client/netiiu.h +++ b/modules/ca/src/client/netiiu.h @@ -43,7 +43,7 @@ public: unsigned bufLength ) const throw () = 0; virtual const char * pHostName ( epicsGuard < epicsMutex > & ) const throw () = 0; - virtual unsigned getHostMinorProtocol ( + virtual unsigned getHostMinorProtocol ( epicsGuard < epicsMutex > & ) const throw (); virtual bool ca_v41_ok ( epicsGuard < epicsMutex > & ) const = 0; diff --git a/modules/ca/src/client/tcpiiu.cpp b/modules/ca/src/client/tcpiiu.cpp index e6e3e9e30..dffc99a8a 100644 --- a/modules/ca/src/client/tcpiiu.cpp +++ b/modules/ca/src/client/tcpiiu.cpp @@ -1804,9 +1804,9 @@ const char * tcpiiu::pHostName ( return this->hostNameCacheInstance.pointer (); } -unsigned tcpiiu::getHostMinorProtocol ( +unsigned tcpiiu::getHostMinorProtocol ( epicsGuard < epicsMutex > & guard) const throw () -{ +{ guard.assertIdenticalMutex ( this->mutex ); return this->minorProtocolVersion; } diff --git a/modules/ca/src/client/test_event.cpp b/modules/ca/src/client/test_event.cpp index 6db6a4a56..e40343a95 100644 --- a/modules/ca/src/client/test_event.cpp +++ b/modules/ca/src/client/test_event.cpp @@ -48,7 +48,7 @@ extern "C" void epicsStdCall ca_test_event ( struct event_handler_args args ) * ca_dump_dbr() * dump the specified dbr type to stdout */ -extern "C" void epicsStdCall ca_dump_dbr ( +extern "C" void epicsStdCall ca_dump_dbr ( chtype type, unsigned count, const void * pbuffer ) { unsigned i; diff --git a/modules/ca/src/client/udpiiu.cpp b/modules/ca/src/client/udpiiu.cpp index 46b3bb205..e2c7a43f2 100644 --- a/modules/ca/src/client/udpiiu.cpp +++ b/modules/ca/src/client/udpiiu.cpp @@ -462,7 +462,7 @@ void udpiiu :: M_repeaterTimerNotify :: repeaterRegistrationMessage ( unsigned a * * register with the repeater */ -void epicsStdCall caRepeaterRegistrationMessage ( +void epicsStdCall caRepeaterRegistrationMessage ( SOCKET sock, unsigned repeaterPort, unsigned attemptNumber ) { osiSockAddr saddr; @@ -1342,7 +1342,7 @@ const char * udpiiu::pHostName ( return netiiu::pHostName ( cacGuard ); } -unsigned udpiiu::getHostMinorProtocol ( +unsigned udpiiu::getHostMinorProtocol ( epicsGuard < epicsMutex > & cacGuard ) const throw () { return netiiu::getHostMinorProtocol ( cacGuard ); diff --git a/modules/ca/src/client/udpiiu.h b/modules/ca/src/client/udpiiu.h index abc3fa757..3b1177ece 100644 --- a/modules/ca/src/client/udpiiu.h +++ b/modules/ca/src/client/udpiiu.h @@ -239,7 +239,7 @@ private: unsigned bufLength ) const throw (); const char * pHostName ( epicsGuard < epicsMutex > & ) const throw (); - unsigned getHostMinorProtocol ( + unsigned getHostMinorProtocol ( epicsGuard < epicsMutex > & ) const throw (); bool ca_v41_ok ( epicsGuard < epicsMutex > & ) const; diff --git a/modules/ca/src/client/virtualCircuit.h b/modules/ca/src/client/virtualCircuit.h index 0f43ea95e..fb7aa1e91 100644 --- a/modules/ca/src/client/virtualCircuit.h +++ b/modules/ca/src/client/virtualCircuit.h @@ -168,7 +168,7 @@ public: unsigned getHostName ( epicsGuard < epicsMutex > &, char *pBuf, unsigned bufLength ) const throw (); - unsigned getHostMinorProtocol ( + unsigned getHostMinorProtocol ( epicsGuard < epicsMutex > &) const throw (); bool alive ( epicsGuard < epicsMutex > & ) const; diff --git a/modules/database/src/ioc/db/RULES b/modules/database/src/ioc/db/RULES index 85fa44a64..842596aa8 100644 --- a/modules/database/src/ioc/db/RULES +++ b/modules/database/src/ioc/db/RULES @@ -15,8 +15,8 @@ THESE_RULES := $(IOCDIR)/db/RULES dbCommon.h$(DEP): $(COMMON_DIR)/dbCommonRecord.dbd $(THESE_RULES) \ $(DBDTORECTYPEH_dep) - @$(RM) $@ - @$(DBTORECORDTYPEH) -D -I ../db -I $(COMMON_DIR) -o $(COMMONDEP_TARGET) $< > $@ + @$(DBTORECORDTYPEH) -D -I ../db -I $(COMMON_DIR) -o $(COMMONDEP_TARGET) $< > $@.stdout + $(MV) $@.stdout $@ $(COMMON_DIR)/dbCommonRecord.html: ../db/dbCommon.dbd.pod diff --git a/modules/database/src/ioc/db/callback.h b/modules/database/src/ioc/db/callback.h index 07bdc0649..54f6a8a32 100644 --- a/modules/database/src/ioc/db/callback.h +++ b/modules/database/src/ioc/db/callback.h @@ -193,18 +193,24 @@ DBCORE_API void callbackQueueShow(const int reset); * By default, only one thread is run for each priority (3 in total). * * Calling with count==0 will take the count from the callbackParallelThreadsDefault - * global variable (default default is 2). + * global variable (initialized to the number of CPU cores initially available to + * the main thread). * Calling with count>0 sets the number of worker threads directly. - * Calling with count<0 computes the count based on the number of CPU cores on the host. + * Calling with count<0 computes the count based on the number of CPU cores + * currently available to the calling thread, * eg. Passing -2 on an 8 core system will start 6 worker threads. - * In all cases, at least one worker thread will always run. + * The iocsh wrapper also accepts positive or negative percentages for count, + * which allows to refer to a fraction of the currently available CPU cores, + * always rounding the number of created threads down. + * In any case, at least one worker thread will always run. * - * A special prio name of "*" will modify all priorities. + * An empty prio name or the special value "*" will modify all priorities. * Otherwise, only the named priority is modified. + * The prio names are case insensitive. * * @param count If zero, reset to default (callbackParallelThreadsDefault global/iocsh variable). * If positive, exact number of worker threads to create. - * If negative, number of worker threads less than core count. + * If negative, reserve this many CPUs to _not_ run parallel callback threads. * @param prio Priority name. eg. "*", "LOW", "MEDIUM" or "HIGH". * @return zero on success, non-zero if called after iocInit() or with invalid arguments. * diff --git a/modules/database/src/ioc/db/dbCa.c b/modules/database/src/ioc/db/dbCa.c index 0a5214895..dda84f34c 100644 --- a/modules/database/src/ioc/db/dbCa.c +++ b/modules/database/src/ioc/db/dbCa.c @@ -40,6 +40,7 @@ /* We can't include dbStaticLib.h here */ #define dbCalloc(nobj,size) callocMustSucceed(nobj,size,"dbCalloc") +#include #include "db_access_routines.h" #include "dbCa.h" #include "dbCaPvt.h" @@ -64,6 +65,7 @@ extern int dbServiceIsolate; static ELLLIST workList = ELLLIST_INIT; /* Work list for dbCaTask */ static epicsMutexId workListLock; /*Mutual exclusions semaphores for workList*/ static epicsEventId workListEvent; /*wakeup event for dbCaTask*/ +static size_t initOutstanding; // one count for every link with DBCA_CALLBACK_INIT_WAIT static int removesOutstanding = 0; #define removesOutstandingWarning 10000 @@ -351,7 +353,7 @@ static void dbCaLinkInitImpl(int isolate) dbCaCtl = ctlPause; dbCaWorker = epicsThreadCreateOpt("dbCaLink", dbCaTask, NULL, &opts); - /* wait for worker to startup and initialize dbCaClientContext */ + /* wait for worker to startup, initialize dbCaClientContext, and connect local CA */ epicsEventMustWait(startStopEvent); } @@ -370,6 +372,10 @@ void dbCaRun(void) if (dbCaCtl == ctlPause) { dbCaCtl = ctlRun; epicsEventSignal(workListEvent); + + while(epicsAtomicGetSizeT(&initOutstanding)) { + epicsEventMustWait(startStopEvent); + } } } @@ -380,11 +386,12 @@ void dbCaPause(void) epicsEventSignal(workListEvent); } } - -void dbCaAddLinkCallback(struct link *plink, - dbCaCallback connect, dbCaCallback monitor, void *userPvt) +void dbCaAddLinkCallbackOpt(struct dbLocker *locker, struct link *plink, + dbCaCallback connect, dbCaCallback monitor, void *userPvt, + unsigned flags) { caLink *pca; + (void)locker; /* Passed for symmetry with dbDbAddLink(). So far unused. */ assert(!plink->value.pv_link.pvt); @@ -396,6 +403,10 @@ void dbCaAddLinkCallback(struct link *plink, pca->connect = connect; pca->monitor = monitor; pca->userPvt = userPvt; + pca->flags = flags; + + if(flags & DBCA_CALLBACK_INIT_WAIT) + epicsAtomicIncrSizeT(&initOutstanding); epicsMutexMustLock(pca->lock); plink->lset = &dbCa_lset; @@ -405,15 +416,22 @@ void dbCaAddLinkCallback(struct link *plink, epicsMutexUnlock(pca->lock); } +void dbCaAddLinkCallback(struct link *plink, + dbCaCallback connect, dbCaCallback monitor, void *userPvt) +{ + dbCaAddLinkCallbackOpt(NULL, plink, connect, monitor, userPvt, 0); +} + long dbCaAddLink(struct dbLocker *locker, struct link *plink, short dbfType) { - dbCaAddLinkCallback(plink, 0, 0, NULL); + dbCaAddLinkCallbackOpt(locker, plink, 0, 0, NULL, 0); return 0; } void dbCaRemoveLink(struct dbLocker *locker, struct link *plink) { caLink *pca = (caLink *)plink->value.pv_link.pvt; + (void)locker; /* Passed for symmetry with dbDbRemoveLink(). So far unused. */ if (!pca) return; epicsMutexMustLock(pca->lock); @@ -841,6 +859,8 @@ static void connectionCallback(struct connection_handler_args arg) } pca->hasReadAccess = ca_read_access(arg.chid); pca->hasWriteAccess = ca_write_access(arg.chid); + if (pca->flags & DBCA_CALLBACK_INIT_WAIT) + link_action |= CA_INIT_READY; // declare initialized, unless cleared below if (pca->gotFirstConnection) { if (pca->nelements != ca_element_count(arg.chid) || @@ -875,9 +895,11 @@ static void connectionCallback(struct connection_handler_args arg) pca->dbrType = ca_field_type(arg.chid); if ((plink->value.pv_link.pvlMask & pvlOptInpNative) && !pca->pgetNative) { link_action |= CA_MONITOR_NATIVE; + link_action &= ~CA_INIT_READY; // defer to eventCallback() } if ((plink->value.pv_link.pvlMask & pvlOptInpString) && !pca->pgetString) { link_action |= CA_MONITOR_STRING; + link_action &= ~CA_INIT_READY; // defer to eventCallback() } if ((plink->value.pv_link.pvlMask & pvlOptOutNative) && pca->gotOutNative) { link_action |= CA_WRITE_NATIVE; @@ -889,6 +911,7 @@ static void connectionCallback(struct connection_handler_args arg) if (pca->dbrType != DBR_STRING) { /* will run connect() callback later */ link_action |= CA_GET_ATTRIBUTES; + link_action &= ~CA_INIT_READY; // defer to getAttribEventCallback() } else { connect = pca->connect; userPvt = pca->userPvt; @@ -909,6 +932,7 @@ static void eventCallback(struct event_handler_args arg) dbCaCallback monitor = 0; void *userPvt = 0; int doScan = 1; + short link_action = 0; assert(pca); epicsMutexMustLock(pca->lock); @@ -969,10 +993,13 @@ static void eventCallback(struct event_handler_args arg) if ((ppv_link->pvlMask & pvlOptCP) || ((ppv_link->pvlMask & pvlOptCPP) && precord->scan == 0)) { - addAction(pca, CA_DBPROCESS); + link_action |= CA_DBPROCESS; } } + if (pca->flags & DBCA_CALLBACK_INIT_WAIT) + link_action |= CA_INIT_READY; done: + if (link_action) addAction(pca, link_action); epicsMutexUnlock(pca->lock); if (monitor) monitor(userPvt); } @@ -1096,6 +1123,8 @@ static void getAttribEventCallback(struct event_handler_args arg) pca->alarmLimits[3] = pdbr->upper_alarm_limit; pca->precision = pdbr->precision; memcpy(pca->units, pdbr->units, MAX_UNITS_SIZE); + if (pca->flags & DBCA_CALLBACK_INIT_WAIT) + addAction(pca, CA_INIT_READY); epicsMutexUnlock(pca->lock); if (getAttributes) getAttributes(getAttributesPvt); if (connect) connect(userPvt); @@ -1110,7 +1139,7 @@ static void dbCaTask(void *arg) dbCaClientContext = ca_current_context (); SEVCHK(ca_add_exception_event(exceptionCallback,NULL), "ca_add_exception_event"); - epicsEventSignal(startStopEvent); + epicsEventSignal(startStopEvent); /* unblock dbCaLinkInitImpl() */ /* channel access event loop */ while (TRUE){ @@ -1266,6 +1295,13 @@ static void dbCaTask(void *arg) db_process(prec); dbScanUnlock(prec); } + if ((link_action & CA_INIT_READY) && (pca->flags & DBCA_CALLBACK_INIT_WAIT)) { + pca->flags &= ~DBCA_CALLBACK_INIT_WAIT; + if (epicsAtomicDecrSizeT(&initOutstanding)==0) + { + epicsEventSignal(startStopEvent); /* unblock dbCaRun() */ + } + } } SEVCHK(ca_flush_io(), "dbCaTask"); } @@ -1275,5 +1311,5 @@ shutdown: ca_context_destroy(); else fprintf(stderr, "dbCa: chan_count = %d at shutdown\n", dbca_chan_count); - epicsEventSignal(startStopEvent); + epicsEventSignal(startStopEvent); /* unblock dbCaShutdown() */ } diff --git a/modules/database/src/ioc/db/dbCaPvt.h b/modules/database/src/ioc/db/dbCaPvt.h index 1ee0745e0..f1a6e758e 100644 --- a/modules/database/src/ioc/db/dbCaPvt.h +++ b/modules/database/src/ioc/db/dbCaPvt.h @@ -21,6 +21,19 @@ #include "epicsMutex.h" #include "epicsTypes.h" #include "link.h" +#include "shareLib.h" +#include "libCaAPI.h" + +#ifndef INC_cadef_H +/* Copy some definitions so this header to be included from + * places where cadef.h and db_access.h can not. + */ +typedef void * chid; +typedef void * evid; +LIBCA_API extern const unsigned short dbr_value_size[]; +LIBCA_API short epicsShareAPI ca_field_type (chid chan); +#define MAX_UNITS_SIZE 8 +#endif /* link_action mask */ #define CA_CLEAR_CHANNEL 0x1 @@ -32,6 +45,7 @@ #define CA_GET_ATTRIBUTES 0x40 #define CA_SYNC 0x1000 #define CA_DBPROCESS 0x2000 +#define CA_INIT_READY 0x4000 /* write type */ #define CA_PUT 0x1 #define CA_PUT_CALLBACK 0x2 @@ -63,6 +77,7 @@ typedef struct caLink dbCaCallback connect; dbCaCallback monitor; void *userPvt; + unsigned flags; /* The following are for write request */ short putType; dbCaCallback putCallback; @@ -97,4 +112,10 @@ typedef struct caLink unsigned long nUpdate; }caLink; +#define DBCA_CALLBACK_INIT_WAIT (1) + +void dbCaAddLinkCallbackOpt(struct dbLocker *locker, struct link *plink, + dbCaCallback connect, dbCaCallback monitor, + void *userPvt, unsigned flags); + #endif /* INC_dbCaPvt_H */ diff --git a/modules/database/src/ioc/db/dbChannel.h b/modules/database/src/ioc/db/dbChannel.h index 74c2a445b..56ce8c4d6 100644 --- a/modules/database/src/ioc/db/dbChannel.h +++ b/modules/database/src/ioc/db/dbChannel.h @@ -310,7 +310,7 @@ typedef struct chFilterIf { } chFilterIf; /** \brief Filter plugin data - * + * * A chFilterPlugin object holds data about a filter plugin. */ typedef struct chFilterPlugin { diff --git a/modules/database/src/ioc/db/dbExtractArray.h b/modules/database/src/ioc/db/dbExtractArray.h index efff6fecf..287d1367c 100644 --- a/modules/database/src/ioc/db/dbExtractArray.h +++ b/modules/database/src/ioc/db/dbExtractArray.h @@ -22,7 +22,12 @@ extern "C" { #endif -/** @brief Make a copy of parts of an array. +/** + * @file dbExtractArray.h + * + * @brief Make a copy of parts of an array. + */ +/** @brief Make a copy of parts of an array * * The source array may or may not be a record field. * diff --git a/modules/database/src/ioc/db/dbFastLinkConv.c b/modules/database/src/ioc/db/dbFastLinkConv.c index 890c6732f..9f4a2e087 100644 --- a/modules/database/src/ioc/db/dbFastLinkConv.c +++ b/modules/database/src/ioc/db/dbFastLinkConv.c @@ -1217,7 +1217,7 @@ static long cvt_f_st(const void *f, void *t, const dbAddr *paddr) { const epicsFloat32 *from = (const epicsFloat32 *) f; char *to = (char *) t; - + rset *prset = 0; long status = 0; long precision = 6; diff --git a/modules/database/src/ioc/db/dbIocRegister.c b/modules/database/src/ioc/db/dbIocRegister.c index abdc28fa7..a6194cbac 100644 --- a/modules/database/src/ioc/db/dbIocRegister.c +++ b/modules/database/src/ioc/db/dbIocRegister.c @@ -10,6 +10,8 @@ #define EPICS_PRIVATE_API +#include + #include "iocsh.h" #include "callback.h" @@ -27,6 +29,9 @@ #include "dbState.h" #include "db_test.h" #include "dbTest.h" +#include "epicsStdlib.h" +#include "epicsStdio.h" +#include "errlog.h" DBCORE_API extern int callbackParallelThreadsDefault; @@ -503,7 +508,7 @@ static void callbackQueueShowCallFunc(const iocshArgBuf *args) } /* callbackParallelThreads */ -static const iocshArg callbackParallelThreadsArg0 = { "no of threads", iocshArgInt}; +static const iocshArg callbackParallelThreadsArg0 = { "no of threads", iocshArgString}; static const iocshArg callbackParallelThreadsArg1 = { "priority", iocshArgString}; static const iocshArg * const callbackParallelThreadsArgs[2] = {&callbackParallelThreadsArg0,&callbackParallelThreadsArg1}; @@ -513,7 +518,25 @@ static const iocshFuncDef callbackParallelThreadsFuncDef = {"callbackParallelThr "or one of LOW, MEDIUM, or HIGH.\n"}; static void callbackParallelThreadsCallFunc(const iocshArgBuf *args) { - iocshSetError(callbackParallelThreads(args[0].ival, args[1].sval)); + epicsInt32 num = 0; + if (args[0].sval) { + char* end; + long status = epicsParseInt32(args[0].sval, &num, 10, &end); + if (status || (end[0] && strcmp(end, "%") != 0)) + { + fprintf(epicsGetStderr(), + ANSI_RED("Invalid integer '%s'.\n"), args[0].sval); + iocshSetError(-1); + return; + } + if (end[0] == '%') { + /* round down, min 1 */ + if (num < 0) num += 100; + if (num > 0) num = num * epicsThreadGetCPUs() / 100; + if (num <= 0) num = 1; + } + } + iocshSetError(callbackParallelThreads(num, args[1].sval)); } /* dbStateCreate */ diff --git a/modules/database/src/ioc/db/dbLink.c b/modules/database/src/ioc/db/dbLink.c index a2819d553..e03650eab 100644 --- a/modules/database/src/ioc/db/dbLink.c +++ b/modules/database/src/ioc/db/dbLink.c @@ -31,7 +31,7 @@ #include "dbAccessDefs.h" #include "dbAddr.h" #include "dbBase.h" -#include "dbCa.h" +#include "dbCaPvt.h" #include "dbCommon.h" #include "dbConstLink.h" #include "dbDbLink.h" @@ -125,7 +125,9 @@ void dbInitLink(struct link *plink, short dbfType) if (dbfType == DBF_INLINK) plink->value.pv_link.pvlMask |= pvlOptInpNative; - dbCaAddLink(NULL, plink, dbfType); + int isLocal = dbChannelTest(plink->value.pv_link.pvname)==0; + + dbCaAddLinkCallbackOpt(NULL, plink, NULL, NULL, NULL, isLocal ? DBCA_CALLBACK_INIT_WAIT : 0); if (dbfType == DBF_FWDLINK) { char *pperiod = strrchr(plink->value.pv_link.pvname, '.'); diff --git a/modules/database/src/ioc/db/dbLock.h b/modules/database/src/ioc/db/dbLock.h index 8fe068ce9..2d656e6b6 100644 --- a/modules/database/src/ioc/db/dbLock.h +++ b/modules/database/src/ioc/db/dbLock.h @@ -24,11 +24,17 @@ extern "C" { struct dbCommon; struct dbBase; -/** @brief Lock multiple records. +/** + * @file dbLock.h + * @brief Lock one or multiple records. * - * A dbLocker allows a caller to simultaneously lock multiple records. - * The list of records is provided to dbLockerAlloc(). - * And the resulting dbLocker can be locked/unlocked repeatedly. + * Locking is required to prevent corruption of record fields due to concurrent + * access by different threads. + */ + /** @brief A dbLocker allows a caller to lock a single record or simultaneously + * lock multiple records. + * The list of records is provided to dbLockerAlloc(). And the resulting + * dbLocker can be locked/unlocked repeatedly. * * Each thread can only lock one dbLocker at a time. * While locked, dbScanLock() may be called only on those records @@ -72,37 +78,68 @@ DBCORE_API void dbLockerFree(dbLocker *plocker); /** @brief Lock all records of dbLocker * - * While locked, caller may access any associated record passed to dbLockerAlloc() . + * Locks multiple record. While locked, caller may access any associated record + * passed to dbLockerAlloc(). * dbScanLockMany() may not be called again (multi-lock is not recursive). * dbScanLock()/dbScanUnlock() may be called on individual record. * The caller must later call dbScanUnlockMany(). * @since 3.16.0.1 */ DBCORE_API void dbScanLockMany(dbLocker*); -/** @brief Unlock all records of dbLocker +/** @brief Unlock all records of dbLocker. + * + * Unlocks the records of dbLocker. A thread must call dbScanUnlockMany with the + * same dbLocker* before calling dbScanLockMany again. * @since 3.16.0.1 */ DBCORE_API void dbScanUnlockMany(dbLocker*); +/** @brief Returns ID number of the lockset*/ DBCORE_API unsigned long dbLockGetLockId( struct dbCommon *precord); +/** @brief During IOC startup the complete list of records is iterated by + * dbLockInitRecords + * + * The required locksets are created and populated based on the links defined + * at the time of IOC startup*/ DBCORE_API void dbLockInitRecords(struct dbBase *pdbbase); + + +/** @brief Frees up locksets which are no longer in use. If lockset is still active, prints warning and calls `dblsr`*/ DBCORE_API void dbLockCleanupRecords(struct dbBase *pdbbase); -/* Lock Set Report */ +/** @brief Lock Set Report + * + * Generates a report showing the lock set to which each record belongs. + * If recordname is 0, "", "*" all records are shown. Otherwise only records + * in the same lock set as recordname are shown. Level can have the following + * values: + * + * 0 - show lock set information only + * + * 1 - show each record in the lock set + * + * 2 - show each record and all database links in the lock set + */ DBCORE_API long dblsr(char *recordname,int level); -/* If recordname NULL then all records*/ /* level = (0,1,2) (lock set state, + recordname, +DB links) */ +/** @brief Displays free and active locksets + */ DBCORE_API long dbLockShowLocked(int level); -/*KLUDGE to support field TPRO*/ + +/** @brief Support for TPRO field */ DBCORE_API int * dbLockSetAddrTrace(struct dbCommon *precord); + /* debugging */ + +/** @brief Returns the reference count */ DBCORE_API unsigned long dbLockGetRefs(struct dbCommon*); +/** @brief Returns the number of active locksets*/ DBCORE_API unsigned long dbLockCountSets(void); #ifdef __cplusplus diff --git a/modules/database/src/ioc/db/dbScan.c b/modules/database/src/ioc/db/dbScan.c index a55300a87..f016f0200 100644 --- a/modules/database/src/ioc/db/dbScan.c +++ b/modules/database/src/ioc/db/dbScan.c @@ -27,6 +27,7 @@ #include "ellLib.h" #include "epicsAtomic.h" #include "epicsEvent.h" +#include "epicsGeneralTime.h" #include "epicsMutex.h" #include "epicsPrint.h" #include "epicsRingBytes.h" @@ -114,7 +115,7 @@ typedef struct event_list { struct event_list *next; char eventname[1]; /* actually arbitrary size */ } event_list; -static event_list * volatile pevent_list[256]; +static event_list * volatile pevent_list[NUM_TIME_EVENTS]; static epicsMutexId event_lock; /* IO_EVENT*/ @@ -546,7 +547,7 @@ void postEvent(event_list *pel) /* backward compatibility */ void post_event(int event) { - if (event <= 0 || event > 255) return; + if (event <= 0 || event >= NUM_TIME_EVENTS) return; postEvent(pevent_list[event]); } diff --git a/modules/database/src/ioc/db/dbTest.c b/modules/database/src/ioc/db/dbTest.c index 8a7ede79f..bcf2a67d6 100644 --- a/modules/database/src/ioc/db/dbTest.c +++ b/modules/database/src/ioc/db/dbTest.c @@ -145,7 +145,7 @@ static void printFieldsList(DBENTRY *pdbentry, char** papfields, int nfields) printf(", \"%s\"", (pvalue ? pvalue : "")); } printf("\n"); -} +} long dbl(const char *precordTypename, const char *fields) { @@ -422,8 +422,10 @@ long dbpf(const char *pname,const char *pvalue) return -1; } status = dbPutConvertJSON(pvalue, dbrType, array, &n); - if (status) + if (status) { + free(array); return status; + } pvalue = array; } } diff --git a/modules/database/src/ioc/dbStatic/dbBase.h b/modules/database/src/ioc/dbStatic/dbBase.h index 086c817c6..1a080393c 100644 --- a/modules/database/src/ioc/dbStatic/dbBase.h +++ b/modules/database/src/ioc/dbStatic/dbBase.h @@ -7,14 +7,16 @@ * EPICS BASE is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. \*************************************************************************/ -/* - * Current Author: Marty Kraimer - * Date: 03-19-92 - */ #ifndef INCdbBaseh #define INCdbBaseh 1 +/** \file dbBase.h + * \author Marty Kraimer + * \date 03-19-92 + * \brief Base db structures + */ + #include "epicsTypes.h" #include "dbFldTypes.h" #include "ellLib.h" @@ -44,7 +46,7 @@ typedef struct devSup { int link_type; /*Following only available on run time system*/ dset *pdset; - struct dsxt *pdsxt; /* Extended device support */ + struct dsxt *pdsxt; /**< Extended device support */ }devSup; typedef struct linkSup { @@ -59,50 +61,55 @@ typedef struct dbDeviceMenu { char **papChoice; }dbDeviceMenu; -/* conversion types*/ +/** \brief conversion types*/ typedef enum {CT_DECIMAL,CT_HEX} ctType; -/* access level types */ +/** \brief access level types */ typedef enum {ASL0,ASL1} asLevel; -/*Breakpoint Tables */ -typedef struct brkInt{ /* breakpoint interval */ - double raw; /*raw value for beginning of interval */ - double slope; /*slope for interval */ - double eng; /*converted value for beginning of interval*/ +/* Breakpoint Tables */ + +/** \brief breakpoint interval */ +typedef struct brkInt{ + double raw; /**< \brief raw value for beginning of interval */ + double slope; /**< \brief slope for interval */ + double eng; /**< \brief converted value for beginning of interval*/ }brkInt; -typedef struct brkTable { /* breakpoint table */ +/** \brief breakpoint table */ +typedef struct brkTable { ELLNODE node; - char *name; /*breakpoint table name */ - long number; /*number of brkInt in this table */ - struct brkInt *paBrkInt; /* ptr to array of brkInts */ + char *name; /**< \brief breakpoint table name */ + long number; /**< \brief number of brkInt in this table */ + struct brkInt *paBrkInt; /**< \brief ptr to array of brkInts */ }brkTable; -typedef struct dbFldDes{ /* field description */ - char *prompt; /*Prompt string for DCT */ - char *name; /*Field name */ - char *extra; /*C def for DBF_NOACCESS */ +/** \brief field description */ +typedef struct dbFldDes{ + char *prompt; /**< \brief Prompt string for DCT */ + char *name; /**< \brief Field name */ + char *extra; /**< \brief C def for DBF_NOACCESS */ struct dbRecordType *pdbRecordType; - short indRecordType; /*within dbRecordType.papFldDes */ - short special; /*Special processing requirements */ - dbfType field_type; /*Field type as defined in dbFldTypes.h */ - unsigned int process_passive:1;/*should dbPutField process passive */ - unsigned int prop:1; /*field is a metadata, post DBE_PROPERTY on change*/ - unsigned int isDevLink:1; /* true for INP/OUT fields */ - ctType base; /*base for integer to string conversions*/ - short promptgroup; /*prompt, i.e. gui group */ - short interest; /*interest level */ - asLevel as_level; /*access security level */ - char *initial; /*initial value */ - /*If (DBF_MENU,DBF_DEVICE) ftPvt is (pdbMenu,pdbDeviceMenu) */ + short indRecordType; /**< \brief within dbRecordType.papFldDes */ + short special; /**< \brief Special processing requirements */ + dbfType field_type; /**< \brief Field type as defined in dbFldTypes.h */ + unsigned int process_passive:1;/**< \brief should dbPutField process passive */ + unsigned int prop:1; /**< \brief field is a metadata, post DBE_PROPERTY on change*/ + unsigned int isDevLink:1; /**< \brief true for INP/OUT fields */ + ctType base; /**< \brief base for integer to string conversions*/ + short promptgroup; /**< \brief prompt, i.e. gui group */ + short interest; /**< \brief interest level */ + asLevel as_level; /**< \brief access security level */ + char *initial; /**< \brief initial value */ + /** \brief If (DBF_MENU,DBF_DEVICE) ftPvt is (pdbMenu,pdbDeviceMenu) */ void *ftPvt; - /*On no runtime following only set for STRING */ - short size; /*length in bytes of a field element */ + /* On no runtime following only set for STRING */ + short size; /**< \brief length in bytes of a field element */ /*The following are only available on run time system*/ - unsigned short offset; /*Offset in bytes from beginning of record*/ + unsigned short offset; /**< \brief Offset in bytes from beginning of record*/ }dbFldDes; -typedef struct dbInfoNode { /*non-field per-record information*/ +/** non-field per-record information*/ +typedef struct dbInfoNode { ELLNODE node; char *name; char *string; @@ -117,13 +124,13 @@ typedef struct dbRecordNode { ELLNODE node; void *precord; char *recordname; - ELLLIST infoList; /*LIST head of info nodes*/ + ELLLIST infoList; /**< \brief LIST head of info nodes*/ int flags; /** Parse order of this record() * @since 7.0.8.1 */ unsigned order; - struct dbRecordNode *aliasedRecnode; /* NULL unless flags|DBRN_FLAGS_ISALIAS */ + struct dbRecordNode *aliasedRecnode; /**< \brief NULL unless flags|DBRN_FLAGS_ISALIAS */ }dbRecordNode; /*dbRecordAttribute is for "pseudo" fields */ @@ -150,24 +157,24 @@ typedef struct dbVariableDef { typedef struct dbRecordType { ELLNODE node; - ELLLIST attributeList; /*LIST head of attributes*/ - ELLLIST recList; /*LIST head of sorted dbRecordNodes*/ - ELLLIST devList; /*List of associated device support*/ - ELLLIST cdefList; /*LIST of Cdef text items*/ + ELLLIST attributeList; /**< \brief LIST head of attributes*/ + ELLLIST recList; /**< \brief LIST head of sorted dbRecordNodes*/ + ELLLIST devList; /**< \brief List of associated device support*/ + ELLLIST cdefList; /**< \brief LIST of Cdef text items*/ char *name; - short no_fields; /* number of fields defined */ - short no_prompt; /* number of fields to configure*/ - short no_links; /* number of links */ - short no_aliases; /* number of aliases in recList */ - short *link_ind; /* addr of array of ind in papFldDes*/ - char **papsortFldName;/* ptr to array of ptr to fld names*/ - short *sortFldInd; /* addr of array of ind in papFldDes*/ - dbFldDes *pvalFldDes; /*pointer dbFldDes for VAL field*/ - short indvalFlddes; /*ind in papFldDes*/ - dbFldDes **papFldDes; /* ptr to array of ptr to fldDes*/ + short no_fields; /**< \brief number of fields defined */ + short no_prompt; /**< \brief number of fields to configure*/ + short no_links; /**< \brief number of links */ + short no_aliases; /**< \brief number of aliases in recList */ + short *link_ind; /**< \brief addr of array of ind in papFldDes*/ + char **papsortFldName;/**< \brief ptr to array of ptr to fld names*/ + short *sortFldInd; /**< \brief * addr of array of ind in papFldDes*/ + dbFldDes *pvalFldDes; /**< \brief pointer dbFldDes for VAL field*/ + short indvalFlddes; /**< \brief ind in papFldDes*/ + dbFldDes **papFldDes; /**< \brief ptr to array of ptr to fldDes*/ /*The following are only available on run time system*/ rset *prset; - int rec_size; /*record size in bytes */ + int rec_size; /**< \brief record size in bytes */ }dbRecordType; struct dbPvd; /* Contents private to dbPvdLib code */ diff --git a/modules/database/src/ioc/dbStatic/dbStaticIocRegister.c b/modules/database/src/ioc/dbStatic/dbStaticIocRegister.c index 2cc96f5aa..26493f67a 100644 --- a/modules/database/src/ioc/dbStatic/dbStaticIocRegister.c +++ b/modules/database/src/ioc/dbStatic/dbStaticIocRegister.c @@ -77,7 +77,7 @@ static const iocshArg * const dbDumpFieldArgs[] = static const iocshFuncDef dbDumpFieldFuncDef = {"dbDumpField",3,dbDumpFieldArgs, "Dump information about the fieldName in the recordTypeName.\n" "Example: dbDumpField pdbbase calcout A\n" - "If last argument(s) are missing, dump information\n" + "If last argument(s) are missing, dump information\n" "about all fieldName in all recordTypeName in the database.\n"}; static void dbDumpFieldCallFunc(const iocshArgBuf *args) { diff --git a/modules/database/src/ioc/dbStatic/dbStaticLib.c b/modules/database/src/ioc/dbStatic/dbStaticLib.c index f81b496d8..cbdcea5fa 100644 --- a/modules/database/src/ioc/dbStatic/dbStaticLib.c +++ b/modules/database/src/ioc/dbStatic/dbStaticLib.c @@ -744,7 +744,7 @@ static long dbAddOnePath (DBBASE *pdbbase, const char *path, unsigned length) pdbPathNode = (dbPathNode *)dbCalloc(1, sizeof(dbPathNode)); pdbPathNode->directory = (char *)dbMalloc(length+1); - strncpy(pdbPathNode->directory, path, length+1); + memcpy(pdbPathNode->directory, path, length); pdbPathNode->directory[length] = '\0'; ellAdd(ppathList, &pdbPathNode->node); return 0; @@ -1447,6 +1447,7 @@ long dbCreateRecord(DBENTRY *pdbentry,const char *precordName) pdbentry->precnode = pNewRecNode; ppvd = dbPvdAdd(pdbentry->pdbbase,precordType,pNewRecNode); if(!ppvd) {errMessage(-1,"Logic Err: Could not add to PVD");return(-1);} + pNewRecNode->order = pdbentry->pdbbase->no_records++; return(0); } @@ -1700,6 +1701,7 @@ long dbCreateAlias(DBENTRY *pdbentry, const char *alias) } ellAdd(&precordType->recList, &pnewnode->node); + pnewnode->order = pdbentry->pdbbase->no_records++; precordType->no_aliases++; return 0; diff --git a/modules/database/src/ioc/misc/miscIocRegister.c b/modules/database/src/ioc/misc/miscIocRegister.c index 920104520..5e764b708 100644 --- a/modules/database/src/ioc/misc/miscIocRegister.c +++ b/modules/database/src/ioc/misc/miscIocRegister.c @@ -36,7 +36,7 @@ static void iocBuildCallFunc(const iocshArgBuf *args) } /* iocRun */ -static const iocshFuncDef iocRunFuncDef = {"iocRun",0,NULL, +static const iocshFuncDef iocRunFuncDef = {"iocRun",0,NULL, "Bring the IOC out of its initial quiescent state to the running state.\n" "See more: iocBuild, iocPause\n"}; static void iocRunCallFunc(const iocshArgBuf *args) @@ -85,7 +85,7 @@ static const iocshArg * const systemArgs[] = {&systemArg0}; static const iocshFuncDef systemFuncDef = {"system",1,systemArgs, "Send command string to the system command interpreter for execution.\n" "Not available on all OSs.\n" - "To enable this command, add registrar(iocshSystemCommand) to an application dbd file,\n" + "To enable this command, add registrar(iocshSystemCommand) to an application dbd file,\n" "or include system.dbd\n"}; static void systemCallFunc(const iocshArgBuf *args) { diff --git a/modules/database/src/ioc/rsrv/caservertask.c b/modules/database/src/ioc/rsrv/caservertask.c index 46cd6e39e..740cd4b4e 100644 --- a/modules/database/src/ioc/rsrv/caservertask.c +++ b/modules/database/src/ioc/rsrv/caservertask.c @@ -312,8 +312,7 @@ void rsrv_build_addr_lists(void) char sockErrBuf[64]; epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) ); - errlogPrintf("CAS: failed to set mcast loopback: %s\n", - sockErrBuf); + errlogPrintf("rsrv: failed to set mcast loopback: %s (%d)\n", sockErrBuf, errno); } } #endif diff --git a/modules/database/src/std/dev/devAaiSoft.c b/modules/database/src/std/dev/devAaiSoft.c index f2e4a41f9..7d86ece0c 100644 --- a/modules/database/src/std/dev/devAaiSoft.c +++ b/modules/database/src/std/dev/devAaiSoft.c @@ -85,7 +85,6 @@ static long readLocked(struct link *pinp, void *dummy) static long read_aai(aaiRecord *prec) { - epicsUInt32 nord = prec->nord; struct link *pinp = prec->simm == menuYesNoYES ? &prec->siol : &prec->inp; long status; @@ -96,8 +95,5 @@ static long read_aai(aaiRecord *prec) if (status == S_db_noLSET) status = readLocked(pinp, NULL); - if (!status && nord != prec->nord) - db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG); - return status; } 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 9d9319c6b..2782d8bb4 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 c8690377b..117b445a5 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 b22d8d7aa..95cc5a4ee 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/devSASoft.c b/modules/database/src/std/dev/devSASoft.c index d8e6e5c62..05d0e5cdf 100644 --- a/modules/database/src/std/dev/devSASoft.c +++ b/modules/database/src/std/dev/devSASoft.c @@ -93,7 +93,6 @@ static long read_sa(subArrayRecord *prec) { long status; struct sart rt; - epicsUInt32 nord = prec->nord; rt.nRequest = prec->indx + prec->nelm; if (rt.nRequest > prec->malm) @@ -118,9 +117,6 @@ static long read_sa(subArrayRecord *prec) if (!status) { subset(prec, rt.nRequest); - - if (nord != prec->nord) - db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG); } return status; 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/dev/devWfSoft.c b/modules/database/src/std/dev/devWfSoft.c index ccc984352..ee324f357 100644 --- a/modules/database/src/std/dev/devWfSoft.c +++ b/modules/database/src/std/dev/devWfSoft.c @@ -72,7 +72,6 @@ static long read_wf(waveformRecord *prec) { long status; struct wfrt rt; - epicsUInt32 nord = prec->nord; rt.nRequest = prec->nelm; rt.ptime = (dbLinkIsConstant(&prec->tsel) && @@ -88,8 +87,6 @@ static long read_wf(waveformRecord *prec) if (!status) { prec->nord = rt.nRequest; prec->udf = FALSE; - if (nord != prec->nord) - db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG); } return status; diff --git a/modules/database/src/std/rec/RULES b/modules/database/src/std/rec/RULES index 868fc1d40..dc1a61960 100644 --- a/modules/database/src/std/rec/RULES +++ b/modules/database/src/std/rec/RULES @@ -8,8 +8,8 @@ # This is a Makefile fragment, see src/ioc/Makefile. stdRecords.dbd$(DEP): $(STDDIR)/rec/Makefile $(STDDIR)/rec/RULES - @$(RM) $@ - @echo "$(COMMON_DIR)/stdRecords.dbd:" > $@ + @echo "$(COMMON_DIR)/stdRecords.dbd:" > $@.stdout + $(MV) $@.stdout $@ $(COMMON_DIR)/stdRecords.dbd: $(STDDIR)/rec/Makefile $(STDDIR)/rec/RULES diff --git a/modules/database/src/std/rec/aaiRecord.c b/modules/database/src/std/rec/aaiRecord.c index 756b892ab..37210fd1f 100644 --- a/modules/database/src/std/rec/aaiRecord.c +++ b/modules/database/src/std/rec/aaiRecord.c @@ -156,8 +156,9 @@ static long process(struct dbCommon *pcommon) { struct aaiRecord *prec = (struct aaiRecord *)pcommon; aaidset *pdset = (aaidset *)(prec->dset); - long status; unsigned char pact = prec->pact; + epicsUInt32 nord = prec->nord; + long status; if (pdset == NULL || pdset->read_aai == NULL) { prec->pact = TRUE; @@ -173,7 +174,11 @@ static long process(struct dbCommon *pcommon) prec->udf = FALSE; recGblGetTimeStampSimm(prec, prec->simm, &prec->siol); + if (nord != prec->nord) { + db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG); + } monitor(prec); + /* process the forward scan link record */ recGblFwdLink(prec); @@ -233,8 +238,9 @@ static long put_array_info(DBADDR *paddr, long nNew) if (prec->nord > prec->nelm) prec->nord = prec->nelm; - if (nord != prec->nord) + if (nord != prec->nord) { db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG); + } return 0; } diff --git a/modules/database/src/std/rec/aaiRecord.dbd.pod b/modules/database/src/std/rec/aaiRecord.dbd.pod index c27a225d0..4dcec08e7 100644 --- a/modules/database/src/std/rec/aaiRecord.dbd.pod +++ b/modules/database/src/std/rec/aaiRecord.dbd.pod @@ -303,6 +303,7 @@ Scan forward link if necessary, set PACT FALSE, and return. % long (*read_aai)(struct aaiRecord *prec); /*returns: (-1,0)=>(failure,success)*/ %} aaidset; %#define HAS_aaidset + %#define AAI_POSTS_NORD %#define AAI_DEVINIT_PASS1 2 % field(VAL,DBF_NOACCESS) { diff --git a/modules/database/src/std/rec/aaoRecord.c b/modules/database/src/std/rec/aaoRecord.c index 1aae712d0..cff429beb 100644 --- a/modules/database/src/std/rec/aaoRecord.c +++ b/modules/database/src/std/rec/aaoRecord.c @@ -153,6 +153,7 @@ static long process(struct dbCommon *pcommon) aaodset *pdset = (aaodset *)(prec->dset); long status; unsigned char pact = prec->pact; + epicsUInt32 nord = prec->nord; if (pdset == NULL || pdset->write_aao == NULL) { prec->pact = TRUE; @@ -180,6 +181,9 @@ static long process(struct dbCommon *pcommon) recGblGetTimeStampSimm(prec, prec->simm, NULL); } + if (nord != prec->nord) { + db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG); + } monitor(prec); /* process the forward scan link record */ recGblFwdLink(prec); diff --git a/modules/database/src/std/rec/aaoRecord.dbd.pod b/modules/database/src/std/rec/aaoRecord.dbd.pod index 4ad29a0bb..14481ba4c 100644 --- a/modules/database/src/std/rec/aaoRecord.dbd.pod +++ b/modules/database/src/std/rec/aaoRecord.dbd.pod @@ -326,6 +326,7 @@ Scan forward link if necessary, set PACT FALSE, and return. % long (*write_aao)(struct aaoRecord *prec); /*returns: (-1,0)=>(failure,success)*/ %} aaodset; %#define HAS_aaodset + %#define AAO_POSTS_NORD % field(VAL,DBF_NOACCESS) { prompt("Value") 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 7f1d1adc8..6a8c40442 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/eventRecord.c b/modules/database/src/std/rec/eventRecord.c index f6ea6fc08..25bad2eba 100644 --- a/modules/database/src/std/rec/eventRecord.c +++ b/modules/database/src/std/rec/eventRecord.c @@ -96,7 +96,7 @@ static long init_record(struct dbCommon *pcommon, int pass) recGblInitSimm(pcommon, &prec->sscn, &prec->oldsimm, &prec->simm, &prec->siml); recGblInitConstantLink(&prec->siol, DBF_STRING, &prec->sval); - if( (pdset=(eventdset *)(prec->dset)) && (pdset->common.init_record) ) + if( (pdset=(eventdset *)(prec->dset)) && (pdset->common.init_record) ) status=(*pdset->common.init_record)(pcommon); prec->epvt = eventNameToHandle(prec->val); @@ -111,7 +111,7 @@ static long process(struct dbCommon *pcommon) long status=0; unsigned char pact=prec->pact; - if((pdset!=NULL) && (pdset->common.number >= 5) && pdset->read_event ) + if((pdset!=NULL) && (pdset->common.number >= 5) && pdset->read_event ) status=readValue(prec); /* read the new value */ /* check if device support set pact */ if ( !pact && prec->pact ) return(0); 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/std/rec/longoutRecord.c b/modules/database/src/std/rec/longoutRecord.c index 39fc5bde5..2c9a33b10 100644 --- a/modules/database/src/std/rec/longoutRecord.c +++ b/modules/database/src/std/rec/longoutRecord.c @@ -125,7 +125,7 @@ static long init_record(struct dbCommon *pcommon, int pass) prec->lalm = prec->val; prec->pval = prec->val; prec->outpvt = EXEC_OUTPUT; - + return 0; } @@ -450,14 +450,14 @@ static long conditional_write(longoutRecord *prec) long status = 0; int doDevSupWrite = 0; - switch (prec->oopt) + switch (prec->oopt) { case longoutOOPT_On_Change: /* Forces a write op if a change in the OUT field is detected OR is first process */ if (prec->outpvt == EXEC_OUTPUT) { doDevSupWrite = 1; } else { - /* Only write if value is different from the previous one */ + /* Only write if value is different from the previous one */ doDevSupWrite = (prec->val != prec->pval); } break; @@ -479,7 +479,7 @@ static long conditional_write(longoutRecord *prec) break; case longoutOOPT_Transition_To_Non_zero: - doDevSupWrite = ((prec->val != 0)&&(prec->pval == 0)); + doDevSupWrite = ((prec->val != 0)&&(prec->pval == 0)); break; default: diff --git a/modules/database/src/std/rec/subArrayRecord.c b/modules/database/src/std/rec/subArrayRecord.c index 06018c0d1..c35385c11 100644 --- a/modules/database/src/std/rec/subArrayRecord.c +++ b/modules/database/src/std/rec/subArrayRecord.c @@ -129,6 +129,7 @@ static long process(struct dbCommon *pcommon) sadset *pdset = (sadset *)(prec->dset); long status; unsigned char pact=prec->pact; + epicsUInt32 nord = prec->nord; if ((pdset==NULL) || (pdset->read_sa==NULL)) { prec->pact=TRUE; @@ -148,6 +149,9 @@ static long process(struct dbCommon *pcommon) if (status) recGblSetSevr(prec, UDF_ALARM, prec->udfs); + if (nord != prec->nord) + db_post_events(prec, &prec->nord, DBE_VALUE | DBE_LOG); + monitor(prec); /* process the forward scan link record */ diff --git a/modules/database/src/std/rec/subArrayRecord.dbd.pod b/modules/database/src/std/rec/subArrayRecord.dbd.pod index e3054a938..3fa5919d5 100644 --- a/modules/database/src/std/rec/subArrayRecord.dbd.pod +++ b/modules/database/src/std/rec/subArrayRecord.dbd.pod @@ -319,6 +319,7 @@ INP is expected to point to an array field of a waveform record or similar. % long (*read_sa)(struct subArrayRecord *prec); /*returns: (-1,0)=>(failure,success)*/ %} sadset; %#define HAS_sadset + %#define SA_POSTS_NORD % field(VAL,DBF_NOACCESS) { prompt("Value") diff --git a/modules/database/src/std/rec/waveformRecord.dbd.pod b/modules/database/src/std/rec/waveformRecord.dbd.pod index 329ceee35..4309a1881 100644 --- a/modules/database/src/std/rec/waveformRecord.dbd.pod +++ b/modules/database/src/std/rec/waveformRecord.dbd.pod @@ -396,6 +396,7 @@ routine and NORD is also set at that time. % long (*read_wf)(struct waveformRecord *prec); /*returns: (-1,0)=>(failure,success)*/ %} wfdset; %#define HAS_wfdset + %#define WF_POSTS_NORD % field(VAL,DBF_NOACCESS) { prompt("Value") diff --git a/modules/database/src/std/softIoc/RULES b/modules/database/src/std/softIoc/RULES index 81f5135ad..301398b01 100644 --- a/modules/database/src/std/softIoc/RULES +++ b/modules/database/src/std/softIoc/RULES @@ -19,5 +19,5 @@ softMain$(DEP): epicsInstallDir.h epicsInstallDir.h: $(TOP)/configure/CONFIG_SITE* $(ECHO) "FINAL_LOCATION=$(FINAL_LOCATION)" - $(PERL) $(STDDIR)/softIoc/makeInstallDir.pl "$(FINAL_LOCATION)" > $@ - + $(PERL) $(STDDIR)/softIoc/makeInstallDir.pl "$(FINAL_LOCATION)" > $@.stdout + $(MV) $@.stdout $@ 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/database/test/ioc/db/dbCaLinkTest.c b/modules/database/test/ioc/db/dbCaLinkTest.c index f92b63409..bb7eaf79c 100644 --- a/modules/database/test/ioc/db/dbCaLinkTest.c +++ b/modules/database/test/ioc/db/dbCaLinkTest.c @@ -29,13 +29,6 @@ #include "dbEvent.h" #include "shareLib.h" -/* Declarations from cadef.h and db_access.h which we can't include here */ -typedef void * chid; -typedef void * evid; -epicsShareExtern const unsigned short dbr_value_size[]; -epicsShareExtern short epicsShareAPI ca_field_type (chid chan); -#define MAX_UNITS_SIZE 8 - #include "dbCaPvt.h" #include "errlog.h" #include "testMain.h" diff --git a/modules/database/test/std/rec/aiTest.c b/modules/database/test/std/rec/aiTest.c index 887f56582..f8705bdb3 100644 --- a/modules/database/test/std/rec/aiTest.c +++ b/modules/database/test/std/rec/aiTest.c @@ -65,14 +65,14 @@ static void test_operator_display(void){ testdbPutFieldOk("test_ai_rec.HOPR", DBF_SHORT, hopr); testdbPutFieldOk("test_ai_rec.LOPR", DBF_SHORT, lopr); testdbPutFieldOk("test_ai_rec.PREC", DBF_SHORT, prec); - + /* verify operator display parameters read back */ testdbGetFieldEqual("test_ai_rec.NAME", DBF_STRING, "test_ai_rec"); - testdbGetFieldEqual("test_ai_rec.EGU", DBF_STRING, egu); + testdbGetFieldEqual("test_ai_rec.EGU", DBF_STRING, egu); testdbGetFieldEqual("test_ai_rec.DESC", DBF_STRING, desc); testdbGetFieldEqual("test_ai_rec.HOPR", DBF_SHORT, hopr); testdbGetFieldEqual("test_ai_rec.LOPR", DBF_SHORT, lopr); - testdbGetFieldEqual("test_ai_rec.PREC", DBF_SHORT, prec); + testdbGetFieldEqual("test_ai_rec.PREC", DBF_SHORT, prec); // number of tests = 7 } @@ -96,7 +96,7 @@ static void test_no_linr_unit_conversion(void){ testdbPutFieldOk("test_ai_rec.ASLO", DBF_SHORT, aslo); testdbPutFieldOk("test_ai_rec.AOFF", DBF_SHORT, aoff); testdbPutFieldOk("test_ai_rec.LINR", DBF_LONG, menuConvertNO_CONVERSION); - + /* verify conversion */ testdbPutFieldOk("test_ai_link_rec.VAL", DBF_SHORT, rval); testdbGetFieldEqual("test_ai_rec.VAL", DBF_SHORT, val); @@ -128,7 +128,7 @@ static void test_slope_linr_unit_conversion(void){ testdbPutFieldOk("test_ai_rec.ESLO", DBF_LONG, eslo); testdbPutFieldOk("test_ai_rec.EOFF", DBF_LONG, eoff); testdbPutFieldOk("test_ai_rec.LINR", DBF_LONG, menuConvertSLOPE); - + /* verify conversion */ testdbPutFieldOk("test_ai_link_rec.VAL", DBF_LONG, rval); testdbGetFieldEqual("test_ai_rec.VAL", DBF_LONG, val); @@ -166,7 +166,7 @@ static void test_linear_linr_unit_conversion(void){ testdbPutFieldOk("test_ai_rec.EGUL", DBF_LONG, egul); testdbPutFieldOk("test_ai_rec.EGUF", DBF_LONG, eguf); testdbPutFieldOk("test_ai_rec.LINR", DBF_LONG, menuConvertLINEAR); - + /* verify conversion */ testdbPutFieldOk("test_ai_link_rec.VAL", DBF_LONG, rval); testdbGetFieldEqual("test_ai_rec.VAL", DBF_LONG, val); @@ -249,7 +249,7 @@ static void test_smoothing_filter(void){ /* set well known starting point (without smmothing) */ testdbPutFieldOk("test_ai_link_rec.VAL", DBF_SHORT, rval1); testdbGetFieldEqual("test_ai_rec.VAL", DBF_SHORT, val1); - + /* set SMOO */ testdbPutFieldOk("test_ai_rec.SMOO", DBF_DOUBLE, smoo); @@ -365,7 +365,7 @@ static void test_aftc(void){ /* test AFTC using a monitor and time stamps */ testdbPutFieldOk("test_ai_rec3.AFTC", DBF_DOUBLE, aftc); testdbPutFieldOk("test_ai_rec3.SCAN", DBF_SHORT, menuScan_1_second); - + /* set HIHI alarm VAL */ testdbPutFieldOk("test_ai_link_rec3.VAL", DBF_DOUBLE, 7550.0); @@ -397,11 +397,11 @@ static void test_aftc(void){ /* Verify that alarm status is now MINOR */ testdbGetFieldEqual("test_ai_rec3.SEVR", DBF_SHORT, menuAlarmSevrMINOR); - + /* Verify that time is at least equal to configured aftc */ diffTime = epicsTimeDiffInSeconds(&endTime, &startTime); testOk(diffTime >= aftc, "ATFC time %lf", diffTime); - + // number of tests = 18 } @@ -416,12 +416,12 @@ MAIN(aiTest) { testPlan(6+6+11+10+12+14+18+15+6+29+18); - testdbPrepare(); + testdbPrepare(); testdbReadDatabase("recTestIoc.dbd", NULL, NULL); recTestIoc_registerRecordDeviceDriver(pdbbase); testdbReadDatabase("aiTest.db", NULL, NULL); - + eltc(0); testIocInitOk(); eltc(1); @@ -436,7 +436,7 @@ MAIN(aiTest) { test_smoothing_filter(); test_udf(); test_alarm(); - test_aftc(); + test_aftc(); testIocShutdownOk(); testdbCleanup(); diff --git a/modules/database/test/std/rec/biTest.c b/modules/database/test/std/rec/biTest.c index 8e551e762..ff7c975ce 100644 --- a/modules/database/test/std/rec/biTest.c +++ b/modules/database/test/std/rec/biTest.c @@ -51,16 +51,16 @@ static void test_operator_display(void){ testdbPutFieldOk("test_bi_rec.DESC", DBF_STRING, "DESC_TEST"); /* verify operator display parameters */ - testdbGetFieldEqual("test_bi_rec.ZNAM", DBF_STRING, "ZNAM_TEST"); - testdbGetFieldEqual("test_bi_rec.ONAM", DBF_STRING, "ONAM_TEST"); + testdbGetFieldEqual("test_bi_rec.ZNAM", DBF_STRING, "ZNAM_TEST"); + testdbGetFieldEqual("test_bi_rec.ONAM", DBF_STRING, "ONAM_TEST"); testdbGetFieldEqual("test_bi_rec.NAME", DBF_STRING, "test_bi_rec"); testdbGetFieldEqual("test_bi_rec.DESC", DBF_STRING, "DESC_TEST"); /* verify conversion */ testdbPutFieldOk("test_bi_link_rec.VAL", DBF_SHORT, TRUE); - testdbGetFieldEqual("test_bi_rec.VAL", DBF_STRING, "ONAM_TEST"); + testdbGetFieldEqual("test_bi_rec.VAL", DBF_STRING, "ONAM_TEST"); testdbPutFieldOk("test_bi_link_rec.VAL", DBF_SHORT, FALSE); - testdbGetFieldEqual("test_bi_rec.VAL", DBF_STRING, "ZNAM_TEST"); + testdbGetFieldEqual("test_bi_rec.VAL", DBF_STRING, "ZNAM_TEST"); // number of tests = 11 } @@ -78,7 +78,7 @@ static void test_alarm(void){ testdbPutFieldOk("test_bi_rec.ZSV", DBF_SHORT, menuAlarmSevrNO_ALARM); testdbPutFieldOk("test_bi_rec.OSV", DBF_SHORT, menuAlarmSevrMINOR); testdbPutFieldOk("test_bi_rec.COSV", DBF_SHORT, menuAlarmSevrINVALID); - + /* verify alarm status is NO_ALARM*/ testdbGetFieldEqual("test_bi_rec.SEVR", DBF_SHORT, menuAlarmSevrNO_ALARM); @@ -92,7 +92,7 @@ static void test_alarm(void){ /* verify LAML */ testdbGetFieldEqual("test_bi_rec.LALM", DBF_SHORT, TRUE); - + // number of tests = 13 } @@ -100,12 +100,12 @@ MAIN(biTest) { testPlan(6+6+11+13); - testdbPrepare(); + testdbPrepare(); testdbReadDatabase("recTestIoc.dbd", NULL, NULL); recTestIoc_registerRecordDeviceDriver(pdbbase); testdbReadDatabase("biTest.db", NULL, NULL); - + eltc(0); testIocInitOk(); eltc(1); diff --git a/modules/database/test/std/rec/boTest.c b/modules/database/test/std/rec/boTest.c index 1ea42733a..2b96987a8 100644 --- a/modules/database/test/std/rec/boTest.c +++ b/modules/database/test/std/rec/boTest.c @@ -76,16 +76,16 @@ static void test_operator_display(void){ testdbPutFieldOk("test_bo_rec.DESC", DBF_STRING, "DESC_TEST"); /* verify operator display parameters */ - testdbGetFieldEqual("test_bo_rec.ZNAM", DBF_STRING, "ZNAM_TEST"); - testdbGetFieldEqual("test_bo_rec.ONAM", DBF_STRING, "ONAM_TEST"); + testdbGetFieldEqual("test_bo_rec.ZNAM", DBF_STRING, "ZNAM_TEST"); + testdbGetFieldEqual("test_bo_rec.ONAM", DBF_STRING, "ONAM_TEST"); testdbGetFieldEqual("test_bo_rec.NAME", DBF_STRING, "test_bo_rec"); testdbGetFieldEqual("test_bo_rec.DESC", DBF_STRING, "DESC_TEST"); /* verify conversion */ testdbPutFieldOk("test_bo_rec.VAL", DBF_SHORT, TRUE); - testdbGetFieldEqual("test_bo_rec.VAL", DBF_STRING, "ONAM_TEST"); + testdbGetFieldEqual("test_bo_rec.VAL", DBF_STRING, "ONAM_TEST"); testdbPutFieldOk("test_bo_rec.VAL", DBF_SHORT, FALSE); - testdbGetFieldEqual("test_bo_rec.VAL", DBF_STRING, "ZNAM_TEST"); + testdbGetFieldEqual("test_bo_rec.VAL", DBF_STRING, "ZNAM_TEST"); // number of tests = 11 } @@ -104,7 +104,7 @@ static void test_alarm(void){ testdbPutFieldOk("test_bo_rec.COSV", DBF_SHORT, menuAlarmSevrINVALID); testdbPutFieldOk("test_bo_rec.IVOA", DBF_SHORT, menuIvoaSet_output_to_IVOV); testdbPutFieldOk("test_bo_rec.IVOV", DBF_SHORT, FALSE); - + /* Verify alarm status is NO_ALARM*/ testdbGetFieldEqual("test_bo_rec.SEVR", DBF_SHORT, menuAlarmSevrNO_ALARM); @@ -136,12 +136,12 @@ MAIN(boTest) { testPlan(4+7+11+22); - testdbPrepare(); + testdbPrepare(); testdbReadDatabase("recTestIoc.dbd", NULL, NULL); recTestIoc_registerRecordDeviceDriver(pdbbase); testdbReadDatabase("boTest.db", NULL, NULL); - + eltc(0); testIocInitOk(); eltc(1); diff --git a/modules/database/test/std/rec/compressTest.c b/modules/database/test/std/rec/compressTest.c index cedb28f48..0bd4767a6 100644 --- a/modules/database/test/std/rec/compressTest.c +++ b/modules/database/test/std/rec/compressTest.c @@ -653,7 +653,7 @@ void testAIAveragePartial(void) { double buf = 0.; double data[5] = {1., 2., 3., 4., 5.}; - /* + /* * Note that the fifth dbPut essentially resets the circular buffer, so the * average is once again the average of the _first_ entry alone. */ diff --git a/modules/database/test/std/rec/epicsExportTest.c b/modules/database/test/std/rec/epicsExportTest.c index aaa3f2215..e407f602b 100644 --- a/modules/database/test/std/rec/epicsExportTest.c +++ b/modules/database/test/std/rec/epicsExportTest.c @@ -6,7 +6,7 @@ \*************************************************************************/ /* Compile and link test for epicsExport.h -* +* * Test if macros eppicsExportAddr, epicsExportRegistrar and epicsRegisterFunction * expand to valid C and C++ code, in the latter case regardless if * wrapped with extern "C" {} or not. diff --git a/modules/database/test/std/rec/epicsExportTestMain.c b/modules/database/test/std/rec/epicsExportTestMain.c index 0f4928e07..12fa613f3 100644 --- a/modules/database/test/std/rec/epicsExportTestMain.c +++ b/modules/database/test/std/rec/epicsExportTestMain.c @@ -6,7 +6,7 @@ \*************************************************************************/ /* Compile and link test for epicsExport.h -* +* */ #include diff --git a/modules/database/test/std/rec/longoutTest.c b/modules/database/test/std/rec/longoutTest.c index 35f161341..48afceed6 100644 --- a/modules/database/test/std/rec/longoutTest.c +++ b/modules/database/test/std/rec/longoutTest.c @@ -146,7 +146,7 @@ static void test_oopt_when_transition_nonzero(void){ /* write a transition to non-zero */ testdbPutFieldOk("longout_rec.VAL", DBF_LONG, 18); - + /* Test if the counter_a was processed */ testdbGetFieldEqual("counter_a", DBF_DOUBLE, 1.0); @@ -156,7 +156,7 @@ static void test_oopt_when_transition_nonzero(void){ static void test_changing_out_field(void){ /* change OOPT to On Change */ testdbPutFieldOk("longout_rec.OOPT", DBF_ENUM, longoutOOPT_On_Change); - + /* write an initial value */ testdbPutFieldOk("longout_rec.VAL", DBF_LONG, 16); @@ -225,7 +225,7 @@ static void test_changing_out_field(void){ /* reset rec processing counters */ testdbPutFieldOk("counter_a.VAL", DBF_DOUBLE, 0.0); - /* test if record with OOPT == On Change will + /* test if record with OOPT == On Change will write to output at its first process */ testdbPutFieldOk("longout_rec2.VAL", DBF_LONG, 16); @@ -250,7 +250,7 @@ MAIN(longoutTest) { recTestIoc_registerRecordDeviceDriver(pdbbase); testdbReadDatabase("longoutTest.db", NULL, NULL); - + eltc(0); testIocInitOk(); eltc(1); diff --git a/modules/database/test/std/rec/printfTest.c b/modules/database/test/std/rec/printfTest.c index b62b1d9c0..8839280dc 100644 --- a/modules/database/test/std/rec/printfTest.c +++ b/modules/database/test/std/rec/printfTest.c @@ -196,20 +196,20 @@ static void test_F_format(void){ /* set value on inp0 */ testdbPutFieldOk("test_printf_inp0_rec.VAL", DBF_DOUBLE, 6729982.999); - + /* verify that string is formatted as expected */ // visual studio less than 2015 does not support %F // mingw/gcc also fails, suspect this may be gcc version - // related and checking __GNUC__ could resolve but + // related and checking __GNUC__ could resolve but // initial attempts didn't work so excluding mingw entirely for now #ifdef _WIN32 #if (defined(_MSC_VER) && _MSC_VER < 1900) || defined(_MINGW) testTodoBegin("Fails on windows with old visual studio versions and mingw"); #endif #endif - + testdbGetFieldEqual("test_printf_rec.VAL", DBF_STRING, result_string); - + #ifdef _WIN32 #if (defined(_MSC_VER) && _MSC_VER < 1900) || defined(_MINGW) testTodoEnd(); @@ -422,7 +422,7 @@ static void test_l_flag(void){ /* set value on inp0 */ testdbPutFieldOk("test_printf_inp0_rec.VAL", DBF_LONG, 0x70a1c0c1); - + /* verify that string is formatted as expected */ testdbGetFieldEqual("test_printf_rec.VAL", DBF_STRING, result_string); // number of tests = 3 @@ -532,12 +532,12 @@ MAIN(printfTest) { testPlan(3+3+3+3+3+3+3+3+4+3+3+3+3+3+3+3+3+3+3+3+3+3+3+3+6+6+12); - testdbPrepare(); + testdbPrepare(); testdbReadDatabase("recTestIoc.dbd", NULL, NULL); recTestIoc_registerRecordDeviceDriver(pdbbase); testdbReadDatabase("printfTest.db", NULL, NULL); - + eltc(0); testIocInitOk(); eltc(1); diff --git a/modules/database/test/std/rec/regressTest.c b/modules/database/test/std/rec/regressTest.c index 6bb3ea140..55285124b 100644 --- a/modules/database/test/std/rec/regressTest.c +++ b/modules/database/test/std/rec/regressTest.c @@ -237,9 +237,8 @@ void testLinkSevr(void) startRegressTestIoc("regressLinkSevr.db"); - /* wait for CA links to connect and receive an initial update */ - testdbCaWaitForUpdateCount(dbGetDevLink(testdbRecordPtr("si2")), 1); - testdbCaWaitForUpdateCount(dbGetDevLink(testdbRecordPtr("li2")), 1); + testOk1(dbIsLinkConnected(dbGetDevLink(testdbRecordPtr("si2")))); + testOk1(dbIsLinkConnected(dbGetDevLink(testdbRecordPtr("li2")))); chan = dbChannelCreate("ai.SEVR"); if(!chan) @@ -272,7 +271,7 @@ void testLinkSevr(void) MAIN(regressTest) { - testPlan(96); + testPlan(98); testArrayLength1(); testHexConstantLinks(); testLinkMS(); diff --git a/modules/database/test/std/rec/subproctest.c b/modules/database/test/std/rec/subproctest.c index 7e44b0112..5f6cb0010 100644 --- a/modules/database/test/std/rec/subproctest.c +++ b/modules/database/test/std/rec/subproctest.c @@ -49,7 +49,7 @@ MAIN(subproctest) * the testdbPutField call above goes through, so we get a partial * result of the PROC field being left as 1. */ testdbGetFieldEqual("InvalidINPARec.PROC", DBF_LONG, 1); - + testIocShutdownOk(); testdbCleanup(); diff --git a/modules/libcom/RTEMS/epicsNtp.c b/modules/libcom/RTEMS/epicsNtp.c index 2c15d8a38..31d56498c 100644 --- a/modules/libcom/RTEMS/epicsNtp.c +++ b/modules/libcom/RTEMS/epicsNtp.c @@ -2,7 +2,7 @@ * (C) 2014 David Lettier. * http://www.lettier.com/ * SPDX-License-Identifier: BSD-3-Clause -* +* * use of UDP funktions and implement timeout, HPJ 15.12.2025 \*************************************************************************/ @@ -33,7 +33,7 @@ int epicsNtpGetTime(char *ntpIp, struct timespec *now) /* Create an UDP socket, use IP address of given nameserver, set the port number struct sockaddr_in serv_addr; // Server address data structure. - add timout of 2 seconds + add timout of 2 seconds. */ struct sockaddr_in serv_addr = { .sin_family = AF_INET, 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/bucketLib/bucketLib.c b/modules/libcom/src/bucketLib/bucketLib.c index 5fcc3c36c..ed1dcf52a 100644 --- a/modules/libcom/src/bucketLib/bucketLib.c +++ b/modules/libcom/src/bucketLib/bucketLib.c @@ -305,17 +305,17 @@ LIBCOM_API int epicsStdCall bucketFree (BUCKET *prb) /* * bucketAddItem() */ -LIBCOM_API int epicsStdCall +LIBCOM_API int epicsStdCall bucketAddItemUnsignedId(BUCKET *prb, const unsigned *pId, const void *pApp) { return bucketAddItem(prb, &BSET[bidtUnsigned], pId, pApp); } -LIBCOM_API int epicsStdCall +LIBCOM_API int epicsStdCall bucketAddItemPointerId(BUCKET *prb, void * const *pId, const void *pApp) { return bucketAddItem(prb, &BSET[bidtPointer], pId, pApp); } -LIBCOM_API int epicsStdCall +LIBCOM_API int epicsStdCall bucketAddItemStringId(BUCKET *prb, const char *pId, const void *pApp) { return bucketAddItem(prb, &BSET[bidtString], pId, pApp); @@ -412,17 +412,17 @@ LIBCOM_API void * epicsStdCall bucketLookupAndRemoveItemStringId (BUCKET *prb, c /* * bucketRemoveItem() */ -LIBCOM_API int epicsStdCall +LIBCOM_API int epicsStdCall bucketRemoveItemUnsignedId (BUCKET *prb, const unsigned *pId) { return bucketLookupAndRemoveItem(prb, &BSET[bidtUnsigned], pId)?S_bucket_success:S_bucket_uknId; } -LIBCOM_API int epicsStdCall +LIBCOM_API int epicsStdCall bucketRemoveItemPointerId (BUCKET *prb, void * const *pId) { return bucketLookupAndRemoveItem(prb, &BSET[bidtPointer], pId)?S_bucket_success:S_bucket_uknId; } -LIBCOM_API int epicsStdCall +LIBCOM_API int epicsStdCall bucketRemoveItemStringId (BUCKET *prb, const char *pId) { return bucketLookupAndRemoveItem(prb, &BSET[bidtString], pId)?S_bucket_success:S_bucket_uknId; diff --git a/modules/libcom/src/cvtFast/cvtFast.h b/modules/libcom/src/cvtFast/cvtFast.h index 4bfd665ba..2f85a971b 100644 --- a/modules/libcom/src/cvtFast/cvtFast.h +++ b/modules/libcom/src/cvtFast/cvtFast.h @@ -17,7 +17,7 @@ * Provides routines for converting various numeric types into an ascii string. * They off a combination of speed and convenience not available with sprintf(). * - * All functions return the number of characters in the output + * All functions return the number of characters in the output */ #ifndef INCcvtFasth diff --git a/modules/libcom/src/env/RULES b/modules/libcom/src/env/RULES index 5ef766d57..cf71f43f2 100644 --- a/modules/libcom/src/env/RULES +++ b/modules/libcom/src/env/RULES @@ -5,7 +5,7 @@ # in file LICENSE that is included with this distribution. #************************************************************************* -# This is a Makefile fragment, see src/libCom/Makefile. +# This is a Makefile fragment, see libCom/src/Makefile. envData.c: $(LIBCOM)/env/envDefs.h \ $(INSTALL_HOST_BIN)/bldEnvData.pl \ diff --git a/modules/libcom/src/env/envSubr.c b/modules/libcom/src/env/envSubr.c index 812b8b4cd..3e83d6d6f 100644 --- a/modules/libcom/src/env/envSubr.c +++ b/modules/libcom/src/env/envSubr.c @@ -394,7 +394,7 @@ epicsPrtEnvParams(void) /* * envGetInetPortConfigParam () */ -LIBCOM_API unsigned short epicsStdCall envGetInetPortConfigParam +LIBCOM_API unsigned short epicsStdCall envGetInetPortConfigParam (const ENV_PARAM *pEnv, unsigned short defaultPort) { long longStatus; diff --git a/modules/libcom/src/error/errlog.h b/modules/libcom/src/error/errlog.h index 44a504812..a3392e6aa 100644 --- a/modules/libcom/src/error/errlog.h +++ b/modules/libcom/src/error/errlog.h @@ -241,7 +241,7 @@ LIBCOM_API void errlogFlush(void); * ::errVerbose determines if the filename and line number are shown. */ LIBCOM_API void errPrintf( - long status, const char *pFileName, int lineno, + long status, const char *pFileName, int lineno, EPICS_PRINTF_FMT(const char *pformat), ... ) EPICS_PRINTF_STYLE(4,5); diff --git a/modules/libcom/src/fdmgr/fdmgr.cpp b/modules/libcom/src/fdmgr/fdmgr.cpp index a49b29310..c8a55e99f 100644 --- a/modules/libcom/src/fdmgr/fdmgr.cpp +++ b/modules/libcom/src/fdmgr/fdmgr.cpp @@ -101,7 +101,7 @@ template class resTable; # pragma warning ( pop ) #endif -LIBCOM_API fdRegForOldFdmgr::fdRegForOldFdmgr +LIBCOM_API fdRegForOldFdmgr::fdRegForOldFdmgr (const SOCKET fdIn, const fdRegType typeIn, const bool onceOnlyIn, fdManager &managerIn, pCallBackFDMgr pFuncIn, void *pParamIn) : @@ -322,7 +322,7 @@ extern "C" LIBCOM_API int epicsStdCall fdmgr_clear_fd (fdctx *pfdctx, SOCKET fd) /* * deprecated interface */ -extern "C" LIBCOM_API int epicsStdCall fdmgr_add_fd ( +extern "C" LIBCOM_API int epicsStdCall fdmgr_add_fd ( fdctx *pfdctx, SOCKET fd, void (*pfunc)(void *pParam), void *param) { return fdmgr_add_callback (pfdctx, fd, fdi_read, pfunc, param); diff --git a/modules/libcom/src/freeList/freeListLib.c b/modules/libcom/src/freeList/freeListLib.c index 9ced2d728..3fa2ffb6f 100644 --- a/modules/libcom/src/freeList/freeListLib.c +++ b/modules/libcom/src/freeList/freeListLib.c @@ -54,7 +54,7 @@ typedef struct { epicsMutexId lock; }FREELISTPVT; -LIBCOM_API void epicsStdCall +LIBCOM_API void epicsStdCall freeListInitPvt(void **ppvt,int size,int nmalloc) { FREELISTPVT *pfl; diff --git a/modules/libcom/src/iocsh/iocsh.cpp b/modules/libcom/src/iocsh/iocsh.cpp index 865c991da..d1b18bff4 100644 --- a/modules/libcom/src/iocsh/iocsh.cpp +++ b/modules/libcom/src/iocsh/iocsh.cpp @@ -780,7 +780,7 @@ const iocshVarDef * epicsStdCall iocshFindVariable(const char *name) /* * Free storage created by iocshRegister/iocshRegisterVariable */ -void epicsStdCall iocshFree(void) +void epicsStdCall iocshFree(void) { struct iocshCommand *pc; struct iocshVariable *pv; @@ -803,8 +803,8 @@ void epicsStdCall iocshFree(void) /* * Parse argument input based on the arg type specified. - * It is worth noting that depending on type this argument may - * be defaulted if a value is not specified. For example, a + * It is worth noting that depending on type this argument may + * be defaulted if a value is not specified. For example, a * double/int with no value will default to 0 which may allow * you to add optional arguments to the end of your argument list. */ @@ -952,7 +952,7 @@ static void helpCallFunc(const iocshArgBuf *args) if (epicsStrGlobMatch(piocshFuncDef->name, argv[iarg]) != 0) { if (! firstFunction) { - fprintf(epicsGetStdout(), + fprintf(epicsGetStdout(), ANSI_UNDERLINE(" ") "\n"); } @@ -974,7 +974,7 @@ static void helpCallFunc(const iocshArgBuf *args) if(piocshFuncDef->usage) { fprintf(epicsGetStdout(), "\n%s", piocshFuncDef->usage); } - + firstFunction = false; } diff --git a/modules/libcom/src/iocsh/iocsh.h b/modules/libcom/src/iocsh/iocsh.h index ff3cfa2a5..34c901a6f 100644 --- a/modules/libcom/src/iocsh/iocsh.h +++ b/modules/libcom/src/iocsh/iocsh.h @@ -68,28 +68,28 @@ extern "C" { * ``` */ typedef enum { - /** The argument is converted to an integer value. */ + /** The argument is converted to an integer value. */ iocshArgInt, - /** The argument is converted to a double-precision floating point value. */ + /** The argument is converted to a double-precision floating point value. */ iocshArgDouble, - /** The argument is left as a string. - * - * The memory used to hold the string is "owned" by iocsh - * and will be reused once the handler function returns. - */ + /** The argument is left as a string. + * + * The memory used to hold the string is "owned" by iocsh + * and will be reused once the handler function returns. + */ iocshArgString, - /** The argument must be pdbbase. */ + /** The argument must be pdbbase. */ iocshArgPdbbase, - /** An arbitrary number of arguments is expected. - * - * Subsequent iocshArg structures will be ignored. - */ + /** An arbitrary number of arguments is expected. + * + * Subsequent iocshArg structures will be ignored. + */ iocshArgArgv, - /** A copy of the argument will be made and a pointer to the copy will be passed to the handler. - * - * The called function should eventually release this copy - * by using the pointer as an argument to free(). - */ + /** A copy of the argument will be made and a pointer to the copy will be passed to the handler. + * + * The called function should eventually release this copy + * by using the pointer as an argument to free(). + */ iocshArgPersistentString, /** * Equivalent to iocshArgString with a hint for tab completion that the @@ -118,41 +118,41 @@ typedef enum { * ``` */ typedef union iocshArgBuf { - /** The value as an integer. - * - * Corresponds to the @ref iocshArgInt type. - */ + /** The value as an integer. + * + * Corresponds to the @ref iocshArgInt type. + */ int ival; - /** The value as a double-precision floating point. - * - * Corresponds to the @ref iocshArgDouble type. - */ + /** The value as a double-precision floating point. + * + * Corresponds to the @ref iocshArgDouble type. + */ double dval; - /** The value as a string. - * - * Corresponds to the @ref iocshArgString and related types. - */ + /** The value as a string. + * + * Corresponds to the @ref iocshArgString and related types. + */ char *sval; - /** The value as an untyped pointer. - * - * Can be used with the @ref iocshArgPdbbase type. - */ + /** The value as an untyped pointer. + * + * Can be used with the @ref iocshArgPdbbase type. + */ void *vval; - /** The variadic arguments, for the @ref iocshArgArgv type. */ + /** The variadic arguments, for the @ref iocshArgArgv type. */ struct { - /** Number of arguments passed to the IOC shell command. - * - * Provides the number of elements of the `av` array. - */ + /** Number of arguments passed to the IOC shell command. + * + * Provides the number of elements of the `av` array. + */ int ac; - /** The arguments, as an array of strings. */ + /** The arguments, as an array of strings. */ char **av; }aval; }iocshArgBuf; /** * @struct iocshVarDef - * + * * This struct is used with the function iocshRegisterVariable. Each * instance includes a name, a data type (see iocshArgType), and a * pointer to the value. @@ -187,9 +187,9 @@ typedef struct iocshVarDef { * ``` */ typedef struct iocshArg { - /** Used by the `help` command to print a synopsis for the command. */ + /** Used by the `help` command to print a synopsis for the command. */ const char *name; - /** Data type of the argument. */ + /** Data type of the argument. */ iocshArgType type; }iocshArg; @@ -211,19 +211,19 @@ typedef struct iocshArg { * ``` */ typedef struct iocshFuncDef { - /** Name of the command or function. */ + /** Name of the command or function. */ const char *name; - /** Number of entries in the array of pointers to argument descriptions. - * - * If 0, `arg` can be `NULL`. - */ + /** Number of entries in the array of pointers to argument descriptions. + * + * If 0, `arg` can be `NULL`. + */ int nargs; - /** Array of pointers to structs of type iocshArg. - * - * Can be `NULL` if `nargs` is 0. - */ + /** Array of pointers to structs of type iocshArg. + * + * Can be `NULL` if `nargs` is 0. + */ const iocshArg * const *arg; - /** Text displayed when using running `help `. */ + /** Text displayed when using running `help `. */ const char* usage; }iocshFuncDef; #define IOCSHFUNCDEF_HAS_USAGE @@ -248,7 +248,7 @@ typedef void (*iocshCallFunc)(const iocshArgBuf *argBuf); /** * @struct - * + * * This struct is used as a return value for the function iocshFindCommand. */ typedef struct iocshCmdDef { @@ -268,10 +268,10 @@ LIBCOM_API void epicsStdCall iocshRegister( const iocshFuncDef *piocshFuncDef, iocshCallFunc func); /** - * @brief - * - * @param piocshVarDef - * @return void + * @brief + * + * @param piocshVarDef + * @return void */ LIBCOM_API void epicsStdCall iocshRegisterVariable ( const iocshVarDef *piocshVarDef); @@ -280,8 +280,8 @@ LIBCOM_API void epicsStdCall iocshRegisterVariable ( * @brief Returns a struct of type iocshCmdDef whose element values are determined * by the name parameter. This function calls the function registryFind, defined in * Registry.h - * - * @param name + * + * @param name * @return const iocshCmdDef* */ LIBCOM_API const iocshCmdDef * epicsStdCall iocshFindCommand( @@ -291,8 +291,8 @@ LIBCOM_API const iocshCmdDef * epicsStdCall iocshFindCommand( * @brief Returns a struct of type iocshVarDef whose element values are determined * by the name parameter. This function calls the function registryFind, defined in * Registry.h - * - * @param name + * + * @param name * @return const iocshVarDef* */ LIBCOM_API const iocshVarDef * epicsStdCall iocshFindVariable( @@ -302,8 +302,8 @@ LIBCOM_API const iocshVarDef * epicsStdCall iocshFindVariable( /* This should only be called when iocsh is no longer needed*/ /** * @brief Frees all memory allocated to registered commands and variables. - * - * @return void + * + * @return void */ LIBCOM_API void epicsStdCall iocshFree(void); @@ -345,7 +345,7 @@ LIBCOM_API int epicsStdCall iocshCmd(const char *cmd); * If `NULL`, commands are read from the standard input. * @param[in] macros * `NULL` or a comma separated list of macro definitions. - * eg. `"VAR1=x,VAR2=y"` + * eg. `"VAR1=x,VAR2=y"` * * @retval 0 on success * @retval non-zero on error @@ -377,7 +377,7 @@ LIBCOM_API int epicsStdCall iocshLoad(const char *pathname, const char* macros); */ LIBCOM_API int epicsStdCall iocshRun(const char *cmd, const char* macros); -/** +/** * @brief Signal error from an IOC shell function. * * @param err 0 - success (no op), !=0 - error @@ -389,11 +389,11 @@ LIBCOM_API int iocshSetError(int err); /* Makes macros that shadow environment variables work correctly with epicsEnvSet */ /** * @brief Unsets macro values. - * - * This function sets the values of all macros passed to either iocshLoad or + * + * This function sets the values of all macros passed to either iocshLoad or * iocshRun to NULL. - * - * @param name + * + * @param name * @return void */ LIBCOM_API void epicsStdCall iocshEnvClear(const char *name); diff --git a/modules/libcom/src/log/logClient.h b/modules/libcom/src/log/logClient.h index 976bc4544..fe4be202e 100644 --- a/modules/libcom/src/log/logClient.h +++ b/modules/libcom/src/log/logClient.h @@ -19,7 +19,7 @@ * * \brief Client on the IOC that forwards log messages to the log server * - * Together with the program iocLogServer, a log client provides generic + * Together with the program iocLogServer, a log client provides generic * support for logging text messages from an IOC or other program to the log * server host machine. */ @@ -40,26 +40,26 @@ extern "C" { typedef void *logClientId; /** \brief Creates a new log client - * - * Starts a background thread to connect to server and returns immediately. - * If a connection cannot be established, an error message is - * printed on the console, but the log client will keep trying to connect in - * the background. This thread will also periodically (every 5 seconds) flush - * pending messages out to the server. + * + * Starts a background thread to connect to server and returns immediately. + * If a connection cannot be established, an error message is + * printed on the console, but the log client will keep trying to connect in + * the background. This thread will also periodically (every 5 seconds) flush + * pending messages out to the server. * * \param server_addr log server IP address * \param server_port log server port * - * \return log client handle. + * \return log client handle. */ LIBCOM_API logClientId epicsStdCall logClientCreate ( struct in_addr server_addr, unsigned short server_port); /** \brief Log message * - * Logs message to log server. Messages are not immediately sent to the log - * server. Instead they are sent periodically (every 5 seconds), when the cache - * overflows, or when logClientFlush() is called. If messages can't sent, an error + * Logs message to log server. Messages are not immediately sent to the log + * server. Instead they are sent periodically (every 5 seconds), when the cache + * overflows, or when logClientFlush() is called. If messages can't sent, an error * message will be printed to stderr * * \param id log client handle @@ -78,7 +78,7 @@ LIBCOM_API void epicsStdCall logClientSend (logClientId id, const char *message) LIBCOM_API void epicsStdCall logClientShow (logClientId id, unsigned level); /** \brief Flushes all outstanding messages - * + * * Immediately sends all outstanding messages to the server * * \param id log client handle @@ -95,7 +95,7 @@ LIBCOM_API void epicsStdCall logClientFlush (logClientId id); LIBCOM_API void epicsStdCall iocLogPrefix(const char* prefix); /** \brief DEPRECATED - * \deprecated deprecated interface; retained for backward compatibility + * \deprecated deprecated interface; retained for backward compatibility */ /* note: implementations are in iocLog.c, not logClient.c */ LIBCOM_API logClientId epicsStdCall logClientInit (void); diff --git a/modules/libcom/src/misc/aToIPAddr.c b/modules/libcom/src/misc/aToIPAddr.c index 628884af5..d46063cf0 100644 --- a/modules/libcom/src/misc/aToIPAddr.c +++ b/modules/libcom/src/misc/aToIPAddr.c @@ -72,7 +72,7 @@ static int initIPAddr ( struct in_addr ipAddr, unsigned port, * "pAddrString" does not contain an address of the form * "n.n.n.n:p or host:p" */ -LIBCOM_API int epicsStdCall +LIBCOM_API int epicsStdCall aToIPAddr( const char *pAddrString, unsigned short defaultPort, struct sockaddr_in *pIP ) { diff --git a/modules/libcom/src/misc/epicsStdlib.h b/modules/libcom/src/misc/epicsStdlib.h index dcb9fb584..a6769dbe0 100644 --- a/modules/libcom/src/misc/epicsStdlib.h +++ b/modules/libcom/src/misc/epicsStdlib.h @@ -13,17 +13,17 @@ #ifndef INC_epicsStdlib_H #define INC_epicsStdlib_H -/** +/** * \file epicsStdlib.h * \brief Functions to convert strings to primitive types * - * These routines convert a string into an integer of the indicated type and - * number base, or into a floating point type. The units pointer argument may - * be NULL, but if not it will be left pointing to the first non-whitespace - * character following the numeric string, or to the terminating zero byte. - * + * These routines convert a string into an integer of the indicated type and + * number base, or into a floating point type. The units pointer argument may + * be NULL, but if not it will be left pointing to the first non-whitespace + * character following the numeric string, or to the terminating zero byte. + * * The return value from these routines is a status code, zero meaning OK. - * For the macro functions beginning with `epicsScan` the return code is 0 + * For the macro functions beginning with `epicsScan` the return code is 0 * or 1 (0=failure or 1=success, similar to the sscanf() function). */ @@ -59,31 +59,31 @@ extern "C" { * \param units Pointer to a char * (this will be set with the units string) * \return Status code (0=OK, see macro definitions for possible errors) */ -LIBCOM_API int +LIBCOM_API int epicsParseLong(const char *str, long *to, int base, char **units); -/** +/** * \brief Convert a string to a unsigned long type - * \copydetails epicsParseLong + * \copydetails epicsParseLong */ LIBCOM_API int epicsParseULong(const char *str, unsigned long *to, int base, char **units); -/** +/** * \brief Convert a string to a long long type - * \copydetails epicsParseLong + * \copydetails epicsParseLong */ LIBCOM_API int epicsParseLLong(const char *str, long long *to, int base, char **units); -/** +/** * \brief Convert a string to a unsigned long long type - * \copydetails epicsParseLong + * \copydetails epicsParseLong */ LIBCOM_API int epicsParseULLong(const char *str, unsigned long long *to, int base, char **units); -/** +/** * \brief Convert a string to a double type * * \param str Pointer to a constant character array @@ -94,65 +94,65 @@ LIBCOM_API int LIBCOM_API int epicsParseDouble(const char *str, double *to, char **units); -/** +/** * \brief Convert a string to a float type * \copydetails epicsParseDouble */ LIBCOM_API int epicsParseFloat(const char *str, float *to, char **units); -/** +/** * \brief Convert a string to an epicsInt8 type - * \copydetails epicsParseLong + * \copydetails epicsParseLong */ LIBCOM_API int epicsParseInt8(const char *str, epicsInt8 *to, int base, char **units); -/** +/** * \brief Convert a string to an epicsUInt8 type - * \copydetails epicsParseLong + * \copydetails epicsParseLong */ LIBCOM_API int epicsParseUInt8(const char *str, epicsUInt8 *to, int base, char **units); -/** +/** * \brief Convert a string to an epicsInt16 type - * \copydetails epicsParseLong + * \copydetails epicsParseLong */ LIBCOM_API int epicsParseInt16(const char *str, epicsInt16 *to, int base, char **units); -/** +/** * \brief Convert a string to an epicsUInt16 type - * \copydetails epicsParseLong + * \copydetails epicsParseLong */ LIBCOM_API int epicsParseUInt16(const char *str, epicsUInt16 *to, int base, char **units); -/** +/** * \brief Convert a string to an epicsInt32 type - * \copydetails epicsParseLong + * \copydetails epicsParseLong */ LIBCOM_API int epicsParseInt32(const char *str, epicsInt32 *to, int base, char **units); -/** +/** * \brief Convert a string to an epicsUInt32 type - * \copydetails epicsParseLong + * \copydetails epicsParseLong */ LIBCOM_API int epicsParseUInt32(const char *str, epicsUInt32 *to, int base, char **units); -/** +/** * \brief Convert a string to an epicsInt64 type - * \copydetails epicsParseLong + * \copydetails epicsParseLong */ LIBCOM_API int epicsParseInt64(const char *str, epicsInt64 *to, int base, char **units); -/** +/** * \brief Convert a string to an epicsUInt64 type - * \copydetails epicsParseLong + * \copydetails epicsParseLong */ LIBCOM_API int epicsParseUInt64(const char *str, epicsUInt64 *to, int base, char **units); @@ -166,38 +166,38 @@ LIBCOM_API int * This is analogous to the return value from sscanf() */ -/** - * Macro utilizing ::epicsParseLong to convert +/** + * Macro utilizing ::epicsParseLong to convert * \return 0=failure, 1=success */ #define epicsScanLong(str, to, base) (!epicsParseLong(str, to, base, NULL)) -/** - * Macro utilizing ::epicsParseULong to convert +/** + * Macro utilizing ::epicsParseULong to convert * \return 0=failure, 1=success */ #define epicsScanULong(str, to, base) (!epicsParseULong(str, to, base, NULL)) -/** - * Macro utilizing ::epicsParseLLong to convert +/** + * Macro utilizing ::epicsParseLLong to convert * \return 0=failure, 1=success */ #define epicsScanLLong(str, to, base) (!epicsParseLLong(str, to, base, NULL)) -/** - * Macro utilizing ::epicsParseULLong to convert +/** + * Macro utilizing ::epicsParseULLong to convert * \return 0=failure, 1=success */ #define epicsScanULLong(str, to, base) (!epicsParseULLong(str, to, base, NULL)) -/** - * Macro utilizing ::epicsParseFloat to convert +/** + * Macro utilizing ::epicsParseFloat to convert * \return 0=failure, 1=success */ #define epicsScanFloat(str, to) (!epicsParseFloat(str, to, NULL)) -/** - * Macro utilizing ::epicsParseDouble to convert +/** + * Macro utilizing ::epicsParseDouble to convert * \return 0=failure, 1=success */ #define epicsScanDouble(str, to) (!epicsParseDouble(str, to, NULL)) diff --git a/modules/libcom/src/misc/epicsString.h b/modules/libcom/src/misc/epicsString.h index 1ccc61ac9..8f7f2b001 100644 --- a/modules/libcom/src/misc/epicsString.h +++ b/modules/libcom/src/misc/epicsString.h @@ -31,26 +31,26 @@ extern "C" { #endif /** \brief Converts C-style escape sequences to their binary form - * - * Copies characters from string to an output buffer and converts C-style escape sequences to - * their binary form. Since the output string can never be longer than the source, it is legal for + * + * Copies characters from string to an output buffer and converts C-style escape sequences to + * their binary form. Since the output string can never be longer than the source, it is legal for * \p inbuf and \p outbuf to point to the same buffer and \p outsize and \p inlen * be equal, thus performing the character translation in-place. - * - * \param outbuf buffer to copy string to. The resulting string will be zero-terminated as long as - * \p outsize is non-zero. - * \param outsize length of output buffer not including the null-terminator. + * + * \param outbuf buffer to copy string to. The resulting string will be zero-terminated as long as + * \p outsize is non-zero. + * \param outsize length of output buffer not including the null-terminator. * \param inbuf buffer to copy from. Null byte terminates the string. * \param inlen maximum number of characters to copy from input buffer. * - * \return number of characters that were written into output buffer, not counting the null terminator. + * \return number of characters that were written into output buffer, not counting the null terminator. **/ LIBCOM_API int epicsStrnRawFromEscaped(char *outbuf, size_t outsize, const char *inbuf, size_t inlen); /** \brief Converts non-printable characters into C-style escape sequences * - * Copies characters from the string into a output buffer converting non-printable characters into C-style + * Copies characters from the string into a output buffer converting non-printable characters into C-style * escape sequences. In-place translations are not allowed since the escaped results will usually be larger * than the input string. * @@ -59,14 +59,14 @@ LIBCOM_API int epicsStrnRawFromEscaped(char *outbuf, size_t outsize, * All other non-printable characters appear in form `\xHH` where HH are two hex digits. * Non-printable characters are determined by the C runtime library’s isprint() function. * - * \param outbuf buffer to copy string to. The resulting string will be zero-terminated as long as - * @p outsize is non-zero. + * \param outbuf buffer to copy string to. The resulting string will be zero-terminated as long as + * @p outsize is non-zero. * \param outsize length of output buffer not including the null-terminator. * \param inbuf buffer to copy from. Null byte will not terminates the string. * \param inlen Number of characters to copy from input buffer. * - * \return number of characters that would have been stored in the output buffer if it were large enough, - * or a negative value if \p outbuf == \p inbuf. + * \return number of characters that would have been stored in the output buffer if it were large enough, + * or a negative value if \p outbuf == \p inbuf. * */ LIBCOM_API int epicsStrnEscapedFromRaw(char *outbuf, size_t outsize, @@ -74,16 +74,16 @@ LIBCOM_API int epicsStrnEscapedFromRaw(char *outbuf, size_t outsize, /** \brief Scans string and returns size of output buffer needed to escape that string * - * Scans up to \p len characters of the string that may contain non-printable characters, and returns - * the size of the output buffer that would be needed to escape that string. - * This routine is faster than calling epicsStrnEscapedFromRaw() with a zero length output buffer; both + * Scans up to \p len characters of the string that may contain non-printable characters, and returns + * the size of the output buffer that would be needed to escape that string. + * This routine is faster than calling epicsStrnEscapedFromRaw() with a zero length output buffer; both * should return the same result. * *\param buf string to scan *\param len length of input string * - *\return size of the output buffer that would be needed for converting to escape characters, not - * including the null terminator. + *\return size of the output buffer that would be needed for converting to escape characters, not + * including the null terminator. */ LIBCOM_API size_t epicsStrnEscapedFromRawSize(const char *buf, size_t len); @@ -113,7 +113,7 @@ LIBCOM_API char * epicsStrnDup(const char *s, size_t len); /** \brief Prints escaped version of string * - * Prints the contents of its input buffer to given file descriptor, substituting escape sequences + * Prints the contents of its input buffer to given file descriptor, substituting escape sequences * for non-printable characters. * * \param fp File descriptor to print to @@ -121,12 +121,12 @@ LIBCOM_API char * epicsStrnDup(const char *s, size_t len); * \param n Length of string */ LIBCOM_API int epicsStrPrintEscaped(FILE *fp, const char *s, size_t n); - + #define epicsStrSnPrintEscaped epicsStrnEscapedFromRaw /** \brief Calculates length of string * - * Implements strnlen from the C standard library. + * Implements strnlen from the C standard library. */ LIBCOM_API size_t epicsStrnLen(const char *s, size_t maxlen); @@ -154,14 +154,14 @@ LIBCOM_API int epicsStrGlobMatch(const char *str, const char *pattern); LIBCOM_API int epicsStrnGlobMatch(const char *str, size_t len, const char *pattern); /** \brief Extract tokens from string - * + * * Implements strtok_r from the C standard library */ LIBCOM_API char * epicsStrtok_r(char *s, const char *delim, char **lasts); /** \brief Calculates a hash of a null-terminated string * - * Calculates a hash of a null-terminated string. Initial seed may be provided which + * Calculates a hash of a null-terminated string. Initial seed may be provided which * permits multiple strings to be combined into a single hash result. * *\param str null-terminated string @@ -169,12 +169,12 @@ LIBCOM_API char * epicsStrtok_r(char *s, const char *delim, char **lasts); * set to 0. * *\return Hash value for string - */ + */ LIBCOM_API unsigned int epicsStrHash(const char *str, unsigned int seed); /** \brief Calculates a hash of a memory buffer * - * Calculates a hash of a memory buffer that may contain null values. Initial seed may be provided which + * Calculates a hash of a memory buffer that may contain null values. Initial seed may be provided which * permits multiple buffers to be combined into a single hash result. * *\param str buffer @@ -183,7 +183,7 @@ LIBCOM_API unsigned int epicsStrHash(const char *str, unsigned int seed); * set to 0. * *\return Hash value for buffer - */ + */ LIBCOM_API unsigned int epicsMemHash(const char *str, size_t length, unsigned int seed); /** \brief Compare two strings and return a number in the range [0.0, 1.0] or -1.0 on error. @@ -198,7 +198,7 @@ LIBCOM_API unsigned int epicsMemHash(const char *str, size_t length, LIBCOM_API double epicsStrSimilarity(const char *A, const char *B); /** \brief DEPRECATED - * \deprecated dbTranslateEscape is deprecated, use epicsStrnRawFromEscaped() instead + * \deprecated dbTranslateEscape is deprecated, use epicsStrnRawFromEscaped() instead */ LIBCOM_API int dbTranslateEscape(char *s, const char *ct); diff --git a/modules/libcom/src/misc/epicsTypes.h b/modules/libcom/src/misc/epicsTypes.h index 5efd69464..403137e99 100644 --- a/modules/libcom/src/misc/epicsTypes.h +++ b/modules/libcom/src/misc/epicsTypes.h @@ -11,7 +11,7 @@ /** * \file epicsTypes.h * \author: Jeff Hill - * + * * \brief The core data types used by epics */ @@ -37,7 +37,7 @@ typedef enum { /** * \name epicsTypes * Architecture Independent Data Types - * + * * These are sufficient for all our current archs * @{ */ diff --git a/modules/libcom/src/osi/epicsAtomic.h b/modules/libcom/src/osi/epicsAtomic.h index 414200715..3ef8eb36e 100644 --- a/modules/libcom/src/osi/epicsAtomic.h +++ b/modules/libcom/src/osi/epicsAtomic.h @@ -13,19 +13,19 @@ * * \brief OS independent interface to perform atomic operations * - * This is an operating system and compiler independent interface to an operating system and or compiler + * This is an operating system and compiler independent interface to an operating system and or compiler * dependent implementation of several atomic primitives. * - * These primitives can be safely used in a multithreaded programs on symmetric multiprocessing (SMP) - * systems. Where possible the primitives are implemented with compiler intrinsic wrappers for architecture + * These primitives can be safely used in a multithreaded programs on symmetric multiprocessing (SMP) + * systems. Where possible the primitives are implemented with compiler intrinsic wrappers for architecture * specific instructions. Otherwise they are implemented with OS specific functions and otherwise, when lacking - * a sufficently capable OS specific interface, then in some rare situations a mutual exclusion primitive is + * a sufficently capable OS specific interface, then in some rare situations a mutual exclusion primitive is * used for synchronization. * - * In operating systems environments which allow C code to run at interrupt level the implementation must + * In operating systems environments which allow C code to run at interrupt level the implementation must * use interrupt level invocable CPU instruction primitives. * - * All C++ functions are implemented in the namespace atomics which is nested inside of namespace epics. + * All C++ functions are implemented in the namespace atomics which is nested inside of namespace epics. */ /* * Author Jeffrey O. Hill @@ -48,15 +48,15 @@ extern "C" { /** Argument type for atomic operations on pointers*/ typedef void * EpicsAtomicPtrT; -/** \brief load target into cache +/** \brief load target into cache * - * load target into cache + * load target into cache **/ EPICS_ATOMIC_INLINE void epicsAtomicReadMemoryBarrier (void); -/** \brief push cache version of target into target +/** \brief push cache version of target into target * - * push cache version of target into target + * push cache version of target into target */ EPICS_ATOMIC_INLINE void epicsAtomicWriteMemoryBarrier (void); @@ -121,7 +121,7 @@ EPICS_ATOMIC_INLINE int epicsAtomicDecrIntT ( int * pTarget ); * * \param pTarget pointer to target * \param delta value to add to target - * + * * \return New value of target */ EPICS_ATOMIC_INLINE size_t epicsAtomicAddSizeT ( size_t * pTarget, size_t delta ); @@ -135,7 +135,7 @@ EPICS_ATOMIC_INLINE size_t epicsAtomicAddSizeT ( size_t * pTarget, size_t delta * * \param pTarget pointer to target * \param delta value to subtract from target - * + * * \return New value of target */ EPICS_ATOMIC_INLINE size_t epicsAtomicSubSizeT ( size_t * pTarget, size_t delta ); @@ -149,7 +149,7 @@ EPICS_ATOMIC_INLINE size_t epicsAtomicSubSizeT ( size_t * pTarget, size_t delta * * \param pTarget pointer to target * \param delta value to add to target - * + * * \return New value of target */ EPICS_ATOMIC_INLINE int epicsAtomicAddIntT ( int * pTarget, int delta ); @@ -181,32 +181,32 @@ EPICS_ATOMIC_INLINE void epicsAtomicSetIntT ( int * pTarget, int newValue ); */ EPICS_ATOMIC_INLINE void epicsAtomicSetPtrT ( EpicsAtomicPtrT * pTarget, EpicsAtomicPtrT newValue ); -/** \brief atomically load and return size_t value +/** \brief atomically load and return size_t value * * fetch target into cache, return new value of target * * \param pTarget pointer to target - * + * * \return value of target */ EPICS_ATOMIC_INLINE size_t epicsAtomicGetSizeT ( const size_t * pTarget ); -/** \brief atomically load and return int value +/** \brief atomically load and return int value * * fetch target into cache, return new value of target * * \param pTarget pointer to target - * + * * \return value of target */ EPICS_ATOMIC_INLINE int epicsAtomicGetIntT ( const int * pTarget ); -/** \brief atomically load and return pointer value +/** \brief atomically load and return pointer value * * fetch target into cache, return new value of target * * \param pTarget pointer to target - * + * * \return value of target */ EPICS_ATOMIC_INLINE EpicsAtomicPtrT epicsAtomicGetPtrT ( const EpicsAtomicPtrT * pTarget ); @@ -286,7 +286,7 @@ namespace atomic { /** \brief C++ API for atomic size_t increment * - * C++ API for atomic size_t increment. + * C++ API for atomic size_t increment. * * \param v variable to increment * @@ -469,7 +469,7 @@ EPICS_ATOMIC_INLINE EpicsAtomicPtrT get ( const EpicsAtomicPtrT & v ) /** \brief C++ API for atomic size_t compare-and-swap * - * C++ API for atomic size_t compare-and-swap. Atomic operation that compares \p v with \p oldVal + * C++ API for atomic size_t compare-and-swap. Atomic operation that compares \p v with \p oldVal * and if \p v == \v oldVal, sets \p v to \v newVal * * \param v variable to compare and swap @@ -486,7 +486,7 @@ EPICS_ATOMIC_INLINE size_t compareAndSwap ( size_t & v, /** \brief C++ API for atomic int compare-and-swap * - * C++ API for atomic size_t compare-and-swap. Atomic operation that compares \p v with \p oldVal + * C++ API for atomic size_t compare-and-swap. Atomic operation that compares \p v with \p oldVal * and if \p v == \v oldVal, sets \p v to \v newVal * * \param v variable to compare and swap @@ -502,7 +502,7 @@ EPICS_ATOMIC_INLINE int compareAndSwap ( int & v, int oldVal, int newVal ) /** \brief C++ API for atomic pointer compare-and-swap * - * C++ API for atomic size_t compare-and-swap. Atomic operation that compares \p v with \p oldVal + * C++ API for atomic size_t compare-and-swap. Atomic operation that compares \p v with \p oldVal * and if \p v == \v oldVal, sets \p v to \v newVal * * \param v variable to compare and swap diff --git a/modules/libcom/src/osi/epicsSpin.h b/modules/libcom/src/osi/epicsSpin.h index e7d89b755..cbc0bc15c 100644 --- a/modules/libcom/src/osi/epicsSpin.h +++ b/modules/libcom/src/osi/epicsSpin.h @@ -12,7 +12,7 @@ * * \brief OS independent interface for creating spin locks * - * OS independent interface for creating spin locks. Implemented using the + * OS independent interface for creating spin locks. Implemented using the * OS-specific spinlock interface if available. Otherwise uses epicsMutexLock. */ #ifndef epicsSpinh @@ -32,20 +32,20 @@ typedef struct epicsSpin *epicsSpinId; * * Creates a spin lock * - * \return Handle to spinlock or NULL if failed + * \return Handle to spinlock or NULL if failed * to create the lock */ LIBCOM_API epicsSpinId epicsSpinCreate(void); /** \brief Creates a spin lock * - * Creates a spin lock. Calls cantProceed() if unable + * Creates a spin lock. Calls cantProceed() if unable * to create lock */ LIBCOM_API epicsSpinId epicsSpinMustCreate(void); /** \brief Destroys spin lock - * + * * Destroys the spin lock * * \param lockId identifies the spinlock @@ -53,20 +53,20 @@ LIBCOM_API epicsSpinId epicsSpinMustCreate(void); LIBCOM_API void epicsSpinDestroy(epicsSpinId lockId); /** \brief Acquires the spin lock - * - * Acquires the lock. Blocks if lock is unavailable + * + * Acquires the lock. Blocks if lock is unavailable * * \param lockId identifies the spinlock */ LIBCOM_API void epicsSpinLock(epicsSpinId lockId); -/** \brief Tries to acquire the spin lock +/** \brief Tries to acquire the spin lock * * Tries to acquire the lock. If failed, return immediately * with non-zero error code. * * \param lockId identifies the spinlock - * + * * \return 0 if lock was acquired. 1 if failed because acquired by another thread. * Otherwise returns non-zero OS specific return code if failed for any other reason */ @@ -75,7 +75,7 @@ LIBCOM_API int epicsSpinTryLock(epicsSpinId lockId); /** \brief Releases spin lock * * Releases spin lock - * + * * \param lockId identifies the spinlock */ LIBCOM_API void epicsSpinUnlock(epicsSpinId lockId); diff --git a/modules/libcom/src/osi/epicsStackTrace.h b/modules/libcom/src/osi/epicsStackTrace.h index f336d419f..3bbf0298d 100644 --- a/modules/libcom/src/osi/epicsStackTrace.h +++ b/modules/libcom/src/osi/epicsStackTrace.h @@ -44,13 +44,13 @@ LIBCOM_API void epicsStackTrace(void); /** Bit mask to check if stack trace is able to lookup local symbols */ #define EPICS_STACKTRACE_LCL_SYMBOLS (1<<3) -/** \brief Get supported stacktrace features +/** \brief Get supported stacktrace features * - * Returns an ORed bitset of supported features. Use the EPICS_STACKTRACE_ masks to + * Returns an ORed bitset of supported features. Use the EPICS_STACKTRACE_ masks to * check if a feature is supported. * * \return 0 if getting the stack trace is unsupported. Otherwise - * returns an ORed bitset of supported features. + * returns an ORed bitset of supported features. */ LIBCOM_API int epicsStackTraceGetFeatures(void); diff --git a/modules/libcom/src/osi/os/RTEMS-posix/devLibVMEOSD.c b/modules/libcom/src/osi/os/RTEMS-posix/devLibVMEOSD.c index 8ae1503ec..7cdcd7224 100644 --- a/modules/libcom/src/osi/os/RTEMS-posix/devLibVMEOSD.c +++ b/modules/libcom/src/osi/os/RTEMS-posix/devLibVMEOSD.c @@ -1,6 +1,6 @@ #ifdef RTEMS_LEGACY_STACK #include "os/RTEMS-score/devLibVMEOSD.c" #else -#pragma message "\n VME Support requires the RTEMS Legacy stack\n" +#pragma message "\n VME Support requires the RTEMS Legacy stack\n" #include "os/default/devLibVMEOSD.c" #endif diff --git a/modules/libcom/src/osi/os/RTEMS-posix/osdMessageQueue.c b/modules/libcom/src/osi/os/RTEMS-posix/osdMessageQueue.c index fd55fa005..53d05d113 100644 --- a/modules/libcom/src/osi/os/RTEMS-posix/osdMessageQueue.c +++ b/modules/libcom/src/osi/os/RTEMS-posix/osdMessageQueue.c @@ -62,12 +62,12 @@ LIBCOM_API void epicsStdCall epicsMessageQueueDestroy( { int rv; rv = mq_close(id->id); - if( rv ) { + if( rv ) { fprintf(stderr, "epicsMessageQueueDestroy mq_close failed: %s\n", strerror(rv)); } rv = mq_unlink(id->name); - if( rv ) { + if( rv ) { fprintf(stderr,"epicsMessageQueueDestroy mq_unlink %s failed: %s\n", id->name, strerror(rv)); } diff --git a/modules/libcom/src/osi/os/RTEMS-posix/osdMessageQueue.h b/modules/libcom/src/osi/os/RTEMS-posix/osdMessageQueue.h index a3fc30bd4..b9f299a62 100644 --- a/modules/libcom/src/osi/os/RTEMS-posix/osdMessageQueue.h +++ b/modules/libcom/src/osi/os/RTEMS-posix/osdMessageQueue.h @@ -5,7 +5,7 @@ * Operator of Los Alamos National Laboratory. * EPICS BASE Versions 3.13.7 * and higher are 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. \*************************************************************************/ /* * Author W. Eric Norum diff --git a/modules/libcom/src/osi/os/RTEMS-posix/osdPoolStatus.c b/modules/libcom/src/osi/os/RTEMS-posix/osdPoolStatus.c index 5b202fd1d..e4ddb350b 100644 --- a/modules/libcom/src/osi/os/RTEMS-posix/osdPoolStatus.c +++ b/modules/libcom/src/osi/os/RTEMS-posix/osdPoolStatus.c @@ -5,7 +5,7 @@ * Operator of Los Alamos National Laboratory. * EPICS BASE Versions 3.13.7 * and higher are 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. \*************************************************************************/ #include #include @@ -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/src/osi/os/RTEMS-score/osdSock.h b/modules/libcom/src/osi/os/RTEMS-score/osdSock.h index ea765ece8..2a320b9a1 100644 --- a/modules/libcom/src/osi/os/RTEMS-score/osdSock.h +++ b/modules/libcom/src/osi/os/RTEMS-score/osdSock.h @@ -39,7 +39,7 @@ int select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, str #ifndef IPPORT_USERRESERVED #define IPPORT_USERRESERVED 5000 -#endif +#endif typedef int SOCKET; #define INVALID_SOCKET (-1) diff --git a/modules/libcom/src/osi/os/RTEMS-score/osdThread.c b/modules/libcom/src/osi/os/RTEMS-score/osdThread.c index abae0d20a..4b0587d0f 100644 --- a/modules/libcom/src/osi/os/RTEMS-score/osdThread.c +++ b/modules/libcom/src/osi/os/RTEMS-score/osdThread.c @@ -104,7 +104,7 @@ int epicsThreadGetOssPriorityValue(unsigned int osiPriority) /* * epicsThreadLowestPriorityLevelAbove () */ -LIBCOM_API epicsThreadBooleanStatus epicsThreadLowestPriorityLevelAbove +LIBCOM_API epicsThreadBooleanStatus epicsThreadLowestPriorityLevelAbove (unsigned int priority, unsigned *pPriorityJustAbove) { unsigned newPriority = priority + 1; @@ -120,7 +120,7 @@ LIBCOM_API epicsThreadBooleanStatus epicsThreadLowestPriorityLevelAbove /* * epicsThreadHighestPriorityLevelBelow () */ -LIBCOM_API epicsThreadBooleanStatus epicsThreadHighestPriorityLevelBelow +LIBCOM_API epicsThreadBooleanStatus epicsThreadHighestPriorityLevelBelow (unsigned int priority, unsigned *pPriorityJustBelow) { unsigned newPriority = priority - 1; diff --git a/modules/libcom/src/osi/os/WIN32/osdEvent.c b/modules/libcom/src/osi/os/WIN32/osdEvent.c index 6eb64d4ca..b6be00da9 100644 --- a/modules/libcom/src/osi/os/WIN32/osdEvent.c +++ b/modules/libcom/src/osi/os/WIN32/osdEvent.c @@ -55,7 +55,7 @@ LIBCOM_API epicsEventId epicsEventCreate ( /* * epicsEventDestroy () */ -LIBCOM_API void epicsEventDestroy ( epicsEventId pSem ) +LIBCOM_API void epicsEventDestroy ( epicsEventId pSem ) { CloseHandle ( pSem->handle ); free ( pSem ); @@ -64,7 +64,7 @@ LIBCOM_API void epicsEventDestroy ( epicsEventId pSem ) /* * epicsEventTrigger () */ -LIBCOM_API epicsEventStatus epicsEventTrigger ( epicsEventId pSem ) +LIBCOM_API epicsEventStatus epicsEventTrigger ( epicsEventId pSem ) { BOOL status; status = SetEvent ( pSem->handle ); @@ -74,7 +74,7 @@ LIBCOM_API epicsEventStatus epicsEventTrigger ( epicsEventId pSem ) /* * epicsEventWait () */ -LIBCOM_API epicsEventStatus epicsEventWait ( epicsEventId pSem ) +LIBCOM_API epicsEventStatus epicsEventWait ( epicsEventId pSem ) { DWORD status; status = WaitForSingleObject (pSem->handle, INFINITE); @@ -106,7 +106,7 @@ LIBCOM_API epicsEventStatus epicsEventWaitWithTimeout ( } else if ( timeout >= INFINITE / mSecPerSec ) { /* we need to apply a maximum wait time to stop an overflow. We choose (INFINITE - 1) milliseconds, - to be compatible with previous WaitForSingleObject() implementation */ + to be compatible with previous WaitForSingleObject() implementation */ nIvals = (LONGLONG)(INFINITE - 1) * (ivalPerSec / mSecPerSec); tmo.QuadPart = -nIvals; /* negative value means a relative time offset for timer */ } @@ -143,7 +143,7 @@ LIBCOM_API epicsEventStatus epicsEventWaitWithTimeout ( /* * epicsEventTryWait () */ -LIBCOM_API epicsEventStatus epicsEventTryWait ( epicsEventId pSem ) +LIBCOM_API epicsEventStatus epicsEventTryWait ( epicsEventId pSem ) { DWORD status; @@ -162,6 +162,6 @@ LIBCOM_API epicsEventStatus epicsEventTryWait ( epicsEventId pSem ) /* * epicsEventShow () */ -LIBCOM_API void epicsEventShow ( epicsEventId id, unsigned level ) +LIBCOM_API void epicsEventShow ( epicsEventId id, unsigned level ) { } diff --git a/modules/libcom/src/osi/os/WIN32/osdProcess.c b/modules/libcom/src/osi/os/WIN32/osdProcess.c index a41105d45..c740a7c5b 100644 --- a/modules/libcom/src/osi/os/WIN32/osdProcess.c +++ b/modules/libcom/src/osi/os/WIN32/osdProcess.c @@ -47,7 +47,7 @@ LIBCOM_API osiGetUserNameReturn epicsStdCall osiGetUserName (char *pBuf, unsigne return osiGetUserNameSuccess; } -LIBCOM_API osiSpawnDetachedProcessReturn epicsStdCall osiSpawnDetachedProcess +LIBCOM_API osiSpawnDetachedProcessReturn epicsStdCall osiSpawnDetachedProcess ( const char *pProcessName, const char *pBaseExecutableName ) { BOOL silent = pProcessName && pProcessName[0]=='!'; diff --git a/modules/libcom/src/osi/os/WIN32/osdSock.c b/modules/libcom/src/osi/os/WIN32/osdSock.c index 3c8dc6ebf..206625375 100644 --- a/modules/libcom/src/osi/os/WIN32/osdSock.c +++ b/modules/libcom/src/osi/os/WIN32/osdSock.c @@ -113,7 +113,7 @@ LIBCOM_API void epicsStdCall osiSockRelease() } } -LIBCOM_API SOCKET epicsStdCall epicsSocketCreate ( +LIBCOM_API SOCKET epicsStdCall epicsSocketCreate ( int domain, int type, int protocol ) { return socket ( domain, type, protocol ); @@ -140,7 +140,7 @@ LIBCOM_API void epicsStdCall epicsSocketDestroy ( SOCKET s ) /* * ipAddrToHostName */ -LIBCOM_API unsigned epicsStdCall ipAddrToHostName +LIBCOM_API unsigned epicsStdCall ipAddrToHostName (const struct in_addr *pAddr, char *pBuf, unsigned bufSize) { struct hostent *ent; @@ -161,7 +161,7 @@ LIBCOM_API unsigned epicsStdCall ipAddrToHostName /* * hostToIPAddr () */ -LIBCOM_API int epicsStdCall hostToIPAddr +LIBCOM_API int epicsStdCall hostToIPAddr (const char *pHostName, struct in_addr *pIPA) { struct hostent *phe; diff --git a/modules/libcom/src/osi/os/WIN32/osdThread.c b/modules/libcom/src/osi/os/WIN32/osdThread.c index f0ed80e03..5d959ed6e 100644 --- a/modules/libcom/src/osi/os/WIN32/osdThread.c +++ b/modules/libcom/src/osi/os/WIN32/osdThread.c @@ -39,7 +39,7 @@ /* Windows Vista and higher supports fibre functions, but the * prototypes only appear in the windows SDK 8 and above. - * VS2010 supplies sdk 7, but can be upgraded to later SDK + * VS2010 supplies sdk 7, but can be upgraded to later SDK * To accommodate this we supply prototypes on, for XP * fall back to Tls*() which will build and run @@ -407,7 +407,7 @@ static unsigned epicsThreadGetOsiPriorityValue ( int osdPriority ) /* * epicsThreadLowestPriorityLevelAbove () */ -LIBCOM_API epicsThreadBooleanStatus epicsStdCall epicsThreadLowestPriorityLevelAbove +LIBCOM_API epicsThreadBooleanStatus epicsStdCall epicsThreadLowestPriorityLevelAbove ( unsigned int priority, unsigned * pPriorityJustAbove ) { const DWORD priorityClass = GetPriorityClass ( GetCurrentProcess () ); @@ -437,7 +437,7 @@ LIBCOM_API epicsThreadBooleanStatus epicsStdCall epicsThreadLowestPriorityLevelA /* * epicsThreadHighestPriorityLevelBelow () */ -LIBCOM_API epicsThreadBooleanStatus epicsStdCall epicsThreadHighestPriorityLevelBelow +LIBCOM_API epicsThreadBooleanStatus epicsStdCall epicsThreadHighestPriorityLevelBelow ( unsigned int priority, unsigned * pPriorityJustBelow ) { const DWORD priorityClass = GetPriorityClass ( GetCurrentProcess () ); @@ -467,7 +467,7 @@ LIBCOM_API epicsThreadBooleanStatus epicsStdCall epicsThreadHighestPriorityLevel /* * epicsThreadGetStackSize () */ -LIBCOM_API unsigned int epicsStdCall +LIBCOM_API unsigned int epicsStdCall epicsThreadGetStackSize ( epicsThreadStackSizeClass stackSizeClass ) { #define STACK_SIZE(f) (f * 0x10000 * sizeof(void *)) @@ -778,7 +778,7 @@ LIBCOM_API void epicsStdCall epicsThreadResume ( epicsThreadId id ) /* * epicsThreadGetPriority () */ -LIBCOM_API unsigned epicsStdCall epicsThreadGetPriority (epicsThreadId id) +LIBCOM_API unsigned epicsStdCall epicsThreadGetPriority (epicsThreadId id) { win32ThreadParam * pParm = ( win32ThreadParam * ) id; return pParm->epicsPriority; @@ -787,8 +787,8 @@ LIBCOM_API unsigned epicsStdCall epicsThreadGetPriority (epicsThreadId id) /* * epicsThreadGetPrioritySelf () */ -LIBCOM_API unsigned epicsStdCall epicsThreadGetPrioritySelf () -{ +LIBCOM_API unsigned epicsStdCall epicsThreadGetPrioritySelf () +{ win32ThreadParam * pParm = getMyWin32ThreadParam ( NULL ); if ( pParm ) { @@ -805,7 +805,7 @@ LIBCOM_API unsigned epicsStdCall epicsThreadGetPrioritySelf () /* * epicsThreadSetPriority () */ -LIBCOM_API void epicsStdCall epicsThreadSetPriority ( epicsThreadId id, unsigned priority ) +LIBCOM_API void epicsStdCall epicsThreadSetPriority ( epicsThreadId id, unsigned priority ) { win32ThreadParam * pParm = ( win32ThreadParam * ) id; BOOL stat = SetThreadPriority ( pParm->handle, epicsThreadGetOsdPriorityValue (priority) ); @@ -815,7 +815,7 @@ LIBCOM_API void epicsStdCall epicsThreadSetPriority ( epicsThreadId id, unsigned /* * epicsThreadIsEqual () */ -LIBCOM_API int epicsStdCall epicsThreadIsEqual ( epicsThreadId id1, epicsThreadId id2 ) +LIBCOM_API int epicsStdCall epicsThreadIsEqual ( epicsThreadId id1, epicsThreadId id2 ) { win32ThreadParam * pParm1 = ( win32ThreadParam * ) id1; win32ThreadParam * pParm2 = ( win32ThreadParam * ) id2; @@ -825,7 +825,7 @@ LIBCOM_API int epicsStdCall epicsThreadIsEqual ( epicsThreadId id1, epicsThreadI /* * epicsThreadIsSuspended () */ -LIBCOM_API int epicsStdCall epicsThreadIsSuspended ( epicsThreadId id ) +LIBCOM_API int epicsStdCall epicsThreadIsSuspended ( epicsThreadId id ) { win32ThreadParam *pParm = ( win32ThreadParam * ) id; DWORD exitCode; @@ -874,9 +874,9 @@ LIBCOM_API void epicsStdCall epicsThreadSleep ( double seconds ) if ( seconds <= 0.0 ) { tmo.QuadPart = 0u; } - else if ( seconds >= INFINITE / mSecPerSec ) { + else if ( seconds >= INFINITE / mSecPerSec ) { /* we need to apply a maximum wait time to stop an overflow. We choose (INFINITE - 1) milliseconds, - to be compatible with previous WaitForSingleObject() implementation */ + to be compatible with previous WaitForSingleObject() implementation */ nIvals = (LONGLONG)(INFINITE - 1) * (ivalPerSec / mSecPerSec); tmo.QuadPart = -nIvals; /* negative value means a relative time offset for timer */ } @@ -935,7 +935,7 @@ double epicsStdCall epicsThreadSleepQuantum () /* * epicsThreadGetIdSelf () */ -LIBCOM_API epicsThreadId epicsStdCall epicsThreadGetIdSelf (void) +LIBCOM_API epicsThreadId epicsStdCall epicsThreadGetIdSelf (void) { win32ThreadParam * pParm = getMyWin32ThreadParam ( NULL ); assert ( pParm ); /* Don't return a NULL thread id */ @@ -988,7 +988,7 @@ LIBCOM_API const char * epicsStdCall epicsThreadGetNameSelf (void) /* * epicsThreadGetName () */ -LIBCOM_API void epicsStdCall epicsThreadGetName ( +LIBCOM_API void epicsStdCall epicsThreadGetName ( epicsThreadId id, char * pName, size_t size ) { win32ThreadParam * pParm = ( win32ThreadParam * ) id; diff --git a/modules/libcom/src/osi/os/WIN32/setThreadName.cpp b/modules/libcom/src/osi/os/WIN32/setThreadName.cpp index b218479e3..bb88b02f8 100644 --- a/modules/libcom/src/osi/os/WIN32/setThreadName.cpp +++ b/modules/libcom/src/osi/os/WIN32/setThreadName.cpp @@ -60,7 +60,7 @@ static void setThreadNameVS( DWORD dwThreadID, LPCSTR szThreadName ) #if _MSC_VER >= 1300 && defined ( _DEBUG ) // This was copied directly from an MSDN example // It sets the thread name by throwing a special exception that is caught by Visual Sudio -// It requires the debugger to be already attached to the process +// It requires the debugger to be already attached to the process // when the exception is thrown for the name to be registered static const DWORD MS_VC_EXCEPTION = 0x406D1388; #pragma pack(push,8) diff --git a/modules/libcom/src/osi/os/cygwin32/osdStrtod.h b/modules/libcom/src/osi/os/cygwin32/osdStrtod.h index 170a69bb0..b87ef62e4 100644 --- a/modules/libcom/src/osi/os/cygwin32/osdStrtod.h +++ b/modules/libcom/src/osi/os/cygwin32/osdStrtod.h @@ -16,7 +16,7 @@ extern "C" { /* * epicsStrtod() for systems with broken strtod() routine */ -LIBCOM_API double epicsStrtod(const char *str, char **endp); +LIBCOM_API double epicsStrtod(const char *str, char **endp); #ifdef __cplusplus } diff --git a/modules/libcom/src/osi/os/default/osdSockAddrReuse.cpp b/modules/libcom/src/osi/os/default/osdSockAddrReuse.cpp index b2d3906bc..40e978249 100644 --- a/modules/libcom/src/osi/os/default/osdSockAddrReuse.cpp +++ b/modules/libcom/src/osi/os/default/osdSockAddrReuse.cpp @@ -19,7 +19,7 @@ #include "osiSock.h" #include "errlog.h" -LIBCOM_API void epicsStdCall +LIBCOM_API void epicsStdCall epicsSocketEnableAddressReuseDuringTimeWaitState ( SOCKET s ) { #ifdef _WIN32 diff --git a/modules/libcom/src/osi/os/posix/osdProcess.c b/modules/libcom/src/osi/os/posix/osdProcess.c index b2c26beb4..032af4c0c 100644 --- a/modules/libcom/src/osi/os/posix/osdProcess.c +++ b/modules/libcom/src/osi/os/posix/osdProcess.c @@ -59,7 +59,7 @@ LIBCOM_API osiGetUserNameReturn epicsStdCall osiGetUserName (char *pBuf, unsigne } } -LIBCOM_API osiSpawnDetachedProcessReturn epicsStdCall osiSpawnDetachedProcess +LIBCOM_API osiSpawnDetachedProcessReturn epicsStdCall osiSpawnDetachedProcess (const char *pProcessName, const char *pBaseExecutableName) { int status; diff --git a/modules/libcom/src/osi/os/posix/osdSignal.cpp b/modules/libcom/src/osi/os/posix/osdSignal.cpp index 4361c665a..d7b22ddd8 100644 --- a/modules/libcom/src/osi/os/posix/osdSignal.cpp +++ b/modules/libcom/src/osi/os/posix/osdSignal.cpp @@ -53,5 +53,5 @@ LIBCOM_API void epicsStdCall epicsSignalInstallSigPipeIgnore (void) /* Disabled */ LIBCOM_API void epicsStdCall epicsSignalInstallSigAlarmIgnore ( void ) {} -LIBCOM_API void epicsStdCall epicsSignalRaiseSigAlarm +LIBCOM_API void epicsStdCall epicsSignalRaiseSigAlarm ( struct epicsThreadOSD * /* threadId */ ) {} diff --git a/modules/libcom/src/osi/os/posix/osdSock.c b/modules/libcom/src/osi/os/posix/osdSock.c index 41f6580f0..61f2828e1 100644 --- a/modules/libcom/src/osi/os/posix/osdSock.c +++ b/modules/libcom/src/osi/os/posix/osdSock.c @@ -87,7 +87,7 @@ void osiSockRelease() * the socket will be closed if the user uses exec() * as is the case with third party tools such as TCL/TK */ -LIBCOM_API SOCKET epicsStdCall epicsSocketCreate ( +LIBCOM_API SOCKET epicsStdCall epicsSocketCreate ( int domain, int type, int protocol ) { static unsigned char warnAttached; @@ -177,7 +177,7 @@ LIBCOM_API void epicsStdCall epicsSocketDestroy ( SOCKET s ) * On many systems, gethostbyaddr must be protected by a * mutex since the routine is not thread-safe. */ -LIBCOM_API unsigned epicsStdCall ipAddrToHostName +LIBCOM_API unsigned epicsStdCall ipAddrToHostName (const struct in_addr *pAddr, char *pBuf, unsigned bufSize) { struct hostent *ent; @@ -203,7 +203,7 @@ LIBCOM_API unsigned epicsStdCall ipAddrToHostName * On many systems, gethostbyname must be protected by a * mutex since the routine is not thread-safe. */ -LIBCOM_API int epicsStdCall hostToIPAddr +LIBCOM_API int epicsStdCall hostToIPAddr (const char *pHostName, struct in_addr *pIPA) { struct hostent *phe; diff --git a/modules/libcom/src/osi/os/posix/osdThread.c b/modules/libcom/src/osi/os/posix/osdThread.c index e86e33c8b..890f448d2 100644 --- a/modules/libcom/src/osi/os/posix/osdThread.c +++ b/modules/libcom/src/osi/os/posix/osdThread.c @@ -31,7 +31,7 @@ #endif #if USE_MEMLOCK -#include +#include #endif /* epicsStdio uses epicsThreadOnce(), require explicit use to avoid unexpected recursion */ @@ -1133,6 +1133,12 @@ LIBCOM_API double epicsStdCall epicsThreadSleepQuantum () LIBCOM_API int epicsThreadGetCPUs(void) { long ret; +#ifdef CPU_COUNT + cpu_set_t mask; + ret = sched_getaffinity(0, sizeof(mask), &mask); + if (ret == 0) + return CPU_COUNT(&mask); +#endif #ifdef _SC_NPROCESSORS_ONLN ret = sysconf(_SC_NPROCESSORS_ONLN); if (ret > 0) diff --git a/modules/libcom/src/osi/os/solaris/osdStrtod.h b/modules/libcom/src/osi/os/solaris/osdStrtod.h index 170a69bb0..b87ef62e4 100644 --- a/modules/libcom/src/osi/os/solaris/osdStrtod.h +++ b/modules/libcom/src/osi/os/solaris/osdStrtod.h @@ -16,7 +16,7 @@ extern "C" { /* * epicsStrtod() for systems with broken strtod() routine */ -LIBCOM_API double epicsStrtod(const char *str, char **endp); +LIBCOM_API double epicsStrtod(const char *str, char **endp); #ifdef __cplusplus } diff --git a/modules/libcom/src/osi/os/vxWorks/osdSock.c b/modules/libcom/src/osi/os/vxWorks/osdSock.c index 3f272c359..1309197ae 100644 --- a/modules/libcom/src/osi/os/vxWorks/osdSock.c +++ b/modules/libcom/src/osi/os/vxWorks/osdSock.c @@ -34,7 +34,7 @@ void osiSockRelease() { } -LIBCOM_API SOCKET epicsStdCall epicsSocketCreate ( +LIBCOM_API SOCKET epicsStdCall epicsSocketCreate ( int domain, int type, int protocol ) { SOCKET sock = socket ( domain, type, protocol ); @@ -70,7 +70,7 @@ LIBCOM_API void epicsStdCall epicsSocketDestroy ( SOCKET s ) /* * ipAddrToHostName */ -LIBCOM_API unsigned epicsStdCall ipAddrToHostName +LIBCOM_API unsigned epicsStdCall ipAddrToHostName (const struct in_addr *pAddr, char *pBuf, unsigned bufSize) { int status; diff --git a/modules/libcom/src/osi/osiProcess.h b/modules/libcom/src/osi/osiProcess.h index a58e04df0..32beba3a5 100644 --- a/modules/libcom/src/osi/osiProcess.h +++ b/modules/libcom/src/osi/osiProcess.h @@ -38,11 +38,11 @@ typedef enum osiGetUserNameReturn { * and copy the name into the provided buffer * * \param pBuf buffer where user name is copied into - * \param bufSize size of input buffer. + * \param bufSize size of input buffer. * * \return return failed if unable to get user name or user name is too large * to fit in buffer. Otherwise return success - */ + */ LIBCOM_API osiGetUserNameReturn epicsStdCall osiGetUserName (char *pBuf, unsigned bufSize); /** Return code for osiSpawnDetachedProcess() */ @@ -55,13 +55,13 @@ typedef enum osiSpawnDetachedProcessReturn { /** \brief Spawn detached process * * Spawn detached process with named executable. - * + * * \param pProcessName process name to be displayed. Not used in all OSs * \param pBaseExecutableName path to executable * * \return return code indicating success or failure */ -LIBCOM_API osiSpawnDetachedProcessReturn epicsStdCall osiSpawnDetachedProcess +LIBCOM_API osiSpawnDetachedProcessReturn epicsStdCall osiSpawnDetachedProcess (const char *pProcessName, const char *pBaseExecutableName); #ifdef __cplusplus diff --git a/modules/libcom/src/osi/osiSock.c b/modules/libcom/src/osi/osiSock.c index 7b72ac9d6..012443700 100644 --- a/modules/libcom/src/osi/osiSock.c +++ b/modules/libcom/src/osi/osiSock.c @@ -31,7 +31,7 @@ * sockAddrAreIdentical() * (returns true if addresses are identical) */ -int epicsStdCall sockAddrAreIdentical +int epicsStdCall sockAddrAreIdentical ( const osiSockAddr *plhs, const osiSockAddr *prhs ) { int match; @@ -58,7 +58,7 @@ int epicsStdCall sockAddrAreIdentical * sockAddrToA() * (convert socket address to ASCII host name) */ -unsigned epicsStdCall sockAddrToA ( +unsigned epicsStdCall sockAddrToA ( const struct sockaddr * paddr, char * pBuf, unsigned bufSize ) { if ( bufSize < 1 ) { @@ -89,7 +89,7 @@ unsigned epicsStdCall sockAddrToA ( * ipAddrToA() * (convert IP address to ASCII host name) */ -unsigned epicsStdCall ipAddrToA ( +unsigned epicsStdCall ipAddrToA ( const struct sockaddr_in * paddr, char * pBuf, unsigned bufSize ) { unsigned len = ipAddrToHostName ( @@ -115,7 +115,7 @@ unsigned epicsStdCall ipAddrToA ( /* * sockAddrToDottedIP () */ -unsigned epicsStdCall sockAddrToDottedIP ( +unsigned epicsStdCall sockAddrToDottedIP ( const struct sockaddr * paddr, char * pBuf, unsigned bufSize ) { if ( paddr->sa_family != AF_INET ) { @@ -141,7 +141,7 @@ unsigned epicsStdCall sockAddrToDottedIP ( /* * ipAddrToDottedIP () */ -unsigned epicsStdCall ipAddrToDottedIP ( +unsigned epicsStdCall ipAddrToDottedIP ( const struct sockaddr_in *paddr, char *pBuf, unsigned bufSize ) { static const char * pErrStr = ""; diff --git a/modules/libcom/src/osi/osiSock.h b/modules/libcom/src/osi/osiSock.h index 6145634f8..82062b922 100644 --- a/modules/libcom/src/osi/osiSock.h +++ b/modules/libcom/src/osi/osiSock.h @@ -44,7 +44,7 @@ struct in_addr; * \param protocol Typically unused and set to 0. * \return A file descriptor referring to the socket, or -1 on error. */ -LIBCOM_API SOCKET epicsStdCall epicsSocketCreate ( +LIBCOM_API SOCKET epicsStdCall epicsSocketCreate ( int domain, int type, int protocol ); /*! @@ -70,7 +70,7 @@ LIBCOM_API SOCKET epicsStdCall epicsSocketAccept ( * * Close and free resources held by a SOCKET object. */ -LIBCOM_API void epicsStdCall epicsSocketDestroy ( +LIBCOM_API void epicsStdCall epicsSocketDestroy ( SOCKET ); /*! * \brief Allows a socket to bind ignoring other sockets in TIME_WAIT state. @@ -88,7 +88,7 @@ LIBCOM_API void epicsStdCall epicsSocketDestroy ( * * \param s The socket to ignore other TIME_WAIT sockets when binding */ -LIBCOM_API void epicsStdCall +LIBCOM_API void epicsStdCall epicsSocketEnableAddressReuseDuringTimeWaitState ( SOCKET s ); /*! * \brief Allows multiple sockets to use the same family, local address, and local @@ -106,7 +106,7 @@ LIBCOM_API void epicsStdCall * * \param s The socket to put in "Fanout" mode (aka REUSEPORT mode) */ -LIBCOM_API void epicsStdCall +LIBCOM_API void epicsStdCall epicsSocketEnableAddressUseForDatagramFanout ( SOCKET s ); /*! @@ -138,7 +138,7 @@ enum epicsSocketSystemCallInterruptMechanismQueryInfo { * \return enum representing whether to call close() or shutdown(RW) to * interrupt blocking socket syscalls. */ -LIBCOM_API enum epicsSocketSystemCallInterruptMechanismQueryInfo +LIBCOM_API enum epicsSocketSystemCallInterruptMechanismQueryInfo epicsSocketSystemCallInterruptMechanismQuery (); #ifdef EPICS_PRIVATE_API @@ -206,7 +206,7 @@ LIBCOM_API unsigned epicsStdCall ipAddrToA ( * null termination, but always writes at least a null terminator in the string * (if bufSize >= 1) */ -LIBCOM_API unsigned epicsStdCall sockAddrToDottedIP ( +LIBCOM_API unsigned epicsStdCall sockAddrToDottedIP ( const struct sockaddr * paddr, char * pBuf, unsigned bufSize ); /*! @@ -222,7 +222,7 @@ LIBCOM_API unsigned epicsStdCall sockAddrToDottedIP ( * null termination, but always writes at least a null terminator in the string * (if bufSize >= 1) */ -LIBCOM_API unsigned epicsStdCall ipAddrToDottedIP ( +LIBCOM_API unsigned epicsStdCall ipAddrToDottedIP ( const struct sockaddr_in * paddr, char * pBuf, unsigned bufSize ); /*! @@ -266,7 +266,7 @@ LIBCOM_API int epicsStdCall aToIPAddr * \param[out] pIPA Pointer to the in_addr structure where the hostname information will be stored * \return 0 on success, negative on error. */ -LIBCOM_API int epicsStdCall hostToIPAddr +LIBCOM_API int epicsStdCall hostToIPAddr (const char *pHostName, struct in_addr *pIPA); /*! * \brief attach to BSD socket library @@ -342,7 +342,7 @@ typedef struct osiSockAddrNode { * * \return true if addresses are identical, false otherwise. */ -LIBCOM_API int epicsStdCall sockAddrAreIdentical +LIBCOM_API int epicsStdCall sockAddrAreIdentical ( const osiSockAddr * plhs, const osiSockAddr * prhs ); /*! diff --git a/modules/libcom/src/pool/threadPool.c b/modules/libcom/src/pool/threadPool.c index a353aa31a..deecafb5e 100644 --- a/modules/libcom/src/pool/threadPool.c +++ b/modules/libcom/src/pool/threadPool.c @@ -338,7 +338,7 @@ LIBCOM_API epicsThreadPool* epicsThreadPoolGetShared(epicsThreadPoolConfig *opts opts = &defopts; } /* shared pools must have a minimum allowed number of workers. - * Use the number of CPU cores + * Use the number of CPU cores currently available to the calling thread. */ if (opts->maxThreads < N) opts->maxThreads = N; diff --git a/modules/libcom/src/timer/epicsTimer.cpp b/modules/libcom/src/timer/epicsTimer.cpp index 2bea637d1..aa36d4af4 100644 --- a/modules/libcom/src/timer/epicsTimer.cpp +++ b/modules/libcom/src/timer/epicsTimer.cpp @@ -109,7 +109,7 @@ void epicsTimerQueuePassiveForC::destroy () delete this; } -LIBCOM_API epicsTimerNotify::expireStatus::expireStatus ( restart_t restart ) : +LIBCOM_API epicsTimerNotify::expireStatus::expireStatus ( restart_t restart ) : delay ( - DBL_MAX ) { if ( restart != noRestart ) { @@ -118,7 +118,7 @@ LIBCOM_API epicsTimerNotify::expireStatus::expireStatus ( restart_t restart ) : } } -LIBCOM_API epicsTimerNotify::expireStatus::expireStatus +LIBCOM_API epicsTimerNotify::expireStatus::expireStatus ( restart_t restartIn, const double & expireDelaySec ) : delay ( expireDelaySec ) { @@ -163,13 +163,13 @@ extern "C" epicsTimerQueuePassiveId epicsStdCall } } -extern "C" void epicsStdCall +extern "C" void epicsStdCall epicsTimerQueuePassiveDestroy ( epicsTimerQueuePassiveId pQueue ) { pQueue->destroy (); } -extern "C" double epicsStdCall +extern "C" double epicsStdCall epicsTimerQueuePassiveProcess ( epicsTimerQueuePassiveId pQueue ) { try { @@ -191,7 +191,7 @@ extern "C" epicsTimerId epicsStdCall epicsTimerQueuePassiveCreateTimer ( } } -extern "C" LIBCOM_API void epicsStdCall epicsTimerQueuePassiveDestroyTimer ( +extern "C" LIBCOM_API void epicsStdCall epicsTimerQueuePassiveDestroyTimer ( epicsTimerQueuePassiveId /* pQueue */, epicsTimerId pTmr ) { pTmr->destroy (); @@ -240,7 +240,7 @@ extern "C" void epicsStdCall epicsTimerQueueShow ( pQueue->show ( level ); } -extern "C" void epicsStdCall epicsTimerQueueDestroyTimer ( +extern "C" void epicsStdCall epicsTimerQueueDestroyTimer ( epicsTimerQueueId /* pQueue */, epicsTimerId pTmr ) { pTmr->destroy (); diff --git a/modules/libcom/src/timer/epicsTimer.h b/modules/libcom/src/timer/epicsTimer.h index 6859ff4dc..36c3f9a49 100644 --- a/modules/libcom/src/timer/epicsTimer.h +++ b/modules/libcom/src/timer/epicsTimer.h @@ -137,14 +137,14 @@ typedef void ( *epicsTimerCallback ) ( void *pPrivate ); typedef struct epicsTimerQueueActiveForC * epicsTimerQueueId; LIBCOM_API epicsTimerQueueId epicsStdCall epicsTimerQueueAllocate ( int okToShare, unsigned int threadPriority ); -LIBCOM_API void epicsStdCall +LIBCOM_API void epicsStdCall epicsTimerQueueRelease ( epicsTimerQueueId ); -LIBCOM_API epicsTimerId epicsStdCall +LIBCOM_API epicsTimerId epicsStdCall epicsTimerQueueCreateTimer ( epicsTimerQueueId queueid, epicsTimerCallback callback, void *arg ); -LIBCOM_API void epicsStdCall +LIBCOM_API void epicsStdCall epicsTimerQueueDestroyTimer ( epicsTimerQueueId queueid, epicsTimerId id ); -LIBCOM_API void epicsStdCall +LIBCOM_API void epicsStdCall epicsTimerQueueShow ( epicsTimerQueueId id, unsigned int level ); /* passive timer queue */ @@ -154,28 +154,28 @@ typedef double ( * epicsTimerQueueNotifyQuantum ) ( void * pPrivate ); LIBCOM_API epicsTimerQueuePassiveId epicsStdCall epicsTimerQueuePassiveCreate ( epicsTimerQueueNotifyReschedule, epicsTimerQueueNotifyQuantum, void *pPrivate ); -LIBCOM_API void epicsStdCall +LIBCOM_API void epicsStdCall epicsTimerQueuePassiveDestroy ( epicsTimerQueuePassiveId ); -LIBCOM_API epicsTimerId epicsStdCall +LIBCOM_API epicsTimerId epicsStdCall epicsTimerQueuePassiveCreateTimer ( epicsTimerQueuePassiveId queueid, epicsTimerCallback pCallback, void *pArg ); -LIBCOM_API void epicsStdCall +LIBCOM_API void epicsStdCall epicsTimerQueuePassiveDestroyTimer ( epicsTimerQueuePassiveId queueid, epicsTimerId id ); -LIBCOM_API double epicsStdCall +LIBCOM_API double epicsStdCall epicsTimerQueuePassiveProcess ( epicsTimerQueuePassiveId ); -LIBCOM_API void epicsStdCall +LIBCOM_API void epicsStdCall epicsTimerQueuePassiveShow ( epicsTimerQueuePassiveId id, unsigned int level ); /* timer */ -LIBCOM_API void epicsStdCall +LIBCOM_API void epicsStdCall epicsTimerStartTime ( epicsTimerId id, const epicsTimeStamp *pTime ); -LIBCOM_API void epicsStdCall +LIBCOM_API void epicsStdCall epicsTimerStartDelay ( epicsTimerId id, double delaySeconds ); -LIBCOM_API void epicsStdCall +LIBCOM_API void epicsStdCall epicsTimerCancel ( epicsTimerId id ); -LIBCOM_API double epicsStdCall +LIBCOM_API double epicsStdCall epicsTimerGetExpireDelay ( epicsTimerId id ); -LIBCOM_API void epicsStdCall +LIBCOM_API void epicsStdCall epicsTimerShow ( epicsTimerId id, unsigned int level ); #ifdef __cplusplus diff --git a/modules/libcom/src/timer/timer.cpp b/modules/libcom/src/timer/timer.cpp index f7da1c476..4f3eac82c 100644 --- a/modules/libcom/src/timer/timer.cpp +++ b/modules/libcom/src/timer/timer.cpp @@ -132,7 +132,7 @@ void timer::privateStart ( epicsTimerNotify & notify, const epicsTime & expire ) debugPrintf ( ("Start of \"%s\" with delay %f at %p preempting %u\n", typeid ( this->pNotify ).name (), - expire - epicsTime::getCurrent (), + expire - epicsTime::getCurrent (), this, preemptCount ) ); } diff --git a/modules/libcom/test/Makefile b/modules/libcom/test/Makefile index 8c3da6928..3da2521c6 100644 --- a/modules/libcom/test/Makefile +++ b/modules/libcom/test/Makefile @@ -364,4 +364,5 @@ epicsLoadTest$(DEP): epicsInstallDir.h # use INSTALL_LOCATION instead of FINAL_LOCATION since test executables are not installed. epicsInstallDir.h: $(TOP)/configure/CONFIG_SITE* $(ECHO) "INSTALL_LOCATION=$(INSTALL_LOCATION)" - $(PERL) $(TOP)/modules/database/src/std/softIoc/makeInstallDir.pl "$(INSTALL_LOCATION)" > $@ + $(PERL) $(TOP)/modules/database/src/std/softIoc/makeInstallDir.pl "$(INSTALL_LOCATION)" > $@.stdout + $(MV) $@.stdout $@ diff --git a/modules/libcom/test/epicsStringTest.c b/modules/libcom/test/epicsStringTest.c index 1279a106d..2bb5ac7ed 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/modules/libcom/test/readlineTest.c b/modules/libcom/test/readlineTest.c index 5ce0c0627..66fe2555d 100644 --- a/modules/libcom/test/readlineTest.c +++ b/modules/libcom/test/readlineTest.c @@ -57,7 +57,7 @@ MAIN(readlineTest) if (!c || c == '#') { continue; } - + do { // expected strings are always single line strings if (! fgets(line_expect, 499, fp_expect)) { diff --git a/modules/libcom/vxWorks/boost/assert.hpp b/modules/libcom/vxWorks/boost/assert.hpp index 174f0846f..81f2016c9 100644 --- a/modules/libcom/vxWorks/boost/assert.hpp +++ b/modules/libcom/vxWorks/boost/assert.hpp @@ -89,9 +89,9 @@ namespace boost #endif namespace boost - { - namespace assertion - { + { + namespace assertion + { namespace detail { inline void assertion_failed_msg(char const * expr, char const * msg, char const * function, diff --git a/modules/libcom/vxWorks/boost/config.hpp b/modules/libcom/vxWorks/boost/config.hpp index f37585ebb..adfaf2a1f 100644 --- a/modules/libcom/vxWorks/boost/config.hpp +++ b/modules/libcom/vxWorks/boost/config.hpp @@ -1,8 +1,8 @@ // Boost config.hpp configuration header file ------------------------------// -// (C) Copyright John Maddock 2002. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright John Maddock 2002. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/libs/config for most recent version. diff --git a/modules/libcom/vxWorks/boost/config/auto_link.hpp b/modules/libcom/vxWorks/boost/config/auto_link.hpp index 21cab3023..8dd720bd1 100644 --- a/modules/libcom/vxWorks/boost/config/auto_link.hpp +++ b/modules/libcom/vxWorks/boost/config/auto_link.hpp @@ -400,7 +400,7 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y. #if defined(BOOST_LIB_NAME) # undef BOOST_LIB_NAME #endif -// Don't undef this one: it can be set by the user and should be the +// Don't undef this one: it can be set by the user and should be the // same for all libraries: //#if defined(BOOST_LIB_TOOLSET) //# undef BOOST_LIB_TOOLSET diff --git a/modules/libcom/vxWorks/boost/config/compiler/gcc.hpp b/modules/libcom/vxWorks/boost/config/compiler/gcc.hpp index c0ac30af2..a1c38dc40 100644 --- a/modules/libcom/vxWorks/boost/config/compiler/gcc.hpp +++ b/modules/libcom/vxWorks/boost/config/compiler/gcc.hpp @@ -1,12 +1,12 @@ -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright Darin Adler 2001 - 2002. -// (C) Copyright Jens Maurer 2001 - 2002. -// (C) Copyright Beman Dawes 2001 - 2003. -// (C) Copyright Douglas Gregor 2002. -// (C) Copyright David Abrahams 2002 - 2003. -// (C) Copyright Synge Todo 2003. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright John Maddock 2001 - 2003. +// (C) Copyright Darin Adler 2001 - 2002. +// (C) Copyright Jens Maurer 2001 - 2002. +// (C) Copyright Beman Dawes 2001 - 2003. +// (C) Copyright Douglas Gregor 2002. +// (C) Copyright David Abrahams 2002 - 2003. +// (C) Copyright Synge Todo 2003. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. @@ -97,7 +97,7 @@ // #if !defined(__MINGW32__) && !defined(linux) && !defined(__linux) && !defined(__linux__) # define BOOST_HAS_THREADS -#endif +#endif // // gcc has "long long" @@ -116,7 +116,7 @@ // #if __GNUC__ >= 4 # if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && !defined(__CYGWIN__) - // All Win32 development environments, including 64-bit Windows and MinGW, define + // All Win32 development environments, including 64-bit Windows and MinGW, define // _WIN32 or one of its variant spellings. Note that Cygwin is a POSIX environment, // so does not define _WIN32 or its variants. # define BOOST_HAS_DECLSPEC @@ -128,7 +128,7 @@ # endif # define BOOST_SYMBOL_VISIBLE __attribute__((visibility("default"))) #else -// config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined +// config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined # define BOOST_SYMBOL_EXPORT #endif @@ -169,7 +169,7 @@ # define BOOST_NO_CXX11_RVALUE_REFERENCES # define BOOST_NO_CXX11_STATIC_ASSERT -// Variadic templates compiler: +// Variadic templates compiler: // http://www.generic-programming.org/~dgregor/cpp/variadic-templates.html # if defined(__VARIADIC_TEMPLATES) || (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4) && defined(__GXX_EXPERIMENTAL_CXX0X__)) # define BOOST_HAS_VARIADIC_TMPL diff --git a/modules/libcom/vxWorks/boost/config/platform/vxworks.hpp b/modules/libcom/vxWorks/boost/config/platform/vxworks.hpp index 6ec5171e3..bf087d1f9 100644 --- a/modules/libcom/vxWorks/boost/config/platform/vxworks.hpp +++ b/modules/libcom/vxWorks/boost/config/platform/vxworks.hpp @@ -1,6 +1,6 @@ -// (C) Copyright Dustin Spicuzza 2009. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright Dustin Spicuzza 2009. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. @@ -28,4 +28,4 @@ // boilerplate code: #include - + diff --git a/modules/libcom/vxWorks/boost/config/posix_features.hpp b/modules/libcom/vxWorks/boost/config/posix_features.hpp index d12954797..7d8526842 100644 --- a/modules/libcom/vxWorks/boost/config/posix_features.hpp +++ b/modules/libcom/vxWorks/boost/config/posix_features.hpp @@ -1,6 +1,6 @@ -// (C) Copyright John Maddock 2001 - 2003. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright John Maddock 2001 - 2003. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/modules/libcom/vxWorks/boost/config/select_compiler_config.hpp b/modules/libcom/vxWorks/boost/config/select_compiler_config.hpp index 0d47b2542..aafd8eb44 100644 --- a/modules/libcom/vxWorks/boost/config/select_compiler_config.hpp +++ b/modules/libcom/vxWorks/boost/config/select_compiler_config.hpp @@ -1,6 +1,6 @@ // Boost compiler configuration selection header file -// (C) Copyright John Maddock 2001 - 2003. +// (C) Copyright John Maddock 2001 - 2003. // (C) Copyright Martin Wille 2003. // (C) Copyright Guillaume Melquiond 2003. // @@ -11,7 +11,7 @@ // See http://www.boost.org/ for most recent version. // locate which compiler we are using and define -// BOOST_COMPILER_CONFIG as needed: +// BOOST_COMPILER_CONFIG as needed: #if defined(__GCCXML__) // GCC-XML emulates other compilers, it has to appear first here! diff --git a/modules/libcom/vxWorks/boost/config/select_platform_config.hpp b/modules/libcom/vxWorks/boost/config/select_platform_config.hpp index 2af61d2d4..e3607b6f4 100644 --- a/modules/libcom/vxWorks/boost/config/select_platform_config.hpp +++ b/modules/libcom/vxWorks/boost/config/select_platform_config.hpp @@ -1,9 +1,9 @@ // Boost compiler configuration selection header file -// (C) Copyright John Maddock 2001 - 2002. -// (C) Copyright Jens Maurer 2001. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright John Maddock 2001 - 2002. +// (C) Copyright Jens Maurer 2001. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. @@ -65,17 +65,17 @@ // vxWorks: # define BOOST_PLATFORM_CONFIG "boost/config/platform/vxworks.hpp" -#elif defined(__SYMBIAN32__) -// Symbian: -# define BOOST_PLATFORM_CONFIG "boost/config/platform/symbian.hpp" +#elif defined(__SYMBIAN32__) +// Symbian: +# define BOOST_PLATFORM_CONFIG "boost/config/platform/symbian.hpp" #elif defined(_CRAYC) // Cray: -# define BOOST_PLATFORM_CONFIG "boost/config/platform/cray.hpp" +# define BOOST_PLATFORM_CONFIG "boost/config/platform/cray.hpp" -#elif defined(__VMS) +#elif defined(__VMS) // VMS: -# define BOOST_PLATFORM_CONFIG "boost/config/platform/vms.hpp" +# define BOOST_PLATFORM_CONFIG "boost/config/platform/vms.hpp" #else # if defined(unix) \ diff --git a/modules/libcom/vxWorks/boost/config/select_stdlib_config.hpp b/modules/libcom/vxWorks/boost/config/select_stdlib_config.hpp index 96ede0022..2c392924f 100644 --- a/modules/libcom/vxWorks/boost/config/select_stdlib_config.hpp +++ b/modules/libcom/vxWorks/boost/config/select_stdlib_config.hpp @@ -1,9 +1,9 @@ // Boost compiler configuration selection header file -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright Jens Maurer 2001 - 2002. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright John Maddock 2001 - 2003. +// (C) Copyright Jens Maurer 2001 - 2002. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -12,7 +12,7 @@ // locate which std lib we are using and define BOOST_STDLIB_CONFIG as needed: // First include to determine if some version of STLport is in use as the std lib -// (do not rely on this header being included since users can short-circuit this header +// (do not rely on this header being included since users can short-circuit this header // if they know whose std lib they are using.) #ifdef __cplusplus # include @@ -28,11 +28,11 @@ #else -// If our std lib was not some version of STLport, then include as it is about +// If our std lib was not some version of STLport, then include as it is about // the smallest of the std lib headers that includes real C++ stuff. (Some std libs do not // include their C++-related macros in so this additional include makes sure // we get those definitions) -// (again do not rely on this header being included since users can short-circuit this +// (again do not rely on this header being included since users can short-circuit this // header if they know whose std lib they are using.) #include diff --git a/modules/libcom/vxWorks/boost/config/stdlib/dinkumware.hpp b/modules/libcom/vxWorks/boost/config/stdlib/dinkumware.hpp index 305885177..380f9a6af 100644 --- a/modules/libcom/vxWorks/boost/config/stdlib/dinkumware.hpp +++ b/modules/libcom/vxWorks/boost/config/stdlib/dinkumware.hpp @@ -56,7 +56,7 @@ # ifndef _CPPLIB_VER // Updated Dinkum library defines this, and provides // its own min and max definitions, as does MTA version. -# ifndef __MTA__ +# ifndef __MTA__ # define BOOST_NO_STD_MIN_MAX # endif # define BOOST_NO_MS_INT64_NUMERIC_LIMITS @@ -64,7 +64,7 @@ #endif // -// std extension namespace is stdext for vc7.1 and later, +// std extension namespace is stdext for vc7.1 and later, // the same applies to other compilers that sit on top // of vc7.1 (Intel and Comeau): // @@ -87,9 +87,9 @@ #endif #include -#if ( (!_HAS_EXCEPTIONS && !defined(__ghs__)) || (!_HAS_NAMESPACE && defined(__ghs__)) ) -# define BOOST_NO_STD_TYPEINFO -#endif +#if ( (!_HAS_EXCEPTIONS && !defined(__ghs__)) || (!_HAS_NAMESPACE && defined(__ghs__)) ) +# define BOOST_NO_STD_TYPEINFO +#endif // C++0x headers implemented in 520 (as shipped by Microsoft) // diff --git a/modules/libcom/vxWorks/boost/config/suffix.hpp b/modules/libcom/vxWorks/boost/config/suffix.hpp index 83b167c0b..f403fa69a 100644 --- a/modules/libcom/vxWorks/boost/config/suffix.hpp +++ b/modules/libcom/vxWorks/boost/config/suffix.hpp @@ -4,7 +4,7 @@ // Copyright (c) 2001-2003 John Maddock // Copyright (c) 2001 Darin Adler // Copyright (c) 2001 Peter Dimov -// Copyright (c) 2002 Bill Kempf +// Copyright (c) 2002 Bill Kempf // Copyright (c) 2002 Jens Maurer // Copyright (c) 2002-2003 David Abrahams // Copyright (c) 2003 Gennaro Prota @@ -146,7 +146,7 @@ # endif // -// Without partial specialization, partial +// Without partial specialization, partial // specialization with default args won't work either: // # if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ @@ -632,7 +632,7 @@ namespace std{ using ::type_info; } // Set some default values GPU support // # ifndef BOOST_GPU_ENABLED -# define BOOST_GPU_ENABLED +# define BOOST_GPU_ENABLED # endif // BOOST_FORCEINLINE ---------------------------------------------// @@ -695,7 +695,7 @@ namespace std{ using ::type_info; } # define BOOST_NO_0X_HDR_FUTURE #endif -// Use BOOST_NO_CXX11_HDR_INITIALIZER_LIST +// Use BOOST_NO_CXX11_HDR_INITIALIZER_LIST // instead of BOOST_NO_0X_HDR_INITIALIZER_LIST or BOOST_NO_INITIALIZER_LISTS #ifdef BOOST_NO_CXX11_HDR_INITIALIZER_LIST # ifndef BOOST_NO_0X_HDR_INITIALIZER_LIST @@ -884,7 +884,7 @@ namespace std{ using ::type_info; } // // constexpr workarounds -// +// #if defined(BOOST_NO_CXX11_CONSTEXPR) #define BOOST_CONSTEXPR #define BOOST_CONSTEXPR_OR_CONST const diff --git a/modules/libcom/vxWorks/boost/config/user.hpp b/modules/libcom/vxWorks/boost/config/user.hpp index 5a4a9d477..3fa1e0de4 100644 --- a/modules/libcom/vxWorks/boost/config/user.hpp +++ b/modules/libcom/vxWorks/boost/config/user.hpp @@ -1,8 +1,8 @@ // boost/config/user.hpp ---------------------------------------------------// -// (C) Copyright John Maddock 2001. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright John Maddock 2001. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // Do not check in modified versions of this file, @@ -65,60 +65,60 @@ // even when available: // #define BOOST_DISABLE_WIN32 -// BOOST_DISABLE_ABI_HEADERS: Stops boost headers from including any -// prefix/suffix headers that normally control things like struct -// packing and alignment. +// BOOST_DISABLE_ABI_HEADERS: Stops boost headers from including any +// prefix/suffix headers that normally control things like struct +// packing and alignment. // #define BOOST_DISABLE_ABI_HEADERS // BOOST_ABI_PREFIX: A prefix header to include in place of whatever -// boost.config would normally select, any replacement should set up -// struct packing and alignment options as required. +// boost.config would normally select, any replacement should set up +// struct packing and alignment options as required. // #define BOOST_ABI_PREFIX my-header-name -// BOOST_ABI_SUFFIX: A suffix header to include in place of whatever -// boost.config would normally select, any replacement should undo -// the effects of the prefix header. +// BOOST_ABI_SUFFIX: A suffix header to include in place of whatever +// boost.config would normally select, any replacement should undo +// the effects of the prefix header. // #define BOOST_ABI_SUFFIX my-header-name -// BOOST_ALL_DYN_LINK: Forces all libraries that have separate source, -// to be linked as dll's rather than static libraries on Microsoft Windows -// (this macro is used to turn on __declspec(dllimport) modifiers, so that -// the compiler knows which symbols to look for in a dll rather than in a -// static library). Note that there may be some libraries that can only -// be statically linked (Boost.Test for example) and others which may only -// be dynamically linked (Boost.Threads for example), in these cases this +// BOOST_ALL_DYN_LINK: Forces all libraries that have separate source, +// to be linked as dll's rather than static libraries on Microsoft Windows +// (this macro is used to turn on __declspec(dllimport) modifiers, so that +// the compiler knows which symbols to look for in a dll rather than in a +// static library). Note that there may be some libraries that can only +// be statically linked (Boost.Test for example) and others which may only +// be dynamically linked (Boost.Threads for example), in these cases this // macro has no effect. // #define BOOST_ALL_DYN_LINK - -// BOOST_WHATEVER_DYN_LINK: Forces library "whatever" to be linked as a dll -// rather than a static library on Microsoft Windows: replace the WHATEVER -// part of the macro name with the name of the library that you want to -// dynamically link to, for example use BOOST_DATE_TIME_DYN_LINK or -// BOOST_REGEX_DYN_LINK etc (this macro is used to turn on __declspec(dllimport) -// modifiers, so that the compiler knows which symbols to look for in a dll -// rather than in a static library). -// Note that there may be some libraries that can only be statically linked -// (Boost.Test for example) and others which may only be dynamically linked + +// BOOST_WHATEVER_DYN_LINK: Forces library "whatever" to be linked as a dll +// rather than a static library on Microsoft Windows: replace the WHATEVER +// part of the macro name with the name of the library that you want to +// dynamically link to, for example use BOOST_DATE_TIME_DYN_LINK or +// BOOST_REGEX_DYN_LINK etc (this macro is used to turn on __declspec(dllimport) +// modifiers, so that the compiler knows which symbols to look for in a dll +// rather than in a static library). +// Note that there may be some libraries that can only be statically linked +// (Boost.Test for example) and others which may only be dynamically linked // (Boost.Threads for example), in these cases this macro is unsupported. // #define BOOST_WHATEVER_DYN_LINK - -// BOOST_ALL_NO_LIB: Tells the config system not to automatically select -// which libraries to link against. -// Normally if a compiler supports #pragma lib, then the correct library -// build variant will be automatically selected and linked against, -// simply by the act of including one of that library's headers. + +// BOOST_ALL_NO_LIB: Tells the config system not to automatically select +// which libraries to link against. +// Normally if a compiler supports #pragma lib, then the correct library +// build variant will be automatically selected and linked against, +// simply by the act of including one of that library's headers. // This macro turns that feature off. // #define BOOST_ALL_NO_LIB - -// BOOST_WHATEVER_NO_LIB: Tells the config system not to automatically -// select which library to link against for library "whatever", -// replace WHATEVER in the macro name with the name of the library; -// for example BOOST_DATE_TIME_NO_LIB or BOOST_REGEX_NO_LIB. -// Normally if a compiler supports #pragma lib, then the correct library -// build variant will be automatically selected and linked against, simply -// by the act of including one of that library's headers. This macro turns + +// BOOST_WHATEVER_NO_LIB: Tells the config system not to automatically +// select which library to link against for library "whatever", +// replace WHATEVER in the macro name with the name of the library; +// for example BOOST_DATE_TIME_NO_LIB or BOOST_REGEX_NO_LIB. +// Normally if a compiler supports #pragma lib, then the correct library +// build variant will be automatically selected and linked against, simply +// by the act of including one of that library's headers. This macro turns // that feature off. // #define BOOST_WHATEVER_NO_LIB - + diff --git a/modules/libcom/vxWorks/boost/detail/sp_typeinfo.hpp b/modules/libcom/vxWorks/boost/detail/sp_typeinfo.hpp index 43fae78ef..a0387bf11 100644 --- a/modules/libcom/vxWorks/boost/detail/sp_typeinfo.hpp +++ b/modules/libcom/vxWorks/boost/detail/sp_typeinfo.hpp @@ -75,8 +75,8 @@ template struct sp_typeid_ }; #if defined(__SUNPRO_CC) -// see #4199, the Sun Studio compiler gets confused about static initialization -// constructor arguments. But an assignment works just fine. +// see #4199, the Sun Studio compiler gets confused about static initialization +// constructor arguments. But an assignment works just fine. template sp_typeinfo sp_typeid_< T >::ti_ = sp_typeid_< T >::name(); #else template sp_typeinfo sp_typeid_< T >::ti_(sp_typeid_< T >::name()); diff --git a/modules/libcom/vxWorks/boost/detail/workaround.hpp b/modules/libcom/vxWorks/boost/detail/workaround.hpp index 40b3423b3..8e5648e82 100644 --- a/modules/libcom/vxWorks/boost/detail/workaround.hpp +++ b/modules/libcom/vxWorks/boost/detail/workaround.hpp @@ -20,8 +20,8 @@ // // (BOOST_MSVC) != 0 && (BOOST_MSVC) < 1300 // -// When used for workarounds that apply to the latest known version -// and all earlier versions of a compiler, the following convention +// When used for workarounds that apply to the latest known version +// and all earlier versions of a compiler, the following convention // should be observed: // // #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1301)) @@ -262,6 +262,6 @@ # define BOOST_WORKAROUND(symbol, test) 0 -# endif +# endif #endif // WORKAROUND_DWA2002126_HPP diff --git a/modules/libcom/vxWorks/boost/smart_ptr/detail/shared_count.hpp b/modules/libcom/vxWorks/boost/smart_ptr/detail/shared_count.hpp index f055fd0df..9d2b4079d 100644 --- a/modules/libcom/vxWorks/boost/smart_ptr/detail/shared_count.hpp +++ b/modules/libcom/vxWorks/boost/smart_ptr/detail/shared_count.hpp @@ -31,7 +31,7 @@ #include // In order to avoid circular dependencies with Boost.TR1 // we make sure that our include of doesn't try to -// pull in the TR1 headers: that's why we use this header +// pull in the TR1 headers: that's why we use this header // rather than including directly: #include // std::auto_ptr #include // std::less @@ -66,7 +66,7 @@ template< class D > struct sp_inplace_tag #if !defined( BOOST_NO_CXX11_SMART_PTR ) template< class T > class sp_reference_wrapper -{ +{ public: explicit sp_reference_wrapper( T & t): t_( boost::addressof( t ) ) @@ -337,7 +337,7 @@ public: r.release(); } -#endif +#endif #if !defined( BOOST_NO_CXX11_SMART_PTR ) diff --git a/modules/libcom/vxWorks/boost/smart_ptr/detail/sp_has_sync.hpp b/modules/libcom/vxWorks/boost/smart_ptr/detail/sp_has_sync.hpp index 16de21d37..51c868257 100644 --- a/modules/libcom/vxWorks/boost/smart_ptr/detail/sp_has_sync.hpp +++ b/modules/libcom/vxWorks/boost/smart_ptr/detail/sp_has_sync.hpp @@ -58,7 +58,7 @@ #undef BOOST_SP_HAS_SYNC #endif -#if defined(__PATHSCALE__) && ((__PATHCC__ == 4) && (__PATHCC_MINOR__ < 9)) +#if defined(__PATHSCALE__) && ((__PATHCC__ == 4) && (__PATHCC_MINOR__ < 9)) #undef BOOST_SP_HAS_SYNC #endif diff --git a/modules/libcom/vxWorks/boost/smart_ptr/detail/spinlock_pool.hpp b/modules/libcom/vxWorks/boost/smart_ptr/detail/spinlock_pool.hpp index f09d5c640..10ecd7de5 100644 --- a/modules/libcom/vxWorks/boost/smart_ptr/detail/spinlock_pool.hpp +++ b/modules/libcom/vxWorks/boost/smart_ptr/detail/spinlock_pool.hpp @@ -41,11 +41,11 @@ public: static spinlock & spinlock_for( void const * pv ) { -#if defined(__VMS) && __INITIAL_POINTER_SIZE == 64 +#if defined(__VMS) && __INITIAL_POINTER_SIZE == 64 std::size_t i = reinterpret_cast< unsigned long long >( pv ) % 41; -#else +#else std::size_t i = reinterpret_cast< std::size_t >( pv ) % 41; -#endif +#endif return pool_[ i ]; } @@ -74,14 +74,14 @@ public: template< int I > spinlock spinlock_pool< I >::pool_[ 41 ] = { - BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, - BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, - BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, - BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, - BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, - BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, - BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, - BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, + BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, + BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, + BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, + BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, + BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, + BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, + BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, + BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT, BOOST_DETAIL_SPINLOCK_INIT }; diff --git a/modules/libcom/vxWorks/boost/smart_ptr/shared_ptr.hpp b/modules/libcom/vxWorks/boost/smart_ptr/shared_ptr.hpp index d2781c158..407768a31 100644 --- a/modules/libcom/vxWorks/boost/smart_ptr/shared_ptr.hpp +++ b/modules/libcom/vxWorks/boost/smart_ptr/shared_ptr.hpp @@ -22,7 +22,7 @@ // In order to avoid circular dependencies with Boost.TR1 // we make sure that our include of doesn't try to -// pull in the TR1 headers: that's why we use this header +// pull in the TR1 headers: that's why we use this header // rather than including directly: #include // std::auto_ptr @@ -247,7 +247,7 @@ template< class T, class R > struct sp_enable_if_auto_ptr template< class T, class R > struct sp_enable_if_auto_ptr< std::auto_ptr< T >, R > { typedef R type; -}; +}; #endif @@ -639,21 +639,21 @@ public: { this_type( r, p ).swap( *this ); } - + // never throws (but has a BOOST_ASSERT in it, so not marked with BOOST_NOEXCEPT) typename boost::detail::sp_dereference< T >::type operator* () const { BOOST_ASSERT( px != 0 ); return *px; } - + // never throws (but has a BOOST_ASSERT in it, so not marked with BOOST_NOEXCEPT) - typename boost::detail::sp_member_access< T >::type operator-> () const + typename boost::detail::sp_member_access< T >::type operator-> () const { BOOST_ASSERT( px != 0 ); return px; } - + // never throws (but has a BOOST_ASSERT in it, so not marked with BOOST_NOEXCEPT) typename boost::detail::sp_array_access< T >::type operator[] ( std::ptrdiff_t i ) const { diff --git a/modules/libcom/vxWorks/boost/tr1/detail/config.hpp b/modules/libcom/vxWorks/boost/tr1/detail/config.hpp index 1b95148bb..73b935aef 100644 --- a/modules/libcom/vxWorks/boost/tr1/detail/config.hpp +++ b/modules/libcom/vxWorks/boost/tr1/detail/config.hpp @@ -9,8 +9,8 @@ #include #if (defined(__GNUC__) && !(defined(linux) || defined(__linux) || defined(__linux__))) \ - || (!defined(_AIX) && defined(__IBMCPP__) && (__IBMCPP__ >= 800)) - // Disable use of #include_next on Linux as typically we are installed in a + || (!defined(_AIX) && defined(__IBMCPP__) && (__IBMCPP__ >= 800)) + // Disable use of #include_next on Linux as typically we are installed in a // directory that is searched *after* the std lib include path. #if !defined(BOOST_HAS_INCLUDE_NEXT) # define BOOST_HAS_INCLUDE_NEXT diff --git a/modules/libcom/vxWorks/boost/type_traits/is_signed.hpp b/modules/libcom/vxWorks/boost/type_traits/is_signed.hpp index ba7d6e97c..e1c5f2059 100644 --- a/modules/libcom/vxWorks/boost/type_traits/is_signed.hpp +++ b/modules/libcom/vxWorks/boost/type_traits/is_signed.hpp @@ -1,5 +1,5 @@ -// (C) Copyright John Maddock 2005. +// (C) Copyright John Maddock 2005. // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt). @@ -69,10 +69,10 @@ struct is_signed_select_helper template struct is_signed_imp { - typedef is_signed_select_helper< + typedef is_signed_select_helper< ::boost::type_traits::ice_or< ::boost::is_integral::value, - ::boost::is_enum::value>::value + ::boost::is_enum::value>::value > selector; typedef typename selector::template rebind binder; typedef typename binder::type type; diff --git a/src/template/ext/makeBaseExt.pl b/src/template/ext/makeBaseExt.pl index 5b5a1df0a..1370b4393 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("$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"; + } } "$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 </bin//makeBaseExt.pl -t example example @@ -293,11 +293,11 @@ sub GetUser { # no args $user = $ENV{USER} || $ENV{USERNAME} || Win32::LoginName(); unless ($user) { - print "I cannot figure out your user name.\n"; - print "What shall you be called ?\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"); diff --git a/src/tools/cvsclean.pl b/src/tools/cvsclean.pl index e87f3c3f5..01e38d54d 100644 --- a/src/tools/cvsclean.pl +++ b/src/tools/cvsclean.pl @@ -6,7 +6,7 @@ # Operator of Los Alamos National Laboratory. # SPDX-License-Identifier: EPICS # EPICS Base is distributed subject to a Software License Agreement found -# in the file LICENSE that is included with this distribution. +# in the file LICENSE that is included with this distribution. #************************************************************************* # Find and delete cvs .#* and editor backup *~ diff --git a/src/tools/dos2unix.pl b/src/tools/dos2unix.pl index cae9e6393..e60a44aa9 100644 --- a/src/tools/dos2unix.pl +++ b/src/tools/dos2unix.pl @@ -6,7 +6,7 @@ # Operator of Los Alamos National Laboratory. # SPDX-License-Identifier: EPICS # 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. #************************************************************************* # Converts text file in DOS CR/LF format to unix ISO format diff --git a/src/tools/installEpics.pl b/src/tools/installEpics.pl index c41cc6f91..ba08c74d9 100644 --- a/src/tools/installEpics.pl +++ b/src/tools/installEpics.pl @@ -6,7 +6,7 @@ # Operator of Los Alamos National Laboratory. # SPDX-License-Identifier: EPICS # 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. #************************************************************************* # # InstallEpics.pl diff --git a/src/tools/makeMakefile.pl b/src/tools/makeMakefile.pl index 615e356d1..ceee48462 100644 --- a/src/tools/makeMakefile.pl +++ b/src/tools/makeMakefile.pl @@ -6,7 +6,7 @@ # Operator of Los Alamos National Laboratory. # SPDX-License-Identifier: EPICS # 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. #************************************************************************* # # makeMakefile.pl diff --git a/src/tools/mkmf.pl b/src/tools/mkmf.pl index 00483a2f1..44f30cb71 100644 --- a/src/tools/mkmf.pl +++ b/src/tools/mkmf.pl @@ -7,7 +7,7 @@ # Operator of Los Alamos National Laboratory. # SPDX-License-Identifier: EPICS # 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. #************************************************************************* #----------------------------------------------------------------------- # mkmf.pl: Perl script to create #include file dependencies @@ -72,9 +72,9 @@ print "\n ALL DONE \n\n" if $debug; #---------------------------------------- sub printList{ - my $depFile = shift; - my $objFile = shift; - my $file; + my $depFile = shift; + my $objFile = shift; + my $file; unlink($depFile) or die "Can't delete $depFile: $!\n" if -f $depFile; @@ -103,7 +103,7 @@ sub scanFile { foreach $line ( ) { $incfile = findNextIncName($line,$file=~/\.substitutions$/); next if !$incfile; - next if $output{$incfile}; + next if $output{$incfile}; push @includes,$incfile; $output{$incfile} = 1; } diff --git a/src/tools/munch.pl b/src/tools/munch.pl index 31d814990..134c824fe 100644 --- a/src/tools/munch.pl +++ b/src/tools/munch.pl @@ -6,7 +6,7 @@ # Operator of Los Alamos National Laboratory. # SPDX-License-Identifier: EPICS # EPICS BASE is distributed subject to a Software License Agreement found -# in the file LICENSE that is included with this distribution. +# in the file LICENSE that is included with this distribution. #************************************************************************* use strict; diff --git a/src/tools/replaceVAR.pl b/src/tools/replaceVAR.pl index 7dd75aef4..63b34c87a 100644 --- a/src/tools/replaceVAR.pl +++ b/src/tools/replaceVAR.pl @@ -6,7 +6,7 @@ # Operator of Los Alamos National Laboratory. # SPDX-License-Identifier: EPICS # 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. #************************************************************************* # Called from within the object directory diff --git a/src/tools/tap-to-junit-xml.pl b/src/tools/tap-to-junit-xml.pl index cbe9ed13b..110d039e8 100644 --- a/src/tools/tap-to-junit-xml.pl +++ b/src/tools/tap-to-junit-xml.pl @@ -57,7 +57,7 @@ will display it (neither has an effect when --puretap is specified). Pod::Usage TAP::Parser Time::HiRes - XML::Generator + XML::Generator =head1 BUGS @@ -194,7 +194,7 @@ exit; sub _get_junit_xml { my ( $xmlgen, $properties, $test_results ) = @_; - my $xml = "\n" . + my $xml = "\n" . $xmlgen->testsuites({ name => $suite_name, }, @$test_results); @@ -439,13 +439,13 @@ sub _parse_tests { push @{$ctx->{test_cases}}, $xmlgen->testcase($test_case); } } - + $ctx->{sysout} .= $s."\n"; } if (scalar(@{$ctx->{test_cases}}) == 0 && scalar(@{$ctx->{testsuites}}) == 0) - { + { # no tests found! create a block containing *something* at least $ctx->{case_tests}++; my $test_case = {