Skip to content

Commit

Permalink
fix(userspace/libsinsp): break cases in plugin table type switch
Browse files Browse the repository at this point in the history
Co-authored-by: Lorenzo Susini <[email protected]>
Signed-off-by: Jason Dellaluce <[email protected]>
  • Loading branch information
2 people authored and poiana committed Jun 6, 2023
1 parent fa40721 commit 20d61be
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions userspace/libsinsp/plugin_table_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,25 @@ limitations under the License.
switch (_kt) \
{ \
case ss_plugin_state_type::SS_PLUGIN_ST_INT8: \
_X(int8_t, s8) \
_X(int8_t, s8); break; \
case ss_plugin_state_type::SS_PLUGIN_ST_INT16: \
_X(int16_t, s16) \
_X(int16_t, s16); break; \
case ss_plugin_state_type::SS_PLUGIN_ST_INT32: \
_X(int32_t, s32) \
_X(int32_t, s32); break; \
case ss_plugin_state_type::SS_PLUGIN_ST_INT64: \
_X(int64_t, s64) \
_X(int64_t, s64); break; \
case ss_plugin_state_type::SS_PLUGIN_ST_UINT8: \
_X(uint8_t, u8) \
_X(uint8_t, u8); break; \
case ss_plugin_state_type::SS_PLUGIN_ST_UINT16: \
_X(uint16_t, u16) \
_X(uint16_t, u16); break; \
case ss_plugin_state_type::SS_PLUGIN_ST_UINT32: \
_X(uint32_t, u32) \
_X(uint32_t, u32); break; \
case ss_plugin_state_type::SS_PLUGIN_ST_UINT64: \
_X(uint64_t, u64) \
_X(uint64_t, u64); break; \
case ss_plugin_state_type::SS_PLUGIN_ST_STRING: \
_X(std::string, str) \
_X(std::string, str); break; \
case ss_plugin_state_type::SS_PLUGIN_ST_BOOL: \
_X(bool, b) \
_X(bool, b); break; \
default: \
throw sinsp_exception("can't convert plugin state type to typeinfo: " + std::to_string(_kt)); \
} \
Expand Down Expand Up @@ -441,6 +441,7 @@ struct sinsp_table_wrapper
{ \
return static_cast<ss_plugin_table_entry_t*>(ret.get()); \
} \
return NULL; \
}
__CATCH_ERR_MSG(t->m_owner_plugin->m_last_owner_err, {
__PLUGIN_STATETYPE_SWITCH(t->m_key_type);
Expand Down Expand Up @@ -554,6 +555,7 @@ struct sinsp_table_wrapper
{ \
auto e = static_cast<libsinsp::state::table_entry*>(_e); \
auto ptr = std::unique_ptr<libsinsp::state::table_entry>(e); \
break; \
}
__CATCH_ERR_MSG(t->m_owner_plugin->m_last_owner_err, {
__PLUGIN_STATETYPE_SWITCH(t->m_key_type);
Expand Down

0 comments on commit 20d61be

Please sign in to comment.