summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/runarray.in
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-05-28 02:18:52 +0000
committerKarl Berry <karl@freefriends.org>2011-05-28 02:18:52 +0000
commitc59fe5fe4739f0c61560f05d4e42b4e552219b27 (patch)
tree8cf79e85e394b3177a28d374415840a4e0a025ad /Build/source/utils/asymptote/runarray.in
parent771db15706dbf3f4af8b630dcb15646a3e5fda00 (diff)
asy 2.10
git-svn-id: svn://tug.org/texlive/trunk@22633 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/runarray.in')
-rw-r--r--Build/source/utils/asymptote/runarray.in32
1 files changed, 9 insertions, 23 deletions
diff --git a/Build/source/utils/asymptote/runarray.in b/Build/source/utils/asymptote/runarray.in
index 1c113c9bb53..e05810b8f27 100644
--- a/Build/source/utils/asymptote/runarray.in
+++ b/Build/source/utils/asymptote/runarray.in
@@ -420,6 +420,7 @@ Int LUdecompose(double *a, size_t n, size_t* index, bool warn=true)
}
namespace run {
+
void dividebyzero(size_t i)
{
ostringstream buf;
@@ -436,12 +437,6 @@ void integeroverflow(size_t i)
error(buf);
}
-void checkSize(Int n, Int depth)
-{
- if(n < 0) error("cannot create a negative length array");
- if(depth < 0) error("cannot copy to a negative depth");
-}
-
}
// Autogenerated routines:
@@ -507,24 +502,15 @@ array* :newAppendedArray(array* tail, Int n)
}
// Produce an array of n deep copies of value.
-array* :copyArray0(Int n, item value, Int depth=Int_MAX)
-{
- checkSize(n,depth);
- return new array((size_t) n, value, (size_t) 0);
-}
-
-array* :copyArray1(Int n, item value, Int depth=Int_MAX)
+// typeDepth is the true depth of the array determined at compile-time when the
+// operations for the array type are added. This typeDepth argument is
+// automatically pushed on the stack and is not visible to the user.
+array* :copyArray(Int n, item value, Int depth=Int_MAX, Int typeDepth)
{
- checkSize(n,depth);
- if(depth > 1) depth=1;
- return new array((size_t) n, value, (size_t) depth);
-}
-
-array* :copyArray2(Int n, item value, Int depth=Int_MAX)
-{
- checkSize(n,depth);
- if(depth > 2) depth=2;
- return new array((size_t) n, value, (size_t) depth);
+ if(n < 0) error("cannot create a negative length array");
+ if(depth < 0) error("cannot copy to a negative depth");
+ if(depth > typeDepth) depth=typeDepth;
+ return new array((size_t) n, value, depth);
}
// Read an element from an array. Checks for initialization & bounds.