Code enhancement: remove some MSVS analysis warning (Part 2)

This commit is contained in:
Don Ho 2023-03-06 19:33:36 +01:00
parent c8e4e671da
commit 25be5dd3b6
13 changed files with 19 additions and 19 deletions

View File

@ -160,7 +160,7 @@ void DocTabView::bufferUpdated(Buffer * buffer, int mask)
if (mask & BufferChangeFilename)
{
tie.mask |= TCIF_TEXT;
tie.pszText = const_cast<TCHAR *>(encodedLabel);
tie.pszText = encodedLabel;
{
const TCHAR* in = buffer->getFileName();

View File

@ -30,7 +30,7 @@ public :
DocTabView():TabBarPlus(), _pView(NULL) {};
virtual ~DocTabView(){};
virtual void destroy() override {
void destroy() override {
TabBarPlus::destroy();
};
@ -84,7 +84,7 @@ public :
return _hideTabBarStatus;
};
virtual void reSizeTo(RECT & rc) override;
void reSizeTo(RECT & rc) override;
const ScintillaEditView* getScintillaEditView() const {
return _pView;

View File

@ -551,7 +551,7 @@ void ScintillaEditView::setSpecialStyle(const Style & styleToSet)
execute(SCI_STYLESETSIZE, styleID, styleToSet._fontSize);
}
void ScintillaEditView::setHotspotStyle(Style& styleToSet)
void ScintillaEditView::setHotspotStyle(const Style& styleToSet)
{
StyleMap* styleMap;
if ( _hotspotStyles.find(_currentBuffer) == _hotspotStyles.end() )

View File

@ -665,7 +665,7 @@ public:
scintillaNew_Proc(_hSelf, WM_MOUSEWHEEL, wParam, lParam);
};
void setHotspotStyle(Style& styleToSet);
void setHotspotStyle(const Style& styleToSet);
void setTabSettings(Lang *lang);
bool isWrapRestoreNeeded() const {return _wrapRestoreNeeded;};
void setWrapRestoreNeeded(bool isWrapRestoredNeeded) {_wrapRestoreNeeded = isWrapRestoredNeeded;};

View File

@ -40,7 +40,7 @@ intptr_t CALLBACK DocumentPeeker::run_dlgProc(UINT message, WPARAM /*wParam*/, L
return FALSE;
}
void DocumentPeeker::doDialog(POINT p, Buffer *pBuf, ScintillaEditView & scintSource)
void DocumentPeeker::doDialog(POINT p, Buffer *pBuf, const ScintillaEditView & scintSource)
{
if (!isCreated())
{
@ -58,7 +58,7 @@ void DocumentPeeker::goTo(POINT p)
}
void DocumentPeeker::syncDisplay(Buffer *buf, ScintillaEditView & scintSource)
void DocumentPeeker::syncDisplay(Buffer *buf, const ScintillaEditView & scintSource)
{
if (_pPeekerView)
{

View File

@ -33,8 +33,8 @@ public:
Window::init(hInst, hPere);
};
void doDialog(POINT p, Buffer *buf, ScintillaEditView & scintSource);
void syncDisplay(Buffer *buf, ScintillaEditView & scintSource);
void doDialog(POINT p, Buffer *buf, const ScintillaEditView & scintSource);
void syncDisplay(Buffer *buf, const ScintillaEditView & scintSource);
void setParent(HWND parent2set){
_hParent = parent2set;

View File

@ -139,7 +139,7 @@ bool FunctionParsersManager::getUnitPaserParameters(TiXmlNode *functionParser, g
}
bool FunctionParsersManager::loadFuncListFromXmlTree(generic_string & xmlDirPath, LangType lType, const generic_string& overrideId, int udlIndex)
bool FunctionParsersManager::loadFuncListFromXmlTree(const generic_string & xmlDirPath, LangType lType, const generic_string& overrideId, int udlIndex)
{
generic_string funcListRulePath = xmlDirPath;
funcListRulePath += TEXT("\\");
@ -241,7 +241,7 @@ bool FunctionParsersManager::loadFuncListFromXmlTree(generic_string & xmlDirPath
return true;
}
bool FunctionParsersManager::getOverrideMapFromXmlTree(generic_string & xmlDirPath)
bool FunctionParsersManager::getOverrideMapFromXmlTree(const generic_string & xmlDirPath)
{
generic_string funcListRulePath = xmlDirPath;
funcListRulePath += TEXT("\\overrideMap.xml");

View File

@ -159,8 +159,8 @@ private:
ParserInfo* _parsers[L_EXTERNAL + nbMaxUserDefined] = {nullptr};
int _currentUDIndex = L_EXTERNAL;
bool getOverrideMapFromXmlTree(generic_string & xmlDirPath);
bool loadFuncListFromXmlTree(generic_string & xmlDirPath, LangType lType, const generic_string& overrideId, int udlIndex = -1);
bool getOverrideMapFromXmlTree(const generic_string & xmlDirPath);
bool loadFuncListFromXmlTree(const generic_string & xmlDirPath, LangType lType, const generic_string& overrideId, int udlIndex = -1);
bool getZonePaserParameters(TiXmlNode *classRangeParser, generic_string &mainExprStr, generic_string &openSymboleStr, generic_string &closeSymboleStr, std::vector<generic_string> &classNameExprArray, generic_string &functionExprStr, std::vector<generic_string> &functionNameExprArray);
bool getUnitPaserParameters(TiXmlNode *functionParser, generic_string &mainExprStr, std::vector<generic_string> &functionNameExprArray, std::vector<generic_string> &classNameExprArray);
FunctionParser * getParser(const AssociationInfo & assoInfo);

View File

@ -56,7 +56,7 @@ public:
Splitter() = default;
virtual ~Splitter() = default;
virtual void destroy() override;
void destroy() override;
void resizeSpliter(RECT *pRect = NULL);
void init(HINSTANCE hInst, HWND hPere, int splitterSize, double iSplitRatio, DWORD dwFlags);

View File

@ -35,7 +35,7 @@ public:
bool setPartWidth(int whichPart, int width);
virtual void destroy() override;
void destroy() override;
virtual void reSizeTo(const RECT& rc);
int getHeight() const override;
@ -46,7 +46,7 @@ public:
private:
virtual void init(HINSTANCE hInst, HWND hPere) override;
void init(HINSTANCE hInst, HWND hPere) override;
private:
std::vector<int> _partWidthArray;

View File

@ -618,7 +618,7 @@ bool TreeView::canDragOut(HTREEITEM targetItem)
bool TreeView::searchLeafAndBuildTree(TreeView & tree2Build, const generic_string & text2Search, int index2Search)
bool TreeView::searchLeafAndBuildTree(const TreeView & tree2Build, const generic_string & text2Search, int index2Search)
{
//tree2Build.removeAllItems();
//HTREEITEM root = getRoot();

View File

@ -116,7 +116,7 @@ public:
bool swapTreeViewItem(HTREEITEM itemGoDown, HTREEITEM itemGoUp);
bool restoreFoldingStateFrom(const TreeStateNode & treeState2Compare, HTREEITEM treeviewNode);
bool retrieveFoldingStateTo(TreeStateNode & treeState2Construct, HTREEITEM treeviewNode);
bool searchLeafAndBuildTree(TreeView & tree2Build, const generic_string & text2Search, int index2Search);
bool searchLeafAndBuildTree(const TreeView & tree2Build, const generic_string & text2Search, int index2Search);
void sort(HTREEITEM hTreeItem, bool isRecusive);
void customSorting(HTREEITEM hTreeItem, PFNTVCOMPARE sortingCallbackFunc, LPARAM lParam, bool isRecursive);
BOOL setImageList(int w, int h, int nbImage, int image_id, ...);

View File

@ -29,7 +29,7 @@ namespace
{
void allowPrivilegeMessages(Notepad_plus_Window& notepad_plus_plus, winVer winVer)
void allowPrivilegeMessages(const Notepad_plus_Window& notepad_plus_plus, winVer winVer)
{
#ifndef MSGFLT_ADD
const DWORD MSGFLT_ADD = 1;