Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
elpa
elpa
Commits
0397d70b
Commit
0397d70b
authored
Dec 11, 2018
by
Pavel Kus
Browse files
correcting the scanf specifier in elpa_index
parent
4a322ee6
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/elpa_index.c
View file @
0397d70b
...
...
@@ -332,7 +332,7 @@ FOR_ALL_TYPES(IMPLEMENT_FIND_ENTRY)
FOR_ALL_TYPES
(
IMPLEMENT_GETENV
)
#define IMPLEMENT_GET_FUNCTION(TYPE, PRINTF_SPEC, ERROR_VALUE) \
#define IMPLEMENT_GET_FUNCTION(TYPE, PRINTF_SPEC,
SCANF_SPEC,
ERROR_VALUE) \
TYPE elpa_index_get_##TYPE##_value(elpa_index_t index, char *name, int *error) { \
TYPE ret; \
if (sizeof(TYPE##_entries) == 0) { \
...
...
@@ -1244,7 +1244,7 @@ int elpa_index_print_autotune_state(elpa_index_t index, int autotune_level, int
const
int
LEN
=
1000
;
#define IMPLEMENT_LOAD_LINE(TYPE, PRINTF_SPEC, ...) \
#define IMPLEMENT_LOAD_LINE(TYPE, PRINTF_SPEC,
SCANF_SPEC,
...) \
static int load_##TYPE##_line(FILE* f, const char* expected, TYPE* val) { \
char line[LEN], s[LEN]; \
int error = 0; \
...
...
@@ -1253,7 +1253,7 @@ const int LEN =1000;
fprintf(stderr, "Loading autotuning state error: line is not there\n"); \
error = 1; \
} else{ \
sscanf(line, "%s = "
PRINT
F_SPEC "\n",
&
s, &n); \
sscanf(line, "%s = "
SCAN
F_SPEC "\n", s, &n); \
if(strcmp(s, expected) != 0){ \
fprintf(stderr, "Loading autotuning state error: expected %s, got %s\n", expected, s); \
error = 1;\
...
...
@@ -1379,7 +1379,7 @@ int elpa_index_load_settings(elpa_index_t index, char *file_name) {
}
if
(
line
[
0
]
!=
'\n'
&&
line
[
0
]
!=
'*'
){
sscanf
(
line
,
"%s = %d
\n
"
,
&
s
,
&
n
);
sscanf
(
line
,
"%s = %d
\n
"
,
s
,
&
n
);
if
(
!
skip
){
int
error
=
elpa_index_set_from_load_int_value
(
index
,
s
,
n
,
explicit
);
}
...
...
src/elpa_index.h
View file @
0397d70b
...
...
@@ -60,8 +60,8 @@
#define nelements(x) (sizeof(x)/sizeof(x[0]))
#define FOR_ALL_TYPES(X) \
X(int, "%d", -1) \
X(double, "%g", NAN)
X(int, "%d",
"%d",
-1) \
X(double, "%g",
"%lg",
NAN)
/* A simple structure for storing values to a pre-set
* number of keys */
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment