diff --git a/Descent3/BriefingParse.cpp b/Descent3/BriefingParse.cpp index d356d0c06..014191b91 100644 --- a/Descent3/BriefingParse.cpp +++ b/Descent3/BriefingParse.cpp @@ -74,24 +74,7 @@ #include "voice.h" // constructor -CBriefParse::CBriefParse() { - AddTextEffect = NULL; - AddBmpEffect = NULL; - AddMovieEffect = NULL; - AddBkgEffect = NULL; - AddPolyEffect = NULL; - AddSoundEffect = NULL; - AddButtonEffect = NULL; - StartScreen = NULL; - EndScreen = NULL; - LoopCallback = NULL; - SetTitle = NULL; - SetStatic = NULL; - SetGlitch = NULL; - AddVoice = NULL; - linenum = 0; - parse_error = false; -} +CBriefParse::CBriefParse() {} // destructor CBriefParse::~CBriefParse() {} diff --git a/Descent3/BriefingParse.h b/Descent3/BriefingParse.h index 5eae21c1b..b50ccce32 100644 --- a/Descent3/BriefingParse.h +++ b/Descent3/BriefingParse.h @@ -91,20 +91,20 @@ class CBriefParse { int ParseBriefing(const char *filename); private: - void (*AddTextEffect)(TCTEXTDESC* desc, char *text, char *description, int id); - void (*AddBmpEffect)(TCBMPDESC* desc, char *description); - void (*AddMovieEffect)(TCMOVIEDESC* desc, char *description); - void (*AddBkgEffect)(TCBKGDESC* desc, char *description); - void (*AddPolyEffect)(TCPOLYDESC* desc, char *description); - void (*AddSoundEffect)(TCSNDDESC* desc, char *description); - void (*AddButtonEffect)(TCBUTTONDESC* desc, char *description, int id); - void (*StartScreen)(int screen_num, char *desc, char *layout, uint32_t mask_set, uint32_t mask_unset); - void (*EndScreen)(); - bool (*LoopCallback)(); - void (*SetTitle)(char *title); - void (*SetStatic)(float amount); - void (*SetGlitch)(float amount); - void (*AddVoice)(char *filename, int flags, char *description); + void (*AddTextEffect)(TCTEXTDESC* desc, char *text, char *description, int id) = nullptr; + void (*AddBmpEffect)(TCBMPDESC* desc, char *description) = nullptr; + void (*AddMovieEffect)(TCMOVIEDESC* desc, char *description) = nullptr; + void (*AddBkgEffect)(TCBKGDESC* desc, char *description) = nullptr; + void (*AddPolyEffect)(TCPOLYDESC* desc, char *description) = nullptr; + void (*AddSoundEffect)(TCSNDDESC* desc, char *description) = nullptr; + void (*AddButtonEffect)(TCBUTTONDESC* desc, char *description, int id) = nullptr; + void (*StartScreen)(int screen_num, char *desc, char *layout, uint32_t mask_set, uint32_t mask_unset) = nullptr; + void (*EndScreen)() = nullptr; + bool (*LoopCallback)() = nullptr; + void (*SetTitle)(char *title) = nullptr; + void (*SetStatic)(float amount) = nullptr; + void (*SetGlitch)(float amount) = nullptr; + void (*AddVoice)(char *filename, int flags, char *description) = nullptr; void ParseError(const char *msg, const char *p = NULL); const char *ParseComma(const char *p); @@ -117,8 +117,8 @@ class CBriefParse { bool ParseButtonEffect(const char *p); bool ParseTextEffect(const char *p, tTextBufferDesc *tbd); - int linenum; - bool parse_error; + int linenum = 0; + bool parse_error = false; }; #endif diff --git a/Descent3/hud.h b/Descent3/hud.h index 3b94ea4b1..a501f1592 100644 --- a/Descent3/hud.h +++ b/Descent3/hud.h @@ -652,14 +652,14 @@ struct tMsgList { ////////////////////////////////////////////////////////////////////////////// class MsgListConsole { - tMsgList *m_list; + tMsgList *m_list = nullptr; int m_x, m_y, m_w, m_h; - int m_bufline, m_buflen, m_curmsgs, m_numlines; - bool m_opened; - char *m_buffer; + int m_bufline = 0, m_buflen, m_curmsgs, m_numlines; + bool m_opened = false; + char *m_buffer = nullptr; char m_title[32]; - char **m_conlines; - int n_conlines; + char **m_conlines = nullptr; + int n_conlines = 0; int m_keydownstate; // -1 for up key, 1 for down key, 0 for none. float m_keydowntime; diff --git a/Descent3/hudmessage.cpp b/Descent3/hudmessage.cpp index d5f83b6b5..5fcaee6f0 100644 --- a/Descent3/hudmessage.cpp +++ b/Descent3/hudmessage.cpp @@ -1604,14 +1604,7 @@ const char *tMsgList::get(int i) { ////////////////////////////////////////////////////////////////////////////// -MsgListConsole::MsgListConsole() { - m_opened = false; - m_list = NULL; - m_buffer = NULL; - m_bufline = 0; - m_conlines = NULL; - n_conlines = 0; -} +MsgListConsole::MsgListConsole() {} MsgListConsole::~MsgListConsole() {} diff --git a/Descent3/mmItem.h b/Descent3/mmItem.h index 2605c6a16..bee7ebafb 100644 --- a/Descent3/mmItem.h +++ b/Descent3/mmItem.h @@ -112,10 +112,10 @@ void MenuScene(); // display menu scene class tmmItemQueue { #define tmmItemSIZE 8 tmmItemFX m_items[tmmItemSIZE]; - int16_t m_head, m_tail; + int16_t m_head = 0, m_tail = 0; public: - tmmItemQueue() { m_head = m_tail = 0; }; + tmmItemQueue() {}; ~tmmItemQueue(){}; void send(tmmItemFX &item) { // sends an item onto the queue int16_t temp = m_tail + 1; diff --git a/Descent3/pilot.cpp b/Descent3/pilot.cpp index 97ec42fea..039a1a2a4 100644 --- a/Descent3/pilot.cpp +++ b/Descent3/pilot.cpp @@ -1821,11 +1821,11 @@ class UIBmpWindow final : public UIStatic { private: void DrawBorder(); - bool animated; - int bm_handle; + bool animated = false; + int bm_handle = -1; float start_time; UIText text; - bool created; + bool created = false; }; // struct ship_pos @@ -2957,10 +2957,7 @@ void UI3DWindow::OnDraw() { } UIBmpWindow::UIBmpWindow() { - animated = false; - bm_handle = -1; start_time = timer_GetTime(); - created = false; } UIBmpWindow::~UIBmpWindow() {} diff --git a/lib/application.h b/lib/application.h index 85a7c0586..acd5fe486 100644 --- a/lib/application.h +++ b/lib/application.h @@ -81,10 +81,10 @@ const int OEAPP_WINDOWED = 1, // App will run in a window. May not be supported. OEAPP_CONSOLE = 8; // App will run in a console style window. class oeApplication { protected: - bool m_AppActive; + bool m_AppActive = true; public: - oeApplication() { m_AppActive = true; }; + oeApplication() {}; virtual ~oeApplication(){}; // initializes the object virtual void init() = 0; diff --git a/lib/psclass.h b/lib/psclass.h index a472775aa..90544894a 100644 --- a/lib/psclass.h +++ b/lib/psclass.h @@ -152,10 +152,10 @@ template class tList { template class tQueue { T m_items[t_LEN]; - int16_t m_head, m_tail; + int16_t m_head = 0, m_tail = 0; public: - tQueue() { m_head = m_tail = 0; }; + tQueue() {}; ~tQueue(){}; void send(T &item) { // sends an item onto the queue