From 83b6a43fd245368b2b605652b5ec3c6581e0b60c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Apitzsch?= Date: Mon, 25 Sep 2023 17:42:26 +0200 Subject: [PATCH] openflow: Fix error: variable 's' declared with deduced type 'auto' cannot appear in its own initializer --- src/openflow/model/openflow-interface.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openflow/model/openflow-interface.cc b/src/openflow/model/openflow-interface.cc index a74c1e70e..c7610893b 100644 --- a/src/openflow/model/openflow-interface.cc +++ b/src/openflow/model/openflow-interface.cc @@ -158,7 +158,7 @@ int Stats::FlowStatsInit(const void* body, int body_len, void** state) { const ofp_flow_stats_request* fsr = (ofp_flow_stats_request*)body; - auto s = (FlowStatsState*)xmalloc(sizeof *s); + auto s = (FlowStatsState*)xmalloc(sizeof(FlowStatsState)); s->table_idx = fsr->table_id == 0xff ? 0 : fsr->table_id; memset(&s->position, 0, sizeof s->position); @@ -325,7 +325,7 @@ Stats::PortTableStatsDump(Ptr swtch, void* state, ofpbu int Stats::PortStatsInit(const void* body, int body_len, void** state) { - auto s = (PortStatsState*)xmalloc(sizeof *s); + auto s = (PortStatsState*)xmalloc(sizeof(PortStatsState)); // the body contains a list of port numbers s->ports = (uint32_t*)xmalloc(body_len);