[latex3-commits] [git/LaTeX3-latex3-latex3] master: Use \ifpdfabsnum for intarray bounds check if available (b02a19e)

Bruno Le Floch bruno at le-floch.fr
Fri May 4 23:18:57 CEST 2018


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/b02a19ee2da4de80cd71b9ef5ff693458e2e4ad0

>---------------------------------------------------------------

commit b02a19ee2da4de80cd71b9ef5ff693458e2e4ad0
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Thu May 3 21:24:41 2018 +0200

    Use \ifpdfabsnum for intarray bounds check if available


>---------------------------------------------------------------

b02a19ee2da4de80cd71b9ef5ff693458e2e4ad0
 l3kernel/l3intarray.dtx |   30 +++++++++++++++++++++++-------
 1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/l3kernel/l3intarray.dtx b/l3kernel/l3intarray.dtx
index be8520b..a49a046 100644
--- a/l3kernel/l3intarray.dtx
+++ b/l3kernel/l3intarray.dtx
@@ -237,16 +237,32 @@
     \int_value:w \int_eval:n {#2} \exp_after:wN ;
     \int_value:w \int_eval:n {#3} ;
   }
-\cs_new_protected:Npn \@@_gset:Nww #1#2 ; #3 ;
+\cs_if_exist:NTF \tex_ifabsnum:D
   {
-    \@@_bounds:NNnTF \__kernel_msg_error:nnxxx #1 {#2}
+    \cs_new_protected:Npn \@@_gset:Nww #1#2 ; #3 ;
       {
-        \if_int_compare:w \int_abs:n {#3} > \c_max_dim
-          \exp_after:wN \@@_gset_overflow:NNnn
-        \fi:
-        \__kernel_intarray_gset:Nnn #1 {#2} {#3}
+        \@@_bounds:NNnTF \__kernel_msg_error:nnxxx #1 {#2}
+          {
+            \tex_ifabsnum:D #3 > \c_max_dim
+              \exp_after:wN \@@_gset_overflow:NNnn
+            \fi:
+            \__kernel_intarray_gset:Nnn #1 {#2} {#3}
+          }
+          { }
+      }
+  }
+  {
+    \cs_new_protected:Npn \@@_gset:Nww #1#2 ; #3 ;
+      {
+        \@@_bounds:NNnTF \__kernel_msg_error:nnxxx #1 {#2}
+          {
+            \if_int_compare:w \int_abs:n {#3} > \c_max_dim
+              \exp_after:wN \@@_gset_overflow:NNnn
+            \fi:
+            \__kernel_intarray_gset:Nnn #1 {#2} {#3}
+          }
+          { }
       }
-      { }
   }
 \cs_new_protected:Npn \@@_gset_overflow:NNnn #1#2#3#4
   {





More information about the latex3-commits mailing list