Skip to content

Commit

Permalink
Silenced remaining VS2015 warnings. Resolved #17.
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmayambre committed Sep 25, 2015
1 parent ecc10ac commit 6d6eb19
Show file tree
Hide file tree
Showing 93 changed files with 101 additions and 277 deletions.
2 changes: 1 addition & 1 deletion cmake/build_configuration.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ elseif( ${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC )
if ( ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 19.00.23026.0 )
message( WARNING "\nMSVC compiler version < 19.00.23026.0" )
endif ( )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_WIN32_WINNT=0x0601 /W4" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_WIN32_WINNT=0x0601 /W4 /wd4068 /wd4702" )
else ( )
message( FATAL_ERROR "Compiler not supported")
endif ( )
Expand Down
4 changes: 2 additions & 2 deletions example/compression/source/example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ void deflate_method_handler( const shared_ptr< Session > session )

if ( request->get_header( "Content-Encoding", String::lowercase ) == "deflate" )
{
mz_ulong length = compressBound( body.size( ) );
mz_ulong length = compressBound( static_cast< mz_ulong >( body.size( ) ) );
unsigned char* data = new unsigned char[ length ];
const int status = uncompress( data, &length, body.data( ), body.size( ) );
const int status = uncompress( data, &length, body.data( ), static_cast< mz_ulong >( body.size( ) ) );

if ( status not_eq MZ_OK )
{
Expand Down
10 changes: 6 additions & 4 deletions example/session_manager/source/example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ class InMemorySessionManager : public SessionManager
void create( const function< void ( const shared_ptr< Session > ) >& callback )
{
static const string charset = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
static uniform_int_distribution< > selector( 0, charset.size( ) - 1 );
static mt19937 generator( chrono::high_resolution_clock::now( ).time_since_epoch( ).count( ) );
static uniform_int_distribution< > selector( 0, 35 );

auto seed = static_cast< unsigned int >( chrono::high_resolution_clock::now( ).time_since_epoch( ).count( ) );
static mt19937 generator( seed );

string key = "";

Expand All @@ -64,8 +66,8 @@ class InMemorySessionManager : public SessionManager

if ( previous_session not_eq sessions.end( ) )
{
const auto key = previous_session->second->get_id( );
session->set_id( key );
const auto id = previous_session->second->get_id( );
session->set_id( id );

for ( const auto key : previous_session->second->keys( ) )
{
Expand Down
2 changes: 1 addition & 1 deletion source/corvusoft/restbed/detail/socket_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ namespace restbed

#endif
struct timeval timeout = { 0, 0 };
timeout.tv_usec = value.count( ) * 1000;
timeout.tv_usec = static_cast< long >( value.count( ) * 1000 );

int status = setsockopt( native_socket, SOL_SOCKET, SO_SNDTIMEO, reinterpret_cast< char* >( &timeout ), sizeof( timeout ) );

Expand Down
3 changes: 0 additions & 3 deletions test/acceptance/source/custom_authentication/resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )

//System Namespaces
using std::thread;
Expand Down
5 changes: 2 additions & 3 deletions test/acceptance/source/custom_authentication/service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )



//System Namespaces
using std::thread;
Expand Down
5 changes: 2 additions & 3 deletions test/acceptance/source/custom_error_handling/resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )



//System Namespaces
using std::thread;
Expand Down
4 changes: 1 addition & 3 deletions test/acceptance/source/custom_error_handling/service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
4 changes: 1 addition & 3 deletions test/acceptance/source/custom_http_methods/http_connect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
4 changes: 1 addition & 3 deletions test/acceptance/source/custom_http_methods/http_delete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
4 changes: 1 addition & 3 deletions test/acceptance/source/custom_http_methods/http_get.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
4 changes: 1 addition & 3 deletions test/acceptance/source/custom_http_methods/http_head.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
4 changes: 1 addition & 3 deletions test/acceptance/source/custom_http_methods/http_invoke.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
4 changes: 1 addition & 3 deletions test/acceptance/source/custom_http_methods/http_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
4 changes: 1 addition & 3 deletions test/acceptance/source/custom_http_methods/http_patch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
4 changes: 1 addition & 3 deletions test/acceptance/source/custom_http_methods/http_post.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
4 changes: 1 addition & 3 deletions test/acceptance/source/custom_http_methods/http_put.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
4 changes: 1 addition & 3 deletions test/acceptance/source/custom_http_methods/http_trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
4 changes: 1 addition & 3 deletions test/acceptance/source/http_method_handlers/http_connect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
4 changes: 1 addition & 3 deletions test/acceptance/source/http_method_handlers/http_delete.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
4 changes: 1 addition & 3 deletions test/acceptance/source/http_method_handlers/http_get.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
4 changes: 1 addition & 3 deletions test/acceptance/source/http_method_handlers/http_head.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
4 changes: 1 addition & 3 deletions test/acceptance/source/http_method_handlers/http_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
4 changes: 1 addition & 3 deletions test/acceptance/source/http_method_handlers/http_patch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
4 changes: 1 addition & 3 deletions test/acceptance/source/http_method_handlers/http_post.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
4 changes: 1 addition & 3 deletions test/acceptance/source/http_method_handlers/http_put.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
4 changes: 1 addition & 3 deletions test/acceptance/source/http_method_handlers/http_trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
#include "http.hpp"

//External Includes
#pragma warning( push )
#pragma warning( disable:4702 )
#include <catch.hpp>
#pragma warning( pop )


//System Namespaces
using std::thread;
Expand Down
Loading

0 comments on commit 6d6eb19

Please sign in to comment.