Hi Pecan,
thank you for the effort.
With the last patch (svn13671 BrowseTracker Move ... ) I get a compile error when building on Linux with make. An include is missing:
I don't understand this, logmanager.h is an sdk header, not a BrowseTracker header. It's included in trunk\src\include\Makefile.am Should my include statement use quotes instead of <> brackets?
When scrolling very briefly through the diff I noticed a function with a suspiciously empty if statement. It looks like unintentional semantics:
void JumpTracker::OnLeftUp(wxMouseEvent& event) {
if (m_leftDown && (not m_isDragging)) {
// Pure click (no drag) occurred
}
m_leftDown = m_isDragging = false;
event.Skip();
}
I had removed some old code. I added a comment to make it clearer. But cppcheck won't like it anyway.
Rant: I have never gotten cppcheck to work reliably. It spews out vast amounts of error or warning messages even when the compiler or clangd does not.
When I run CppCheck over the BrowseTracker cb-project, I get several warnings. E.g.:
BrowseTrackerLayout.cpp:173:41: warning: Either the condition 'cursor' is redundant or there is possible null pointer dereference: cursor. [nullPointerRedundantCheck]
TiXmlElement* browsemarks = cursor->NextSiblingElement("BrowseMarks");
^
BrowseTrackerLayout.cpp:155:17: note: Assuming that condition 'cursor' is not redundant
if (cursor)
^
BrowseTrackerLayout.cpp:173:41: note: Null pointer dereference
TiXmlElement* browsemarks = cursor->NextSiblingElement("BrowseMarks");
^
or
BrowseSelector.cpp:93:17: warning: Member variable 'BrowseSelector::m_pBrowseTracker' is not initialized in the constructor. Member variables of native types, pointers, or references are left uninitialized when the class is instantiated. That may cause bugs or undefined behavior. [uninitMemberVarPrivate]
BrowseSelector::BrowseSelector()
^
BrowseSelector.cpp:93:17: warning: Member variable 'BrowseSelector::m_menuID' is not initialized in the constructor. Member variables of native types, pointers, or references are left uninitialized when the class is instantiated. That may cause bugs or undefined behavior. [uninitMemberVarPrivate]
BrowseSelector::BrowseSelector()
^
BrowseSelector.cpp:93:17: warning: Member variable 'BrowseSelector::m_KeyDownCode' is not initialized in the constructor. Member variables of native types, pointers, or references are left uninitialized when the class is instantiated. That may cause bugs or undefined behavior. [uninitMemberVarPrivate]
BrowseSelector::BrowseSelector()
^
BrowseSelector.cpp:93:17: warning: Member variable 'BrowseSelector::m_KeyDownMods' is not initialized in the constructor. Member variables of native types, pointers, or references are left uninitialized when the class is instantiated. That may cause bugs or undefined behavior. [uninitMemberVarPrivate]
BrowseSelector::BrowseSelector()
^
Besides other warnings.
Since the topic-starter observed a crash, these should be fixed.
Have a nice day.
Those variables were actually initialized, but the code got smushed without white space so that cppcheck didn't recognize it.
I re-formated it to cppcheck taste.
I've changed the "cursor" statement to guard against use of a nullptr. Thanks.
Thanks for looking at this.