Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 583660
Collapse All | Expand All

(-)a/src/core/common/avatarmanager.cpp (-2 / +2 lines)
Lines 61-67 using namespace std; Link Here
61
using namespace boost::filesystem;
61
using namespace boost::filesystem;
62
62
63
struct AvatarFileState {
63
struct AvatarFileState {
64
	ifstream		inputStream;
64
	std::ifstream		inputStream;
65
};
65
};
66
66
67
AvatarManager::AvatarManager(bool useExternalServer, const std::string &externalServerAddress,
67
AvatarManager::AvatarManager(bool useExternalServer, const std::string &externalServerAddress,
Lines 371-377 AvatarManager::StoreAvatarInCache(const MD5Buf &md5buf, AvatarFileType avatarFil Link Here
371
				path tmpPath(cacheDir);
371
				path tmpPath(cacheDir);
372
				tmpPath /= (md5buf.ToString() + ext);
372
				tmpPath /= (md5buf.ToString() + ext);
373
				string fileName(tmpPath.file_string());
373
				string fileName(tmpPath.file_string());
374
				ofstream o(fileName.c_str(), ios_base::out | ios_base::binary | ios_base::trunc);
374
				std::ofstream o(fileName.c_str(), ios_base::out | ios_base::binary | ios_base::trunc);
375
				if (!o.fail()) {
375
				if (!o.fail()) {
376
					o.write((const char *)data, size);
376
					o.write((const char *)data, size);
377
					o.close();
377
					o.close();
(-)a/src/core/common/loghelper_server.cpp (-3 / +3 lines)
Lines 67-73 void Link Here
67
internal_log_err(const string &msg)
67
internal_log_err(const string &msg)
68
{
68
{
69
	if (!g_logFile.empty()) {
69
	if (!g_logFile.empty()) {
70
		ofstream o(g_logFile.c_str(), ios_base::out | ios_base::app);
70
		std::ofstream o(g_logFile.c_str(), ios_base::out | ios_base::app);
71
		if (!o.fail()) {
71
		if (!o.fail()) {
72
			o << second_clock::local_time() << " ERR: " << msg;
72
			o << second_clock::local_time() << " ERR: " << msg;
73
			o.flush();
73
			o.flush();
Lines 80-86 internal_log_msg(const std::string &msg) Link Here
80
{
80
{
81
	if (g_logLevel) {
81
	if (g_logLevel) {
82
		if (!g_logFile.empty()) {
82
		if (!g_logFile.empty()) {
83
			ofstream o(g_logFile.c_str(), ios_base::out | ios_base::app);
83
			std::ofstream o(g_logFile.c_str(), ios_base::out | ios_base::app);
84
			if (!o.fail())
84
			if (!o.fail())
85
				o << second_clock::local_time() << " MSG: " << msg;
85
				o << second_clock::local_time() << " MSG: " << msg;
86
		}
86
		}
Lines 92-98 internal_log_level(const std::string &msg, int logLevel) Link Here
92
{
92
{
93
	if (g_logLevel >= logLevel) {
93
	if (g_logLevel >= logLevel) {
94
		if (!g_logFile.empty()) {
94
		if (!g_logFile.empty()) {
95
			ofstream o(g_logFile.c_str(), ios_base::out | ios_base::app);
95
			std::ofstream o(g_logFile.c_str(), ios_base::out | ios_base::app);
96
			if (!o.fail())
96
			if (!o.fail())
97
				o << second_clock::local_time() << " OUT: " << msg;
97
				o << second_clock::local_time() << " OUT: " << msg;
98
		}
98
		}
(-)a/src/net/common/clientstate.cpp (-2 / +2 lines)
Lines 308-315 ClientStateReadingServerList::Enter(boost::shared_ptr<ClientThread> client) Link Here
308
308
309
		// Unzip the file using zlib.
309
		// Unzip the file using zlib.
310
		try {
310
		try {
311
			ifstream inFile(zippedServerListPath.directory_string().c_str(), ios_base::in | ios_base::binary);
311
			std::ifstream inFile(zippedServerListPath.directory_string().c_str(), ios_base::in | ios_base::binary);
312
			ofstream outFile(xmlServerListPath.directory_string().c_str(), ios_base::out | ios_base::trunc);
312
			std::ofstream outFile(xmlServerListPath.directory_string().c_str(), ios_base::out | ios_base::trunc);
313
			boost::iostreams::filtering_streambuf<boost::iostreams::input> in;
313
			boost::iostreams::filtering_streambuf<boost::iostreams::input> in;
314
			in.push(boost::iostreams::zlib_decompressor());
314
			in.push(boost::iostreams::zlib_decompressor());
315
			in.push(inFile);
315
			in.push(inFile);
(-)a/src/net/common/clientthread.cpp (-2 / +2 lines)
Lines 1695-1701 void Link Here
1695
ClientThread::ReadSessionGuidFromFile()
1695
ClientThread::ReadSessionGuidFromFile()
1696
{
1696
{
1697
	string guidFileName(GetContext().GetCacheDir() + TEMP_GUID_FILENAME);
1697
	string guidFileName(GetContext().GetCacheDir() + TEMP_GUID_FILENAME);
1698
	ifstream guidStream(guidFileName.c_str(), ios::in | ios::binary);
1698
	std::ifstream guidStream(guidFileName.c_str(), ios::in | ios::binary);
1699
	if (guidStream.good()) {
1699
	if (guidStream.good()) {
1700
		std::vector<char> tmpGuid(CLIENT_GUID_SIZE);
1700
		std::vector<char> tmpGuid(CLIENT_GUID_SIZE);
1701
		guidStream.read(&tmpGuid[0], CLIENT_GUID_SIZE);
1701
		guidStream.read(&tmpGuid[0], CLIENT_GUID_SIZE);
Lines 1707-1713 void Link Here
1707
ClientThread::WriteSessionGuidToFile() const
1707
ClientThread::WriteSessionGuidToFile() const
1708
{
1708
{
1709
	string guidFileName(GetContext().GetCacheDir() + TEMP_GUID_FILENAME);
1709
	string guidFileName(GetContext().GetCacheDir() + TEMP_GUID_FILENAME);
1710
	ofstream guidStream(guidFileName.c_str(), ios::out | ios::trunc | ios::binary);
1710
	std::ofstream guidStream(guidFileName.c_str(), ios::out | ios::trunc | ios::binary);
1711
	if (guidStream.good()) {
1711
	if (guidStream.good()) {
1712
		guidStream.write(GetContext().GetSessionGuid().c_str(), GetContext().GetSessionGuid().size());
1712
		guidStream.write(GetContext().GetSessionGuid().c_str(), GetContext().GetSessionGuid().size());
1713
	}
1713
	}
(-)a/src/net/common/downloaderthread.cpp (-1 / +1 lines)
Lines 96-102 DownloaderThread::Main() Link Here
96
				// Previous download was finished.
96
				// Previous download was finished.
97
				if (m_curDownloadData) {
97
				if (m_curDownloadData) {
98
					path filepath(m_curDownloadData->filename);
98
					path filepath(m_curDownloadData->filename);
99
					ifstream instream(filepath.file_string().c_str(), ios_base::in | ios_base::binary);
99
					std::ifstream instream(filepath.file_string().c_str(), ios_base::in | ios_base::binary);
100
					// Find out file size.
100
					// Find out file size.
101
					// Not fully portable, but works on win/linux/mac.
101
					// Not fully portable, but works on win/linux/mac.
102
					instream.seekg(0, ios_base::beg);
102
					instream.seekg(0, ios_base::beg);
(-)a/src/pokerth_server.cpp (-1 / +1 lines)
Lines 161-167 main(int argc, char *argv[]) Link Here
161
		pidFile = tmpPidPath.directory_string();
161
		pidFile = tmpPidPath.directory_string();
162
	}
162
	}
163
	{
163
	{
164
		ofstream pidStream(pidFile.c_str(), ios_base::out | ios_base::trunc);
164
		std::ofstream pidStream(pidFile.c_str(), ios_base::out | ios_base::trunc);
165
		if (!pidStream.fail())
165
		if (!pidStream.fail())
166
			pidStream << getpid();
166
			pidStream << getpid();
167
		else
167
		else
(-)a/src/zlib_compress.cpp (-2 / +2 lines)
Lines 59-66 main(int argc, char *argv[]) Link Here
59
		return 2;
59
		return 2;
60
	}
60
	}
61
	try {
61
	try {
62
		ifstream inFile(inputFilePath.directory_string().c_str(), ios_base::in);
62
		std::ifstream inFile(inputFilePath.directory_string().c_str(), ios_base::in);
63
		ofstream outFile(outputFilePath.directory_string().c_str(), ios_base::out | ios_base::binary);
63
		std::ofstream outFile(outputFilePath.directory_string().c_str(), ios_base::out | ios_base::binary);
64
		boost::iostreams::filtering_streambuf<boost::iostreams::output> out;
64
		boost::iostreams::filtering_streambuf<boost::iostreams::output> out;
65
		out.push(boost::iostreams::zlib_compressor());
65
		out.push(boost::iostreams::zlib_compressor());
66
		out.push(outFile);
66
		out.push(outFile);

Return to bug 583660