Skip to content

Commit ae12dfc

Browse files
committed
Fix compilation on win32 given recet changes to what sq.h and sqVirtualMachine.h
define. Make the type of io[Micro]MSecs usqInt because a) these are unsigned clocks and b) usqInt is the word size and so generates the simplest client code.
1 parent 704a4df commit ae12dfc

File tree

16 files changed

+47
-31
lines changed

16 files changed

+47
-31
lines changed

platforms/Cross/vm/sq.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@
9797
the clock to return the time right now, rather than of the last heartbeat.
9898
*/
9999

100-
long ioMSecs(void);
101-
long ioMicroMSecs(void);
100+
usqInt ioMSecs(void);
101+
usqInt ioMicroMSecs(void);
102102

103103
/* duplicate the generated definition in the interpreter. If they differ the
104104
* compiler will complain and catch it for us. We use 0x1FFFFFFF instead of

platforms/Cross/vm/sqVirtualMachine.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ typedef struct VirtualMachine {
239239
#if VM_PROXY_MINOR > 3
240240

241241
void *(*ioLoadFunctionFrom)(char *fnName, char *modName);
242-
sqInt (*ioMicroMSecs)(void);
242+
usqInt (*ioMicroMSecs)(void);
243243

244244
#endif
245245

@@ -544,7 +544,7 @@ sqInt showDisplayBitsLeftTopRightBottom(sqInt aForm, sqInt l, sqInt t, sqInt r,
544544
sqInt signalSemaphoreWithIndex(sqInt semaIndex);
545545
sqInt success(sqInt aBoolean);
546546
sqInt superclassOf(sqInt classPointer);
547-
sqInt ioMicroMSecs(void);
547+
usqInt ioMicroMSecs(void);
548548
unsigned long long ioUTCMicroseconds(void);
549549
unsigned long long ioUTCMicrosecondsNow(void);
550550
void forceInterruptCheck(void);

platforms/Plan9/vm/sqPlan9io.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,15 @@ void ioDestroy(void) {
7070
}
7171

7272
/* Time */
73-
long ioMSecs(void) {
73+
usqInt
74+
ioMSecs(void)
75+
{
7476
vlong now = nsec();
7577
return (now - start_time)/1000000;
7678
}
7779

78-
long ioMicroMSecs(void) { return ioMSecs(); }
80+
usqInt
81+
ioMicroMSecs(void) { return ioMSecs(); }
7982

8083
sqInt ioSeconds(void) {
8184
return (sqInt)convertToSqueakTime(time(NULL));

platforms/RiscOS/vm/sqRPCMain.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,8 @@ unsigned int microsecondsvalue(void) {
361361
return 1000 * millisecondTimerValue();
362362
}
363363

364-
sqInt ioMicroMSecs(void) {
364+
usqInt
365+
ioMicroMSecs(void) {
365366
/* The
366367
function ioMicroMSecs() is used only to collect timing statistics
367368
for the garbage collector and other VM facilities. (The function

platforms/iOS/vm/Common/Classes/sqMacV2Time.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ sqLong ioMicroSeconds(void)
9090
return theTimeIs;
9191
}
9292

93-
sqInt ioMicroMSecs(void)
93+
usqInt ioMicroMSecs(void)
9494
{
9595
//API Documented
9696
struct timeval now;
@@ -106,7 +106,7 @@ sqInt ioMicroMSecs(void)
106106
return theTimeIs;
107107
}
108108

109-
sqInt ioMSecs(void) {
109+
usqInt ioMSecs(void) {
110110
//API Documented
111111
return ioMicroMSecs();
112112
}

platforms/minheadless/generic/sqPlatformSpecific-Generic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ osCogStackPageHeadroom(void)
4242
return 1024;
4343
}
4444

45-
long
45+
usqInt
4646
ioMSecs(void)
4747
{
4848
return 0;
4949
}
5050

51-
long
51+
usqInt
5252
ioMicroMSecs(void)
5353
{
5454
return 0;

platforms/minheadless/unix/sqUnixHeartbeat.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,12 @@ unsigned long long
204204
ioLocalMicrosecondsNow() { return currentUTCMicroseconds() + vmGMTOffset; };
205205

206206
/* ioMSecs answers the millisecondClock as of the last tick. */
207-
long
207+
usqInt
208208
ioMSecs() { return millisecondClock; }
209209

210210
/* ioMicroMSecs answers the millisecondClock right now */
211-
long ioMicroMSecs(void) { return microToMilliseconds(currentUTCMicroseconds());}
211+
usqInt
212+
ioMicroMSecs(void) { return microToMilliseconds(currentUTCMicroseconds());}
212213

213214
/* returns the local wall clock time */
214215
sqInt

platforms/minheadless/windows/sqWin32Heartbeat.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,12 @@ unsigned long long
262262
ioLocalMicrosecondsNow() { return ioUTCMicrosecondsNow() + vmGMTOffset; };
263263

264264
/* ioMSecs answers the millisecondClock as of the last tick. */
265-
long
265+
usqInt
266266
ioMSecs() { return millisecondClock; }
267267

268268
/* ioMicroMSecs answers the millisecondClock right now */
269-
long ioMicroMSecs(void) { return microToMilliseconds(ioUTCMicrosecondsNow());}
269+
usqInt
270+
ioMicroMSecs(void) { return microToMilliseconds(ioUTCMicrosecondsNow());}
270271

271272
/* returns the local wall clock time */
272273
sqInt

platforms/minheadless/windows/sqWin32Time.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ int ioSeconds(void)
4949
return convertToSqueakTime(sysTime);
5050
}
5151

52-
int ioMSecs()
52+
usqInt
53+
ioMSecs()
5354
{
5455
/* Make sure the value fits into Squeak SmallIntegers */
5556
#ifndef _WIN32_WCE
@@ -60,7 +61,8 @@ int ioMSecs()
6061
}
6162

6263
/* Note: ioMicroMSecs returns *milli*seconds */
63-
int ioMicroMSecs(void)
64+
usqInt
65+
ioMicroMSecs(void)
6466
{
6567
/* Make sure the value fits into Squeak SmallIntegers */
6668
return timeGetTime() & MillisecondClockMask;

platforms/unix/misc/threadValidate/sqUnixHeartbeat.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ ioUpdateVMTimezone()
8181
vmGMTOffset = localtime(&utctt)->tm_gmtoff * MicrosecondsPerSecond;
8282
}
8383

84-
int
84+
usqInt
8585
ioMSecs()
8686
{
8787
return ((get64(utcMicrosecondClock) - utcStartMicroseconds)
@@ -105,7 +105,7 @@ ioHighResClock(void)
105105
}
106106

107107
/* Note: ioMicroMSecs returns *milli*seconds */
108-
int ioMicroMSecs(void)
108+
usqInt ioMicroMSecs(void)
109109
{
110110
updateMicrosecondClock();
111111
return ioMSecs();

0 commit comments

Comments
 (0)