From 4a584bad40493056bc7e143ce1a44ee98d9de6d6 Mon Sep 17 00:00:00 2001 From: epezent Date: Tue, 1 Sep 2020 08:22:49 -0500 Subject: [PATCH] fix compiler warning in demo --- implot_demo.cpp | 2 +- implot_items.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/implot_demo.cpp b/implot_demo.cpp index 504b032..213b8ac 100644 --- a/implot_demo.cpp +++ b/implot_demo.cpp @@ -1048,7 +1048,7 @@ void ShowDemoWindow(bool* p_open) { ImGui::BulletText("You can implement legend context menus to inject per-item controls and widgets."); ImGui::BulletText("Right click the legend label/icon to edit custom item attributes."); - static float frequency = 0.1; + static float frequency = 0.1f; static float amplitude = 0.5f; static ImVec4 color = ImVec4(1,1,0,1); static float alpha = 1.0f; diff --git a/implot_items.cpp b/implot_items.cpp index e3de59d..78daad6 100644 --- a/implot_items.cpp +++ b/implot_items.cpp @@ -105,7 +105,7 @@ void BustItemCache() { } // Begins a new item. Returns false if the item should not be plotted. -bool BeginItem(const char* label_id, ImPlotCol recolor_from) { +inline bool BeginItem(const char* label_id, ImPlotCol recolor_from) { ImPlotContext& gp = *GImPlot; IM_ASSERT_USER_ERROR(gp.CurrentPlot != NULL, "PlotX() needs to be called between BeginPlot() and EndPlot()!"); ImPlotItem* item = RegisterOrGetItem(label_id); @@ -162,7 +162,7 @@ bool BeginItem(const char* label_id, ImPlotCol recolor_from) { } // Ends an item (call only if BeginItem returns true) -void EndItem() { +inline void EndItem() { ImPlotContext& gp = *GImPlot; // pop rendering clip rect PopPlotClipRect();