Skip to content

Commit d54ec78

Browse files
committed
[LINT] error 834
Operator ‘Name’ followed by operator ‘Name’ is confusing. In the cases fixed here, there was no real possible confusion: simply +'s and -'s. However, keeping this clean would allow us to uncover potential mishaps with *'s and /'s in the future. Signed-off-by: Jocelyn Legault <[email protected]>
1 parent cfed9b1 commit d54ec78

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

PythonScript/src/ConsoleDialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -784,8 +784,8 @@ bool ConsoleDialog::parseVSErrorLine(LineDetails *lineDetails)
784784
break;
785785
}
786786

787-
char *lineNumber = new char[endLineNoPos - startLineNoPos + 2];
788-
strncpy_s(lineNumber, endLineNoPos - startLineNoPos + 2, lineDetails->line + startLineNoPos, endLineNoPos - startLineNoPos);
787+
char *lineNumber = new char[(endLineNoPos - startLineNoPos) + 2];
788+
strncpy_s(lineNumber, (endLineNoPos - startLineNoPos) + 2, lineDetails->line + startLineNoPos, endLineNoPos - startLineNoPos);
789789
lineDetails->errorLineNo = strtoul(lineNumber, NULL, 0) - 1;
790790
delete[] lineNumber;
791791
lineDetails->filenameEnd = startLineNoPos - 1;

PythonScript/src/MenuManager.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,17 +1077,17 @@ void MenuManager::idsInitialised()
10771077
{
10781078
if ((idx_t)m_funcItems[i]._cmdID != lastID + 1)
10791079
{
1080-
m_originalDynamicMenuManager->addBlock(startBlock, lastID - startBlock + 1);
1081-
m_dynamicMenuManager->addBlock(startBlock, lastID - startBlock + 1);
1080+
m_originalDynamicMenuManager->addBlock(startBlock, (lastID - startBlock) + 1);
1081+
m_dynamicMenuManager->addBlock(startBlock, (lastID - startBlock) + 1);
10821082
startBlock = (idx_t)m_funcItems[i]._cmdID;
10831083
}
10841084
lastID = (idx_t)m_funcItems[i]._cmdID;
10851085
}
10861086

1087-
if (startBlock != (idx_t)m_funcItems[m_dynamicStartIndex + m_originalDynamicCount - 1]._cmdID)
1087+
if (startBlock != (idx_t)m_funcItems[(m_dynamicStartIndex + m_originalDynamicCount) - 1]._cmdID)
10881088
{
1089-
m_originalDynamicMenuManager->addBlock(startBlock, lastID - startBlock + 1);
1090-
m_dynamicMenuManager->addBlock(startBlock, lastID - startBlock + 1);
1089+
m_originalDynamicMenuManager->addBlock(startBlock, (lastID - startBlock) + 1);
1090+
m_dynamicMenuManager->addBlock(startBlock, (lastID - startBlock) + 1);
10911091
}
10921092
}
10931093

PythonScript/src/ShortcutDlg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ void ShortcutDlg::onInitDialog()
230230

231231
RECT rect;
232232
::GetClientRect(m_hListToolbarItems, &rect);
233-
m_toolbarColumnWidth = (size_t)(rect.right - rect.left - 18);
233+
m_toolbarColumnWidth = (size_t)((rect.right - rect.left) - 18);
234234
lvCol.cx = m_toolbarColumnWidth;
235235
ListView_InsertColumn(m_hListToolbarItems, 0, &lvCol);
236236

0 commit comments

Comments
 (0)