diff options
author | John Ankarström <john@ankarstrom.se> | 2022-07-17 02:05:15 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-07-17 02:05:15 +0200 |
commit | e96b4db3fb46384f286e9297186b87648c7219c4 (patch) | |
tree | 16766c9d41426ee110f374e5915ab5d6b9bcdb2a /c/main.cpp | |
parent | 26bc41099c10b3a63fd744690df5c25cb713718b (diff) | |
download | EpisodeBrowser-e96b4db3fb46384f286e9297186b87648c7219c4.tar.gz |
Add const to pointers, update spacing.
It seems that "right-spaced" pointers are more widely used among C++
programmers.
Diffstat (limited to 'c/main.cpp')
-rw-r--r-- | c/main.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -11,8 +11,8 @@ #include "main.h" #include "pl.h" -DataListView *g_lpDlv = nullptr; -EpisodeListView *g_lpElv = nullptr; +DataListView* g_lpDlv = nullptr; +EpisodeListView* g_lpElv = nullptr; atom_t g_aThread; char g_szLimitScreenwriter[64] = {0}; @@ -63,7 +63,7 @@ int WINAPI WinMain(const HINSTANCE hInstance, const HINSTANCE, const LPSTR lpCmd g_fBold = CreateFontIndirect(&lf); /* Initialize Prolog. */ - char *argv[] = { (char *)"EpisodeBrowser", NULL }; + char* argv[] = { (char*)"EpisodeBrowser", NULL }; if (!PL_initialise(1, argv)) throw std::runtime_error("Could not initialize Prolog."); if (!Pl("track_episodes","attach") || !Pl("episode_data","attach")) @@ -129,14 +129,14 @@ void OnTerminate() { try { std::rethrow_exception(std::current_exception()); - } catch (const term_t &t) { - TCHAR *tsz; + } catch (const term_t& t) { + TCHAR* tsz; if (PL_get_tchars(t, &tsz, CVT_WRITE)) { MessageBox(NULL, tsz, TEXT("Fatal Error"), MB_ICONERROR); } else MessageBoxA(NULL, "The program was terminated due to a Prolog exception.", "Fatal Error", MB_ICONERROR); - } catch (std::exception &e) { + } catch (std::exception& e) { MessageBoxA(NULL, e.what(), "Fatal Error", MB_ICONERROR); } catch (...) { MessageBoxA(NULL, "The program was terminated due to an exception.", @@ -166,7 +166,7 @@ static LRESULT CALLBACK CBTProc(int nCode, WPARAM wParam, LPARAM lParam) g_lpElv = new EpisodeListView(g_hWnd); /* Get saved view settings. */ - char *sz; + char* sz; Pl("cfg","get_view_watched",&g_bViewWatched); Pl("cfg","get_view_tv_original",&g_bViewTVOriginal); if (Pl("cfg","get_limit_screenwriter",&sz)) @@ -325,7 +325,7 @@ LRESULT CALLBACK WndProc(const HWND hWnd, const UINT uMsg, const WPARAM wParam, lvi.mask = LVIF_PARAM; if (!ListView_GetItem(g_lpElv->Handle(), &lvi)) break; - char *sz; + char* sz; if (!Pl("episode_data","episode_datum",lvi.lParam,"Screenwriter",&sz)) break; strcpy_s(g_szLimitScreenwriter, |