Compare commits

...
Author SHA1 Message Date
Peter Thorson a5bb90807b Merge pull request #252 from breyed/visual-studio
Fixed Visual Studio 2012 warnings and formatting
2013-06-09 07:05:53 -07:00
breyed e68d492ed2 Fixed Visual Studio 2012 warnings
Fixed daylight savings time formatting problem on Windows
2013-06-08 11:07:02 -05:00
3 changed files with 14 additions and 5 deletions

No files matched your search

+5 -3
View File
@@ -111,15 +111,17 @@ private:
typedef typename concurrency::scoped_lock_type scoped_lock_type;
typedef typename concurrency::mutex_type mutex_type;
const char* get_timestamp() {
// The timestamp does not include the time zone, because on Windows with the default registry settings,
// the time zone would be written out in full, which would be obnoxiously verbose.
std::string get_timestamp() {
std::time_t t = std::time(NULL);
std::strftime(buffer,39,"%Y-%m-%d %H:%M:%S%z",std::localtime(&t));
char buffer[40];
std::strftime(buffer,sizeof(buffer),"%Y-%m-%d %H:%M:%S",std::localtime(&t));
return buffer;
}
mutex_type m_lock;
char buffer[40];
const level m_static_channels;
level m_dynamic_channels;
std::ostream* m_out;
+2 -2
View File
@@ -338,8 +338,8 @@ public:
}
std::string val;
val.append(1,0xff);
val.append(1,0x00);
val.append(1,'\xff');
val.append(1,'\x00');
out->set_payload(val);
out->set_prepared(true);
+7
View File
@@ -102,7 +102,14 @@ class SHA1
while(length-- && !Corrupted)
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(suppress: 6386) // Suppresses Visual Studio code analysis for write overrun. It doesn't know the index into Message_Block is protected by checking length.
#endif
Message_Block[Message_Block_Index++] = (*message_array & 0xFF);
#ifdef _MSC_VER
#pragma warning(pop)
#endif
Length_Low += 8;
Length_Low &= 0xFFFFFFFF; // Force it to 32 bits