I wouldn't mind knocking this one out just to get my feet wet in the codebase.
My assumptions/steps I would take are as follows:
1) I should only update header files in the /common subdirectory. I assume files in /lib and whatnot are all 3rd party code?
2) Add #pragma once to the top of every header file in those directories. (would there be any headers that we'd want to exclude for some reason?)
3) Remove all instances of the "#ifndef - #define - #endif" dance in those directories.
4) Make sure it all compiles
Does that make sense?
Cool! @kduske we're ok with going ahead with this, right?
Everything in /common can be updated plus /lib/kdl (this is where we put utility code, it lives in the TrenchBroom git repo.) The other directories in /lib are 3rd-party git submodules. (vecmath is not really 3rd party but it's in a separate git repo at https://github.com/TrenchBroom/vecmath ).
My first suggestion would be try to do a regex find/replace so that it stays at the same position under the copyright comment:
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef KDL_COLLECTION_UTILS_H
#define KDL_COLLECTION_UTILS_H
#include <algorithm> // for std::remove
gets converted to:
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#pragma once
#include <algorithm> // for std::remove
Sure. The plan sounds good. We should give vecmath the same treatment in a separate PR for that repo.
There may be some stray header files elsewhere in the code, too.
For removing the #endifs at the end of the headers, is it ok to remove the comment too ?
i.e. remove this whole line:
#endif /* defined(TrenchBroom_TextureBrowserView) */
rather then leave the comment intact. /* defined(TrenchBroom_TextureBrowserView) */.
Yep, removing the whole #endif line including comment sounds good
Most helpful comment
Sure. The plan sounds good. We should give vecmath the same treatment in a separate PR for that repo.
There may be some stray header files elsewhere in the code, too.