File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -71,9 +71,10 @@ extern uint32_t ly_static_ext_plugins_count;
7171 * @return Type plugin.
7272 */
7373#define LYSC_GET_TYPE_PLG (PLUGIN_REF ) \
74+ ((PLUGIN_REF) ? \
7475 (((uintptr_t)(PLUGIN_REF) <= (uintptr_t)ly_static_type_plugins_count) ? \
7576 (struct lyplg_type *)&((struct lyplg_type_record *)ly_plugins_types.objs[(PLUGIN_REF) - 1])->plugin : \
76- (struct lyplg_type *)(PLUGIN_REF))
77+ (struct lyplg_type *)(PLUGIN_REF)) : NULL)
7778
7879/**
7980 * @brief Get an extension plugin.
@@ -83,9 +84,10 @@ extern uint32_t ly_static_ext_plugins_count;
8384 * @return Extension plugin.
8485 */
8586#define LYSC_GET_EXT_PLG (PLUGIN_REF ) \
87+ ((PLUGIN_REF) ? \
8688 (((uintptr_t)(PLUGIN_REF) <= (uintptr_t)ly_static_ext_plugins_count) ? \
8789 (struct lyplg_ext *)&((struct lyplg_ext_record *)ly_plugins_extensions.objs[(PLUGIN_REF) - 1])->plugin : \
88- (struct lyplg_ext *)(PLUGIN_REF))
90+ (struct lyplg_ext *)(PLUGIN_REF)) : NULL)
8991
9092/**
9193 * @brief Initiate libyang plugins.
You can’t perform that action at this time.
0 commit comments