From e96b4db3fb46384f286e9297186b87648c7219c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sun, 17 Jul 2022 02:05:15 +0200 Subject: Add const to pointers, update spacing. It seems that "right-spaced" pointers are more widely used among C++ programmers. --- c/main.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'c/main.cpp') diff --git a/c/main.cpp b/c/main.cpp index 73d1e3b..36738c5 100644 --- a/c/main.cpp +++ b/c/main.cpp @@ -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, -- cgit v1.2.3