@@ -51,6 +51,10 @@ string TimePoint::PrettyPrintDate() const
5151 if (offset > FS_PER_SECOND)
5252 {
5353 base += (offset / FS_PER_SECOND);
54+
55+ // cppcheck seems to think this is a divide by zero for some reason, it's obviously not
56+ // (FS_PER_SECOND is 1e15 which is only 50 bits long and comfortably fits in a signed int64)
57+ // cppcheck-suppress zerodiv
5458 offset = offset % (int64_t )FS_PER_SECOND;
5559 }
5660
@@ -79,6 +83,10 @@ string TimePoint::PrettyPrint() const
7983 if (offset > FS_PER_SECOND)
8084 {
8185 base += (offset / FS_PER_SECOND);
86+
87+ // cppcheck seems to think this is a divide by zero for some reason, it's obviously not
88+ // (FS_PER_SECOND is 1e15 which is only 50 bits long and comfortably fits in a signed int64)
89+ // cppcheck-suppress zerodiv
8290 offset = offset % (int64_t )FS_PER_SECOND;
8391 }
8492
@@ -103,11 +111,9 @@ string TimePoint::PrettyPrint() const
103111// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
104112// Construction / destruction
105113
106- HistoryDialog::HistoryDialog (HistoryManager& mgr, Session& session, MainWindow& wnd)
107- : Dialog(" History" , " History" , ImVec2(425 , 350 ))
114+ HistoryDialog::HistoryDialog (HistoryManager& mgr, Session* session, MainWindow* wnd)
115+ : Dialog(" History" , " History" , ImVec2(425 , 350 ), session, wnd )
108116 , m_mgr(mgr)
109- , m_session(session)
110- , m_parent(wnd)
111117 , m_rowHeight(0 )
112118 , m_selectionChanged(false )
113119 , m_selectedMarker(nullptr )
@@ -191,7 +197,7 @@ bool HistoryDialog::DoRender()
191197 }
192198
193199 // Force pin if we have a nickname or markers
194- auto & markers = m_session. GetMarkers (point->m_time );
200+ auto & markers = m_session-> GetMarkers (point->m_time );
195201 bool forcePin = false ;
196202 if (!point->m_nickname .empty () || !markers.empty ())
197203 {
@@ -297,7 +303,7 @@ bool HistoryDialog::DoRender()
297303 m_selectionChanged = true ;
298304 }
299305
300- m_parent. NavigateToTimestamp (m.m_offset );
306+ m_parent-> NavigateToTimestamp (m.m_offset );
301307 }
302308
303309 if (ImGui::BeginPopupContextItem ())
@@ -316,7 +322,7 @@ bool HistoryDialog::DoRender()
316322 // Nickname box
317323 ImGui::TableSetColumnIndex (2 );
318324 if (ImGui::InputText (" ###nick" , &m.m_name ))
319- m_parent. GetSession (). OnMarkerChanged ();
325+ m_session-> OnMarkerChanged ();
320326
321327 ImGui::PopID ();
322328 }
@@ -325,7 +331,7 @@ bool HistoryDialog::DoRender()
325331 if (deletingMarker)
326332 {
327333 markers.erase (markers.begin () + markerToDelete);
328- m_parent. GetSession (). OnMarkerChanged ();
334+ m_session-> OnMarkerChanged ();
329335 }
330336
331337 ImGui::TreePop ();
@@ -344,8 +350,8 @@ bool HistoryDialog::DoRender()
344350
345351 // Delete the selected row
346352 // (manual delete applies even if we have markers or a pin)
347- m_session. RemoveMarkers ((*itDelete)->m_time );
348- m_session. RemovePackets ((*itDelete)->m_time );
353+ m_session-> RemoveMarkers ((*itDelete)->m_time );
354+ m_session-> RemovePackets ((*itDelete)->m_time );
349355 m_mgr.m_history .erase (itDelete);
350356
351357 if (deletedSelection)
0 commit comments