1
0

64bit環境でとりあえずコンパイルできるようにした

This commit is contained in:
otya128
2015-08-26 21:55:55 +09:00
parent 435138c8d1
commit 478c3a397e
4 changed files with 17 additions and 19 deletions

View File

@@ -112,7 +112,7 @@ class VM
}
void end()
{
pc = code.length;
pc = cast(int)code.length;
}
void dump()
{

View File

@@ -274,7 +274,7 @@ class BuiltinFunction
//hairetuha?
static int LEN(wstring str)
{
return str.length;
return cast(int)str.length;
}
static double VAL(wstring str)
{
@@ -360,8 +360,7 @@ class BuiltinFunction
str1 = vstart.castString;
str2 = vstr1.castString;
}
int aaa = str1[start..$].indexOf(str2, CaseSensitive.no);
return str1[start..$].indexOf(str2, CaseSensitive.no);
return cast(int)(str1[start..$].indexOf(str2, CaseSensitive.no));
}
static int ASC(wstring str)
{
@@ -508,7 +507,6 @@ class BuiltinFunction
return;
}
throw new IllegalFunctionCall("SPDEF");
return;
}
default:
}
@@ -587,7 +585,7 @@ class BuiltinFunction
auto f = format[i];
if(f == '%')
{
int d = indexOf(format, 'D', CaseSensitive.yes);
int d = cast(int)indexOf(format, 'D', CaseSensitive.yes);
if(d != -1)
{
auto spec = singleSpec(format[i .. d + 1]);
@@ -597,7 +595,7 @@ class BuiltinFunction
i = d;
continue;
}
d = indexOf(format, 'X', CaseSensitive.yes);
d = cast(int)indexOf(format, 'X', CaseSensitive.yes);
if(d != -1)
{
auto spec = singleSpec(format[i .. d + 1]);
@@ -607,7 +605,7 @@ class BuiltinFunction
i = d;
continue;
}
d = indexOf(format, 'S', CaseSensitive.yes);
d = cast(int)indexOf(format, 'S', CaseSensitive.yes);
if(d != -1)
{
auto spec = singleSpec(format[i .. d + 1]);
@@ -617,7 +615,7 @@ class BuiltinFunction
i = d;
continue;
}
d = indexOf(format, 'F', CaseSensitive.yes);
d = cast(int)indexOf(format, 'F', CaseSensitive.yes);
if(d != -1)
{
auto spec = singleSpec(format[i .. d + 1]);

View File

@@ -385,7 +385,7 @@ class Compiler
IndexExpressions ie = cast(IndexExpressions)binop.item2;
if(ie)
{
genCode(new PushArray(ie.expressions.length));
genCode(new PushArray(cast(int)ie.expressions.length));
}
else
{
@@ -428,12 +428,12 @@ class Compiler
}
if(bfun)
{
genCode(new CallBuiltinFunction(bfun, func.args.length, 1));
genCode(new CallBuiltinFunction(bfun, cast(int)func.args.length, 1));
}
else
{
writeln(func.name);
genCode(new CallFunctionCode(func.name, func.args.length));
genCode(new CallFunctionCode(func.name, cast(int)func.args.length));
}
}
break;
@@ -481,7 +481,7 @@ class Compiler
getVarIndex(var.name, sc, index, local);
if(ie)
{
genCode(new PopArray(index, ie.expressions.length, local));
genCode(new PopArray(index, cast(int)ie.expressions.length, local));
}
else
{
@@ -508,14 +508,14 @@ class Compiler
if(node.hasElse)
{
then = genCodeGoto();
else_.address = code.length;
else_.address = cast(int)code.length;
compileStatements(node.else_, sc);
then.address = code.length;
then.address = cast(int)code.length;
}
else
{
//endifに飛ばす
else_.address = code.length;
else_.address = cast(int)code.length;
}
}
void compileFor(For node, Scope s)
@@ -540,7 +540,7 @@ class Compiler
genCodeOP(TokenType.Greater);
auto breakAddr = genCodeGotoTrue();
auto forAddr = genCodeGoto();
positiveZero.address = code.length;
positiveZero.address = cast(int)code.length;
//stepが正の値の時の処理
//toよりcounterが大きい場合はBREAK
//t c
@@ -551,7 +551,7 @@ class Compiler
genCodePushVar(node.initExpression.name, s);
genCodeOP(TokenType.Less);
genCode(breakAddr);
forAddr.address = code.length;
forAddr.address = cast(int)code.length;
s = new Scope(new GotoAddr(-1), new GotoAddr(-1), s);
compileStatements(node.statements, s);
s.continueAddr.address = code.length;

View File

@@ -151,7 +151,7 @@ class Array(T)
{
array[] = 0;
}
dimCount = dim.length;
dimCount = cast(int)dim.length;
}
T opIndexAssign(T v, int[] dim)
{