eecsninja
-
Posts
4 -
Joined
-
Last visited
Posts posted by eecsninja
-
-
^^^
I can't tell why we need the warnings when I read over the thread. What's the reason?
-
Resurrecting an old thread...
I just built 0AD for the first time and saw a bunch of these compiler warnings:
../../../source/tools/atlas/AtlasObject/AtlasObjectXML.cpp: In function ‘std::__cxx11::wstring fromXmlChar(const xmlChar*)’: ../../../source/tools/atlas/AtlasObject/AtlasObjectXML.cpp:96:31: warning: this statement may fall through [-Wimplicit-fallthrough=] case 5: ch += *source++; ch <<= 6; ~~~^~~~~
To get my feet wet with 0AD, I think I can rewrite the code to avoid these warnings and be a little cleaner.
- These break-less case statements are all repetitive. I could replace them with for loops.
- The number of cases (and if I were to make the change in #1, loop iterations) is hard-coded. They should be replaced with a constant for more clarity.
Let me know what you think.
- 1
-
Hi 0 AD community. I am a full-time software engineer at a large tech company. I have been programming since I was a kid, when I started learning C++ so I could write my own games for fun. It took me several years to get good enough to write my first game, Tetris.
I am a big fan of Age of Empires 2. That's how I heard about 0 A.D. I'd like to contribute to the code whenever I have time. It helps keeps my sanity when I don't get to write much code at work due to Big Company Reasons (TM).
- 2
Greetings from eecsninja
in Introductions & Off-Topic Discussion
Posted
@stanislas69 @feneur Thank you!