Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Elsa Gonsiorowski
codes
Commits
211a7dac
Commit
211a7dac
authored
Aug 03, 2015
by
Jonathan Jenkins
Browse files
mapping: option to count only "first-found" lp entry
parent
d4bd177d
Changes
3
Show whitespace changes
Inline
Side-by-side
codes/codes_mapping.h
View file @
211a7dac
...
...
@@ -43,8 +43,10 @@ int codes_mapping_get_group_reps(const char* group_name);
* lp_type_name - name of LP type
* annotation - optional annotation. If NULL, entry is considered
* unannotated
* ignore_annos - If non-zero, then count across all annotations (and
* ignore whatever annotation parameter is passed in)
* ignore_annos - If zero, then count in an annotation-specific manner.
* If 1, then count the "first-found" LP in the
* configuration, regardless of annotation.
* Otherwise, count across all annotations.
*
* returns the number of LPs found (0 in the case of some combination of group,
* lp_type_name, and annotation not being found)
...
...
src/util/codes_mapping.c
View file @
211a7dac
...
...
@@ -125,6 +125,8 @@ int codes_mapping_get_lp_count(
lp_type_ct_total
+=
lpt
->
count
;
else
lp_type_ct_total
+=
lpt
->
count
*
lpg
->
repetitions
;
if
(
ignore_annos
==
1
)
break
;
}
}
}
...
...
tests/mapping_test.c
View file @
211a7dac
...
...
@@ -163,7 +163,7 @@ int main(int argc, char *argv[])
groups
[
g
],
lpnm
);
}
printf
(
"TEST1 %2d %6s %s ignore annos
\n
"
,
codes_mapping_get_lp_count
(
groups
[
g
],
0
,
lps
[
l
],
NULL
,
1
),
codes_mapping_get_lp_count
(
groups
[
g
],
0
,
lps
[
l
],
NULL
,
2
),
groups
[
g
],
lps
[
l
]);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment