-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warnings and analyzer issues #270
base: master
Are you sure you want to change the base?
Warnings and analyzer issues #270
Conversation
matrixManager is assigned before self is set to [self init..] or [super init..] Moved assignment to after self = [super init...]
targetName is declared and assigned a vale. Its first use is another assignment. Moved declaration to first assignment that gets used.
targetCoordinates is assined a value in its declaration. Its first use is another assignment. Moved declaration to first assignment that gets used.
Assignment at :1347 is redundant Removed this line. Moved declaration to first assignment that gets used.
Value stored in 'alpha' is never used. Removed variable altogether. Guess at desired behavior: - assign cached alpha to alpha component in textColor, - feed textColor to GetRGBAArrayFromInfo(), which may or may not change it, - multiply result by overallAlpha.
…nter dereference If error != NO_ERROR, we release and nillify self, then touch _source. Put subsequent code in else block.
10 warnings in PlayerEntityStickProfile.m Changed some arguments and return values from int to NSUInteger: jostick axis, control index, point count
Warning in OOPlanetEntity.m:124 in assignment to _shuttlesOnGround
cast activeMFD, NSUInteger, to int32 in call to INT_TO_JSVAL()
PlayerEntity.m:6918 and :6994 pass OOCreditsQuantity (aka 'unsigned long long') to int Changed markAsOffender prototype to use OOCreditsQuantity for offence_value.
…nter dereference We test for (self == nil) indicating this is a possibility. Then we touch an instance variable regardless. Removed this line. If self == nil, this is a null pointer dereference; if not, standardMatrixUniformLocations is already nil.
OK, this is a lot of stuff to check. Generally it looks OK and most of it can be committed, but I have a few comments. Fitst of all, now that we have entered feature freeze, the objective of every commit is to either improve documentation or fix broken behaviour. This PR contains various commits for fixing compiler warnings and, in principle, is OK to review for merge. However, if there are any doubts about the functionality of a specidic patch, I would prefer to keep the compiler warning than having to fix something that does not affect anything in the game code. With that in mind, the commits that I would like to discuss are:
The rest seems OK to me and I see no problem merging it. |
I realized we entered code freeze, and we could just leave all of these until after release of 1.86. They don't actually address any real problems anyway, just make compilation cleaner. (On for xcode 64 bit at least. Might even introduce new warnings for other platforms?) I didn't mean to suggest to merge all of this wholesale. Especially not at this time. Would it be better for things like this to add comments in the code? (On github, by clicking the blue + , not in the actual code..) An 'attention request' rather than a 'pull request' so to speak..
Question:
|
Right now the problem I am faced with is that I am not sure how to commit the parts that seem no problem and exclude the three commits that are under discussion. Compiler warning fixes are fine for code freeze, provided they do not change the behaviour of the game so the majority of the PR could go in, I am just not sure how. I think that at least the analyzer fixes to potential null pointer dereferences are particularly important and should go in. @jobi-wan since you are now a member of the project with write access, maybe it would be easier if you pushed the changes that are good to go directly to the repository. I can do it myself, if you prefer, just let me know. Regarding the commits:
Regarding the if with a negative condition, I don't think there is any particular consensus or guideline about how to handle such situations. What I normally do is just keep the style used by the original coder when editing someone else's code and try to follow a logic aligned to what you propose when I write new code. |
Yes, please go ahead. |
1a53bfd
to
22856e5
Compare
4d65277
to
be540a2
Compare
This branch addresses a bunch of compiler warnings and analyzer issues.
See individual commits for details.