A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Kill malek's leftovers
[simgrid.git]
/
src
/
gras
/
DataDesc
/
ddt_parse.c
diff --git
a/src/gras/DataDesc/ddt_parse.c
b/src/gras/DataDesc/ddt_parse.c
index
2bdd122
..
e06a297
100644
(file)
--- a/
src/gras/DataDesc/ddt_parse.c
+++ b/
src/gras/DataDesc/ddt_parse.c
@@
-198,13
+198,13
@@
static void change_to_matrix_of(xbt_dynar_t dynar,gras_datadesc_type_t subtype)
XBT_OUT;
}
XBT_OUT;
}
-static void add_free_f(xbt_dynar_t dynar,void_f_pvoid_t free_f) {
+static void add_free_f(xbt_dynar_t dynar,void_f_pvoid_t
*
free_f) {
s_identifier_t former,ref;
memset(&ref,0,sizeof(ref));
XBT_IN;
xbt_dynar_pop(dynar,&former);
s_identifier_t former,ref;
memset(&ref,0,sizeof(ref));
XBT_IN;
xbt_dynar_pop(dynar,&former);
- memcpy(former.type->extra,
&
free_f, sizeof(free_f));
+ memcpy(former.type->extra,free_f, sizeof(free_f));
xbt_dynar_push(dynar,&former);
XBT_OUT;
}
xbt_dynar_push(dynar,&former);
XBT_OUT;
}
@@
-249,7
+249,7
@@
static void parse_statement(char *definition,
/* FIXME: This does not detect recursive definitions at all? */
if (identifier.tm.is_union || identifier.tm.is_enum || identifier.tm.is_struct)
/* FIXME: This does not detect recursive definitions at all? */
if (identifier.tm.is_union || identifier.tm.is_enum || identifier.tm.is_struct)
- PARSE_ERROR0("
C
annot handle recursive type definition yet");
+ PARSE_ERROR0("
Unimplemented feature: GRAS_DEFINE_TYPE c
annot handle recursive type definition yet");
/**** get the base type, giving "short a" the needed love ****/
if (!identifier.tm.is_union &&
/**** get the base type, giving "short a" the needed love ****/
if (!identifier.tm.is_union &&
@@
-274,10
+274,10
@@
static void parse_statement(char *definition,
/**** build the base type for latter use ****/
if (identifier.tm.is_union) {
/**** build the base type for latter use ****/
if (identifier.tm.is_union) {
- PARSE_ERROR0("
C
annot handle union yet (get callback from annotation?)");
+ PARSE_ERROR0("
Unimplemented feature: GRAS_DEFINE_TYPE c
annot handle union yet (get callback from annotation?)");
} else if (identifier.tm.is_enum) {
} else if (identifier.tm.is_enum) {
- PARSE_ERROR0("
C
annot handle enum yet");
+ PARSE_ERROR0("
Unimplemented feature: GRAS_DEFINE_TYPE c
annot handle enum yet");
} else if (identifier.tm.is_struct) {
sprintf(buffname,"struct %s",identifier.type_name);
} else if (identifier.tm.is_struct) {
sprintf(buffname,"struct %s",identifier.type_name);
@@
-364,7
+364,7
@@
static void parse_statement(char *definition,
/* Handle fixed size arrays */
gras_ddt_parse_tok_num = gras_ddt_parse_lex_n_dump();
if (gras_ddt_parse_tok_num == GRAS_DDT_PARSE_TOKEN_RB) {
/* Handle fixed size arrays */
gras_ddt_parse_tok_num = gras_ddt_parse_lex_n_dump();
if (gras_ddt_parse_tok_num == GRAS_DDT_PARSE_TOKEN_RB) {
- PARSE_ERROR0("
C
annot deal with [] constructs (yet)");
+ PARSE_ERROR0("
Unimplemented feature: GRAS_DEFINE_TYPE c
annot deal with [] constructs (yet)");
} else if (gras_ddt_parse_tok_num == GRAS_DDT_PARSE_TOKEN_WORD) {
char *end;
} else if (gras_ddt_parse_tok_num == GRAS_DDT_PARSE_TOKEN_WORD) {
char *end;
@@
-468,6
+468,7
@@
static void parse_statement(char *definition,
} else {
PARSE_ERROR1("subtype annotation only accepted for dynars and matrices, but passed to '%s'",identifier.type_name);
}
} else {
PARSE_ERROR1("subtype annotation only accepted for dynars and matrices, but passed to '%s'",identifier.type_name);
}
+ free(keyval);
} else if (!strcmp(keyname,"free_f")) {
int *storage=xbt_dict_get_or_null(gras_dd_constants,keyval);
if (!storage)
} else if (!strcmp(keyname,"free_f")) {
int *storage=xbt_dict_get_or_null(gras_dd_constants,keyval);
if (!storage)
@@
-482,7
+483,9
@@
static void parse_statement(char *definition,
PARSE_ERROR1("free_f annotation only accepted for dynars and matrices which subtype is already declared (field %s)",
identifier.name);
}
PARSE_ERROR1("free_f annotation only accepted for dynars and matrices which subtype is already declared (field %s)",
identifier.name);
}
+ free(keyval);
} else {
} else {
+ free(keyval);
PARSE_ERROR1("Unknown annotation type: '%s'",keyname);
}
PARSE_ERROR1("Unknown annotation type: '%s'",keyname);
}
@@
-662,7
+665,7
@@
static gras_datadesc_type_t parse_typedef(char *definition) {
parse_type_modifier(&tm);
if (tm.is_ref)
parse_type_modifier(&tm);
if (tm.is_ref)
- PARSE_ERROR0("
C
annot handle reference without annotation");
+ PARSE_ERROR0("
GRAS_DEFINE_TYPE c
annot handle reference without annotation");
/* get the aliasing name */
if (gras_ddt_parse_tok_num != GRAS_DDT_PARSE_TOKEN_WORD)
/* get the aliasing name */
if (gras_ddt_parse_tok_num != GRAS_DDT_PARSE_TOKEN_WORD)
@@
-670,7
+673,7
@@
static gras_datadesc_type_t parse_typedef(char *definition) {
gras_ddt_parse_text);
/* (FIXME: should) build the alias */
gras_ddt_parse_text);
/* (FIXME: should) build the alias */
- PARSE_ERROR0("
C
annot handle typedef yet");
+ PARSE_ERROR0("
Unimplemented feature: GRAS_DEFINE_TYPE c
annot handle typedef yet");
XBT_OUT;
return typedef_desc;
XBT_OUT;
return typedef_desc;
@@
-745,5
+748,5
@@
void gras_datadesc_set_const(const char*name, int value) {
int *stored = xbt_new(int, 1);
*stored=value;
int *stored = xbt_new(int, 1);
*stored=value;
- xbt_dict_set(gras_dd_constants,name, stored,
free
);
+ xbt_dict_set(gras_dd_constants,name, stored,
xbt_free_f
);
}
}