diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile.in | 104 | ||||
| -rw-r--r-- | src/string.c | 16 | ||||
| -rw-r--r-- | src/tc-compile.c | 1 | ||||
| -rw-r--r-- | src/tc-string.c | 10 | ||||
| -rw-r--r-- | src/tx-compile.cpp | 1 | 
5 files changed, 88 insertions, 44 deletions
diff --git a/src/Makefile.in b/src/Makefile.in index 0ad4cde..0768775 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.5 from Makefile.am. +# Makefile.in generated by automake 1.17 from Makefile.am.  # @configure_input@ -# Copyright (C) 1994-2021 Free Software Foundation, Inc. +# Copyright (C) 1994-2024 Free Software Foundation, Inc.  # This Makefile.in is free software; the Free Software Foundation  # gives unlimited permission to copy and/or distribute it, @@ -72,6 +72,8 @@ am__make_running_with_option = \    test $$has_opt = yes  am__make_dryrun = (target_option=n; $(am__make_running_with_option))  am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +am__rm_f = rm -f $(am__rm_f_notfound) +am__rm_rf = rm -rf $(am__rm_f_notfound)  pkgdatadir = $(datadir)/@PACKAGE@  pkgincludedir = $(includedir)/@PACKAGE@  pkglibdir = $(libdir)/@PACKAGE@ @@ -155,10 +157,9 @@ am__base_list = \    sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \    sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'  am__uninstall_files_from_dir = { \ -  test -z "$$files" \ -    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ -    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ -         $(am__cd) "$$dir" && rm -f $$files; }; \ +  { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ +  || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ +       $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \    }  am__installdirs = "$(DESTDIR)$(libdir)"  LTLIBRARIES = $(lib_LTLIBRARIES) @@ -556,6 +557,7 @@ am__sh_e_setup = case $$- in *e*) set +e;; esac  # Default flags passed to test drivers.  am__common_driver_flags = \    --color-tests "$$am__color_tests" \ +  $$am__collect_skipped_logs \    --enable-hard-errors "$$am__enable_hard_errors" \    --expect-failure "$$am__expect_failure"  # To be inserted before the command running the test.  Creates the @@ -580,6 +582,11 @@ if test -f "./$$f"; then dir=./;			\  elif test -f "$$f"; then dir=;				\  else dir="$(srcdir)/"; fi;				\  tst=$$dir$$f; log='$@'; 				\ +if test -n '$(IGNORE_SKIPPED_LOGS)'; then		\ +  am__collect_skipped_logs='--collect-skipped-logs no';	\ +else							\ +  am__collect_skipped_logs='';				\ +fi;							\  if test -n '$(DISABLE_HARD_ERRORS)'; then		\    am__enable_hard_errors=no; 				\  else							\ @@ -712,8 +719,10 @@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@  am__include = @am__include@  am__leading_dot = @am__leading_dot@  am__quote = @am__quote@ +am__rm_f_notfound = @am__rm_f_notfound@  am__tar = @am__tar@  am__untar = @am__untar@ +am__xargs_n = @am__xargs_n@  bindir = @bindir@  build = @build@  build_alias = @build_alias@ @@ -865,13 +874,8 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)  $(am__aclocal_m4_deps):  clean-checkPROGRAMS: -	@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ -	echo " rm -f" $$list; \ -	rm -f $$list || exit $$?; \ -	test -n "$(EXEEXT)" || exit 0; \ -	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ -	echo " rm -f" $$list; \ -	rm -f $$list +	$(am__rm_f) $(check_PROGRAMS) +	test -z "$(EXEEXT)" || $(am__rm_f) $(check_PROGRAMS:$(EXEEXT)=)  install-libLTLIBRARIES: $(lib_LTLIBRARIES)  	@$(NORMAL_INSTALL) @@ -898,15 +902,13 @@ uninstall-libLTLIBRARIES:  	done  clean-libLTLIBRARIES: -	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) +	-$(am__rm_f) $(lib_LTLIBRARIES)  	@list='$(lib_LTLIBRARIES)'; \  	locs=`for p in $$list; do echo $$p; done | \  	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \  	      sort -u`; \ -	test -z "$$locs" || { \ -	  echo rm -f $${locs}; \ -	  rm -f $${locs}; \ -	} +	echo rm -f $${locs}; \ +	$(am__rm_f) $${locs}  libHX.la: $(libHX_la_OBJECTS) $(libHX_la_DEPENDENCIES) $(EXTRA_libHX_la_DEPENDENCIES)   	$(AM_V_CCLD)$(libHX_la_LINK) -rpath $(libdir) $(libHX_la_OBJECTS) $(libHX_la_LIBADD) $(LIBS) @@ -1130,7 +1132,7 @@ distclean-compile:  $(am__depfiles_remade):  	@$(MKDIR_P) $(@D) -	@echo '# dummy' >$@-t && $(am__mv) $@-t $@ +	@: >>$@  am--depfiles: $(am__depfiles_remade) @@ -1295,7 +1297,6 @@ distclean-tags:  am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)  am--force-recheck:  	@: -  $(TEST_SUITE_LOG): $(TEST_LOGS)  	@$(am__set_TESTS_bases); \  	am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ @@ -1371,10 +1372,37 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)  	  result_count $$1 "XPASS:" $$xpass "$$red"; \  	  result_count $$1 "ERROR:" $$error "$$mgn"; \  	}; \ +	output_system_information () \ +	{ \ +          echo;                                     \ +	  { uname -a | $(AWK) '{                    \ +  printf "System information (uname -a):";          \ +  for (i = 1; i < NF; ++i)                          \ +    {                                               \ +      if (i != 2)                                   \ +        printf " %s", $$i;                          \ +    }                                               \ +  printf "\n";                                      \ +}'; } 2>&1;                                         \ +	  if test -r /etc/os-release; then          \ +	    echo "Distribution information (/etc/os-release):"; \ +	    sed 8q /etc/os-release;                 \ +	  elif test -r /etc/issue; then             \ +	    echo "Distribution information (/etc/issue):";      \ +	    cat /etc/issue;                         \ +	  fi;                                       \ +	}; \ +	please_report () \ +	{ \ +echo "Some test(s) failed.  Please report this to $(PACKAGE_BUGREPORT),";    \ +echo "together with the test-suite.log file (gzipped) and your system";      \ +echo "information.  Thanks.";                                                \ +	}; \  	{								\  	  echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" |	\  	    $(am__rst_title);						\  	  create_testsuite_report --no-color;				\ +	  output_system_information;                                    \  	  echo;								\  	  echo ".. contents:: :depth: 2";				\  	  echo;								\ @@ -1394,26 +1422,25 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)  	create_testsuite_report --maybe-color;				\  	echo "$$col$$br$$std";						\  	if $$success; then :; else					\ -	  echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}";		\ +	  echo "$${col}See $(subdir)/$(TEST_SUITE_LOG) for debugging.$${std}";\  	  if test -n "$(PACKAGE_BUGREPORT)"; then			\ -	    echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}";	\ +	    please_report | sed -e "s/^/$${col}/" -e s/'$$'/"$${std}"/; \  	  fi;								\  	  echo "$$col$$br$$std";					\  	fi;								\  	$$success || exit 1  check-TESTS: $(check_PROGRAMS) -	@list='$(RECHECK_LOGS)';           test -z "$$list" || rm -f $$list -	@list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list -	@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) +	@$(am__rm_f) $(RECHECK_LOGS) +	@$(am__rm_f) $(RECHECK_LOGS:.log=.trs) +	@$(am__rm_f) $(TEST_SUITE_LOG)  	@set +e; $(am__set_TESTS_bases); \  	log_list=`for i in $$bases; do echo $$i.log; done`; \ -	trs_list=`for i in $$bases; do echo $$i.trs; done`; \ -	log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ +	log_list=`echo $$log_list`; \  	$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \  	exit $$?;  recheck: all $(check_PROGRAMS) -	@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) +	@$(am__rm_f) $(TEST_SUITE_LOG)  	@set +e; $(am__set_TESTS_bases); \  	bases=`for i in $$bases; do echo $$i; done \  	         | $(am__list_recheck_tests)` || exit 1; \ @@ -1550,15 +1577,15 @@ install-strip:  	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \  	fi  mostlyclean-generic: -	-test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -	-test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -	-test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) +	-$(am__rm_f) $(TEST_LOGS) +	-$(am__rm_f) $(TEST_LOGS:.log=.trs) +	-$(am__rm_f) $(TEST_SUITE_LOG)  clean-generic:  distclean-generic: -	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) +	-$(am__rm_f) $(CONFIG_CLEAN_FILES) +	-test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES)  maintainer-clean-generic:  	@echo "This command is intended for maintainers to use" @@ -1569,7 +1596,7 @@ clean-am: clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \  	clean-libtool mostlyclean-am  distclean: distclean-am -		-rm -f ./$(DEPDIR)/deque.Plo +	-rm -f ./$(DEPDIR)/deque.Plo  	-rm -f ./$(DEPDIR)/dl.Plo  	-rm -f ./$(DEPDIR)/format.Plo  	-rm -f ./$(DEPDIR)/io.Plo @@ -1668,7 +1695,7 @@ install-ps-am:  installcheck-am:  maintainer-clean: maintainer-clean-am -		-rm -f ./$(DEPDIR)/deque.Plo +	-rm -f ./$(DEPDIR)/deque.Plo  	-rm -f ./$(DEPDIR)/dl.Plo  	-rm -f ./$(DEPDIR)/format.Plo  	-rm -f ./$(DEPDIR)/io.Plo @@ -1764,3 +1791,10 @@ uninstall-am: uninstall-libLTLIBRARIES  # Tell versions [3.59,3.63) of GNU make to not export all variables.  # Otherwise a system limit (for SysV at least) may be exceeded.  .NOEXPORT: + +# Tell GNU make to disable its built-in pattern rules. +%:: %,v +%:: RCS/%,v +%:: RCS/% +%:: s.% +%:: SCCS/s.% diff --git a/src/string.c b/src/string.c index e468063..3a85fa8 100644 --- a/src/string.c +++ b/src/string.c @@ -41,7 +41,7 @@ struct HX_quote_rule {  	const char *chars;  }; -static const char HX_hexenc[16] = "0123456789ABCDEF"; +static const char HX_hexenc[] = "0123456789ABCDEF";  EXPORT_SYMBOL char *HX_basename(const char *s)  { @@ -1175,7 +1175,7 @@ EXPORT_SYMBOL unsigned long long HX_strtoull_nsec(const char *s, char **out_end)  EXPORT_SYMBOL char *HX_unit_seconds(char *out, size_t outsize,      unsigned long long secs, unsigned int flags)  { -	unsigned long years = 0, months = 0, weeks = 0, days, hours, mins; +	unsigned long long years = 0, months = 0, weeks = 0, days, hours, mins;  	char buf[HXSIZEOF_Z64+4];  	if (flags & HXUNIT_YEARS) {  		years = secs / SECONDS_PER_YEAR; @@ -1197,31 +1197,31 @@ EXPORT_SYMBOL char *HX_unit_seconds(char *out, size_t outsize,  	secs %= 60;  	*out = '\0';  	if (years > 0) { -		snprintf(buf, ARRAY_SIZE(buf), "%luy", years); +		snprintf(buf, ARRAY_SIZE(buf), "%lluy", years);  		HX_strlcat(out, buf, outsize);  	}  	if (months == 1) {  		HX_strlcat(out, "1month", outsize);  	} else if (months > 0) { -		snprintf(buf, ARRAY_SIZE(buf), "%lumonths", months); +		snprintf(buf, ARRAY_SIZE(buf), "%llumonths", months);  		HX_strlcat(out, buf, outsize);  	}  	if (weeks == 1) {  		HX_strlcat(out, "1week", outsize);  	} else if (weeks > 0) { -		snprintf(buf, ARRAY_SIZE(buf), "%luweeks", weeks); +		snprintf(buf, ARRAY_SIZE(buf), "%lluweeks", weeks);  		HX_strlcat(out, buf, outsize);  	}  	if (days > 0) { -		snprintf(buf, ARRAY_SIZE(buf), "%lud", days); +		snprintf(buf, ARRAY_SIZE(buf), "%llud", days);  		HX_strlcat(out, buf, outsize);  	}  	if (hours > 0) { -		snprintf(buf, ARRAY_SIZE(buf), "%luh", hours); +		snprintf(buf, ARRAY_SIZE(buf), "%lluh", hours);  		HX_strlcat(out, buf, outsize);  	}  	if (mins > 0) { -		snprintf(buf, ARRAY_SIZE(buf), "%lumin", mins); +		snprintf(buf, ARRAY_SIZE(buf), "%llumin", mins);  		HX_strlcat(out, buf, outsize);  	}  	if (secs > 0 || diff --git a/src/tc-compile.c b/src/tc-compile.c index d60ff21..b3f3b0e 100644 --- a/src/tc-compile.c +++ b/src/tc-compile.c @@ -5,6 +5,7 @@  #	include <cstdlib>  #endif  #include <libHX.h> +#include <libHX/endian.h>  #define ZZ 64 diff --git a/src/tc-string.c b/src/tc-string.c index e7f90c2..d777268 100644 --- a/src/tc-string.c +++ b/src/tc-string.c @@ -355,8 +355,16 @@ static int t_time_units(void)  	static const struct {  		unsigned long long input;  		unsigned int flags; -		const char expect_out[24]; +		const char expect_out[41];  	} vt[] = { +#define SECONDS_PER_YEAR 31557600 /* 365.25 days */ +#define SECONDS_PER_MONTH 2629800 /* 1/12th of that year = 30.4375 days */ +		{18446744073709551615ULL, 0, "213503982334601d7h15s"}, +		{18446744073709526399ULL, 0, "213503982334600d23h59min59s"}, +		{18446744073709180799ULL, HXUNIT_WEEKS, "30500568904942weeks2d23h59min59s"}, +		{18446744073708451799ULL, HXUNIT_MONTHS, "7014504553087months2d23h59min59s"}, +		{18446744073707636399ULL, HXUNIT_MONTHS | HXUNIT_WEEKS, "7014504553086months3weeks2d23h59min59s"}, +		{18446744073688622999ULL, HXUNIT_YEARS | HXUNIT_MONTHS | HXUNIT_WEEKS, "584542046089y11months2weeks2d23h59min59s"},  		{31536000, 0, "365d"},  		{31622400, 0, "366d"},  		{34819200, HXUNIT_WEEKS, "57weeks4d"}, diff --git a/src/tx-compile.cpp b/src/tx-compile.cpp index 2c21e3b..2bcdb1e 100644 --- a/src/tx-compile.cpp +++ b/src/tx-compile.cpp @@ -1 +1,2 @@  #include "tc-compile.c" +#include <libHX/scope.hpp>  | 
