Skip to content

Commit

Permalink
add initalizers found by IntelliSense
Browse files Browse the repository at this point in the history
  • Loading branch information
chcg committed Aug 22, 2023
1 parent 7dcca50 commit 33dcca7
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions PythonScript/src/ConsoleDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void ConsoleDialog::initDialog(HINSTANCE hInst, NppData& nppData, ConsoleInterfa

m_console = console;
m_hContext = CreatePopupMenu();
MENUITEMINFO mi;
MENUITEMINFO mi{};
mi.cbSize = sizeof(mi);
mi.fMask = MIIM_ID | MIIM_STRING;
mi.fType = MFT_STRING;
Expand Down Expand Up @@ -149,7 +149,7 @@ INT_PTR CALLBACK ConsoleDialog::run_dlgProc(UINT message, WPARAM wParam, LPARAM

case WM_CONTEXTMENU:
{
MENUITEMINFO mi;
MENUITEMINFO mi{};
mi.cbSize = sizeof(mi);
mi.fMask = MIIM_STATE;
if (0 == (callScintilla(SCI_GETSELECTIONSTART) - callScintilla(SCI_GETSELECTIONEND)))
Expand Down Expand Up @@ -557,7 +557,7 @@ void ConsoleDialog::doDialog()
m_data->uMask = DWS_DF_CONT_BOTTOM | DWS_ICONTAB;
m_data->pszName = _T("Python");

RECT rc;
RECT rc{};
rc.bottom = 0;
rc.top = 0;
rc.left = 0;
Expand Down
2 changes: 1 addition & 1 deletion PythonScript/src/DebugTrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void printStack()
unsigned short frames;
SYMBOL_INFO * symbol;
HANDLE process;
char buffer[500];
char buffer[500]{};
int bufferRemaining = 500;
int usedBuffer;
char *output = buffer;
Expand Down
2 changes: 1 addition & 1 deletion PythonScript/src/HelpController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void HelpController::callHelp()

std::wstring HelpController::getFilename()
{
TCHAR helpPath[MAX_PATH];
TCHAR helpPath[MAX_PATH]{};
::SendMessage(m_hNotepad, NPPM_GETNPPDIRECTORY, MAX_PATH, reinterpret_cast<LPARAM>(helpPath));
_tcscat_s(helpPath, MAX_PATH, _T("\\plugins\\PythonScript\\doc"));

Expand Down
2 changes: 1 addition & 1 deletion PythonScript/src/ProcessExecute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ DWORD ProcessExecute::execute(const TCHAR *commandLine, boost::python::object py
else
{
DWORD errorNo = ::GetLastError();
TCHAR *buffer;
TCHAR* buffer = nullptr;

::FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, errorNo, 0, reinterpret_cast<LPTSTR>(&buffer), 0, NULL);

Expand Down
4 changes: 2 additions & 2 deletions PythonScript/src/PythonConsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void PythonConsole::pythonShowDialog()
// Post the message to ourselves (on the right thread) to create the window
if (!mp_consoleDlg->isCreated())
{
CommunicationInfo commInfo;
CommunicationInfo commInfo{};
commInfo.internalMsg = PYSCR_SHOWCONSOLE;
commInfo.srcModuleName = _T("PythonScript.dll");
TCHAR pluginName[] = _T("PythonScript.dll");
Expand Down Expand Up @@ -359,7 +359,7 @@ void PythonConsole::openFile(const char *filename, idx_t lineNo)

if (lineNo != IDX_MAX)
{
int currentView;
int currentView = 0;
SendMessage(m_hNotepad, NPPM_GETCURRENTSCINTILLA, 0, reinterpret_cast<LPARAM>(&currentView));

assert(m_nppData);
Expand Down
4 changes: 2 additions & 2 deletions PythonScript/src/PythonScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ extern "C" __declspec(dllexport) void beNotified(SCNotification *notifyCode)

case NPPN_FILESAVED:
{
TCHAR filename[MAX_PATH];
TCHAR filename[MAX_PATH]{};
::SendMessage(nppData._nppHandle, NPPM_GETFULLPATHFROMBUFFERID, notifyCode->nmhdr.idFrom, reinterpret_cast<LPARAM>(filename));
ConfigFile *configFile = ConfigFile::getInstance();
const tstring machineScripts = configFile->getMachineScriptsDir().c_str();
Expand Down Expand Up @@ -704,7 +704,7 @@ static void shutdown(void* /* dummy */)

static void doHelp()
{
int which;
int which = 0;

SendMessage(nppData._nppHandle, NPPM_GETCURRENTSCINTILLA, 0, reinterpret_cast<LPARAM>(&which));

Expand Down
12 changes: 6 additions & 6 deletions PythonScript/src/ShortcutDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ShortcutDlg::ShortcutDlg(HINSTANCE hInst, NppData& nppData, const TCHAR *scriptD
m_currentScript(NULL)
{
Window::init(hInst, nppData._nppHandle);
TCHAR temp[MAX_PATH];
TCHAR temp[MAX_PATH]{};
::SendMessage(nppData._nppHandle, NPPM_GETPLUGINSCONFIGDIR, MAX_PATH, reinterpret_cast<LPARAM>(temp));

m_userScriptDir = temp;
Expand Down Expand Up @@ -245,7 +245,7 @@ void ShortcutDlg::onInitDialog()
HBITMAP hPython = static_cast<HBITMAP>(LoadImage(_hInst, MAKEINTRESOURCE(IDB_PYTHON), IMAGE_BITMAP, 0, 0, LR_COLOR | LR_LOADMAP3DCOLORS | LR_DEFAULTSIZE));
m_hDefaultImageIndex = ImageList_Add(m_hImageList, hPython, NULL);
ListView_SetImageList(m_hListToolbarItems, m_hImageList, LVSIL_SMALL);
LVCOLUMN lvCol;
LVCOLUMN lvCol{};
lvCol.cchTextMax = 10;
lvCol.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT;
lvCol.iSubItem = 0;
Expand Down Expand Up @@ -360,7 +360,7 @@ void ShortcutDlg::populateScripts(tstring dir, HTREEITEM parent /* = TVI_ROOT */

HTREEITEM ShortcutDlg::addTreeItem(HTREEITEM parent, HTREEITEM /* lastItem */, TCHAR *fullPath, TCHAR *text, bool isDirectory)
{
TV_INSERTSTRUCT tvInsert;
TV_INSERTSTRUCT tvInsert{};
tvInsert.hParent = parent;
tvInsert.hInsertAfter = TVI_SORT;
tvInsert.item.mask = TVIF_TEXT | TVIF_PARAM |TVIF_IMAGE | TVIF_SELECTEDIMAGE;
Expand Down Expand Up @@ -394,7 +394,7 @@ void ShortcutDlg::addMenuItem()

void ShortcutDlg::addMenuItem(const TCHAR *item)
{
LVITEM lvItem;
LVITEM lvItem{};
lvItem.stateMask = LVIS_SELECTED;
lvItem.state = 0;
lvItem.iItem = (int)(m_menuItemCount++);
Expand Down Expand Up @@ -444,7 +444,7 @@ void ShortcutDlg::addToolbarItem(const TCHAR *item, HBITMAP hBitmap)
imageIndex = ImageList_Add(m_hImageList, hBitmap, NULL);
}

LVITEM lvItem;
LVITEM lvItem{};
lvItem.stateMask = LVIS_SELECTED;
lvItem.state = 0;
lvItem.iItem = (int)(m_toolbarItemCount++);
Expand Down Expand Up @@ -604,7 +604,7 @@ void ShortcutDlg::toolbarSetIcon()
it->second.first = static_cast<HBITMAP>(LoadImage(NULL, ofn.lpstrFile, IMAGE_BITMAP, 16, 16, LR_COLOR | LR_LOADFROMFILE));
it->second.second = ofn.lpstrFile;
int imageIndex = ImageList_Add(m_hImageList, it->second.first, NULL);
LVITEM lvItem;
LVITEM lvItem{};
lvItem.mask = LVIF_IMAGE;
lvItem.iItem = index;
lvItem.iImage = imageIndex;
Expand Down

0 comments on commit 33dcca7

Please sign in to comment.