Merge pull request #42 from Abscissa/fix32bit

Fixed for 32-bit.
This commit is contained in:
Hackerpilot 2013-08-01 19:33:01 -07:00
commit 83fd2457d2
2 changed files with 5 additions and 4 deletions

View File

@ -12,6 +12,7 @@ import std.algorithm;
import std.range;
import std.stdio;
import std.array;
import std.conv;
void doNothing(string, int, int, string) {}
@ -21,7 +22,7 @@ void printCtags(File output, string[] fileNames)
foreach (fileName; fileNames)
{
File f = File(fileName);
auto bytes = uninitializedArray!(ubyte[])(f.size);
auto bytes = uninitializedArray!(ubyte[])(to!size_t(f.size));
f.rawRead(bytes);
LexerConfig config;
auto tokens = byToken(bytes, config);

6
main.d
View File

@ -74,7 +74,7 @@ int main(string[] args)
config.iterStyle = IterationStyle.everything;
config.tokenStyle = TokenStyle.source;
File f = args.length == 1 ? stdin : File(args[1]);
ubyte[] buffer = uninitializedArray!(ubyte[])(f.size);
ubyte[] buffer = uninitializedArray!(ubyte[])(to!size_t(f.size));
highlighter.highlight(byToken(f.rawRead(buffer), config),
args.length == 1 ? "stdin" : args[1]);
return 0;
@ -97,7 +97,7 @@ int main(string[] args)
bool usingStdin = args.length == 3;
config.fileName = usingStdin ? "stdin" : args[1];
File f = usingStdin ? stdin : File(args[1]);
auto bytes = usingStdin ? cast(ubyte[]) [] : uninitializedArray!(ubyte[])(f.size);
auto bytes = usingStdin ? cast(ubyte[]) [] : uninitializedArray!(ubyte[])(to!size_t(f.size));
f.rawRead(bytes);
auto tokens = byToken(bytes, config);
@ -107,7 +107,7 @@ int main(string[] args)
}
else if (tokenCount)
{
printTokenCount(stdout, tokens, f.size);
printTokenCount(stdout, tokens, to!size_t(f.size));
}
else if (syntaxCheck)
{