Page MenuHomeWildfire Games

Fix Warnings of VS2015
Needs ReviewPublic

Authored by Stan on Thu, Nov 22, 10:39 PM.

Details

Summary

This patch fixes warnings when building the tests and atlas about a variable being redeclared, by getting rid of the macro

Test Plan

Test I didn't break anything.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 6461
Build 10701: Vulcan BuildJenkins

Event Timeline

Stan created this revision.Thu, Nov 22, 10:39 PM
Vulcan added a subscriber: Vulcan.Thu, Nov 22, 10:43 PM

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Default...
Executing section Source...

source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp
|  33| #include·"graphics/Terrain.h"
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Invalid number of character ({) when these macros are defined: ''.

source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp
|  33| #include·"graphics/Terrain.h"
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Invalid number of character ({) when these macros are defined: 'MESSAGES_SKIP_STRUCTS'.

source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp
|  33| #include·"graphics/Terrain.h"
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Invalid number of character ({) when these macros are defined: '_MSC_VER'.
Executing section JS...

Link to build: https://jenkins.wildfiregames.com/job/differential/794/

Stan planned changes to this revision.Fri, Nov 23, 9:08 AM

I will see if I can fix those warnings in terrain.h

The problem isn't in macros, because we use scoped block to solve the redeclaration. Probably it was missed somewhere. If you still remove macros, you need to remove scoped blocks too.

Stan added a comment.EditedFri, Nov 23, 9:52 AM

You can't remove braces see the comment I added : "scoping braces are important to indicate where an element ends. If you don't put them the tag won't be closed until the object's destructor is called, usually when it goes out of scope."

There was no way to update the macros to work because you couldn't know what users would name them. Also some of the macros were hacky.

Stan requested review of this revision.Fri, Nov 23, 12:57 PM

Can't fix those warnings, because they have no reasons to be.

https://github.com/0ad/0ad/search?q=MESSAGES_SKIP_STRUCTS&unscoped_q=MESSAGES_SKIP_STRUCTS

Angen added a comment.Fri, Nov 23, 2:34 PM

So far I can tell that warnings are solved. I did not try to run game with this patch yet.