From 26ef1128d89057dbf1e334c1b7233ca9214ef6f3 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 9 Aug 2023 17:40:48 +0200 Subject: [PATCH] Initialize OAIgraph before usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Newer GCC releases warn about the scope being uninitialized: openair1/PHY/TOOLS/nr_phy_scope.c:1076:20: error: ‘graph.text’ is used uninitialized [-Werror=uninitialized] This is correct, as we don't initialize the scope. This commit correctly initializes the scope. --- openair1/PHY/TOOLS/nr_phy_scope.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openair1/PHY/TOOLS/nr_phy_scope.c b/openair1/PHY/TOOLS/nr_phy_scope.c index d07bf07076..79ac95ef73 100644 --- a/openair1/PHY/TOOLS/nr_phy_scope.c +++ b/openair1/PHY/TOOLS/nr_phy_scope.c @@ -193,7 +193,9 @@ void websrv_setpoint(int x, int y, websrv_scopedata_msg_t *msg) msg->data_xy[msg->data_xy[0]] = (int16_t)y; } #endif -static void commonGraph(OAIgraph_t *graph, int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label, FL_COLOR pointColor) { +static void commonGraph(OAIgraph_t *graph, int type, FL_Coord x, FL_Coord y, FL_Coord w, FL_Coord h, const char *label, FL_COLOR pointColor) +{ + memset(graph, 0, sizeof(*graph)); if (type==WATERFALL) { graph->waterFallh=h-15; graph->waterFallAvg=malloc(sizeof(*graph->waterFallAvg) * graph->waterFallh);