From 2ea0994507e748eb0cf5df166d3ff4ad12be4ec2 Mon Sep 17 00:00:00 2001 From: Jack Harper Date: Tue, 9 Mar 2021 13:04:57 +0000 Subject: [PATCH 1/8] tests passing --- src/libCom/osi/os/WIN32/osdStrtod.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/libCom/osi/os/WIN32/osdStrtod.h b/src/libCom/osi/os/WIN32/osdStrtod.h index 4edb444ee..9a2e8d75e 100644 --- a/src/libCom/osi/os/WIN32/osdStrtod.h +++ b/src/libCom/osi/os/WIN32/osdStrtod.h @@ -13,10 +13,6 @@ extern "C" { #endif -/* - * epicsStrtod() for systems with broken strtod() routine - */ -epicsShareFunc double epicsStrtod(const char *str, char **endp); /* * Microsoft apparently added strto[u]ll() in VS2013 @@ -28,6 +24,15 @@ epicsShareFunc double epicsStrtod(const char *str, char **endp); # define strtoull _strtoui64 #endif +#if (_MSC_VER < 1800) && defined(_MINGW) +/* + * epicsStrtod() for systems with broken strtod() routine + */ +epicsShareFunc double epicsStrtod(const char *str, char **endp); +#else +# define epicsStrtod strtod +#endif + #ifdef __cplusplus } #endif From 30172226f9ea5a413526749cd24f812e19817634 Mon Sep 17 00:00:00 2001 From: Jack Harper Date: Tue, 9 Mar 2021 13:13:16 +0000 Subject: [PATCH 2/8] whoops, MSVC 1900 not 1800 --- src/libCom/osi/os/WIN32/osdStrtod.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libCom/osi/os/WIN32/osdStrtod.h b/src/libCom/osi/os/WIN32/osdStrtod.h index 9a2e8d75e..a7df57002 100644 --- a/src/libCom/osi/os/WIN32/osdStrtod.h +++ b/src/libCom/osi/os/WIN32/osdStrtod.h @@ -24,7 +24,11 @@ extern "C" { # define strtoull _strtoui64 #endif -#if (_MSC_VER < 1800) && defined(_MINGW) +/* + * strtod works in MSVC 1900 and mingw, use + * the OS version in those and our own otherwise + */ +#if (_MSC_VER < 1900) && !defined(_MINGW) /* * epicsStrtod() for systems with broken strtod() routine */ From 6ac10d43b1bc3f8ae475abd448a6c62bdb12f158 Mon Sep 17 00:00:00 2001 From: Gabriel Fedel Date: Wed, 10 Mar 2021 09:42:56 +0100 Subject: [PATCH 3/8] Fix type comparision on msi.cpp This change fix the comparision of different signedess (int and long unsigned int). --- src/ioc/dbtemplate/msi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ioc/dbtemplate/msi.cpp b/src/ioc/dbtemplate/msi.cpp index 462869cb3..34afaabd5 100644 --- a/src/ioc/dbtemplate/msi.cpp +++ b/src/ioc/dbtemplate/msi.cpp @@ -300,7 +300,7 @@ static void makeSubstitutions(inputData * const inputPvt, char *pstart; char *pend; int cmdind=-1; - int i; + long unsigned int i; for (i = 0; i < NELEMENTS(cmdNames); i++) { if (strstr(command, cmdNames[i])) { From 8e7702c8a569b212ffd5df44a430384e3ec37fc3 Mon Sep 17 00:00:00 2001 From: Freddie Akeroyd Date: Wed, 10 Mar 2021 11:29:45 +0000 Subject: [PATCH 4/8] Use epicsStrtod, remove some warnings --- src/libCom/yajl/yajl_parser.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libCom/yajl/yajl_parser.c b/src/libCom/yajl/yajl_parser.c index bbcf80880..b57b1b40d 100644 --- a/src/libCom/yajl/yajl_parser.c +++ b/src/libCom/yajl/yajl_parser.c @@ -45,6 +45,8 @@ #include "yajl_encode.h" #include "yajl_bytestack.h" +#include + unsigned char * yajl_render_error_string(yajl_handle hand, const unsigned char * jsonText, unsigned int jsonTextLen, int verbose) @@ -67,14 +69,14 @@ yajl_render_error_string(yajl_handle hand, const unsigned char * jsonText, } { - unsigned int memneeded = 0; + size_t memneeded = 0; memneeded += strlen(errorType); memneeded += strlen(" error"); if (errorText != NULL) { memneeded += strlen(": "); memneeded += strlen(errorText); } - str = (unsigned char *) YA_MALLOC(&(hand->alloc), memneeded + 2); + str = (unsigned char *) YA_MALLOC(&(hand->alloc), (unsigned int)(memneeded + 2)); str[0] = 0; strcat((char *) str, errorType); strcat((char *) str, " error"); @@ -263,7 +265,7 @@ yajl_do_parse(yajl_handle hand, const unsigned char * jsonText, yajl_buf_clear(hand->decodeBuf); yajl_buf_append(hand->decodeBuf, buf, bufLen); buf = yajl_buf_data(hand->decodeBuf); - d = strtod((char *) buf, NULL); + d = epicsStrtod((char *) buf, NULL); if ((d == HUGE_VAL || d == -HUGE_VAL) && errno == ERANGE) { From 0bc2a3e99930974199940b0d50e2c92401c980d3 Mon Sep 17 00:00:00 2001 From: Gabriel Fedel Date: Wed, 10 Mar 2021 14:37:14 +0100 Subject: [PATCH 5/8] Fix variable type and cast on msi.cpp This way the attribution of i to cmdind is a valid value. --- src/ioc/dbtemplate/msi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ioc/dbtemplate/msi.cpp b/src/ioc/dbtemplate/msi.cpp index 34afaabd5..6b899830f 100644 --- a/src/ioc/dbtemplate/msi.cpp +++ b/src/ioc/dbtemplate/msi.cpp @@ -300,11 +300,11 @@ static void makeSubstitutions(inputData * const inputPvt, char *pstart; char *pend; int cmdind=-1; - long unsigned int i; + size_t i; for (i = 0; i < NELEMENTS(cmdNames); i++) { if (strstr(command, cmdNames[i])) { - cmdind = i; + cmdind = (int)i; } } if (cmdind < 0) goto endcmd; From c359b49aedbbb2e91c1c5e6c38904ee1a3d7363f Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 10 Mar 2021 22:05:39 -0600 Subject: [PATCH 6/8] Fix the 3.15 'make inc' build target Now generates and installs dbd, header and html files. No compilation involved/required. --- configure/RULES.Db | 3 ++- configure/RULES_BUILD | 6 ++++-- configure/RULES_TOP | 2 +- src/ioc/bpt/Makefile | 3 +++ src/tools/Makefile | 2 ++ 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/configure/RULES.Db b/configure/RULES.Db index 8c5d99ed7..7cf50322b 100644 --- a/configure/RULES.Db +++ b/configure/RULES.Db @@ -187,7 +187,8 @@ endif ##################################################### build dependancies, clean rule -inc : $(COMMON_INC) $(INSTALL_INC) +inc : $(COMMON_INC) $(INSTALL_INC) $(COMMON_DBDS) $(COMMON_DBDCATS) \ + $(INSTALL_DBDS) $(INSTALL_DBD_INSTALLS) build : $(COMMON_DBDS) $(COMMON_DBS) $(COMMON_DBDCATS) \ $(INSTALL_DBDS) $(INSTALL_DBS) \ diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index 3dcbcaa74..96603d26b 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -93,10 +93,12 @@ include $(CONFIG)/RULES_TARGET #--------------------------------------------------------------- # Read dependency files +ifneq (inc,$(strip $(MAKECMDGOALS))) ifneq (,$(strip $(HDEPENDS_FILES))) $(filter-out $(wildcard *$(DEP)), $(HDEPENDS_FILES)): | $(COMMON_INC) -include $(HDEPENDS_FILES) endif +endif #--------------------------------------------------------------- # Products and Object libraries @@ -144,14 +146,14 @@ build: inc build: $(OBJSNAME) $(LIBTARGETS) $(PRODTARGETS) $(TESTPRODTARGETS) \ $(TARGETS) $(TESTSCRIPTS) $(INSTALL_LIB_INSTALLS) -inc : $(COMMON_INC) $(INSTALL_INC) $(INSTALL_CONFIGS) +inc : $(COMMON_INC) $(INSTALL_INC) $(INSTALL_CONFIGS) \ + $(INSTALL_HTMLS) buildInstall : \ $(INSTALL_SCRIPTS) $(INSTALL_PROD) $(INSTALL_MUNCHS) \ $(INSTALL_TCLLIBS) $(INSTALL_TCLINDEX) \ $(INSTALL_OBJS) \ $(INSTALL_DOCS) \ - $(INSTALL_HTMLS) \ $(INSTALL_TEMPLATE) \ $(INSTALL_BIN_INSTALLS) diff --git a/configure/RULES_TOP b/configure/RULES_TOP index abcd75cb8..012d7f9ad 100644 --- a/configure/RULES_TOP +++ b/configure/RULES_TOP @@ -45,7 +45,7 @@ help: @echo "Usage: gnumake [options] [target] ..." @echo "Targets supported by all Makefiles:" @echo " all - Same as install (default rule)" - @echo " inc - Installs header files" + @echo " inc - Installs header, dbd and html files" @echo " build - Builds and installs all targets" @echo " install - Builds and installs all targets" @echo " buildInstall - Same as install (deprecated)" diff --git a/src/ioc/bpt/Makefile b/src/ioc/bpt/Makefile index b8d73345f..d6367bfe3 100644 --- a/src/ioc/bpt/Makefile +++ b/src/ioc/bpt/Makefile @@ -19,7 +19,10 @@ BPT_DBD += bptTypeJdegC.dbd BPT_DBD += bptTypeJdegF.dbd BPT_DBD += bptTypeKdegC.dbd BPT_DBD += bptTypeKdegF.dbd + +ifneq (inc,$(strip $(MAKECMDGOALS))) DBD += $(BPT_DBD) +endif PROD_HOST += makeBpt diff --git a/src/tools/Makefile b/src/tools/Makefile index faa08abbf..1d9991d2b 100644 --- a/src/tools/Makefile +++ b/src/tools/Makefile @@ -86,6 +86,8 @@ CLEANS += epics-base-$(T_A).pc@ include $(TOP)/configure/RULES +inc: $(INSTALLS_PERL_MODULES) $(INSTALL_SCRIPTS) + epics-base-$(T_A).pc@: ../epics-base-arch.pc@ @$(RM) $@ @$(CP) $< $@ From 3c7fb7990f3558948a4a418bceafed412f29cb6b Mon Sep 17 00:00:00 2001 From: Freddie Akeroyd Date: Thu, 11 Mar 2021 15:08:00 +0000 Subject: [PATCH 7/8] Use --- src/libCom/yajl/yajl_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libCom/yajl/yajl_parser.c b/src/libCom/yajl/yajl_parser.c index b57b1b40d..7a27f29d8 100644 --- a/src/libCom/yajl/yajl_parser.c +++ b/src/libCom/yajl/yajl_parser.c @@ -45,7 +45,7 @@ #include "yajl_encode.h" #include "yajl_bytestack.h" -#include +#include unsigned char * yajl_render_error_string(yajl_handle hand, const unsigned char * jsonText, From b2f7f4e173c7d4206744a5ad1bd2620e06808a76 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 11 Mar 2021 18:13:44 -0600 Subject: [PATCH 8/8] Minor fixes in configure/RULES files --- configure/RULES.Db | 2 +- configure/RULES_BUILD | 5 +++-- configure/RULES_TARGET | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configure/RULES.Db b/configure/RULES.Db index 8c5d99ed7..61b548386 100644 --- a/configure/RULES.Db +++ b/configure/RULES.Db @@ -159,7 +159,7 @@ cleanArchTargets = $(foreach arch,$(BUILD_ARCHS), clean$(DIVIDER)$(arch)) -include $(TOP)/configure/CONFIG_APP_INCLUDE all: install -ifeq ($(EPICS_HOST_ARCH),$T_A) +ifeq ($(EPICS_HOST_ARCH),$(T_A)) host: install else # Do nothing diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index 3dcbcaa74..13428d846 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -86,9 +86,10 @@ endif #--------------------------------------------------------------- # Include defines and rules for prod, library and test* targets -#ifneq (,$(strip $(PROD) $(TESTPROD) $(LIBRARY) $(TESTLIBRARY) $(LOADABLE_LIBRARY) )) +ifneq (,$(strip $(PROD) $(TESTPROD) $(LIBRARY) $(TESTLIBRARY) \ + $(LOADABLE_LIBRARY))) include $(CONFIG)/RULES_TARGET -#endif +endif #--------------------------------------------------------------- # Read dependency files diff --git a/configure/RULES_TARGET b/configure/RULES_TARGET index 4e9cb6e05..ece7e10bc 100644 --- a/configure/RULES_TARGET +++ b/configure/RULES_TARGET @@ -26,7 +26,6 @@ $(foreach target, $(PROD) $(TESTPROD) $(LIBRARY) $(TESTLIBRARY) $(LOADABLE_LIBRA #----------------------------------------------------------------------- -# This define block requires GNU make 3.81 define PROD_template ifeq ($$(strip $$($(1)_OBJS) $$($(1)_SRCS) $$(PRODUCT_OBJS)),) $(1)_OBJS = $(1)$$(OBJ)