Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
dd838070
Commit
dd838070
authored
9 years ago
by
James Willis
Committed by
Matthieu Schaller
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added name of parameter file to error messages.
parent
22f10e35
No related branches found
No related tags found
1 merge request
!170
Added name of parameter file to error messages.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/parser.c
+5
-4
5 additions, 4 deletions
src/parser.c
src/parser.h
+1
-0
1 addition, 0 deletions
src/parser.h
with
6 additions
and
4 deletions
src/parser.c
+
5
−
4
View file @
dd838070
...
...
@@ -70,6 +70,7 @@ void parser_read_file(const char *file_name, struct swift_params *params) {
/* Initialise parameter count. */
params
->
paramCount
=
0
;
params
->
sectionCount
=
0
;
strcpy
(
params
->
fileName
,
file_name
);
/* Check if parameter file exits. */
if
(
file
==
NULL
)
{
...
...
@@ -375,7 +376,7 @@ int parser_get_param_int(const struct swift_params *params, const char *name) {
}
}
error
(
"Cannot find '%s' in the structure
."
,
n
ame
);
error
(
"Cannot find '%s' in the structure
, in file '%s'."
,
name
,
params
->
fileN
ame
);
return
0
;
}
...
...
@@ -407,7 +408,7 @@ char parser_get_param_char(const struct swift_params *params,
}
}
error
(
"Cannot find '%s' in the structure
."
,
n
ame
);
error
(
"Cannot find '%s' in the structure
, in file '%s'."
,
name
,
params
->
fileN
ame
);
return
0
;
}
...
...
@@ -439,7 +440,7 @@ float parser_get_param_float(const struct swift_params *params,
}
}
error
(
"Cannot find '%s' in the structure
."
,
n
ame
);
error
(
"Cannot find '%s' in the structure
, in file '%s'."
,
name
,
params
->
fileN
ame
);
return
0
.
f
;
}
...
...
@@ -470,7 +471,7 @@ double parser_get_param_double(const struct swift_params *params,
}
}
error
(
"Cannot find '%s' in the structure
."
,
n
ame
);
error
(
"Cannot find '%s' in the structure
, in file '%s'."
,
name
,
params
->
fileN
ame
);
return
0
.;
}
...
...
This diff is collapsed.
Click to expand it.
src/parser.h
+
1
−
0
View file @
dd838070
...
...
@@ -42,6 +42,7 @@ struct swift_params {
struct
parameter
data
[
PARSER_MAX_NO_OF_PARAMS
];
int
sectionCount
;
int
paramCount
;
char
fileName
[
PARSER_MAX_LINE_SIZE
];
};
/* Public API. */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment