Modified:
/trunk/include/double.h
/trunk/include/int.h
/trunk/include/module.h
/trunk/include/opcode.h
/trunk/include/type.h
/trunk/src/double.cc
/trunk/src/int.cc
=======================================
--- /trunk/include/double.h Sun Jan 30 12:33:27 2011
+++ /trunk/include/double.h Wed Jul 20 16:10:31 2011
@@ -28,7 +28,6 @@
#ifndef CLEVER_DOUBLE_H
#define CLEVER_DOUBLE_H
-#include "module.h"
#include "type.h"
#include "value.h"
@@ -42,8 +41,8 @@
void Init();
/* Type methods */
- static CLEVER_METHOD(toString);
- static CLEVER_METHOD(sqrt);
+ static CLEVER_TYPE_METHOD(toString);
+ static CLEVER_TYPE_METHOD(sqrt);
private:
DISALLOW_COPY_AND_ASSIGN(Double);
};
=======================================
--- /trunk/include/int.h Sun Jan 30 12:33:27 2011
+++ /trunk/include/int.h Wed Jul 20 16:10:31 2011
@@ -28,7 +28,6 @@
#ifndef CLEVER_INT_H
#define CLEVER_INT_H
-#include "module.h"
#include "type.h"
#include "value.h"
@@ -42,7 +41,7 @@
void Init();
/* Type methods */
- static CLEVER_METHOD(toString);
+ static CLEVER_TYPE_METHOD(toString);
private:
DISALLOW_COPY_AND_ASSIGN(Integer);
};
=======================================
--- /trunk/include/module.h Sun Feb 6 10:25:25 2011
+++ /trunk/include/module.h Wed Jul 20 16:10:31 2011
@@ -49,9 +49,9 @@
* Macros to help on module function declaration
*/
#define CLEVER_FUNCTION_ARGS const ValueVector* args, Value* retval
-#define CLEVER_METHOD_ARGS const ValueVector* args, Value* retval, Value*
value
#define CLEVER_FUNC_NAME(name) clv_##name
#define CLEVER_FUNCTION(name) void CLEVER_FASTCALL
CLEVER_FUNC_NAME(name)(CLEVER_FUNCTION_ARGS) throw()
+#define CLEVER_METHOD_ARGS const ValueVector* args, Value* retval, Value*
value
#define CLEVER_METHOD(name) void CLEVER_FASTCALL name(CLEVER_METHOD_ARGS)
throw()
/**
=======================================
--- /trunk/include/opcode.h Sun Feb 13 10:23:26 2011
+++ /trunk/include/opcode.h Wed Jul 20 16:10:31 2011
@@ -28,7 +28,6 @@
#ifndef CLEVER_OPCODES_H
#define CLEVER_OPCODES_H
-#include <cstring>
#include "vm.h"
namespace clever {
=======================================
--- /trunk/include/type.h Sun Feb 6 09:31:36 2011
+++ /trunk/include/type.h Wed Jul 20 16:10:31 2011
@@ -36,6 +36,12 @@
class CString;
+/**
+ * Prototype for class methods which the class represents a type
+ */
+#define CLEVER_TYPE_METHOD_ARGS const ValueVector* args, Value* retval,
Value* value
+#define CLEVER_TYPE_METHOD(name) void CLEVER_FASTCALL
name(CLEVER_TYPE_METHOD_ARGS) throw()
+
/**
* Type representation
*/
=======================================
--- /trunk/src/double.cc Sun Feb 6 09:31:36 2011
+++ /trunk/src/double.cc Wed Jul 20 16:10:31 2011
@@ -37,7 +37,7 @@
* Double::toString()
* Converts the number to string
*/
-CLEVER_METHOD(Double::toString) {
+CLEVER_TYPE_METHOD(Double::toString) {
retval->setString(CSTRING(value->toString()));
retval->set_type(Value::STRING);
}
@@ -46,7 +46,7 @@
* Double::sqrt()
* Returns the square root of the number
*/
-CLEVER_METHOD(Double::sqrt) {
+CLEVER_TYPE_METHOD(Double::sqrt) {
retval->set_type(Value::DOUBLE);
retval->setDouble(std::sqrt(value->getDouble()));
}
=======================================
--- /trunk/src/int.cc Sun Feb 6 09:31:36 2011
+++ /trunk/src/int.cc Wed Jul 20 16:10:31 2011
@@ -36,7 +36,7 @@
* Int::toString()
* Converts the number to string
*/
-CLEVER_METHOD(Integer::toString) {
+CLEVER_TYPE_METHOD(Integer::toString) {
retval->setString(CSTRING(value->toString()));
retval->set_type(Value::STRING);
}