Skip to content
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

Review/fix msvc warnings #44

Merged
merged 19 commits into from
Jun 22, 2011
Merged

Review/fix msvc warnings #44

merged 19 commits into from
Jun 22, 2011

Conversation

QbProg
Copy link
Collaborator

@QbProg QbProg commented Jun 19, 2011

Completed "first pass" of warning fixes, probably enough for 0.4, of the MSVC compiler (/W4)

Some warnings remain:

  • 64 bit warnings , as mostly related to 32-bit standard array access. Hopefully in the future the array size will match the architecture, at least where required
  • Breaking changes warnings : some warnings are not removed since they require a breaking change to be correctly fixed. Postponed to 0.5

Also , a bug was fixed but to insufficient array size.

I've marked some @todo here and there to mark critical points

QbProg added 17 commits June 19, 2011 18:30
Fixed uninitialized variables
Fixed unreachable code warnings
in this case a static function was called through an useless local var
fixed uninitialized vars warnings
Fixes warnings like : (potentially) uninitialized local variable 'name' used
Fixes unreachable code warnings
Fixes warnings like 'conversion' conversion from 'type1' to 'type2', possible loss of data
Fixes warnings like : assignment in conditional expression
Fixes warnings like : unused local variable 'name' or 'name' initialized but never used
Fixes warnings like 'function doesn't return a value' in one or more code-paths
Fixes warnings like : (potentially) uninitialized local variable 'name' used
Fixes warning like 'expression' : signed/unsigned mismatch
Fixes warnings where an invalid value is used in a switch of an enum value
@tpaviot
Copy link
Owner

tpaviot commented Jun 19, 2011

I still have to remove a few xcode warnings. I will work from your branch when it is merged to master.

@tpaviot
Copy link
Owner

tpaviot commented Jun 19, 2011

compiles under MacOSX.

+1

@dbarbier
Copy link
Collaborator

Hello, I am not sure that changes in CGM_Driver.cxx are fine with Borland compiler, IIRC patches had been committed to avoid trigraphs in function arguments. I believe that swapping assignments would work (ditto for int_style):

-    curatt.edge_vis = myEdgeVisibility = (DrawEdge ? ON : OFF);
+    myEdgeVisibility = curatt.edge_vis = (DrawEdge ? ON : OFF);

Anyway +1 for this branch, with or without this change.

@IvaKom
Copy link

IvaKom commented Jun 22, 2011

Hello, MSVS 2008 complains about using uninitialized pBuff variable at runtime. OSD/OSD_Environment.cxx, line 261. I fixed it with assigning a zero string ("") to it, works well.
Upd: initializing it with NULL (line 254) works as well.

@QbProg
Copy link
Collaborator Author

QbProg commented Jun 22, 2011

Thank you for the catch!
Strange that the compiler didn't complain at compile time, even with W4!

I'm fixing this in this branch, plus the other modification, and then
I will merge.
I will assign NULL instead of ""

Qb

2011/6/22 IvaKom
[email protected]:

Hello, MSVS 2008 complains about using uninitialized pBuff variable at runtime. OSD/OSD_Environment.cxx, line 261. I fixed it with assigning a zero string ("") to it, works well.

Reply to this email directly or view it on GitHub:
#44 (comment)

QbProg added 2 commits June 22, 2011 19:43
Fixed annoying runtime error appearing in MSVC/WIN32 about an uninitialized var
… and more compatible with borland compilers.
QbProg added a commit that referenced this pull request Jun 22, 2011
@QbProg QbProg merged commit 22fd4e0 into master Jun 22, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants