Browse Source

* Use convert_cast instead of static_cast where feasible

master
bergmann 4 years ago
parent
commit
7396db4c76
3 changed files with 5 additions and 3 deletions
  1. +3
    -1
      include/cppmicrohttpd/daemon.inl
  2. +1
    -1
      src/cppmicrohttpd/damon.cpp
  3. +1
    -1
      test/CMakeLists.txt

+ 3
- 1
include/cppmicrohttpd/daemon.inl View File

@@ -1,5 +1,7 @@
#pragma once

#include <cppcore/conversion/convert_cast.h>

#include "daemon.h"

namespace cppmicrohttpd
@@ -41,7 +43,7 @@ namespace cppmicrohttpd
unsigned long long timeout = 0;
if (MHD_get_timeout(_handle.get(), &timeout) != MHD_YES)
return -1;
return static_cast<long long>(timeout);
return cppcore::convert_cast<long long>(timeout);
}

}

+ 1
- 1
src/cppmicrohttpd/damon.cpp View File

@@ -17,7 +17,7 @@ daemon::daemon(
options.emplace_back(MHD_OptionItem { MHD_OPTION_END, 0, nullptr });

_handle.reset(MHD_start_daemon(
static_cast<unsigned int>(flags),
flags.value,
port,
nullptr,
nullptr,


+ 1
- 1
test/CMakeLists.txt View File

@@ -61,7 +61,7 @@ ForEach ( FILE IN LISTS CPPMICROHTTPD_TEST_SOURCE_FILES )

# test
If ( HAS_CMAKE_TESTS )
Add_CMake_Test ( NAME ${TEST_NAME} TARGET ${TEST_NAME} )
Add_CMake_Test ( NAME ${TEST_NAME} TARGET ${TEST_NAME} GROUP cppmicrohttpd )
Else ( )
Add_Test ( NAME ${TEST_NAME} COMMAND ${TEST_NAME} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
EndIf ( )


Loading…
Cancel
Save