CVSROOT: /sources/gnash Module name: gnash Changes by: Sandro Santilli <strk> 07/10/07 21:11:50
Modified files: . : ChangeLog server/parser : movie_def_impl.cpp Log message: * server/parser/movie_def_impl.cpp (dump_tag_bytes): output cleanup. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4561&r2=1.4562 http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/movie_def_impl.cpp?cvsroot=gnash&r1=1.83&r2=1.84 Patches: Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.4561 retrieving revision 1.4562 diff -u -b -r1.4561 -r1.4562 --- ChangeLog 7 Oct 2007 05:09:18 -0000 1.4561 +++ ChangeLog 7 Oct 2007 21:11:50 -0000 1.4562 @@ -1,3 +1,7 @@ +2007-10-06 Sandro Santilli <[EMAIL PROTECTED]> + + * server/parser/movie_def_impl.cpp (dump_tag_bytes): output cleanup. + 2007-10-07 Chad Musick <[EMAIL PROTECTED]> * server/vm/SafeStack.h: New file. Complete definition of a stack Index: server/parser/movie_def_impl.cpp =================================================================== RCS file: /sources/gnash/gnash/server/parser/movie_def_impl.cpp,v retrieving revision 1.83 retrieving revision 1.84 diff -u -b -r1.83 -r1.84 --- server/parser/movie_def_impl.cpp 19 Sep 2007 23:24:45 -0000 1.83 +++ server/parser/movie_def_impl.cpp 7 Oct 2007 21:11:50 -0000 1.84 @@ -42,6 +42,7 @@ #include "sound_definition.h" // for sound_sample #include <boost/bind.hpp> +#include <iomanip> #include <memory> #include <string> #include <unistd.h> @@ -139,45 +140,37 @@ // // some utility stuff // -// FIXME, this needs work now that log_msg always ends with a newline. -void dump_tag_bytes(stream* in) - // Log the contents of the current tag, in hex. +/// Log the contents of the current tag, in hex to the output strream +static void dump_tag_bytes(stream* in, ostream& os) { static const int ROW_BYTES = 16; char row_buf[ROW_BYTES]; int row_count = 0; + row_buf[ROW_BYTES-1] = '\0'; + + os << endl; while(in->get_position() < in->get_tag_end_position()) { int c = in->read_u8(); - log_msg("%02X", c); + os << std::hex << std::setw(2) << std::setfill('0') << c << " "; - if (c < 32) c = '.'; - if (c > 127) c = '.'; + if (c < 32 || c > 127 ) c = '.'; row_buf[row_count] = c; row_count++; if (row_count >= ROW_BYTES) { - log_msg(" "); - for (int i = 0; i < ROW_BYTES; i++) - { - log_msg("%c", row_buf[i]); - } - - log_msg("\n"); + os << row_buf << endl; row_count = 0; } - else - { - log_msg(" "); } - } - - if (row_count > 0) + if ( row_count ) { - log_msg("\n"); + row_buf[row_count] = '\0'; + while (row_count++ < ROW_BYTES ) os << " "; + os << row_buf << endl; } } @@ -931,7 +924,9 @@ log_error(_("*** no tag loader for type %d (movie)"), tag_type); IF_VERBOSE_PARSE( - dump_tag_bytes(&str); + stringstream ss; + dump_tag_bytes(&str, ss); + log_error("tag dump follows: %s", ss.str().c_str()); ); } _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit