mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Use cylinder use helper function
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
74582de06c
commit
1739042f34
2 changed files with 4 additions and 14 deletions
|
@ -264,12 +264,8 @@ static void parse_cylinder_keyvalue(void *_cylinder, const char *key, const char
|
|||
return;
|
||||
}
|
||||
if (!strcmp(key, "use")) {
|
||||
for (enum cylinderuse i = 0; i < NUM_GAS_USE; i++) {
|
||||
if (same_string(value, cylinderuse_text[i])) {
|
||||
cylinder->cylinder_use = i;
|
||||
return;
|
||||
}
|
||||
}
|
||||
cylinder->cylinder_use = cylinderuse_from_text(value);
|
||||
return;
|
||||
}
|
||||
report_error("Unknown cylinder key/value pair (%s/%s)", key, value);
|
||||
}
|
||||
|
|
10
parse-xml.c
10
parse-xml.c
|
@ -338,14 +338,8 @@ static void pressure(char *buffer, pressure_t *pressure)
|
|||
|
||||
static void cylinder_use(char *buffer, enum cylinderuse *cyl_use)
|
||||
{
|
||||
if (trimspace(buffer)) {
|
||||
for (enum cylinderuse i = 0; i < NUM_GAS_USE; i++) {
|
||||
if (same_string(buffer, cylinderuse_text[i])) {
|
||||
*cyl_use = i;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (trimspace(buffer))
|
||||
*cyl_use = cylinderuse_from_text(buffer);
|
||||
}
|
||||
|
||||
static void salinity(char *buffer, int *salinity)
|
||||
|
|
Loading…
Add table
Reference in a new issue