From d9e1caa37e53c7dbc42b1fc652efc23a40c47c42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sun, 31 Jul 2022 19:56:53 +0200 Subject: Limit use of Hungarian notation. I don't hate Hungarian notation. It has some very nice qualities. But it also adds a lot of typing. That said, not using it feels a bit... unsafe. I might go back on this decision. We'll see. --- c/datalistview.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'c/datalistview.cpp') diff --git a/c/datalistview.cpp b/c/datalistview.cpp index 02a399f..dd59250 100644 --- a/c/datalistview.cpp +++ b/c/datalistview.cpp @@ -40,34 +40,34 @@ void DataListView::ResizeColumns(int w) void DataListView::ShowEpisode(const int iEpisode) { - extern EpisodeListView* const g_pElv; + extern EpisodeListView* const g_elv; ListView_DeleteAllItems(hWnd); Frame f; - const int iArity = 3; - const term_t t = PL_new_term_refs(iArity); + const int arity = 3; + const term_t t = PL_new_term_refs(arity); if (!PlPut(t, iEpisode)) return; - Query q (NULL, PL_predicate("episode_datum", iArity, "episode_data"), t); + Query q (NULL, PL_predicate("episode_datum", arity, "episode_data"), t); LVITEM lviKey = {LVIF_TEXT}; LVITEM lviValue = {LVIF_TEXT}; for (int i = 0; q.NextSolution(std::nothrow); i++) { - wstring_owner wsoKey; - wstring_owner wsoValue; + wstring_owner key; + wstring_owner value; - if (!(PlGet(t+1, &wsoKey) && PlGet(t+2, &wsoValue))) + if (!(PlGet(t+1, &key) && PlGet(t+2, &value))) continue; lviKey.iItem = i; lviKey.iSubItem = 0; - lviKey.pszText = wsoKey.p; + lviKey.pszText = key.p; ListView_InsertItem(hWnd, &lviKey); lviValue.iItem = i; lviValue.iSubItem = 1; - lviValue.pszText = wsoValue.p; + lviValue.pszText = value.p; ListView_SetItem(hWnd, &lviValue); } @@ -76,7 +76,7 @@ void DataListView::ShowEpisode(const int iEpisode) LVFINDINFO lvfi; lvfi.flags = LVFI_PARAM; lvfi.lParam = iEpisode; - int iItem = ListView_FindItem(g_pElv->hWnd, -1, &lvfi); + int iItem = ListView_FindItem(g_elv->hWnd, -1, &lvfi); if (iItem != -1) - ListView_EnsureVisible(g_pElv->hWnd, iItem, TRUE); + ListView_EnsureVisible(g_elv->hWnd, iItem, TRUE); } -- cgit v1.2.3