/* ddt_new - creation/deletion of datatypes structs (private to this module)*/
-/* Copyright (c) 2003 Olivier Aumage. */
-/* Copyright (c) 2003, 2004 Martin Quinson. */
-/* All rights reserved. */
+/* Copyright (c) 2003-2009 The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
return;
}
- xbt_assert1(field_type->size != 0,
+ xbt_assert1(field_type->size[GRAS_THISARCH] >= 0,
"Cannot add a dynamically sized field in structure %s",
struct_type->name);
int arch;
XBT_IN3("(%s %s.%s;)",field_type->name,union_type->name,name);
- xbt_assert1(field_type->size != 0,
+ xbt_assert1(field_type->size[GRAS_THISARCH] >= 0,
"Cannot add a dynamically sized field in union %s",
union_type->name);
}
res = gras_ddt_new(name);
- xbt_assert1(fixed_size > 0, "'%s' is a array of null fixed size",name);
+ xbt_assert1(fixed_size >= 0, "'%s' is a array of negative fixed size",name);
for (arch=0; arch<gras_arch_count; arch ++) {
res->size[arch] = fixed_size * element_type->aligned_size[arch];
res->alignment[arch] = element_type->alignment[arch];
"Redefinition of type %s does not match", name);
xbt_assert1(res->category.array_data.type == element_type,
"Redefinition of type %s does not match", name);
- xbt_assert1(res->category.array_data.fixed_size == 0,
+ xbt_assert1(res->category.array_data.fixed_size == -1,
"Redefinition of type %s does not match", name);
xbt_assert1(res->category.array_data.dynamic_size == dynamic_size,
"Redefinition of type %s does not match", name);
res->category_code = e_gras_datadesc_type_cat_array;
res->category.array_data.type = element_type;
- res->category.array_data.fixed_size = 0;
+ res->category.array_data.fixed_size = -1;
res->category.array_data.dynamic_size = dynamic_size;
return res;