From 50795cdf435f4149f3fed8c7f7f3cb1b7d5e8791 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 26 Nov 2017 17:27:51 +0100 Subject: [PATCH] Declare buffer at function start. --- server/TracyView.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index e15e06f5..4bfd9f03 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -3165,6 +3165,9 @@ enum { PlotHeight = 100 }; int View::DrawPlots( int offset, double pxns, const ImVec2& wpos, bool hover ) { + enum { MaxPoints = 512 }; + float tmpvec[MaxPoints*2]; + const auto w = ImGui::GetWindowContentRegionWidth() - 1; const auto ty = ImGui::GetFontSize(); auto draw = ImGui::GetWindowDrawList(); @@ -3287,12 +3290,10 @@ int View::DrawPlots( int offset, double pxns, const ImVec2& wpos, bool hover ) { prevx = it; - enum { MaxPoints = 512 }; skip = rsz / MaxPoints; const auto skip1 = std::max( 1, skip ); const auto sz = rsz / skip1 + 1; assert( sz <= MaxPoints*2 ); - float tmpvec[MaxPoints*2]; auto dst = tmpvec; for(;;)