From: Martin Quinson Date: Sun, 9 Jul 2017 20:20:20 +0000 (+0200) Subject: sonar & codacy X-Git-Tag: v3_17~420 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/08b0207634111339deda63fa368c42be87b6dc13?hp=-c;ds=sidebyside sonar & codacy --- 08b0207634111339deda63fa368c42be87b6dc13 diff --git a/examples/msg/app-bittorrent/app-bittorrent.tesh b/examples/msg/app-bittorrent/app-bittorrent.tesh old mode 100755 new mode 100644 diff --git a/examples/simdag/properties/sd_properties.tesh b/examples/simdag/properties/sd_properties.tesh old mode 100755 new mode 100644 diff --git a/src/kernel/context/ContextThread.cpp b/src/kernel/context/ContextThread.cpp index 3e28c30768..85ac35a62a 100644 --- a/src/kernel/context/ContextThread.cpp +++ b/src/kernel/context/ContextThread.cpp @@ -1,5 +1,4 @@ -/* Copyright (c) 2009-2015. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2009-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. */ @@ -115,7 +114,7 @@ ThreadContext::ThreadContext(std::function code, * name, but now the name is stored at SIMIX level, so we pass a null */ this->thread_ = xbt_os_thread_create(nullptr, - maestro ? ThreadContext::maestro_wrapper : ThreadContext::wrapper, + maestro ? &ThreadContext::maestro_wrapper : &ThreadContext::wrapper, this, this); /* wait the starting of the newly created process */ xbt_os_sem_acquire(this->end_); diff --git a/src/mc/ChunkedData.hpp b/src/mc/ChunkedData.hpp index 891e2fa1e3..330f2c9841 100644 --- a/src/mc/ChunkedData.hpp +++ b/src/mc/ChunkedData.hpp @@ -49,9 +49,10 @@ public: // Copy and move ChunkedData(ChunkedData const& that) + : store_ (that.store_) + , pagenos_(that.pagenos_) + { - store_ = that.store_; - pagenos_ = that.pagenos_; for (std::size_t pageno : pagenos_) store_->ref_page(pageno); } diff --git a/src/msg/msg_io.cpp b/src/msg/msg_io.cpp index 2c0b61bf3c..b4791450a6 100644 --- a/src/msg/msg_io.cpp +++ b/src/msg/msg_io.cpp @@ -93,7 +93,7 @@ sg_size_t MSG_file_read(msg_file_t fd, sg_size_t size) /* Find the host where the file is physically located and read it */ msg_storage_t storage_src = simgrid::s4u::Storage::byName(fd->storageId); msg_host_t attached_host = storage_src->getHost(); - read_size = fd->read(size); // TODO re-add attached_host; + read_size = fd->read(size); // TODO re-add attached_host if (strcmp(attached_host->getCname(), MSG_host_self()->getCname())) { /* the file is hosted on a remote host, initiate a communication between src and dest hosts for data transfer */ @@ -158,7 +158,7 @@ sg_size_t MSG_file_write(msg_file_t fd, sg_size_t size) } /* Write file on local or remote host */ // sg_size_t offset = fd->tell(); - sg_size_t write_size = fd->write(size); // TODO readd attached_host; + sg_size_t write_size = fd->write(size); // TODO readd attached_host return write_size; } diff --git a/src/xbt/memory_map.cpp b/src/xbt/memory_map.cpp index 3bb597dec9..ae6113c147 100644 --- a/src/xbt/memory_map.cpp +++ b/src/xbt/memory_map.cpp @@ -339,6 +339,7 @@ XBT_PRIVATE std::vector get_memory_map(pid_t pid) memreg.prot |= PROT_EXEC; /* Private (copy-on-write) or shared? */ + memreg.flags = 0; if (vmentries[i].kve_flags & KVME_FLAG_COW) memreg.flags |= MAP_PRIVATE; else diff --git a/src/xbt/mmalloc/mmalloc.c b/src/xbt/mmalloc/mmalloc.c index 35baa0fa7f..ee9dee9219 100644 --- a/src/xbt/mmalloc/mmalloc.c +++ b/src/xbt/mmalloc/mmalloc.c @@ -1,7 +1,6 @@ /* Memory allocator `malloc'. */ -/* Copyright (c) 2010-2015. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2010-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. */ @@ -269,7 +268,8 @@ void *mmalloc_no_memset(xbt_mheap_t mdp, size_t size) If we loop completely around without finding a large enough space we will have to get more memory from the system. */ size_t blocks = BLOCKIFY(size); - size_t start = block = MALLOC_SEARCH_START; + size_t start = MALLOC_SEARCH_START; + block = MALLOC_SEARCH_START; while (mdp->heapinfo[block].free_block.size < blocks) { if (mdp->heapinfo[block].type >=0) { // Don't trust xbt_die and friends in malloc-level library, you fool! fprintf(stderr,"Internal error: found a free block not marked as such (block=%lu type=%lu). Please report this bug.\n",(unsigned long)block,(unsigned long)mdp->heapinfo[block].type);