diff --git cleanup_code.sh cleanup_code.sh old mode 100644 new mode 100755 diff --git dataobj/powernet.h dataobj/powernet.h index c4bd7e28a..23dffbbd7 100644 --- dataobj/powernet.h +++ dataobj/powernet.h @@ -3,8 +3,6 @@ * (see LICENSE.txt) */ -/** @file powernet.h Data structure to manage a net of powerlines - a powernet */ - #ifndef DATAOBJ_POWERNET_H #define DATAOBJ_POWERNET_H @@ -12,6 +10,10 @@ #include "../simtypes.h" #include "../tpl/slist_tpl.h" + +/** @file powernet.h Data structure to manage a net of powerlines - a powernet */ + + /** * Data class for power networks. A two phase queue to store * and hand out power. diff --git descriptor/intro_dates.h descriptor/intro_dates.h index 58b9af0d8..8bf98978a 100644 --- descriptor/intro_dates.h +++ descriptor/intro_dates.h @@ -3,11 +3,13 @@ * (see LICENSE.txt) */ -// just some default intro and retirement dates, if nothing else is defined +#ifndef DESCRIPTOR_INTRO_DATES_H +#define DESCRIPTOR_INTRO_DATES_H -#ifndef DEFAULT_INTRO_DATE +// just some default intro and retirement dates, if nothing else is defined #define DEFAULT_INTRO_DATE (1900) #define DEFAULT_RETIRE_DATE (2999) + #endif diff --git descriptor/reader/root_reader.h descriptor/reader/root_reader.h index f98d65c41..630df7d38 100644 --- descriptor/reader/root_reader.h +++ descriptor/reader/root_reader.h @@ -3,6 +3,10 @@ * (see LICENSE.txt) */ +#ifndef DESCRIPTOR_READER_ROOT_READER_H +#define DESCRIPTOR_READER_ROOT_READER_H + + #include "obj_reader.h" class root_reader_t : public obj_reader_t { @@ -19,3 +23,5 @@ public: protected: void register_obj(obj_desc_t*&) OVERRIDE; }; + +#endif diff --git descriptor/reader/text_reader.h descriptor/reader/text_reader.h index fe539df48..45824977b 100644 --- descriptor/reader/text_reader.h +++ descriptor/reader/text_reader.h @@ -3,6 +3,10 @@ * (see LICENSE.txt) */ +#ifndef DESCRIPTOR_READER_TEXT_READER_H +#define DESCRIPTOR_READER_TEXT_READER_H + + #include "obj_reader.h" class text_reader_t : public obj_reader_t { @@ -17,3 +21,5 @@ public: obj_type get_type() const OVERRIDE { return obj_text; } char const* get_type_name() const OVERRIDE { return "text"; } }; + +#endif diff --git descriptor/reader/xref_reader.h descriptor/reader/xref_reader.h index 4da6c0010..9edd12473 100644 --- descriptor/reader/xref_reader.h +++ descriptor/reader/xref_reader.h @@ -3,6 +3,10 @@ * (see LICENSE.txt) */ +#ifndef DESCRIPTOR_READER_XREF_READER_H +#define DESCRIPTOR_READER_XREF_READER_H + + #include "obj_reader.h" class xref_reader_t : public obj_reader_t { @@ -21,3 +25,5 @@ public: obj_desc_t* read_node(FILE*, obj_node_info_t&) OVERRIDE; }; + +#endif diff --git gui/components/gui_button.h gui/components/gui_button.h index 5678cd002..6a27f5861 100644 --- gui/components/gui_button.h +++ gui/components/gui_button.h @@ -3,10 +3,6 @@ * (see LICENSE.txt) */ -/* - * Defines all button types: Normal (roundbox), Checkboxes (square), Arrows, Scrollbars - */ - #ifndef GUI_COMPONENTS_GUI_BUTTON_H #define GUI_COMPONENTS_GUI_BUTTON_H @@ -22,6 +18,7 @@ class karte_ptr_t; /** * Class for buttons in Windows + * Defines all button types: Normal (roundbox), Checkboxes (square), Arrows, Scrollbars */ class button_t : public gui_action_creator_t, diff --git gui/components/gui_convoiinfo.h gui/components/gui_convoiinfo.h index 6f4d05cc6..90d02ea4a 100644 --- gui/components/gui_convoiinfo.h +++ gui/components/gui_convoiinfo.h @@ -3,10 +3,6 @@ * (see LICENSE.txt) */ -/* - * Convoi info stats, like loading status bar - */ - #ifndef GUI_COMPONENTS_GUI_CONVOIINFO_H #define GUI_COMPONENTS_GUI_CONVOIINFO_H @@ -18,6 +14,7 @@ #include "../../convoihandle_t.h" /** + * Convoi info stats, like loading status bar * One element of the vehicle list display */ class gui_convoiinfo_t : public gui_aligned_container_t, public gui_scrolled_list_t::scrollitem_t diff --git gui/convoi_detail_t.h gui/convoi_detail_t.h index 0816ee3bd..422ee3fa3 100644 --- gui/convoi_detail_t.h +++ gui/convoi_detail_t.h @@ -3,6 +3,10 @@ * (see LICENSE.txt) */ +#ifndef GUI_CONVOI_DETAIL_T_H +#define GUI_CONVOI_DETAIL_T_H + + #include "components/gui_aligned_container.h" #include "components/gui_scrollpane.h" #include "components/gui_button.h" @@ -50,3 +54,5 @@ public: void rdwr( loadsave_t *file ); }; + +#endif diff --git gui/convoi_info_t.h gui/convoi_info_t.h index 55b3eddf9..f243fca57 100644 --- gui/convoi_info_t.h +++ gui/convoi_info_t.h @@ -3,6 +3,9 @@ * (see LICENSE.txt) */ +#ifndef GUI_CONVOI_INFO_T_H +#define GUI_CONVOI_INFO_T_H + #include "gui_frame.h" #include "components/gui_scrollpane.h" @@ -121,3 +124,5 @@ public: void route_search_finished() { route_search_in_progress = false; } }; + +#endif diff --git gui/halt_list_filter_frame.h gui/halt_list_filter_frame.h index 4fc86813e..e34b11e10 100644 --- gui/halt_list_filter_frame.h +++ gui/halt_list_filter_frame.h @@ -3,6 +3,10 @@ * (see LICENSE.txt) */ +#ifndef GUI_HALT_LIST_FILTER_FRAME_H +#define GUI_HALT_LIST_FILTER_FRAME_H + + #include "gui_frame.h" #include "components/gui_label.h" #include "components/gui_scrollpane.h" @@ -127,3 +131,5 @@ public: bool action_triggered(gui_action_creator_t*, value_t) OVERRIDE; }; + +#endif diff --git gui/line_management_gui.h gui/line_management_gui.h index 41e195869..b327a7340 100644 --- gui/line_management_gui.h +++ gui/line_management_gui.h @@ -3,6 +3,10 @@ * (see LICENSE.txt) */ +#ifndef GUI_LINE_MANAGEMENT_GUI_H +#define GUI_LINE_MANAGEMENT_GUI_H + + #include "schedule_gui.h" #include "../linehandle_t.h" @@ -26,3 +30,5 @@ public: private: linehandle_t line; }; + +#endif diff --git gui/simwin.h gui/simwin.h index ad65a6886..ed28058dd 100644 --- gui/simwin.h +++ gui/simwin.h @@ -3,11 +3,6 @@ * (see LICENSE.txt) */ -/* - * The function implements a WindowManager 'Object' - * There's only one WindowManager - */ - #ifndef GUI_SIMWIN_H #define GUI_SIMWIN_H @@ -17,6 +12,13 @@ #include "../simtypes.h" #include "../simconst.h" + +/* + * The function implements a WindowManager 'Object' + * There's only one WindowManager + */ + + class karte_t; class scr_coord; class loadsave_t; diff --git gui/sound_frame.h gui/sound_frame.h index 2449e8b7e..cd96e6554 100644 --- gui/sound_frame.h +++ gui/sound_frame.h @@ -3,6 +3,10 @@ * (see LICENSE.txt) */ +#ifndef GUI_SOUND_FRAME_H +#define GUI_SOUND_FRAME_H + + #include "gui_frame.h" #include "components/gui_scrollbar.h" #include "components/gui_label.h" @@ -42,3 +46,5 @@ public: bool action_triggered(gui_action_creator_t*, value_t) OVERRIDE; }; + +#endif diff --git scrolltext.h scrolltext.h index 152a9bd92..2928017ed 100644 --- scrolltext.h +++ scrolltext.h @@ -3,6 +3,10 @@ * (see LICENSE.txt) */ +#ifndef SCROLLTEXT_H +#define SCROLLTEXT_H + + /* first part is left, second part right side */ "","", @@ -128,3 +132,5 @@ "","", "","", 0 + +#endif diff --git simconst.h simconst.h index 3def1ab0e..39467409d 100644 --- simconst.h +++ simconst.h @@ -3,13 +3,14 @@ * (see LICENSE.txt) */ +#ifndef SIMCONST_H +#define SIMCONST_H + + /* * all defines that can change the compiling */ -#ifndef SIMCONST_H -#define SIMCONST_H - // color depth (default assumes RGB565), undefine only for rgb555 builds! //#define RGB555 diff --git simio.h simio.h index d9a135c45..171db7930 100644 --- simio.h +++ simio.h @@ -3,8 +3,14 @@ * (see LICENSE.txt) */ +#ifndef SIMIO_H +#define SIMIO_H + + /** * Reads a line from a file. Skips lines starting with # * @see fgets */ char *read_line(char *s, int size, FILE *stream); + +#endif diff --git simmenu.h simmenu.h index ac8b32afb..88964c8b5 100644 --- simmenu.h +++ simmenu.h @@ -3,8 +3,6 @@ * (see LICENSE.txt) */ -/// New configurable OOP tool system - #ifndef SIMMENU_H #define SIMMENU_H @@ -18,6 +16,8 @@ #include "simtypes.h" #include "display/simimg.h" +/// New configurable OOP tool system + template class vector_tpl; template class slist_tpl; diff --git tpl/ptrhashtable_tpl.h tpl/ptrhashtable_tpl.h index b34e06b77..aee4656a2 100644 --- tpl/ptrhashtable_tpl.h +++ tpl/ptrhashtable_tpl.h @@ -3,10 +3,6 @@ * (see LICENSE.txt) */ -/* - * a template class which implements a hashtable with pointer keys - */ - #ifndef TPL_PTRHASHTABLE_TPL_H #define TPL_PTRHASHTABLE_TPL_H @@ -15,6 +11,7 @@ #include // intptr_t (standard) #include // ptrdiff_t, intptr_t (Microsoft) + /* * Define the key characteristics for hashing pointers. For hashing the * direct value is used. @@ -48,8 +45,8 @@ public: }; -/* - * Ready to use class for hashing pointers. +/** + * Implements a hashtable with pointer keys */ template class ptrhashtable_tpl : public hashtable_tpl > diff --git utils/csv.h utils/csv.h index 96823d384..18f545ff4 100644 --- utils/csv.h +++ utils/csv.h @@ -3,6 +3,13 @@ * (see LICENSE.txt) */ +#ifndef UTILS_CSV_H +#define UTILS_CSV_H + + +#include "cbuffer_t.h" + + /* Provides functionality for building a buffer containing CSV encoded data. This is done in a very simple way, building up @@ -54,13 +61,6 @@ Field1 Header,Field2 Header field1 data,"field2, data" */ - -#ifndef UTILS_CSV_H -#define UTILS_CSV_H - - -#include "cbuffer_t.h" - class CSV_t { // The raw data itself (stored encoded) cbuffer_t contents; diff --git utils/fetchopt.h utils/fetchopt.h index ee5bcb5e7..e658058b1 100644 --- utils/fetchopt.h +++ utils/fetchopt.h @@ -3,7 +3,11 @@ * (see LICENSE.txt) */ -/* +#ifndef UTILS_FETCHOPT_H +#define UTILS_FETCHOPT_H + + +/** This class can be used to parse unix-style single character command line options. It is intended to provide a similar interface to the POSIX getopt() function. @@ -72,11 +76,6 @@ while ((ch = fetchopt.next()) != -1) { // argv[fetchopt.get_optind()] = "somecommand" */ - -#ifndef UTILS_FETCHOPT_H -#define UTILS_FETCHOPT_H - - class Fetchopt_t { const char *optstr; // Options definition string int ac; // argc