Skip to content
This repository has been archived by the owner on Feb 28, 2019. It is now read-only.

Commit

Permalink
Jump to latest data fix
Browse files Browse the repository at this point in the history
* Fix for amd64 in jump to latest data broke search
on i386 due to time_t overflow. This version works
on both platforms.
  • Loading branch information
Krzysztof Gałązka committed Nov 1, 2014
1 parent 5a9337a commit 32406e9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion wx/draw3/drawsctrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ void DrawsController::DisplayState::MoveScreenRight() {

void DrawsController::DisplayState::GoToLatestDate() {
const TimeIndex& index = m_c->m_draws[m_c->m_selected_draw]->GetTimeIndex();
wxDateTime t = wxDateTime(31, wxDateTime::Dec, 0xffff, 23, 59, 59)

// problem with 32bit time_t
int year = sizeof(time_t) == 8 ? 0xffff : 2037;

wxDateTime t = wxDateTime(31, wxDateTime::Dec, year, 23, 59, 59)
- index.GetTimeRes()
- index.GetDateRes();
m_c->EnterState(SEARCH_LEFT, DTime(m_c->GetPeriod(), t));
Expand Down

0 comments on commit 32406e9

Please sign in to comment.