From 8b3d01329439105ff7bd6263541a937382ed43b5 Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Wed, 29 Feb 2012 18:48:54 -0800 Subject: [PATCH] AP_Param: One more nexted group recursion disableable by macro * c.f. e5515bb6ef82 --- libraries/AP_Common/AP_Param.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/AP_Common/AP_Param.cpp b/libraries/AP_Common/AP_Param.cpp index d94d5a7f60..6648c6fc84 100644 --- a/libraries/AP_Common/AP_Param.cpp +++ b/libraries/AP_Common/AP_Param.cpp @@ -492,13 +492,16 @@ AP_Param::find_group(const char *name, uint8_t vindex, const struct GroupInfo *g for (uint8_t i=0; (type=PGM_UINT8(&group_info[i].type)) != AP_PARAM_NONE; i++) { +#ifdef AP_NESTED_GROUPS_ENABLED if (type == AP_PARAM_GROUP) { const struct GroupInfo *ginfo = (const struct GroupInfo *)PGM_POINTER(&group_info[i].group_info); AP_Param *ap = find_group(name, vindex, ginfo, ptype); if (ap != NULL) { return ap; } - } else if (strcasecmp_P(name, group_info[i].name) == 0) { + } else +#endif // AP_NESTED_GROUPS_ENABLED + if (strcasecmp_P(name, group_info[i].name) == 0) { uintptr_t p = PGM_POINTER(&_var_info[vindex].ptr); *ptype = (enum ap_var_type)type; return (AP_Param *)(p + PGM_POINTER(&group_info[i].offset));