X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cdf6a962eb4e88efbed3df9c41343adabcf09e6c..78da1c00f59351748ceb0f957c7293b6bd71a31d:/teshsuite/xbt/mmalloc/mmalloc_test.cpp diff --git a/teshsuite/xbt/mmalloc/mmalloc_test.cpp b/teshsuite/xbt/mmalloc/mmalloc_test.cpp index 9217257b76..fd9e809deb 100644 --- a/teshsuite/xbt/mmalloc/mmalloc_test.cpp +++ b/teshsuite/xbt/mmalloc/mmalloc_test.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2019. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2012-2020. 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. */ @@ -7,6 +7,7 @@ #include "xbt.h" #include "xbt/mmalloc.h" +#include #include #include #include @@ -14,6 +15,7 @@ #include #include #include +#include XBT_LOG_NEW_DEFAULT_CATEGORY(test,"this test"); @@ -32,14 +34,14 @@ static void check_block(const unsigned char* p, unsigned char b, int n) int main(int argc, char**argv) { xbt_mheap_t heapA = nullptr; - void *pointers[TESTSIZE]; + std::array pointers; xbt_init(&argc,argv); XBT_INFO("Allocating a new heap"); unsigned long mask = ~((unsigned long)xbt_pagesize - 1); - void *addr = (void*)(((unsigned long)sbrk(0) + BUFFSIZE) & mask); + auto* addr = reinterpret_cast(((unsigned long)sbrk(0) + BUFFSIZE) & mask); heapA = xbt_mheap_new(-1, addr); - if (heapA == NULL) { + if (heapA == nullptr) { perror("attach 1 failed"); fprintf(stderr, "bye\n"); exit(1);