Previous Thread
Next Thread
Print Thread
Page 108 of 536 1 2 106 107 108 109 110 535 536
Joined: Mar 2001
Posts: 17,234
Likes: 259
R
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 17,234
Likes: 259
Oh, god. This code is beyond Acho levels of 64-bit dirtiness. If MSVC compiled it without warnings the compiler team should be nuked from orbit.

Code
Compiling src/mame/video/n64.c...                                 
cc1: warnings being treated as errors                             
src/mame/video/n64.c: In function �video_update_n64�:             
src/mame/video/n64.c:565: error: cast from pointer to integer of different size
src/mame/video/n64.c:565: error: cast from pointer to integer of different size
src/mame/video/n64.c: In function �video_filter16�:
src/mame/video/n64.c:2139: error: cast from pointer to integer of different size
src/mame/video/n64.c:2165: error: cast from pointer to integer of different size
src/mame/video/n64.c:2172: error: cast to pointer from integer of different size
src/mame/video/n64.c:2173: error: cast to pointer from integer of different size
src/mame/video/n64.c:2199: error: cast to pointer from integer of different size
src/mame/video/n64.c:2200: error: cast to pointer from integer of different size
src/mame/video/n64.c:2226: error: cast to pointer from integer of different size
src/mame/video/n64.c:2227: error: cast to pointer from integer of different size
src/mame/video/n64.c: In function �divot_filter16�:
src/mame/video/n64.c:2356: error: cast from pointer to integer of different size
src/mame/video/n64.c:2358: error: cast to pointer from integer of different size
src/mame/video/n64.c:2358: error: cast to pointer from integer of different size
src/mame/video/n64.c:2359: error: cast to pointer from integer of different size
src/mame/video/n64.c:2359: error: cast to pointer from integer of different size
src/mame/video/n64.c: In function �restore_filter16�:
src/mame/video/n64.c:2449: error: cast from pointer to integer of different size
src/mame/video/n64.c:2468: error: cast to pointer from integer of different size
src/mame/video/n64.c:2504: error: cast to pointer from integer of different size
src/mame/video/n64.c:2541: error: cast to pointer from integer of different size

Last edited by R. Belmont; 11/15/09 08:15 PM.
Joined: Dec 1999
Posts: 1,180
Likes: 2
J
Very Senior Member
Offline
Very Senior Member
J
Joined: Dec 1999
Posts: 1,180
Likes: 2
Those cast issues should have been fixed in MESS SVN last night. I do still get some different warnings in MSVC though:

Quote
src\mame\video\n64.c(3488) : warning C4819: The file contains a character that cannot be represented in the current code page (932). Save the file in Unicode format to prevent data loss
c:\games\emulated\mess\src\mame\video\n64.c(4271) : warning C4701: potentially uninitialized local variable 'dsdeh' used
c:\games\emulated\mess\src\mame\video\n64.c(4272) : warning C4701: potentially uninitialized local variable 'dtdeh' used
c:\games\emulated\mess\src\mame\video\n64.c(4273) : warning C4701: potentially uninitialized local variable 'dwdeh' used
c:\games\emulated\mess\src\mame\video\n64.c(4274) : warning C4701: potentially uninitialized local variable 'drdeh' used
c:\games\emulated\mess\src\mame\video\n64.c(4275) : warning C4701: potentially uninitialized local variable 'dgdeh' used
c:\games\emulated\mess\src\mame\video\n64.c(4276) : warning C4701: potentially uninitialized local variable 'dbdeh' used
c:\games\emulated\mess\src\mame\video\n64.c(4277) : warning C4701: potentially uninitialized local variable 'dadeh' used
c:\games\emulated\mess\src\mame\video\n64.c(4278) : warning C4701: potentially uninitialized local variable 'dzdeh' used
c:\games\emulated\mess\src\mame\video\n64.c(1859) : warning C4701: potentially uninitialized local variable 't0' used
c:\games\emulated\mess\src\mame\video\n64.c(1864) : warning C4701: potentially uninitialized local variable 't3' used

(The Unicode thing is because of a comment in what appears to be the legacy Windows Russian encoding on line 4008. I'd convert it myself if it wasn't in a src/mame/ file.)

Joined: Mar 2001
Posts: 17,234
Likes: 259
R
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 17,234
Likes: 259
Oh, well those cast issues weren't fixed in MAME - that's current MAME SVN I got those errors from. Could whoever fixed them in MESS please submit them over?

Joined: May 2009
Posts: 2,222
Likes: 387
J
Very Senior Member
Offline
Very Senior Member
J
Joined: May 2009
Posts: 2,222
Likes: 387
Originally Posted by R. Belmont
Oh, well those cast issues weren't fixed in MAME - that's current MAME SVN I got those errors from. Could whoever fixed them in MESS please submit them over?

I will as soon as I fix all of these Mysterious Issues That I'm Not Seeing in the MESS build, then I'll move it all over en masse.

Joined: Mar 2001
Posts: 17,234
Likes: 259
R
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 17,234
Likes: 259
Incidentally, current SVN does compile finally, but zero (0) N64 games don't crash on a 64-bit build now, which makes it impossible for me or Aaron to diagnose your TLB problems. Can we back out to 0.135 until angrylion and friends get their shit together?

Joined: Sep 2007
Posts: 40
A
Member
Offline
Member
A
Joined: Sep 2007
Posts: 40
Yeah, my code is dirty in many aspects, not warning-free and not 64-bit compatible. I warned JD about that.
Negative array indices are allowed by C (C 99 standard, 6.5.2.1, 6.5.6.8), provided that an array is effectively a pointer into another array, which is the case here. It's a dangerous programming practice, though.
leftup and the likes should be signed, as I suggested on the previous page. In r6390 JD made them unsigned, it may be (just a guess) a cause for crashes on 64 bit machines.
One option is to exclude VI filters entirely until the clean implementation is written.
Another option is to roll back altogether and then add functionality from my code in parts.

Last edited by angrylion; 11/16/09 11:57 AM.
Joined: May 2009
Posts: 2,222
Likes: 387
J
Very Senior Member
Offline
Very Senior Member
J
Joined: May 2009
Posts: 2,222
Likes: 387
I just checked in a potential fix for the 64-bit crashiness, see if that fixes anything.

Joined: Dec 1999
Posts: 1,180
Likes: 2
J
Very Senior Member
Offline
Very Senior Member
J
Joined: Dec 1999
Posts: 1,180
Likes: 2
Yes, that did the trick.

Joined: May 2004
Posts: 1,772
Likes: 34
H
Very Senior Member
Offline
Very Senior Member
H
Joined: May 2004
Posts: 1,772
Likes: 34
Originally Posted by angrylion
I warned JD about that.
Negative array indices are allowed by C (C 99 standard, 6.5.2.1, 6.5.6.8), provided that an array is effectively a pointer into another array, which is the case here. It's a dangerous programming practice, though.


I'm pretty sure we used to have a bug in a few drivers caused by this very thing on 64-bit systems, and when compiled as 64-bit a negative array index would kill it on the spot, regardless of how valid it was. Might have been an issue with that version of the compiler tho.


Joined: May 2009
Posts: 2,222
Likes: 387
J
Very Senior Member
Offline
Very Senior Member
J
Joined: May 2009
Posts: 2,222
Likes: 387
Fortunately, that doesn't seem to happen anymore. INT32-ing the UINT32s took care of it nicely. Thanks for the suggestion, AL! smile

Page 108 of 536 1 2 106 107 108 109 110 535 536

Link Copied to Clipboard
Who's Online Now
1 members (Kale), 225 guests, and 0 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,328
Posts122,126
Members5,074
Most Online1,283
Dec 21st, 2022
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Forum hosted by www.retrogamesformac.com