| Sign In/My Account | View Cart |
| Article: |
Building a Game Engine with Cocoa, Part 2 | |
| Subject: | Incorrect Boolean login in NOTEQUAL_NSPOINTS? | |
| Date: | 2007-01-06 07:15:35 | |
| From: | ptwobrussell | |
|
Response to: Incorrect Boolean login in NOTEQUAL_NSPOINTS?
|
||
|
Joe, That's a great catch. According to DeMorgan's law, you're absolutely correct. The reason this typo (from where I'd cut/pasted the previous macro) didn't surface in the execution of the program as presented is that in all cases valid NSPoints were being compared to NIL_POINT. Thus, the sub-expressions always evaluate to NO. i.e. (NO && NO == NO) and (NO || NO == NO) and it didn't make a difference as far as the end result was concerned. When you compare a valid point to another valid point, however, there would have certainly been a noticeable bug in place.
|
||
Showing messages 1 through 5 of 5.
FIXED: Incorrect Boolean login in NOTEQUAL_NSPOINTS?[..]/BoardGame/GameBoard.h:77: error: array type has incomplete element type
In file included from [..]/BoardGame/AppController.m:5:
[..]/BoardGame/AppController.h:12: error: array type has incomplete element type
[..]/BoardGame/AppController.m:11: error: array type has incomplete element type
[..]/BoardGame/AppController.m: In function '-[AppController validLOAMovesFromSpot:withBoard:]':
[..]/BoardGame/AppController.m:13: error: type of formal parameter 4 is incomplete
[..]/BoardGame/AppController.m: In function '-[AppController awakeFromNib]':
[..]/BoardGame/AppController.m:38: error: type of formal parameter 4 is incomplete
In file included from [..]/BoardGame/GameBoard.m:7:
[..]/BoardGame/GameBoard.h:77: error: array type has incomplete element type
[..]/BoardGame/GameBoard.m:601: error: array type has incomplete element type
FIXED: Incorrect Boolean login in NOTEQUAL_NSPOINTS?
FIXED: Incorrect Boolean login in NOTEQUAL_NSPOINTS?
Looking forward to next time, where we'll finish this series off!