|
From: Carlo W. <li...@us...> - 2002-01-20 02:33:48
|
CVSROOT : /cvsroot/libcw
Module : src
Commit time: 2002-00-20 02:33:46 UTC
Modified files:
libcwd/debug.cc libcwd/include/libcw/Makefile.am
libcwd/include/libcw/class_debug.inl
libcwd/include/libcw/struct_debug_tsd.h
Log message:
Clean ups.
---------------------- diff included ----------------------
Index: src/libcwd/debug.cc
diff -u src/libcwd/debug.cc:1.54 src/libcwd/debug.cc:1.55
--- src/libcwd/debug.cc:1.54 Fri Jan 18 21:08:54 2002
+++ src/libcwd/debug.cc Sat Jan 19 18:33:36 2002
@@ -1,4 +1,4 @@
-// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.54 2002/01/19 05:08:54 libcw Exp $
+// $Header: /cvsroot/l/li/libcw/src/libcwd/debug.cc,v 1.55 2002/01/20 02:33:36 libcw Exp $
//
// Copyright (C) 2000 - 2001, by
//
@@ -645,7 +645,7 @@
target_os->write("<unfinished>\n", 13); // Continued debug output should end on a space by itself,
// Truncate the buffer to its prefix and append "<continued>" to it already.
static_cast<buffer_ct*>(current_oss)->restore_position();
- static_cast<buffer_ct*>(current_oss)->write("<continued> ", 12); // therefore we repeat the space here.
+ current_oss->write("<continued> ", 12); // therefore we repeat the space here.
}
// Is this a nested debug output (the first of a series in the middle of another debug output)?
@@ -682,9 +682,9 @@
// Handle most common case first: no special flags set
if (!(channel_set.mask & (noprefix_cf|nolabel_cf|blank_margin_cf|blank_label_cf|blank_marker_cf)))
{
- static_cast<buffer_ct*>(current_oss)->write(debug_object.margin.c_str(), debug_object.margin.size());
- static_cast<buffer_ct*>(current_oss)->write(channel_set.label, WST_max_len);
- static_cast<buffer_ct*>(current_oss)->write(debug_object.marker.c_str(), debug_object.marker.size());
+ current_oss->write(debug_object.margin.c_str(), debug_object.margin.size());
+ current_oss->write(channel_set.label, WST_max_len);
+ current_oss->write(debug_object.marker.c_str(), debug_object.marker.size());
write_whitespace_to(*current_oss, indent);
}
else if (!(channel_set.mask & noprefix_cf))
@@ -692,7 +692,7 @@
if ((channel_set.mask & blank_margin_cf))
write_whitespace_to(*current_oss, debug_object.margin.size());
else
- static_cast<buffer_ct*>(current_oss)->write(debug_object.margin.c_str(), debug_object.margin.size());
+ current_oss->write(debug_object.margin.c_str(), debug_object.margin.size());
#ifndef DEBUGDEBUGOUTPUT
if (!(channel_set.mask & nolabel_cf))
#endif
@@ -700,11 +700,11 @@
if ((channel_set.mask & blank_label_cf))
write_whitespace_to(*current_oss, WST_max_len);
else
- static_cast<buffer_ct*>(current_oss)->write(channel_set.label, WST_max_len);
+ current_oss->write(channel_set.label, WST_max_len);
if ((channel_set.mask & blank_marker_cf))
write_whitespace_to(*current_oss, debug_object.marker.size());
else
- static_cast<buffer_ct*>(current_oss)->write(debug_object.marker.c_str(), debug_object.marker.size());
+ current_oss->write(debug_object.marker.c_str(), debug_object.marker.size());
write_whitespace_to(*current_oss, indent);
}
}
@@ -825,8 +825,10 @@
{
current = reinterpret_cast<laf_ct*>(_private_::WST_dummy_laf); // Used (MT: read-only!) in next debug_ct::start().
DEBUGDEBUG_CERR( "current = " << (void*)current );
- current_oss = target_os; // Used in start.
+#ifdef DEBUGDEBUG
+ current_oss = NULL;
DEBUGDEBUG_CERR( "current_oss = " << (void*)current_oss );
+#endif
}
start_expected = true;
@@ -844,23 +846,6 @@
DoutFatal( dc::core, "Don't use `DoutFatal' together with `continued_cf', use `Dout' instead. (This message can also occur when using DoutFatal correctly but from the constructor of a global object)." );
}
- /**
- * \brief Set output device.
- * \ingroup group_destination
- *
- * Assign a new \c ostream to this %debug object (default is <CODE>std::cerr</CODE>).
- */
- void debug_ct::set_ostream(std::ostream* os)
- {
- LIBCWD_TSD_DECLARATION
-#ifdef DEBUGDEBUG
- LIBCWD_ASSERT( LIBCWD_TSD_MEMBER(tsd_initialized) );
-#endif
- real_os = os;
- if (LIBCWD_TSD_MEMBER(laf_stack).size() == 0)
- LIBCWD_TSD_MEMBER(current_oss) = real_os;
- }
-
void debug_ct::NS_init(void)
{
ST_initialize_globals(); // Because all allocations for global objects are internal these days, we use
@@ -952,8 +937,10 @@
// current.mask needs to be 0 to avoid a crash in start():
current = reinterpret_cast<laf_ct*>(_private_::WST_dummy_laf);
DEBUGDEBUG_CERR( "current = " << (void*)current );
- current_oss = ¤t->oss;
+#ifdef DEBUGDEBUG
+ current_oss = NULL;
DEBUGDEBUG_CERR( "current_oss = " << (void*)current_oss );
+#endif
laf_stack.init();
continued_stack.init();
Index: src/libcwd/include/libcw/Makefile.am
diff -u src/libcwd/include/libcw/Makefile.am:1.18 src/libcwd/include/libcw/Makefile.am:1.19
--- src/libcwd/include/libcw/Makefile.am:1.18 Fri Jan 18 21:08:54 2002
+++ src/libcwd/include/libcw/Makefile.am Sat Jan 19 18:33:36 2002
@@ -5,6 +5,7 @@
buf2str.h \
char2str.h \
class_alloc.h \
+ class_always_channel.h \
class_always_channel.inl \
class_channel.h \
class_channel.inl \
@@ -45,6 +46,7 @@
private_set_alloc_checking.h \
private_threading.h \
strerrno.h \
+ struct_debug_tsd.h \
type_info.h
BUILT_SOURCES = sysd.ho debug_config.ho
Index: src/libcwd/include/libcw/class_debug.inl
diff -u src/libcwd/include/libcw/class_debug.inl:1.3 src/libcwd/include/libcw/class_debug.inl:1.4
--- src/libcwd/include/libcw/class_debug.inl:1.3 Fri Jan 18 21:08:54 2002
+++ src/libcwd/include/libcw/class_debug.inl Sat Jan 19 18:33:36 2002
@@ -1,4 +1,4 @@
-// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_debug.inl,v 1.3 2002/01/19 05:08:54 libcw Exp $
+// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/class_debug.inl,v 1.4 2002/01/20 02:33:36 libcw Exp $
//
// Copyright (C) 2000 - 2001, by
//
@@ -133,6 +133,25 @@
debug_ct::get_ostream(void) const
{
return real_os;
+}
+
+/**
+ * \brief Set output device.
+ * \ingroup group_destination
+ *
+ * Assign a new \c ostream to this %debug object (default is <CODE>std::cerr</CODE>).
+ */
+__inline__
+void
+debug_ct::set_ostream(std::ostream* os)
+{
+ real_os = os;
+#ifdef DEBUGDEBUG
+ LIBCWD_TSD_DECLARATION
+ LIBCWD_ASSERT( LIBCWD_TSD_MEMBER(tsd_initialized) );
+ if (LIBCWD_TSD_MEMBER(laf_stack).size() == 0)
+ LIBCWD_TSD_MEMBER(current_oss) = NULL;
+#endif
}
/** \} */
Index: src/libcwd/include/libcw/struct_debug_tsd.h
diff -u src/libcwd/include/libcw/struct_debug_tsd.h:1.1 src/libcwd/include/libcw/struct_debug_tsd.h:1.2
--- src/libcwd/include/libcw/struct_debug_tsd.h:1.1 Fri Jan 18 21:08:54 2002
+++ src/libcwd/include/libcw/struct_debug_tsd.h Sat Jan 19 18:33:36 2002
@@ -1,4 +1,4 @@
-// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/struct_debug_tsd.h,v 1.1 2002/01/19 05:08:54 libcw Exp $
+// $Header: /cvsroot/l/li/libcw/src/libcwd/include/libcw/struct_debug_tsd.h,v 1.2 2002/01/20 02:33:36 libcw Exp $
//
// Copyright (C) 2002, by
//
@@ -45,7 +45,6 @@
class channel_ct;
class fatal_channel_ct;
class laf_ct;
-class buffer_ct;
//===================================================================================================
// struct debug_tsd_st
----------------------- End of diff -----------------------
|