CVSROOT: /sources/gnash Module name: gnash Changes by: Rob Savoye <rsavoye> 07/12/20 03:13:42
Modified files: libamf : Makefile.am amf.cpp sol.cpp Log message: Reduce the verbosity of debugging messages. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/libamf/Makefile.am?cvsroot=gnash&r1=1.29&r2=1.30 http://cvs.savannah.gnu.org/viewcvs/gnash/libamf/amf.cpp?cvsroot=gnash&r1=1.47&r2=1.48 http://cvs.savannah.gnu.org/viewcvs/gnash/libamf/sol.cpp?cvsroot=gnash&r1=1.3&r2=1.4 Patches: Index: Makefile.am =================================================================== RCS file: /sources/gnash/gnash/libamf/Makefile.am,v retrieving revision 1.29 retrieving revision 1.30 diff -u -b -r1.29 -r1.30 --- Makefile.am 15 Dec 2007 06:58:40 -0000 1.29 +++ Makefile.am 20 Dec 2007 03:13:41 -0000 1.30 @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# $Id: Makefile.am,v 1.29 2007/12/15 06:58:40 rsavoye Exp $ +# $Id: Makefile.am,v 1.30 2007/12/20 03:13:41 rsavoye Exp $ AUTOMAKE_OPTIONS = @@ -25,7 +25,9 @@ rtmp.cpp \ sol.cpp -libgnashamf_la_LIBADD = $(top_builddir)/libbase/libgnashbase.la +libgnashamf_la_LIBADD = \ + $(top_builddir)/libbase/libgnashbase.la + libgnashamf_la_LDFLAGS = -release $(VERSION) ${AM_LDFLAGS} # noinst_HEADERS = amf.h amfutf8.h Index: amf.cpp =================================================================== RCS file: /sources/gnash/gnash/libamf/amf.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -u -b -r1.47 -r1.48 --- amf.cpp 19 Dec 2007 21:04:11 -0000 1.47 +++ amf.cpp 20 Dec 2007 03:13:42 -0000 1.48 @@ -190,18 +190,18 @@ amfnum_t nanosecs; short length; - log_msg(_("Type is %s"), astype_str[type]); +// log_msg(_("Type is %s"), astype_str[type]); x++; // skip the type byte switch (type) { case NUMBER: // AMF numbers are 64-bit big-endian integers. num = *(amfnum_t *)swapBytes(x+1, 8); - log_msg(_("Number is " AMFNUM_F), num); +// log_msg(_("Number is " AMFNUM_F), num); break; case BOOLEAN: boolshift = *x; - log_msg(_("Boolean is %d"), boolshift); +// log_msg(_("Boolean is %d"), boolshift); break; case STRING: // int length = *(short *)swapBytes(x, 2); @@ -214,7 +214,7 @@ // *src to a sequence of wide characters as if by repeated // calls of the form: // mbsrtowcs - log_msg(_("String is %s"), mstr); +// log_msg(_("String is %s"), mstr); break; case OBJECT: // readElement(); @@ -246,14 +246,14 @@ break; case DATE: nanosecs = *(amfnum_t *)swapBytes(x+1, 8); - log_msg(_("Date is " AMFNUM_F " nanoseconds"), nanosecs); +// log_msg(_("Date is " AMFNUM_F " nanoseconds"), nanosecs); break; case LONG_STRING: // int length = *(short *)swapBytes(x, 4); x+=4; // skip the length bytes // mstr = new char[length+1]; // memcpy(mstr, x, length); - log_msg(_("String is %s"), mstr); +// log_msg(_("String is %s"), mstr); break; case RECORD_SET: log_unimpl("Recordset AMF decoder"); @@ -265,7 +265,7 @@ log_unimpl("TypedObject AMF decoder"); break; default: - log_msg("Warning: Unknown AMF element type %d\n", type); + log_error("Warning: Unknown AMF element type %d\n", type); break; } @@ -293,7 +293,7 @@ uint8_t * AMF::encodeElement(astype_e type, const void *in, int nbytes) { - GNASH_REPORT_FUNCTION; +// GNASH_REPORT_FUNCTION; amfnum_t num; int pktsize = 0; @@ -474,7 +474,7 @@ int total_size, content_types_e type, amfsource_e routing) { - GNASH_REPORT_FUNCTION; +// GNASH_REPORT_FUNCTION; void *out = new char[total_size + 12 + 4]; memset(out, 0, total_size + 12 + 4); char *tmpptr = reinterpret_cast<char *>(out); @@ -783,7 +783,7 @@ AMF::amf_element_t * AMF::createElement(amf_element_t *el, const std::string &name, amfnum_t data) { - GNASH_REPORT_FUNCTION; +// GNASH_REPORT_FUNCTION; log_debug("Creating element %s", name.c_str()); el->type = AMF::NUMBER; @@ -808,7 +808,7 @@ AMF::amf_element_t * AMF::createElement(amf_element_t *el, const std::string &name, double data) { - GNASH_REPORT_FUNCTION; +// GNASH_REPORT_FUNCTION; log_debug("Creating element %s", name.c_str()); el->type = AMF::NUMBER; @@ -825,7 +825,7 @@ AMF::amf_element_t * AMF::createElement(amf_element_t *el, const char *name, const char *data) { - GNASH_REPORT_FUNCTION; +// GNASH_REPORT_FUNCTION; log_debug("Creating element %s", name); el->type = AMF::STRING; @@ -839,7 +839,7 @@ AMF::amf_element_t * AMF::createElement(amf_element_t *el, const std::string &name, std::string &data) { - GNASH_REPORT_FUNCTION; +// GNASH_REPORT_FUNCTION; log_debug("Creating element %s", name.c_str()); el->type = AMF::STRING; @@ -861,7 +861,7 @@ AMF::amf_element_t * AMF::createElement(AMF::amf_element_t *el, const std::string &name, bool data) { - GNASH_REPORT_FUNCTION; +// GNASH_REPORT_FUNCTION; log_debug("Creating element %s", name.c_str()); el->type = AMF::BOOLEAN; @@ -902,9 +902,8 @@ uint8_t * AMF::encodeVariable(amf_element_t *el) { - GNASH_REPORT_FUNCTION; +// GNASH_REPORT_FUNCTION; int outsize = el->name.size() + el->length + 5; - log_debug("FIXME: Outsize is: %d", outsize); uint8_t *out = new uint8_t[outsize + 2]; memset(out, 0, outsize + 2); uint8_t *tmpptr = out; @@ -1365,17 +1364,17 @@ tmpptr += 2; // get the name of the element if (length > 0) { - log_msg(_("AMF element length is: %d"), length); +// log_msg(_("AMF element length is: %d"), length); memcpy(buffer, tmpptr, length); el->name = reinterpret_cast<char *>(buffer); tmpptr += length; } - log_msg(_("AMF element name is: %s"), buffer); +// log_msg(_("AMF element name is: %s"), buffer); astype_e type = (astype_e)((*tmpptr++) & 0xff); if (type <= AMF::TYPED_OBJECT) { - log_msg(_("AMF type is: %s"), astype_str[(int)type]); +// log_msg(_("AMF type is: %s"), astype_str[(int)type]); el->type = type; } @@ -1393,7 +1392,7 @@ uint8_t hexint[AMF_NUMBER_SIZE*3]; hexify((uint8_t *)hexint, (uint8_t *)buffer, AMF_NUMBER_SIZE, false); - log_msg(_("Number \"%s\" is: 0x%s"), el->name.c_str(), hexint); +// log_msg(_("Number \"%s\" is: 0x%s"), el->name.c_str(), hexint); // amfnum_t *num = extractNumber(tmpptr); #endif tmpptr += 8; @@ -1407,9 +1406,9 @@ el->data = new uint8_t[2]; // memcpy(tmp, tmpptr, 2); el->data[0] =* tmpptr; - log_msg((*tmpptr == 0) ? - _("Boolean \"%s\" is: true"): - _("Boolean \"%s\" is: false"), el->name.c_str()); +// log_msg((*tmpptr == 0) ? +// _("Boolean \"%s\" is: true"): +// _("Boolean \"%s\" is: false"), el->name.c_str()); tmpptr += 1; break; } @@ -1434,7 +1433,7 @@ // Undefined types have a name, but no value //FIXME this shouldn't fall through! case UNDEFINED: - log_msg(_("Undefined type")); +// log_msg(_("Undefined type")); el->data = 0; // (const uint8_t*)tmpptr; //log_msg(_("Variable \"%s\" is of undefined type"), el->name.c_str()); el->length = 0; @@ -1444,7 +1443,7 @@ case ECMA_ARRAY: // FIXME this shouldn't fall thru case OBJECT_END: - log_msg(_("End of Object definition")); +// log_msg(_("End of Object definition")); el->name.erase(); el->length = 0; el->data = 0; Index: sol.cpp =================================================================== RCS file: /sources/gnash/gnash/libamf/sol.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -b -r1.3 -r1.4 --- sol.cpp 19 Dec 2007 19:40:21 -0000 1.3 +++ sol.cpp 20 Dec 2007 03:13:42 -0000 1.4 @@ -39,6 +39,7 @@ #else #include <arpa/inet.h> #endif + using namespace std; using namespace gnash; @@ -63,29 +64,30 @@ SOL::SOL() : _filesize(0) { - GNASH_REPORT_FUNCTION; +// GNASH_REPORT_FUNCTION; } SOL::~SOL() { - GNASH_REPORT_FUNCTION; +// GNASH_REPORT_FUNCTION; } bool SOL::extractHeader(std::string &filespec) { - GNASH_REPORT_FUNCTION; +// GNASH_REPORT_FUNCTION; } bool SOL::extractHeader(vector<unsigned char> &data) { +// GNASH_REPORT_FUNCTION; } void SOL::addObj(AMF::amf_element_t &el) { - GNASH_REPORT_FUNCTION; +// GNASH_REPORT_FUNCTION; _amfobjs.push_back(el); _filesize += el.name.size() + el.length + 5; } @@ -93,7 +95,7 @@ bool SOL::formatHeader(vector<unsigned char> &data) { - GNASH_REPORT_FUNCTION; +// GNASH_REPORT_FUNCTION; } // name is the object name @@ -106,7 +108,7 @@ bool SOL::formatHeader(std::string &name, int filesize) { - GNASH_REPORT_FUNCTION; +// GNASH_REPORT_FUNCTION; uint32_t i; // First we add the magic number. All SOL data is in big-endian format, @@ -202,8 +204,8 @@ bool SOL::writeFile(string &filespec, string &name) { - GNASH_REPORT_FUNCTION; - ofstream ofs("test.sol", ios::binary); +// GNASH_REPORT_FUNCTION; + ofstream ofs(filespec.c_str(), ios::binary); vector<uint8_t>::iterator it; vector<AMF::amf_element_t>::iterator ita; AMF amf_obj; @@ -214,7 +216,7 @@ return false; } - char *body = new char[_filesize]; // FIXME: bogus size! + char *body = new char[_filesize + 16]; memset(body, 0, _filesize); ptr = body; @@ -281,7 +283,7 @@ bool SOL::readFile(std::string &filespec) { - GNASH_REPORT_FUNCTION; +// GNASH_REPORT_FUNCTION; struct stat st; uint16_t magic, size; char *buf, *ptr; _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit