Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix a bug in an error message
[simgrid.git] / src / xbt / xbt_log_appender_file.cpp
index 669f2dfc47cf6ec436a708096cd46ea41b7cfe38..8e8831d3a7a6a64869eca968b94c86eed59cc889 100644 (file)
@@ -1,6 +1,6 @@
 /* file_appender - a dumb log appender which simply prints to a file        */
 
-/* Copyright (c) 2007-2019. The SimGrid Team.
+/* Copyright (c) 2007-2020. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -89,7 +89,7 @@ static void open_append2_file(xbt_log_append2_file_t data){
 
 static void append2_file(const s_xbt_log_appender_t* this_, const char* str)
 {
-  xbt_log_append2_file_t d = (xbt_log_append2_file_t)this_->data;
+  auto* d = static_cast<xbt_log_append2_file_t>(this_->data);
   xbt_assert(d->file);
   if (ftell(d->file) >= d->limit) {
     open_append2_file(d);
@@ -103,7 +103,7 @@ static void append2_file(const s_xbt_log_appender_t* this_, const char* str)
 
 static void free_append2_(const s_xbt_log_appender_t* this_)
 {
-  xbt_log_append2_file_t data = static_cast<xbt_log_append2_file_t>(this_->data);
+  auto* data = static_cast<xbt_log_append2_file_t>(this_->data);
   if (data->file)
     fclose(data->file);
   xbt_free(data->filename);