/* dict_multi - dictionnaries of dictionnaries of ... of data */
-/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2004-2014. 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. */
+#ifdef XBT_USE_DEPRECATED
+
#include "dict_private.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_dict_multi, xbt_dict,
{
xbt_dynar_t lens = xbt_dynar_new(sizeof(unsigned long int), NULL);
unsigned long i;
- xbt_ex_t e;
for (i = 0; i < xbt_dynar_length(keys); i++) {
char *thiskey = xbt_dynar_get_as(keys, i, char *);
TRY {
xbt_multidict_set_ext(mdict, keys, lens, data, free_ctn);
- } TRY_CLEANUP {
+ }
+ TRY_CLEANUP {
xbt_dynar_free(&lens);
- } CATCH(e) {
+ }
+ CATCH_ANONYMOUS {
RETHROW;
}
}
int keys_len = xbt_dynar_length(keys);
xbt_assert(xbt_dynar_length(keys) == xbt_dynar_length(lens));
- xbt_assert(xbt_dynar_length(keys) >= 1,
+ xbt_assert(!xbt_dynar_is_empty(keys),
"Can't get a zero-long key set in a multidict");
XBT_DEBUG("xbt_multidict_get(%p, %ld)", mdict, xbt_dynar_length(keys));
xbt_multidict_remove_ext(xbt_dict_t mdict, xbt_dynar_t keys,
xbt_dynar_t lens)
{
- xbt_dict_t thislevel, nextlevel = NULL;
- int i;
+ volatile xbt_dict_t thislevel;
+ volatile xbt_dict_t nextlevel = NULL;
+ volatile int i;
xbt_ex_t e;
unsigned long int thislen;
void xbt_multidict_remove(xbt_dict_t mdict, xbt_dynar_t keys)
{
-
- xbt_ex_t e;
xbt_dynar_t lens = xbt_dynar_new(sizeof(unsigned long int), NULL);
unsigned long i;
TRY {
xbt_multidict_remove_ext(mdict, keys, lens);
- } TRY_CLEANUP {
+ }
+ TRY_CLEANUP {
xbt_dynar_free(&lens);
- } CATCH(e) {
+ }
+ CATCH_ANONYMOUS {
RETHROW;
}
}
+
+#endif