summaryrefslogtreecommitdiff
path: root/graphics/asymptote/item.h
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/asymptote/item.h')
-rw-r--r--graphics/asymptote/item.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/graphics/asymptote/item.h b/graphics/asymptote/item.h
index 70d4923445..28bba31b41 100644
--- a/graphics/asymptote/item.h
+++ b/graphics/asymptote/item.h
@@ -115,15 +115,19 @@ public:
item(Int i)
: kind(&typeid(Int)), i(i) {}
+#ifndef intIsInt
item(int i)
: kind(&typeid(Int)), i(i) {}
+#endif
item(double x)
: kind(&typeid(double)), x(x) {}
item(bool b)
: kind(&typeid(bool)), b(b) {}
+#ifndef intIsInt
item& operator= (int a)
{ kind=&typeid(Int); i=a; return *this; }
+#endif
item& operator= (unsigned int a)
{ kind=&typeid(Int); i=a; return *this; }
item& operator= (Int a)
@@ -197,29 +201,29 @@ private:
#ifdef SIMPLE_FRAME
// In the simple implementation, a frame is just an array of items.
-typedef item frame;
+typedef item vmFrame;
#else
-class frame : public gc {
+class vmFrame : public gc {
#ifdef DEBUG_FRAME
string name;
- Int parentIndex;
+ size_t parentIndex;
#endif
- typedef mem::vector<item> internal_vars_t;
+ using internal_vars_t = mem::vector<item>;
internal_vars_t vars;
// Allow the stack direct access to vars.
friend class stack;
public:
#ifdef DEBUG_FRAME
- frame(string name, Int parentIndex, size_t size)
+ vmFrame(string name, size_t parentIndex, size_t size)
: name(name), parentIndex(parentIndex), vars(size)
{}
string getName() { return name; }
- Int getParentIndex() { return parentIndex; }
+ size_t getParentIndex() { return parentIndex; }
#else
- frame(size_t size)
+ vmFrame(size_t size)
: vars(size)
{}
#endif
@@ -248,12 +252,6 @@ inline T get(const item& it)
}
template <>
-inline int get<int>(const item&)
-{
- throw vm::bad_item_value();
-}
-
-template <>
inline Int get<Int>(const item& it)
{
#if COMPACT