summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
93e9fdd)
The goal is to use C++ mutex.
#include "src/xbt_modinter.h"
#include "src/xbt_modinter.h"
-#include "src/xbt/log_private.h"
+#include "src/xbt/log_private.hpp"
#include "xbt/asserts.h"
#include "xbt/dynar.h"
#include "xbt/ex.h"
#include "xbt/asserts.h"
#include "xbt/dynar.h"
#include "xbt/ex.h"
xbt_log_category_t cat = ev->cat;
xbt_assert(ev->priority >= 0, "Negative logging priority naturally forbidden");
xbt_log_category_t cat = ev->cat;
xbt_assert(ev->priority >= 0, "Negative logging priority naturally forbidden");
- xbt_assert(ev->priority < sizeof(xbt_log_priority_names) / sizeof(xbt_log_priority_names[0]),
+ xbt_assert(static_cast<size_t>(ev->priority) < sizeof(xbt_log_priority_names)/sizeof(xbt_log_priority_names[0]),
"Priority %d is greater than the biggest allowed value", ev->priority);
while (1) {
"Priority %d is greater than the biggest allowed value", ev->priority);
while (1) {
/* The static buffer was too small, use a dynamically expanded one */
ev->buffer_size = XBT_LOG_DYNAMIC_BUFFER_SIZE;
/* The static buffer was too small, use a dynamically expanded one */
ev->buffer_size = XBT_LOG_DYNAMIC_BUFFER_SIZE;
- ev->buffer = xbt_malloc(ev->buffer_size);
+ ev->buffer = static_cast<char*>(xbt_malloc(ev->buffer_size));
while (1) {
va_start(ev->ap, fmt);
done = cat->layout->do_layout(cat->layout, ev, fmt);
while (1) {
va_start(ev->ap, fmt);
done = cat->layout->do_layout(cat->layout, ev, fmt);
if (done)
break; /* Got it */
ev->buffer_size *= 2;
if (done)
break; /* Got it */
ev->buffer_size *= 2;
- ev->buffer = xbt_realloc(ev->buffer, ev->buffer_size);
+ ev->buffer = static_cast<char*>(xbt_realloc(ev->buffer, ev->buffer_size));
}
appender->do_append(appender, ev->buffer);
xbt_free(ev->buffer);
}
appender->do_append(appender, ev->buffer);
xbt_free(ev->buffer);
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/internal_config.h"
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/internal_config.h"
-#include "src/xbt/log_private.h"
+#include "src/xbt/log_private.hpp"
#include "xbt/sysdep.h"
#include <errno.h>
#include <stdio.h>
#include "xbt/sysdep.h"
#include <errno.h>
#include <stdio.h>
static void free_(xbt_log_appender_t this_) {
if (this_->data != stderr)
static void free_(xbt_log_appender_t this_) {
if (this_->data != stderr)
+ fclose(static_cast<FILE*>(this_->data));
}
xbt_log_appender_t xbt_log_appender_file_new(char *arg) {
}
xbt_log_appender_t xbt_log_appender_file_new(char *arg) {
static void free_append2_(xbt_log_appender_t this_)
{
static void free_append2_(xbt_log_appender_t this_)
{
- xbt_log_append2_file_t data = this_->data;
+ xbt_log_append2_file_t data = static_cast<xbt_log_append2_file_t>(this_->data);
if (data->file)
fclose(data->file);
xbt_free(data->filename);
if (data->file)
fclose(data->file);
xbt_free(data->filename);
#include "simgrid/host.h"
#include "simgrid/msg.h" /* MSG_get_clock */
#include "simgrid/host.h"
#include "simgrid/msg.h" /* MSG_get_clock */
-#include "src/xbt/log_private.h"
+#include "src/xbt/log_private.hpp"
#include "xbt/sysdep.h"
#include <stdio.h>
#include "xbt/sysdep.h"
#include <stdio.h>
int precision = -1;
int length = -1;
int precision = -1;
int length = -1;
- for (char* q = l->data ; *q != '\0' ; q++) {
+ for (char* q = static_cast<char*>(l->data) ; *q != '\0' ; q++) {
if (*q == '%') {
q++;
do {
if (*q == '%') {
q++;
do {
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "xbt/sysdep.h"
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "xbt/sysdep.h"
-#include "src/xbt/log_private.h"
+#include "src/xbt/log_private.hpp"
#include "simgrid/host.h" /* sg_host_self_get_name */
#include "simgrid/msg.h" /* MSG_get_clock */
#include "simgrid/host.h" /* sg_host_self_get_name */
#include "simgrid/msg.h" /* MSG_get_clock */
src/xbt/automaton/parserPromela.tab.hacc
src/xbt/automaton/parserPromela.yacc
src/xbt/dict_private.h
src/xbt/automaton/parserPromela.tab.hacc
src/xbt/automaton/parserPromela.yacc
src/xbt/dict_private.h
+ src/xbt/log_private.hpp
src/xbt/mallocator_private.h
src/xbt/mmalloc/mfree.c
src/xbt/mallocator_private.h
src/xbt/mmalloc/mfree.c
src/xbt/dynar.cpp
src/xbt/exception.cpp
src/xbt/graph.c
src/xbt/dynar.cpp
src/xbt/exception.cpp
src/xbt/graph.c
src/xbt/mallocator.c
src/xbt/memory_map.cpp
src/xbt/memory_map.hpp
src/xbt/mallocator.c
src/xbt/memory_map.cpp
src/xbt/memory_map.hpp
src/xbt/parmap.cpp
src/xbt/snprintf.c
src/xbt/string.cpp
src/xbt/parmap.cpp
src/xbt/snprintf.c
src/xbt/string.cpp
- src/xbt/xbt_log_appender_file.c
- src/xbt/xbt_log_layout_format.c
- src/xbt/xbt_log_layout_simple.c
+ src/xbt/xbt_log_appender_file.cpp
+ src/xbt/xbt_log_layout_format.cpp
+ src/xbt/xbt_log_layout_simple.cpp
src/xbt/xbt_main.cpp
src/xbt/xbt_os_file.cpp
src/xbt/xbt_os_synchro.cpp
src/xbt/xbt_main.cpp
src/xbt/xbt_os_file.cpp
src/xbt/xbt_os_synchro.cpp
foreach(s
src/kernel/lmm/fair_bottleneck.cpp src/kernel/lmm/lagrange.cpp src/kernel/lmm/maxmin.cpp
src/xbt/mmalloc/mm.c
foreach(s
src/kernel/lmm/fair_bottleneck.cpp src/kernel/lmm/lagrange.cpp src/kernel/lmm/maxmin.cpp
src/xbt/mmalloc/mm.c
- src/xbt/log.c src/xbt/xbt_log_appender_file.c
- src/xbt/xbt_log_layout_format.c src/xbt/xbt_log_layout_simple.c
+ src/xbt/log.cpp src/xbt/xbt_log_appender_file.cpp
+ src/xbt/xbt_log_layout_format.cpp src/xbt/xbt_log_layout_simple.cpp
src/xbt/dict.cpp src/xbt/dict_elm.c src/xbt/dict_cursor.c
src/xbt/dynar.cpp
src/xbt/xbt_str.cpp src/xbt/snprintf.c
src/xbt/dict.cpp src/xbt/dict_elm.c src/xbt/dict_cursor.c
src/xbt/dynar.cpp
src/xbt/xbt_str.cpp src/xbt/snprintf.c