-/* Copyright (c) 2015-2016. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2015-2017. 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. */
static void action_read(const char *const *action) {
const char *file_name = action[2];
const char *size_str = action[3];
- msg_file_t file = NULL;
sg_size_t size = parse_size(size_str);
double clock = MSG_get_clock();
- file = get_file_descriptor(file_name);
+ msg_file_t file = get_file_descriptor(file_name);
ACT_DEBUG("Entering Read: %s (size: %llu)", NAME, size);
MSG_file_read(file, size);
-/* Copyright (c) 2007-2015. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2007-2017. 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. */
static void launch_communication_worker(msg_host_t tx_host, msg_host_t rx_host)
{
char *mbox = bprintf("MBOX:%s-%s", MSG_host_get_name(tx_host), MSG_host_get_name(rx_host));
- char **argv = NULL;
-
const char *pr_name_tx = "comm_tx";
- argv = xbt_new(char *, 3);
+
+ char** argv = xbt_new(char*, 3);
argv[0] = xbt_strdup(pr_name_tx);
argv[1] = xbt_strdup(mbox);
argv[2] = NULL;
/* The Dream master: */
static int dream_master(int argc, char *argv[])
{
- msg_process_t lazy = NULL;
-
XBT_INFO("Let's create a lazy guy."); /* - Create a lazy_guy process */
- lazy = MSG_process_create("Lazy", lazy_guy, NULL, MSG_host_self());
+ msg_process_t lazy = MSG_process_create("Lazy", lazy_guy, NULL, MSG_host_self());
XBT_INFO("Let's wait a little bit...");
MSG_process_sleep(10.0); /* - Wait for 10 seconds */
XBT_INFO("Let's wake the lazy guy up! >:) BOOOOOUUUHHH!!!!");
}
extra->datatype1 = encode_datatype(sendtmptype, &known);
- int dt_size_send = 1;
- dt_size_send = sendtmptype->size();
+ int dt_size_send = sendtmptype->size();
for (i = 0; i < size; i++) { // copy data to avoid bad free
extra->send_size += sendtmpcounts[i] * dt_size_send;
};
xbt_automaton_t xbt_automaton_new(void){
- xbt_automaton_t automaton = NULL;
- automaton = xbt_new0(struct xbt_automaton, 1);
+ xbt_automaton_t automaton = xbt_new0(struct xbt_automaton, 1);
automaton->states = xbt_dynar_new(sizeof(xbt_automaton_state_t), xbt_automaton_state_free_voidp);
automaton->transitions = xbt_dynar_new(sizeof(xbt_automaton_transition_t), xbt_automaton_transition_free_voidp);
automaton->propositional_symbols = xbt_dynar_new(sizeof(xbt_automaton_propositional_symbol_t), xbt_automaton_propositional_symbol_free_voidp);
}
xbt_automaton_state_t xbt_automaton_state_new(xbt_automaton_t a, int type, char* id){
- xbt_automaton_state_t state = NULL;
- state = xbt_new0(struct xbt_automaton_state, 1);
+ xbt_automaton_state_t state = xbt_new0(struct xbt_automaton_state, 1);
state->type = type;
state->id = xbt_strdup(id);
state->in = xbt_dynar_new(sizeof(xbt_automaton_transition_t), xbt_automaton_transition_free_voidp);
}
xbt_automaton_transition_t xbt_automaton_transition_new(xbt_automaton_t a, xbt_automaton_state_t src, xbt_automaton_state_t dst, xbt_automaton_exp_label_t label){
- xbt_automaton_transition_t transition = NULL;
- transition = xbt_new0(struct xbt_automaton_transition, 1);
+ xbt_automaton_transition_t transition = xbt_new0(struct xbt_automaton_transition, 1);
if(src != NULL){
xbt_dynar_push(src->out, &transition);
transition->src = src;
}
xbt_automaton_propositional_symbol_t xbt_automaton_propositional_symbol_new(xbt_automaton_t a, const char* id, int(*fct)(void)){
- xbt_automaton_propositional_symbol_t prop_symb = NULL;
- prop_symb = xbt_new0(struct xbt_automaton_propositional_symbol, 1);
+ xbt_automaton_propositional_symbol_t prop_symb = xbt_new0(struct xbt_automaton_propositional_symbol, 1);
prop_symb->pred = xbt_strdup(id);
prop_symb->callback = &call_simple_function;
prop_symb->data = fct;
/* methods for implementation of automaton from promela description */
-/* Copyright (c) 2011-2015. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2011-2017. 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. */
}
free(id_copy);
- xbt_automaton_state_t state = NULL;
- state = xbt_automaton_state_exists(parsed_automaton, id);
+ xbt_automaton_state_t state = xbt_automaton_state_exists(parsed_automaton, id);
if(state == NULL){
state = xbt_automaton_state_new(parsed_automaton, type, id);
}