3 new commits in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/a0268c5597f3/
Changeset:   a0268c5597f3
User:        kehoea
Date:        2017-05-11 07:13:08+00:00
Summary:     Fix dummy chartab_range initializers.
Affected #:  3 files
diff -r eec2a31de9d67f78b606314136ed13abb364046d -r
a0268c5597f37d95723b9570254be522f714986c src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2017-04-27  Stephen J. Turnbull  <stephen(a)xemacs.org>
+
+	* chartab.c (char_table_print_preprocess):
+	(char_table_nsubst_structures_descend):
+	data.c (build_fixnum_to_char_map):
+	Fix chartab_range initializers.
+
 2017-04-21  Aidan Kehoe  <kehoea(a)parhasard.net>
 
 	* elhash.c (intern_istring):
diff -r eec2a31de9d67f78b606314136ed13abb364046d -r
a0268c5597f37d95723b9570254be522f714986c src/chartab.c
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -157,7 +157,7 @@
 char_table_print_preprocess (Lisp_Object object, Lisp_Object print_number_table,
                              Elemcount *seen_object_count)
 {
-  struct chartab_range ctr = { CHARTAB_RANGE_ALL, 0, Qnil, 0 };
+  struct chartab_range ctr = { CHARTAB_RANGE_ALL, 0, 0, Qnil, 0 };
   preprocess_info_t preprocess_info = { print_number_table, seen_object_count };
   map_char_table (object, &ctr, print_preprocess_mapper, &preprocess_info);
 }
@@ -193,7 +193,7 @@
                                       Lisp_Object number_table,
                                       Boolint test_not_unboundp)
 {
-  struct chartab_range ctr = { CHARTAB_RANGE_ALL, 0, Qnil, 0 };
+  struct chartab_range ctr = { CHARTAB_RANGE_ALL, 0, 0, Qnil, 0 };
   nsubst_structures_info_t nsubst_structures_info
     = { number_table, new_, old, object, test_not_unboundp };
 
diff -r eec2a31de9d67f78b606314136ed13abb364046d -r
a0268c5597f37d95723b9570254be522f714986c src/data.c
--- a/src/data.c
+++ b/src/data.c
@@ -1504,7 +1504,7 @@
 build_fixnum_to_char_map (Lisp_Object radix_table)
 {
   Lisp_Object highest_value, result;
-  struct chartab_range ctr = { CHARTAB_RANGE_ALL, 0, Qnil, 0 };
+  struct chartab_range ctr = { CHARTAB_RANGE_ALL, 0, 0, Qnil, 0 };
   Ichar *cctable;
   EMACS_INT ii, cclen;
   Ibyte *data;
https://bitbucket.org/xemacs/xemacs/commits/50b05df76160/
Changeset:   50b05df76160
User:        kehoea
Date:        2017-05-11 18:58:56+00:00
Summary:     Work around type +/- template problems on the C++ build, text.h
src/ChangeLog addition:
2017-05-11  Aidan Kehoe  <kehoea(a)parhasard.net>
	* alloc.c (resize_string):
	Use set_string_byte() here for the zero termination.
	* text.h:
	Make string_byte(), set_string_byte() into inline functions to
	work around g++ type (+/- template) difficulties with the macro
	versions.
Affected #:  3 files
diff -r a0268c5597f37d95723b9570254be522f714986c -r
50b05df76160d68a18c7afcaf4f66c0fb339dcbe src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
+2017-05-11  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* alloc.c (resize_string):
+	Use set_string_byte() here for the zero termination.
+	* text.h:
+	Make string_byte(), set_string_byte() into inline functions to
+	work around g++ type (+/- template) difficulties with the macro
+	versions.
+
 2017-04-27  Stephen J. Turnbull  <stephen(a)xemacs.org>
 
 	* chartab.c (char_table_print_preprocess):
diff -r a0268c5597f37d95723b9570254be522f714986c -r
50b05df76160d68a18c7afcaf4f66c0fb339dcbe src/alloc.c
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -3143,7 +3143,7 @@
   XSET_STRING_LENGTH (s, XSTRING_LENGTH (s) + delta);
   /* If pos < 0, the string won't be zero-terminated.
      Terminate now just to make sure. */
-  XSTRING_DATA (s)[XSTRING_LENGTH (s)] = '\0';
+  set_string_byte (s, XSTRING_LENGTH (s), '\0');
 
   if (pos >= 0)
     /* We also have to adjust all of the extent indices after the
diff -r a0268c5597f37d95723b9570254be522f714986c -r
50b05df76160d68a18c7afcaf4f66c0fb339dcbe src/text.h
--- a/src/text.h
+++ b/src/text.h
@@ -1935,11 +1935,24 @@
 
 #define string_char_length(s) \
   string_index_byte_to_char (s, XSTRING_LENGTH (s))
-/* Without the cast, C++ promotes the following expression to an int and then
-   complains about a narrowing cast when it is used as an Ibyte. */
-#define string_byte(s, i) (Ibyte) (XSTRING_DATA (s)[i] + 0)
+
+DECLARE_INLINE_HEADER (
+Ibyte
+string_byte (Lisp_Object s, Bytecount i)
+)
+{
+  /* C++ deals with a macro version of this badly. */
+  return XSTRING_DATA (s)[i];
+}
 /* In case we ever allow strings to be in a different format ... */
-#define set_string_byte(s, i, c) (XSTRING_DATA (s)[i] = (c))
+DECLARE_INLINE_HEADER (
+Ibyte
+set_string_byte(Lisp_Object s, Bytecount i, Ibyte c)
+)
+{
+  /* See above re C++. */
+  return XSTRING_DATA (s)[i] = (c);
+}
 
 #define ASSERT_VALID_CHAR_STRING_INDEX_UNSAFE(s, x) do {		\
   text_checking_assert ((x) >= 0 && x <= string_char_length (s));	\
https://bitbucket.org/xemacs/xemacs/commits/d74511673812/
Changeset:   d74511673812
User:        kehoea
Date:        2017-05-11 20:02:50+00:00
Summary:     Restrict the integer values passed as the ZONE argument, #'encode-time
src/ChangeLog addition:
2017-05-11  Aidan Kehoe  <kehoea(a)parhasard.net>
	* editfns.c (Fencode_time):
	Restrict the possible integer values passed as the ZONE argument
	to this function, as per the OS X and Linux documentation for
	tzset(3).
tests/ChangeLog addition:
2017-05-11  Aidan Kehoe  <kehoea(a)parhasard.net>
	* automated/os-tests.el:
	Test restrictions just introduced to the integer values passed as
	the ZONE argument to #'encode-time.
Affected #:  4 files
diff -r 50b05df76160d68a18c7afcaf4f66c0fb339dcbe -r
d745116738120282e98054133b2835e04a206758 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2017-05-11  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* editfns.c (Fencode_time):
+	Restrict the possible integer values passed as the ZONE argument
+	to this function, as per the OS X and Linux documentation for
+	tzset(3).
+
 2017-05-11  Aidan Kehoe  <kehoea(a)parhasard.net>
 
 	* alloc.c (resize_string):
diff -r 50b05df76160d68a18c7afcaf4f66c0fb339dcbe -r
d745116738120282e98054133b2835e04a206758 src/editfns.c
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1230,24 +1230,40 @@
       /* #### This business of modifying environ is horrendous!
 	 Why don't we just putenv()?  Why don't we implement our own
 	 funs that don't require this futzing? */
-      Extbyte tzbuf[100];
+      Ibyte tzbuf[100];
       Extbyte *tzstring;
       Extbyte **oldenv = environ, **newenv;
 
       if (STRINGP (zone))
 	tzstring = LISP_STRING_TO_EXTERNAL (zone, Qtime_zone_encoding);
-      else if (FIXNUMP (zone))
+      else if (INTEGERP (zone))
 	{
-	  int abszone = abs (XFIXNUM (zone));
-	  /* We specify the time zone in offset notation (see `man
-	     tzset' for details).  The offset indicates the value one
-	     must add to local time to arrive at UTC.  Thus, we sign
-	     the offset with a `-' if the time zone is east of GMT; we
-	     sign the offset with a `+' if the time zone is GMT (then
-	     the offset is 0) or if the time zone is west of GMT. */
-	  sprintf (tzbuf, "XXX%s%d:%02d:%02d", (XFIXNUM (zone) < 0) ? "+"
: "-",
-		   abszone / (60*60), (abszone/60) % 60, abszone % 60);
-	  tzstring = tzbuf;
+          int abszone;
+          Bytecount bufwritten;
+
+          /* The number of hours must be less or equal to 24, documented as
+             such on OS X and Linux as of 2017. */
+          check_integer_range (zone, make_fixnum (-86400),
+                               make_fixnum (86400));
+
+          abszone = abs ((int) (XFIXNUM (zone)));
+
+          /* We specify the time zone in offset notation (see `man tzset' for
+             details).  The offset indicates the value one must add to local
+             time to arrive at UTC; the Emacs sign convention is the opposite
+             of that used by tzset(3).
+
+             Thus, we sign the offset with a `-' if the time zone is east of
+             GMT; we sign the offset with a `+' if the time zone is GMT (then
+             the offset is 0) or if the time zone is west of GMT. */
+          bufwritten
+            = emacs_snprintf (tzbuf, sizeof (tzbuf), "XXX%s%d:%02d:%02d", 
+                              XFIXNUM (zone) <= 0 ? "+" : "-",
+                              abszone / (60*60),
+                              (abszone/60) % 60,
+                              abszone % 60);
+          assert (bufwritten < (Bytecount) (sizeof (tzbuf)));
+          tzstring = (Extbyte *) tzbuf;
 	}
       else
 	invalid_argument ("Invalid time zone specification", Qunbound);
diff -r 50b05df76160d68a18c7afcaf4f66c0fb339dcbe -r
d745116738120282e98054133b2835e04a206758 tests/ChangeLog
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,9 @@
+2017-05-11  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* automated/os-tests.el:
+	Test restrictions just introduced to the integer values passed as
+	the ZONE argument to #'encode-time.
+
 2017-03-16  Aidan Kehoe  <kehoea(a)parhasard.net>
 
 	* automated/lisp-reader-tests.el (args-out-of-range):
diff -r 50b05df76160d68a18c7afcaf4f66c0fb339dcbe -r
d745116738120282e98054133b2835e04a206758 tests/automated/os-tests.el
--- a/tests/automated/os-tests.el
+++ b/tests/automated/os-tests.el
@@ -123,4 +123,13 @@
   do 
   (Assert (string= post (substitute-in-file-name pre))))
 
+;; Check some restrictions introduced to the ZONE argument to #'encode-time.
+
+(Check-Error (encode-time 24 4 20 11 5 2017 -86401) args-out-of-range)
+(Assert (equal (encode-time 24 4 20 11 5 2017 -86400)
+               '(22806 . 5448))) ;; "05/12/17 09:04:25 PM"
+(Assert (equal (encode-time 24 4 20 11 5 2017 86400)
+               '(22803 . 29256))) ;; "05/10/17 09:04:24 PM"
+(Check-Error (encode-time 24 4 20 11 5 2017 86401) args-out-of-range)
+
 ;;; end of os-tests.el
Repository URL: 
https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from 
bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.