[quake3] first win64 patch

James Lacey jamlacey at gmail.com
Mon Feb 13 13:14:30 EST 2006


-----Original Message-----
From: Ludwig Nussel [mailto:ludwig.nussel at suse.de] 
Sent: Monday, February 13, 2006 10:23 AM
To: quake3 at icculus.org
Subject: Re: [quake3] first win64 patch

On Monday 13 February 2006 05:19, James Lacey wrote:
> Here is my first Win64 Quake 3 patch. A couple of notes:

- Are all those int -> size_t (ie signed 32bit -> unsigned 64bit)
  changes actually needed? Did you verify they don't break stuff by
  looking at the code or by running the game? E.g. the loop in
  SV_Status_f, l could become negative (yeah the code is broken
  anyways)?

I did verify that the int -> size_t changes don't break anything as far as I
have played a couple of maps and everything seems to work fine. There was
one bug I can think of that was caused this way because of a for loop
"counting backwards" i.e. for(int i = SOME_NUMBER; i >= 0; i--). A lot of
the int to size_t changes were for file system and memory functions. Not
that realistically Quake 3 needs to address more than 4 GB of memory but I
made the changes so that it was clean 64-bit code. Besides, isn't it good
practice to use size_t for things like length and size?

- What kind of warning gets silenced by the #pragma you added?

Off the top of my head, two warnings that I silenced were signed/unsigned
mismatch on comparisons and promoting a value to a bigger data type (not
exactly sure why that is a warning).

- Is sizeof(intptr_t) != sizeof(long) on Windows?

Yeah, I found this a little annoying but VC++ treats int and long as 4 bytes
even when compiling for a 64-bit target. You have to use long long or
__int64 explicitly to get an 8 byte integer.

- I suppose the vm_x86.c diff is an accident

- If you omit the vcproj files the diff is 200K instead of 1.4MB

Sorry if the patch wasn't really clean, I just did an svn diff and zipped it
up.

James





More information about the quake3 mailing list