64-bit cleanup

This commit is contained in:
Ed McCardell 2012-03-14 16:29:58 -04:00
parent 3c7cca9c55
commit 0063a9e8e0
9 changed files with 19 additions and 14 deletions

View File

@ -1,7 +1,7 @@
DMD_OPTS = -c -version=CycleAccuracy -op -Jdata -I$(GTKD)/src -I$(GTKD)/srcgl \
-I$(DERELICT)/import
GCC_OPTS = -m32 -lpthread -lm -lGL -ldl -lrt \
GCC_OPTS = -lpthread -lm -lGL -ldl -lX11 -lrt \
-L$(GTKD) -lgtkd -lgtkdgl \
-L$(DERELICT)/lib -lDerelictSDL -lDerelictUtil \
-lphobos2 -ldruntime

View File

@ -87,13 +87,13 @@ class Keyboard
{
// assert(canRead()); XXX
int val = values[nextRead];
nextRead = (nextRead + 1) % values.length;
nextRead = (nextRead + 1) % cast(int)values.length;
return val;
}
void write(int val)
{
int next = (nextWrite + 1) % values.length;
int next = (nextWrite + 1) % cast(int)values.length;
if (next != nextRead)
{
values[nextWrite] = val;

View File

@ -100,7 +100,9 @@ class Delay
// Assume that tv_sec = 0;
if (timeCompare(&timeShould, &timeNow, &timeDiff))
usleep(timeDiff.tv_usec);
{
usleep(cast(uint)timeDiff.tv_usec);
}
}
void reset()
@ -122,7 +124,8 @@ class Delay
{
gettimeofday(&timeNow, null);
timeCompare(&timeNow, &timeCheck, &timeDiff);
uint elapsed = (timeDiff.tv_sec * 1000000) + timeDiff.tv_usec;
uint elapsed =
cast(uint)((timeDiff.tv_sec * 1000000) + timeDiff.tv_usec);
if (elapsed >= 1000000)
{
float percent = cast(float)checkCycles / cast(float)elapsed;
@ -137,12 +140,12 @@ class Delay
bool timeCompare(timeval* later, timeval* earlier, timeval* diff)
{
if (later.tv_usec < earlier.tv_usec) {
int nsec = (earlier.tv_usec - later.tv_usec) / 1000000 + 1;
int nsec = cast(int)((earlier.tv_usec - later.tv_usec) / 1000000 + 1);
earlier.tv_usec -= 1000000 * nsec;
earlier.tv_sec += nsec;
}
if (later.tv_usec - earlier.tv_usec > 1000000) {
int nsec = (later.tv_usec - earlier.tv_usec) / 1000000;
int nsec = cast(int)((later.tv_usec - earlier.tv_usec) / 1000000);
earlier.tv_usec += 1000000 * nsec;
earlier.tv_sec -= nsec;
}

View File

@ -297,7 +297,7 @@ class IOMem_IIe : IOMem
void setRom(ubyte[] romDump)
{
int c100 = romDump.length - 16128;
int c100 = cast(int)(romDump.length - 16128);
c100c2ff = new Rom(0xC100, 0x0200, romDump[c100 .. (c100 + 0x0200)]);
intC3ROM = new IntC3ROM(romDump[(c100 + 0x0200) .. (c100 + 0x0300)]);
c400c7ff = new Rom(0xC400, 0x0400,

View File

@ -808,7 +808,7 @@ class DSKImage : ExternalImage
void loadBytes(ubyte[] data)
{
uint len = data.length;
uint len = cast(uint)data.length;
trackData[offset..offset+len] = data;
offset += len;
}

View File

@ -168,7 +168,7 @@ class Timer
private void deleteCounters()
{
int numCounters = counters.length;
int numCounters = cast(int)counters.length;
int lastCounter;
main: for (int counter = 0; counter < counters.length; ++counter)
{

View File

@ -48,7 +48,7 @@ class TestSystem : II
void setRom(ubyte[] rom_data)
{
uint rom_len = rom_data.length;
uint rom_len = cast(uint)rom_data.length;
memory_.mainRom.data_[0..12288] = rom_data[(rom_len - 12288)..rom_len];
}
}

View File

@ -442,7 +442,7 @@ class TwoappleDialog
response = 0;
else if ((response == ResponseType.GTK_RESPONSE_CANCEL) ||
(response == ResponseType.GTK_RESPONSE_DELETE_EVENT))
response = buttonText.length - 1;
response = cast(int)(buttonText.length - 1);
host.delay.reset();
soundCard.resume();

View File

@ -188,7 +188,8 @@ class TextPatternGenerator_II : TextPatternGenerator
{
foreach(index, pattern; segments[seg])
{
uint ascii = (((index / 32) * 4) + (index % 4)) + (seg * 32);
uint ascii =
cast(uint)((((index / 32) * 4) + (index % 4)) + (seg * 32));
uint dotLine = (index / 4) % 8;
switch (seg)
{
@ -249,7 +250,8 @@ class TextPatternGenerator_IIe : TextPatternGenerator
{
foreach(index, pattern; segments[seg])
{
uint ascii = (((index / 32) * 4) + (index % 4)) + (seg * 32);
uint ascii =
cast(uint)((((index / 32) * 4) + (index % 4)) + (seg * 32));
uint dotLine = (index / 4) % 8;
switch (seg)
{