Commit f1bd727f authored by Jonathan Jenkins's avatar Jonathan Jenkins

fix: multiple = lp names in cfg group breaks id calculation

parent 75e90381
...@@ -157,7 +157,7 @@ void codes_mapping_get_lp_id( ...@@ -157,7 +157,7 @@ void codes_mapping_get_lp_id(
} }
// does group name match? // does group name match?
if (strcmp(lpg->name, group_name) == 0){ if (strcmp(lpg->name, group_name) == 0){
tw_lpid local_rep_count = 0; tw_lpid local_lp_count = 0;
// for each lp type // for each lp type
for (int l = 0; l < lpg->lptypes_count; l++){ for (int l = 0; l < lpg->lptypes_count; l++){
const config_lptype_t *lpt = &lpg->lptypes[l]; const config_lptype_t *lpt = &lpg->lptypes[l];
...@@ -171,14 +171,12 @@ void codes_mapping_get_lp_id( ...@@ -171,14 +171,12 @@ void codes_mapping_get_lp_id(
} }
else{ else{
*gid += (rep_count * (tw_lpid)rep_id) + *gid += (rep_count * (tw_lpid)rep_id) +
local_rep_count + (tw_lpid)offset; local_lp_count + (tw_lpid)offset;
return; return;
} }
} }
} }
else{ local_lp_count += lpt->count;
local_rep_count += lpt->count;
}
} }
// after a group match, short circuit to end if lp not found // after a group match, short circuit to end if lp not found
goto ERROR; goto ERROR;
...@@ -193,11 +191,11 @@ ERROR: ...@@ -193,11 +191,11 @@ ERROR:
tw_error(TW_LOC, "Unable to find LP id given " tw_error(TW_LOC, "Unable to find LP id given "
"group \"%s\", " "group \"%s\", "
"typename \"%s\", " "typename \"%s\", "
"annotation \"%s\"", "annotation \"%s\", "
"repetition %d, and offset %d", "repetition %d, and offset %d",
group_name==NULL ? "<NULL>" : group_name, group_name==NULL ? "<NULL>" : group_name,
lp_type_name==NULL? "<NULL>" : lp_type_name, lp_type_name==NULL ? "<NULL>" : lp_type_name,
annotation==NULL ? "<NULL>" : annotation, annotation==NULL ? "<NULL>" : annotation,
rep_id, offset); rep_id, offset);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment