Spoiler:Code: Select all
1: /home/edward-san/zdoom/gzdoom/trunk/src/gl/data/gl_portaldata.cpp:226:26: warning: suggest braces around initialization of subobject [-Wmissing-braces] FCoverageLine vl = { *v1, *v2 }; ^~~~~~~~ { } 2: [ 76%] /home/edward-san/zdoom/gzdoom/trunk/src/gl/data/gl_setup.cpp:133:17: warning: comparison of integers of different signs: 'DWORD' (aka 'unsigned int') and 'int' [-Wsign-compare] for(DWORD i=0;i<numsegs;i++) ~^~~~~~~~ /home/edward-san/zdoom/gzdoom/trunk/src/gl/data/gl_setup.cpp:145:17: warning: comparison of integers of different signs: 'DWORD' (aka 'unsigned int') and 'int' [-Wsign-compare] for(DWORD i=0;i<numsegs;i++) ~^~~~~~~~ 3: /home/edward-san/zdoom/gzdoom/trunk/src/gl/textures/gl_material.cpp:438:8: warning: variable 'w' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (!tex->bHasCanvas) ^~~~~~~~~~~~~~~~ /home/edward-san/zdoom/gzdoom/trunk/src/gl/textures/gl_material.cpp:443:38: note: uninitialized use occurs here if (!hwtex->CreateTexture(buffer, w, h, true, te... ^ /home/edward-san/zdoom/gzdoom/trunk/src/gl/textures/gl_material.cpp:438:4: note: remove the 'if' if its condition is always true if (!tex->bHasCanvas) ^~~~~~~~~~~~~~~~~~~~~ /home/edward-san/zdoom/gzdoom/trunk/src/gl/textures/gl_material.cpp:433:9: note: initialize the variable 'w' to silence this warning int w, h; ^ = 0 /home/edward-san/zdoom/gzdoom/trunk/src/gl/textures/gl_material.cpp:438:8: warning: variable 'h' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (!tex->bHasCanvas) ^~~~~~~~~~~~~~~~ /home/edward-san/zdoom/gzdoom/trunk/src/gl/textures/gl_material.cpp:443:41: note: uninitialized use occurs here if (!hwtex->CreateTexture(buffer, w, h, true, te... ^ /home/edward-san/zdoom/gzdoom/trunk/src/gl/textures/gl_material.cpp:438:4: note: remove the 'if' if its condition is always true if (!tex->bHasCanvas) ^~~~~~~~~~~~~~~~~~~~~ /home/edward-san/zdoom/gzdoom/trunk/src/gl/textures/gl_material.cpp:433:12: note: initialize the variable 'h' to silence this warning int w, h; ^ = 0
Fix C++11 compiling errors and some warnings
Moderator: Graf Zahl
-
- Developer
- Posts: 197
- Joined: Sun Nov 29, 2009 16:36
Fix C++11 compiling errors and some warnings
Hi. I noticed that the c++11 fixes I made in zdoom is not complete in gzdoom, hence I submit two patches: the former should allow the compilation with a C++11 compiler, the latter should shut up these compiler warnings:
Spoiler:
- Attachments
-
- fixgzdoomwarns.txt
- (1.74 KiB) Downloaded 44 times
-
- c++11compile.txt
- (2.37 KiB) Downloaded 48 times