[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r11998: Remove some more 'using name
From: |
Bastiaan Jacques |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r11998: Remove some more 'using namespace ...' from the global namespace. |
Date: |
Tue, 09 Mar 2010 02:24:14 +0100 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 11998
committer: Bastiaan Jacques <address@hidden>
branch nick: trunk
timestamp: Tue 2010-03-09 02:24:14 +0100
message:
Remove some more 'using namespace ...' from the global namespace.
modified:
libamf/amf.cpp
libamf/amf_msg.cpp
libamf/buffer.cpp
libamf/element.cpp
libamf/flv.cpp
libamf/lcshm.cpp
libamf/sol.cpp
libnet/cache.cpp
libnet/cque.cpp
libnet/diskstream.cpp
libnet/http.cpp
libnet/lirc.cpp
libnet/netstats.cpp
libnet/network.cpp
libnet/rtmp_msg.cpp
libnet/statistics.cpp
=== modified file 'libamf/amf.cpp'
--- a/libamf/amf.cpp 2010-01-25 18:52:20 +0000
+++ b/libamf/amf.cpp 2010-03-09 01:24:14 +0000
@@ -31,9 +31,6 @@
#include <vector>
#include <boost/cstdint.hpp>
-using namespace std;
-using namespace gnash;
-
namespace amf
{
@@ -179,7 +176,7 @@
// GNASH_REPORT_FUNCTION;
boost::uint32_t length;
length = data.propertySize();
- log_debug("Encoded data size has %d properties", length);
+ gnash::log_debug("Encoded data size has %d properties", length);
boost::shared_ptr<amf::Buffer> buf;
if (length) {
buf.reset(new amf::Buffer);
@@ -189,8 +186,8 @@
*buf = Element::OBJECT_AMF0;
if (data.propertySize() > 0) {
- vector<boost::shared_ptr<amf::Element> >::const_iterator ait;
- vector<boost::shared_ptr<amf::Element> > props = data.getProperties();
+ std::vector<boost::shared_ptr<amf::Element> >::const_iterator ait;
+ std::vector<boost::shared_ptr<amf::Element> > props =
data.getProperties();
for (ait = props.begin(); ait != props.end(); ait++) {
boost::shared_ptr<amf::Element> el = (*(ait));
boost::shared_ptr<amf::Buffer> item = AMF::encodeElement(el);
@@ -299,7 +296,7 @@
{
// GNASH_REPORT_FUNCTION;
boost::shared_ptr<Buffer> buf;
- log_unimpl("XML AMF objects not supported yet");
+ gnash::log_unimpl("XML AMF objects not supported yet");
buf.reset();
return buf;
}
@@ -341,15 +338,15 @@
*buf += enclength;
if (data.getName()) {
- string name = data.getName();
+ std::string name = data.getName();
if (name.size() > 0) {
*buf += name;
}
}
if (data.propertySize() > 0) {
- vector<boost::shared_ptr<amf::Element> >::const_iterator ait;
- vector<boost::shared_ptr<amf::Element> > props = data.getProperties();
+ std::vector<boost::shared_ptr<amf::Element> >::const_iterator ait;
+ std::vector<boost::shared_ptr<amf::Element> > props =
data.getProperties();
for (ait = props.begin(); ait != props.end(); ait++) {
boost::shared_ptr<amf::Element> el = (*(ait));
boost::shared_ptr<amf::Buffer> item = AMF::encodeElement(el);
@@ -403,7 +400,7 @@
{
// GNASH_REPORT_FUNCTION;
boost::shared_ptr<Buffer> buf;
- log_unimpl("Movie Clip AMF objects not supported yet");
+ gnash::log_unimpl("Movie Clip AMF objects not supported yet");
return buf;
}
@@ -442,8 +439,8 @@
// first, so we do the same for now.
if (data.propertySize() > 0) {
boost::shared_ptr<amf::Buffer> item;
- vector<boost::shared_ptr<amf::Element> >::const_iterator ait;
- vector<boost::shared_ptr<amf::Element> > props = data.getProperties();
+ std::vector<boost::shared_ptr<amf::Element> >::const_iterator ait;
+ std::vector<boost::shared_ptr<amf::Element> > props =
data.getProperties();
for (ait = props.begin(); ait != props.end(); ait++) {
boost::shared_ptr<amf::Element> el = (*(ait));
if (sparse) {
@@ -494,7 +491,7 @@
{
// GNASH_REPORT_FUNCTION;
boost::shared_ptr<Buffer> buf;
- log_unimpl("Long String AMF objects not supported yet");
+ gnash::log_unimpl("Long String AMF objects not supported yet");
return buf;
}
@@ -511,7 +508,7 @@
{
// GNASH_REPORT_FUNCTION;
boost::shared_ptr<Buffer> buf;
- log_unimpl("Reecord Set AMF objects not supported yet");
+ gnash::log_unimpl("Reecord Set AMF objects not supported yet");
return buf;
}
@@ -546,8 +543,8 @@
*buf += items;
if (data.propertySize() > 0) {
- vector<boost::shared_ptr<amf::Element> >::const_iterator ait;
- vector<boost::shared_ptr<amf::Element> > props = data.getProperties();
+ std::vector<boost::shared_ptr<amf::Element> >::const_iterator ait;
+ std::vector<boost::shared_ptr<amf::Element> > props =
data.getProperties();
bool sparse = false;
size_t counter = 0;
for (ait = props.begin(); ait != props.end(); ait++) {
@@ -560,7 +557,7 @@
// array which is more compact. At least this is what Red5 does.
if (el->getType() == Element::UNDEFINED_AMF0) {
if (!sparse) {
- log_debug("Encoding a strict array as an ecma array");
+ gnash::log_debug("Encoding a strict array as an ecma
array");
*buf->reference() = Element::ECMA_ARRAY_AMF0;
// When returning an ECMA array for a sparsely populated
// array, Red5 adds one more to the count to be 1 based,
@@ -607,7 +604,7 @@
///
/// @return a binary AMF packet in big endian format
boost::shared_ptr<Buffer>
-AMF::encodeString(const string &str)
+AMF::encodeString(const std::string &str)
{
boost::uint8_t *ptr = const_cast<boost::uint8_t *>(reinterpret_cast<const
boost::uint8_t *>(str.c_str()));
return encodeString(ptr, str.size());
@@ -783,7 +780,7 @@
// case Element::FUNCTION:
// break;
case Element::AMF3_DATA:
- log_error("FIXME: got AMF3 data type");
+ gnash::log_error("FIXME: got AMF3 data type");
break;
default:
buf.reset();
@@ -805,7 +802,7 @@
swapBytes(&enclength, 2);
*bigbuf = enclength;
// Now the name itself
- string name = el.getName();
+ std::string name = el.getName();
if (name.size() > 0) {
*bigbuf += name;
}
@@ -841,7 +838,7 @@
*buf = enclength;
if (el->getName()) {
- string name = el->getName();
+ std::string name = el->getName();
if (name.size() > 0) {
*buf += name;
}
@@ -912,7 +909,7 @@
boost::shared_ptr<amf::Element> el(new Element);
if (in == 0) {
- log_error(_("AMF body input data is NULL"));
+ gnash::log_error(_("AMF body input data is NULL"));
return el;
}
@@ -936,7 +933,7 @@
// char c = *(reinterpret_cast<char *>(tmpptr));
if (tooFar - tmpptr < 1) {
- log_error(_("AMF data too short to contain type field"));
+ gnash::log_error(_("AMF data too short to contain type field"));
return el;
}
@@ -947,7 +944,7 @@
switch (type) {
case Element::NOTYPE:
{
- log_error("Element has no type!");
+ gnash::log_error("Element has no type!");
break;
}
case Element::NUMBER_AMF0:
@@ -957,7 +954,7 @@
assert(tooFar >= tmpptr);
if (static_cast<size_t>(tooFar - tmpptr) < sizeof(const double)) {
- log_error(_("AMF data segment too short to contain"
+ gnash::log_error(_("AMF data segment too short to contain"
"type NUMBER"));
el.reset();
return el;
@@ -977,7 +974,7 @@
length = ntohs((*(boost::uint16_t *)tmpptr) & 0xffff);
tmpptr += sizeof(boost::uint16_t);
if (length >= SANE_STR_SIZE) {
- log_error("%d bytes for a string is over the safe "
+ gnash::log_error("%d bytes for a string is over the safe "
"limit of %d, line %d", length,
SANE_STR_SIZE, __LINE__);
el.reset();
@@ -1020,7 +1017,7 @@
break;
}
case Element::MOVIECLIP_AMF0:
- log_debug("AMF0 MovieClip frame");
+ gnash::log_debug("AMF0 MovieClip frame");
break;
case Element::NULL_AMF0:
el->makeNull();
@@ -1150,7 +1147,7 @@
while (tmpptr < tooFar - length) {
// FIXME: was tooFar - AMF_HEADER_SIZE)
if (*(tmpptr +3) == TERMINATOR) {
- log_debug("Found object terminator byte");
+ gnash::log_debug("Found object terminator byte");
tmpptr++;
break;
}
@@ -1168,7 +1165,7 @@
}
case Element::AMF3_DATA:
default:
- log_unimpl("%s: type %d", __PRETTY_FUNCTION__, (int)type);
+ gnash::log_unimpl("%s: type %d", __PRETTY_FUNCTION__, (int)type);
el.reset();
return el;
}
@@ -1243,7 +1240,7 @@
}
#else
if (length >= SANE_STR_SIZE) {
- log_error("%d bytes for a string is over the safe limit of %d. Putting
the rest of the buffer into the string, line %d", length, SANE_STR_SIZE,
__LINE__);
+ gnash::log_error("%d bytes for a string is over the safe limit of %d.
Putting the rest of the buffer into the string, line %d", length,
SANE_STR_SIZE, __LINE__);
}
#endif
@@ -1261,7 +1258,7 @@
// If we get a NULL object, there is no data. In that case, we only return
// the name of the property.
if (type == Element::NULL_AMF0) {
- log_debug("No data associated with Property \"%s\"", name);
+ gnash::log_debug("No data associated with Property \"%s\"", name);
el.reset(new Element);
el->setName(name.c_str(), name.size());
tmpptr += 1;
=== modified file 'libamf/amf_msg.cpp'
--- a/libamf/amf_msg.cpp 2010-01-11 06:41:38 +0000
+++ b/libamf/amf_msg.cpp 2010-03-09 01:24:14 +0000
@@ -31,9 +31,11 @@
#include <string>
#include <boost/cstdint.hpp> // For C99 int types
+using gnash::GnashException;
+using gnash::log_error;
+using std::cout;
+using std::endl;
-using namespace std;
-using namespace gnash;
namespace amf
{
@@ -142,7 +144,7 @@
throw GnashException(msg.str());
}
tmpptr += sizeof(boost::uint16_t);
- string str1(reinterpret_cast<const char *>(tmpptr), length);
+ std::string str1(reinterpret_cast<const char *>(tmpptr), length);
msg->target = str1;
if ((tmpptr - data) > static_cast<int>(size)) {
boost::format msg("Trying to read past the end of data! Wants %1%
bytes, given %2% bytes");
@@ -160,7 +162,7 @@
throw GnashException(msg.str());
}
tmpptr += sizeof(boost::uint16_t);
- string str2(reinterpret_cast<const char *>(tmpptr), length);
+ std::string str2(reinterpret_cast<const char *>(tmpptr), length);
msg->response = str2;
tmpptr += length;
if ((tmpptr - data) > static_cast<int>(size)) {
@@ -253,7 +255,7 @@
// Now encode all the messages
- vector<boost::shared_ptr<AMF_msg::amf_message_t> >::iterator it;
+ std::vector<boost::shared_ptr<AMF_msg::amf_message_t> >::iterator it;
for (it = _messages.begin(); it != _messages.end(); it++) {
boost::shared_ptr<AMF_msg::amf_message_t> msg = (*(it));
@@ -320,7 +322,7 @@
{
// GNASH_REPORT_FUNCTION;
cout << "AMF Packet has " << _messages.size() << " messages." << endl;
- vector<boost::shared_ptr<AMF_msg::amf_message_t> >::iterator it;
+ std::vector<boost::shared_ptr<AMF_msg::amf_message_t> >::iterator it;
for (it = _messages.begin(); it != _messages.end(); it++) {
boost::shared_ptr<AMF_msg::amf_message_t> msg = (*(it));
AMF_msg::dump(msg->header);
=== modified file 'libamf/buffer.cpp'
--- a/libamf/buffer.cpp 2010-01-01 20:41:28 +0000
+++ b/libamf/buffer.cpp 2010-03-09 01:24:14 +0000
@@ -31,8 +31,6 @@
//#include "network.h"
#include "GnashException.h"
-using namespace std;
-using namespace gnash;
/// \namespace amf
///
@@ -70,7 +68,7 @@
/// primary used only for testing to create binary data
/// from an easy to read and edit format.
Buffer &
-Buffer::hex2mem(const string &str)
+Buffer::hex2mem(const std::string &str)
{
// GNASH_REPORT_FUNCTION;
size_t count = str.size();
@@ -208,7 +206,7 @@
boost::format msg("Not enough storage was allocated to hold the "
"copied data! Needs %1%, only has %2% bytes");
msg % nbytes % _nbytes;
- throw GnashException(msg.str());
+ throw gnash::GnashException(msg.str());
}
}
return *this;
@@ -234,7 +232,7 @@
boost::format msg("Not enough storage was allocated to hold the "
"appended data! Needs %1%, only has %2% bytes");
msg % nbytes % spaceLeft();
- throw GnashException(msg.str());
+ throw gnash::GnashException(msg.str());
}
}
@@ -514,7 +512,7 @@
if (data) {
_data.reset(data);
} else {
- throw ParserException("Passing invalid pointer!");
+ throw gnash::ParserException("Passing invalid pointer!");
}
return *this;
}
@@ -710,7 +708,7 @@
// deleted when this method returns.
// We loose data if we resize smaller than the data currently held.
if (size < used) {
- log_error("amf::Buffer::resize(%d): Truncating data (%d bytes)
while resizing!", size, used - size);
+ gnash::log_error("amf::Buffer::resize(%d): Truncating data (%d
bytes) while resizing!", size, used - size);
used = size;
}
boost::uint8_t *newptr = new boost::uint8_t[size];
@@ -736,10 +734,12 @@
// Skip in-memory address " at " << (void *)_data.get() << endl;
if (_nbytes > 0) {
const size_t bytes = _seekptr - _data.get();
- os << gnash::hexify((unsigned char *)_data.get(), bytes, false) << endl;
- os << gnash::hexify((unsigned char *)_data.get(), bytes, true) << endl;
+ os << gnash::hexify((unsigned char *)_data.get(), bytes, false)
+ << std::endl;
+ os << gnash::hexify((unsigned char *)_data.get(), bytes, true)
+ << std::endl;
} else {
- os << "ERROR: Buffer size out of range!" << endl;
+ os << "ERROR: Buffer size out of range!" << std::endl;
}
}
@@ -763,7 +763,7 @@
// Pick the number of errors to create based on the Buffer's data size
boost::uniform_int<> errs(1, (_nbytes/factor));
int errors = errs(seed);
- log_debug("Creating %d errors in the buffer", errors);
+ gnash::log_debug("Creating %d errors in the buffer", errors);
for (int i=0; i<errors; i++) {
// find a location someplace within the file.
=== modified file 'libamf/element.cpp'
--- a/libamf/element.cpp 2010-01-25 18:52:20 +0000
+++ b/libamf/element.cpp 2010-03-09 01:24:14 +0000
@@ -33,8 +33,8 @@
#include "element.h"
#include "GnashException.h"
-using namespace std;
-using namespace gnash;
+using std::string;
+using gnash::log_error;
/// \namespace amf
///
@@ -431,7 +431,7 @@
// More complex messages have child elements, either properties or
// the items in an array, If we have children, count up their size too.
// Calculate the total size of the message
- vector<boost::shared_ptr<amf::Element> > props = el.getProperties();
+ std::vector<boost::shared_ptr<amf::Element> > props = el.getProperties();
for (size_t i=0; i<props.size(); i++) {
outsize += props[i]->getDataSize();
if (props[i]->getNameSize()) {
@@ -476,7 +476,7 @@
size += _properties[i]->getNameSize();
size += AMF_PROP_HEADER_SIZE;
}
- log_debug("Size of Element \"%s\" is: %d", _name, size);
+ gnash::log_debug("Size of Element \"%s\" is: %d", _name, size);
buf.reset(new Buffer(size+AMF_PROP_HEADER_SIZE));
if (!notobject) {
*buf = Element::OBJECT_AMF0;
@@ -967,7 +967,7 @@
{
// GNASH_REPORT_FUNCTION;
_type = Element::OBJECT_AMF0;
- vector<boost::shared_ptr<Element> >::const_iterator ait;
+ std::vector<boost::shared_ptr<Element> >::const_iterator ait;
for (ait = data.begin(); ait != data.end(); ait++) {
boost::shared_ptr<Element> el = (*(ait));
addProperty(el);
@@ -1474,10 +1474,10 @@
_buffer.reset(new Buffer(size));
} else {
if (_buffer->size() < size) {
- throw ParserException("Buffer not big enough, try resizing!");
+ throw gnash::ParserException("Buffer not big enough, try
resizing!");
}
if (_buffer->size() == 0) {
- throw ParserException("Buffer has zero size, not initialized!");
+ throw gnash::ParserException("Buffer has zero size, not
initialized!");
}
}
}
@@ -1495,22 +1495,22 @@
} else {
os << "(no name), ";
}
- os << "data length is " << getDataSize() << endl;
+ os << "data length is " << getDataSize() << std::endl;
switch (_type) {
case Element::NUMBER_AMF0:
- os << to_number() << endl;
+ os << to_number() << std::endl;
break;
case Element::BOOLEAN_AMF0:
- os << (to_bool() ? "true" : "false") << endl;
+ os << (to_bool() ? "true" : "false") << std::endl;
break;
case Element::STRING_AMF0:
os << "(" << getDataSize() << " bytes): ";
if (getDataSize()) {
os << "\t\"" << to_string() << "\"";
}
- cerr << endl;
+ std::cerr << std::endl;
break;
case Element::OBJECT_AMF0:
break;
@@ -1527,11 +1527,11 @@
case Element::RECORD_SET_AMF0:
case Element::XML_OBJECT_AMF0:
case Element::TYPED_OBJECT_AMF0:
- cerr << endl;
+ std::cerr << std::endl;
break;
case Element::AMF3_DATA:
if (getDataSize() != 0) {
- log_debug("FIXME: got AMF3 data!");
+ gnash::log_debug("FIXME: got AMF3 data!");
}
// cerr << "AMF3 data is: 0x" << hexify(_data, _length, false) << endl;
break;
@@ -1554,8 +1554,8 @@
}
if (_properties.size() > 0) {
- vector<boost::shared_ptr<Element> >::const_iterator ait;
- os << "# of Properties in object: " << _properties.size() << endl;
+ std::vector<boost::shared_ptr<Element> >::const_iterator ait;
+ os << "# of Properties in object: " << _properties.size() << std::endl;
for (ait = _properties.begin(); ait != _properties.end(); ait++) {
const boost::shared_ptr<Element> el = (*(ait));
el->dump(os);
@@ -1573,7 +1573,7 @@
Element::findProperty(const std::string &name)
{
if (_properties.size() > 0) {
- vector<boost::shared_ptr<Element> >::iterator ait;
+ std::vector<boost::shared_ptr<Element> >::iterator ait;
// cerr << "# of Properties in object: " << _properties.size() << endl;
for (ait = _properties.begin(); ait != _properties.end(); ait++) {
boost::shared_ptr<Element> el = (*(ait));
=== modified file 'libamf/flv.cpp'
--- a/libamf/flv.cpp 2010-01-25 18:52:20 +0000
+++ b/libamf/flv.cpp 2010-03-09 01:24:14 +0000
@@ -34,8 +34,8 @@
#include <climits>
#include <boost/cstdint.hpp>
-using namespace std;
-using namespace gnash;
+using gnash::log_debug;
+using gnash::log_error;
namespace amf
{
@@ -310,7 +310,7 @@
Flv::findProperty(const std::string &name)
{
if (_properties.size() > 0) {
- vector<boost::shared_ptr<amf::Element> >::iterator ait;
+ std::vector<boost::shared_ptr<amf::Element> >::iterator ait;
// cerr << "# of Properties in object: " << _properties.size() << endl;
for (ait = _properties.begin(); ait != _properties.end(); ait++) {
boost::shared_ptr<amf::Element> el = (*(ait));
@@ -329,8 +329,9 @@
{
// GNASH_REPORT_FUNCTION;
if (_properties.size() > 0) {
- vector<boost::shared_ptr<amf::Element> >::iterator ait;
- cerr << "# of Properties in object: " << _properties.size() << endl;
+ std::vector<boost::shared_ptr<amf::Element> >::iterator ait;
+ std::cerr << "# of Properties in object: " << _properties.size()
+ << std::endl;
for (ait = _properties.begin(); ait != _properties.end(); ait++) {
boost::shared_ptr<amf::Element> el = (*(ait));
// an onMetaData packet of an FLV stream only contains number or
@@ -344,7 +345,7 @@
}
}
} else {
- cerr << "No properties" << endl;
+ std::cerr << "No properties" << std::endl;
}
}
=== modified file 'libamf/lcshm.cpp'
--- a/libamf/lcshm.cpp 2010-02-09 16:03:15 +0000
+++ b/libamf/lcshm.cpp 2010-03-09 01:24:14 +0000
@@ -37,8 +37,10 @@
#include <vector>
#endif
-using namespace std;
-using namespace gnash;
+using std::string;
+using std::vector;
+using gnash::log_debug;
+using gnash::log_error;
// Some facts:
// * The header is 16 bytes,
@@ -87,7 +89,7 @@
/// @remarks May throw an Exception
#define ENSUREBYTES(from, toofar, size) { \
if ( from+size >= toofar ) \
- throw ParserException("Premature end of AMF stream"); \
+ throw gnash::ParserException("Premature end of AMF stream"); \
}
/// \brief Construct an uninitialized shared memory segment.
@@ -296,11 +298,11 @@
/// @return A smart pointer to a vector of Listener names.
///
/// @remarks This is only used for debugging
-auto_ptr< vector<string> >
+std::auto_ptr< vector<string> >
Listener::listListeners()
{
// GNASH_REPORT_FUNCTION;
- auto_ptr< vector<string> > listeners ( new vector<string> );
+ std::auto_ptr< vector<string> > listeners ( new vector<string> );
if (_baseaddr != 0) {
boost::uint8_t *addr = _baseaddr + LC_LISTENERS_START;
@@ -779,7 +781,7 @@
// cerr <<"Timestamp: " << _header.timestamp << endl;
// cerr << "Length: " << _header.length << endl;
-
+ using namespace std;
cerr << "Connection Name:\t" << _object.connection_name << endl;
cerr << "Hostname Name:\t\t" << _object.hostname << endl;
cerr << "Domain Allowed:\t\t" << ((_object.domain) ? "true" : "false") <<
endl;
=== modified file 'libamf/sol.cpp'
--- a/libamf/sol.cpp 2010-01-25 18:52:20 +0000
+++ b/libamf/sol.cpp 2010-03-09 01:24:14 +0000
@@ -35,10 +35,10 @@
#include <fstream>
#include <cassert>
-
-using namespace std;
-using namespace amf;
-using namespace gnash;
+using std::vector;
+using gnash::ParserException;
+using gnash::log_debug;
+using gnash::log_error;
// It comprises of a magic number, followed by the file length, a
// filetype, which appears to always be "TCSO", and what appears to be
@@ -242,10 +242,10 @@
///
/// @return true if this succeeded. false if it doesn't.
bool
-SOL::writeFile(const string &filespec, const string &name)
+SOL::writeFile(const std::string &filespec, const std::string &name)
{
// GNASH_REPORT_FUNCTION;
- ofstream ofs(filespec.c_str(), ios::binary);
+ std::ofstream ofs(filespec.c_str(), std::ios::binary);
if ( ! ofs ) {
log_error("Failed opening file '%s' in binary mode", filespec.c_str());
return false;
@@ -370,7 +370,7 @@
boost::uint8_t *ptr = 0;
- ifstream ifs(filespec.c_str(), ios::binary);
+ std::ifstream ifs(filespec.c_str(), std::ios::binary);
_filesize = st.st_size;
boost::scoped_array<boost::uint8_t> buf(
@@ -486,6 +486,7 @@
void
SOL::dump()
{
+ using namespace std;
vector<boost::shared_ptr<amf::Element> >::iterator it;
cerr << "Dumping SOL file" << endl;
=== modified file 'libnet/cache.cpp'
--- a/libnet/cache.cpp 2010-01-11 06:41:38 +0000
+++ b/libnet/cache.cpp 2010-03-09 01:24:14 +0000
@@ -37,7 +37,9 @@
#include "log.h"
#include "diskstream.h"
-using namespace std;
+using std::string;
+using std::map;
+using std::endl;
static boost::mutex cache_mutex;
@@ -188,7 +190,7 @@
// GNASH_REPORT_FUNCTION;
// dump timing related data
struct timespec now;
- stringstream text;
+ std::stringstream text;
clock_gettime (CLOCK_REALTIME, &now);
double time = ((now.tv_sec - _last_access.tv_sec) + ((now.tv_nsec -
_last_access.tv_nsec)/1e9));
@@ -209,7 +211,7 @@
<< " <Hits>" << _file_hits << "</Hits>"
<< endl
<< " </Files>" << endl;
} else {
- text << "Time since last access: " << fixed << time << " seconds ago."
<< endl;
+ text << "Time since last access: " << std::fixed << time << " seconds
ago." << endl;
text << "Pathnames in cache: " << _pathnames.size() << ", accessed "
<< _pathname_lookups << " times" << endl;
@@ -238,7 +240,7 @@
text << "Disktream: " << data->first
<< ", accessed: " << data->second->getAccessCount()
<< " times." << endl;
- text << " Time since last file access: " << fixed << time << "
seconds ago." << endl;
+ text << " Time since last file access: " << std::fixed << time
<< " seconds ago." << endl;
}
}
=== modified file 'libnet/cque.cpp'
--- a/libnet/cque.cpp 2010-01-15 02:12:11 +0000
+++ b/libnet/cque.cpp 2010-03-09 01:24:14 +0000
@@ -29,10 +29,7 @@
#include "gmemory.h"
#include "buffer.h"
-using namespace gnash;
-using namespace amf;
-using namespace std;
-using namespace boost;
+using std::deque;
namespace gnash
{
@@ -235,7 +232,7 @@
// log_debug("%s: Final Totalsize is %s", __PRETTY_FUNCTION__, totalsize);
// Merge all elements in a single buffer. We have totalsize now.
- boost::shared_ptr<amf::Buffer> newbuf(new Buffer(totalsize));
+ boost::shared_ptr<amf::Buffer> newbuf(new amf::Buffer(totalsize));
for (que_t::iterator i=from; i!=to; ++i) {
// log_debug("%s: copying %d bytes, space left is %d, totalsize is %d",
__PRETTY_FUNCTION__,
// (*i)->allocated(), newbuf->spaceLeft(), totalsize);
@@ -265,7 +262,8 @@
// GNASH_REPORT_FUNCTION;
deque<boost::shared_ptr<amf::Buffer> >::iterator it;
boost::mutex::scoped_lock lock(_mutex);
- cerr << endl << "CQue \"" << _name << "\" has "<< _que.size() << "
buffers." << endl;
+ std::cerr << std::endl << "CQue \"" << _name << "\" has "<< _que.size()
+ << " buffers." << std::endl;
for (it = _que.begin(); it != _que.end(); it++) {
boost::shared_ptr<amf::Buffer> ptr = *(it);
ptr->dump();
=== modified file 'libnet/diskstream.cpp'
--- a/libnet/diskstream.cpp 2010-02-14 00:41:33 +0000
+++ b/libnet/diskstream.cpp 2010-03-09 01:24:14 +0000
@@ -58,9 +58,7 @@
static boost::mutex io_mutex;
static boost::mutex mem_mutex;
-using namespace gnash;
-using namespace std;
-using namespace amf;
+using std::string;
/// \namespace gnash
/// This is the main namespace for Gnash and it's libraries.
@@ -1102,6 +1100,7 @@
void
DiskStream::dump()
{
+ using namespace std;
// GNASH_REPORT_FUNCTION;
const char *state_str[] = {
"NO_STATE",
=== modified file 'libnet/http.cpp'
--- a/libnet/http.cpp 2010-02-14 00:41:33 +0000
+++ b/libnet/http.cpp 2010-03-09 01:24:14 +0000
@@ -63,8 +63,7 @@
# include <sys/param.h>
#endif
-using namespace gnash;
-using namespace std;
+using std::string;
static boost::mutex stl_mutex;
@@ -1118,7 +1117,7 @@
{
// GNASH_REPORT_FUNCTION;
boost::posix_time::ptime now =
boost::posix_time::second_clock::local_time();
- stringstream date;
+ std::stringstream date;
boost::gregorian::date d(now.date());
@@ -1560,7 +1559,7 @@
log_debug (_("Filespec: %s"), _filespec.c_str());
log_debug (_("Version: %d.%d"), _version.major, _version.minor);
- map<string, string>::const_iterator it;
+ std::map<string, string>::const_iterator it;
for (it = _fields.begin(); it != _fields.end(); ++it) {
log_debug("Field: \"%s\" = \"%s\"", it->first, it->second);
}
=== modified file 'libnet/lirc.cpp'
--- a/libnet/lirc.cpp 2010-01-25 18:52:20 +0000
+++ b/libnet/lirc.cpp 2010-03-09 01:24:14 +0000
@@ -24,7 +24,7 @@
#include "log.h"
#include "lirc.h"
-using namespace std;
+using std::string;
namespace gnash {
@@ -95,7 +95,7 @@
string control_str = packet.substr(space3);
if (button_str[0] > 'A' && button_str[0] < 'Z') {
- cerr << "Character: " << button_str << endl;
+ std::cerr << "Character: " << button_str << std::endl;
key = (gnash::key::code)button_str[0];
}
=== modified file 'libnet/netstats.cpp'
--- a/libnet/netstats.cpp 2010-01-25 18:52:20 +0000
+++ b/libnet/netstats.cpp 2010-03-09 01:24:14 +0000
@@ -21,8 +21,6 @@
#include "netstats.h"
#include "log.h"
-using namespace gnash;
-using namespace boost::posix_time;
namespace gnash {
=== modified file 'libnet/network.cpp'
--- a/libnet/network.cpp 2010-02-09 21:09:48 +0000
+++ b/libnet/network.cpp 2010-03-09 01:24:14 +0000
@@ -77,7 +77,8 @@
#define FIONREAD 0
#endif
-using namespace std;
+using std::string;
+using std::vector;
/// \namespace gnash
/// This is the main namespace for Gnash and it's libraries.
=== modified file 'libnet/rtmp_msg.cpp'
--- a/libnet/rtmp_msg.cpp 2010-01-11 06:41:38 +0000
+++ b/libnet/rtmp_msg.cpp 2010-03-09 01:24:14 +0000
@@ -40,9 +40,8 @@
#include "utility.h"
#include "buffer.h"
-using namespace gnash;
-using namespace std;
-using namespace amf;
+using std::vector;
+using amf::Element;
namespace gnash
{
@@ -139,8 +138,8 @@
for (cit = props.begin(); cit != props.end(); cit++) {
boost::shared_ptr<amf::Element> child = (*(cit));
// child->dump();
- string name = child->getName();
- string value;
+ std::string name = child->getName();
+ std::string value;
if (child->getDataSize()) {
value = child->to_string();
if (name == "code") {
@@ -206,6 +205,7 @@
void
RTMPMsg::dump()
{
+ using namespace std;
// GNASH_REPORT_FUNCTION;
// cerr <<"Timestamp: " << _header.timestamp << endl;
=== modified file 'libnet/statistics.cpp'
--- a/libnet/statistics.cpp 2010-01-25 18:52:20 +0000
+++ b/libnet/statistics.cpp 2010-03-09 01:24:14 +0000
@@ -27,8 +27,6 @@
#include "netstats.h"
#include "statistics.h"
-using namespace gnash;
-using namespace std;
static boost::mutex io_mutex;
@@ -108,7 +106,7 @@
void
Statistics::dump() {
boost::mutex::scoped_lock lock(io_mutex);
- list<NetStats *>::iterator it;
+ std::list<NetStats *>::iterator it;
for (it = _netstats.begin(); it != _netstats.end(); it++) {
NetStats *stats = (*it);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r11998: Remove some more 'using namespace ...' from the global namespace.,
Bastiaan Jacques <=