diff options
author | Jaeseung Ha <ipknhama@gmail.com> | 2017-09-18 00:44:36 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-18 00:44:36 +0900 |
commit | 6da6579ce94a06f5389db62340b762fcb56f7c39 (patch) | |
tree | 77aa4aa0f2cbfd139dc3194a3cf113ed2100454f /examples | |
parent | 194a9ef6812e3d5476419e33be2756ab69fc0696 (diff) | |
parent | 08acc7c0bedc24bf5b8c6cc01f1701b0d45e141e (diff) | |
download | crow-6da6579ce94a06f5389db62340b762fcb56f7c39.tar.gz crow-6da6579ce94a06f5389db62340b762fcb56f7c39.zip |
Merge pull request #171 from yorickdewid/master
Set cast type without dereferencing pointer
Diffstat (limited to 'examples')
-rw-r--r-- | examples/CMakeLists.txt | 46 | ||||
-rw-r--r-- | examples/example_chat.cpp | 2 |
2 files changed, 23 insertions, 25 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 3c9b0b0..b92539e 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -2,29 +2,28 @@ cmake_minimum_required(VERSION 2.8) project (crow_examples) if (MSVC) -add_executable(example_vs example_vs.cpp) -target_link_libraries(example_vs ${Boost_LIBRARIES}) -target_link_libraries(example_vs ${CMAKE_THREAD_LIBS_INIT}) + add_executable(example_vs example_vs.cpp) + target_link_libraries(example_vs ${Boost_LIBRARIES}) + target_link_libraries(example_vs ${CMAKE_THREAD_LIBS_INIT}) else () - -add_executable(helloworld helloworld.cpp) -target_link_libraries(helloworld ${Boost_LIBRARIES}) -target_link_libraries(helloworld ${CMAKE_THREAD_LIBS_INIT}) + add_executable(helloworld helloworld.cpp) + target_link_libraries(helloworld ${Boost_LIBRARIES}) + target_link_libraries(helloworld ${CMAKE_THREAD_LIBS_INIT}) if (OPENSSL_FOUND) -add_executable(example_ssl ssl/example_ssl.cpp) -target_link_libraries(example_ssl ${Boost_LIBRARIES}) -target_link_libraries(example_ssl ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES}) + add_executable(example_ssl ssl/example_ssl.cpp) + target_link_libraries(example_ssl ${Boost_LIBRARIES}) + target_link_libraries(example_ssl ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES}) endif() add_executable(example_websocket websocket/example_ws.cpp) target_link_libraries(example_websocket ${Boost_LIBRARIES}) target_link_libraries(example_websocket ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES}) add_custom_command(OUTPUT ws.html - COMMAND ${CMAKE_COMMAND} -E - copy ${PROJECT_SOURCE_DIR}/websocket/templates/ws.html ${CMAKE_CURRENT_BINARY_DIR}/templates/ws.html - DEPENDS ${PROJECT_SOURCE_DIR}/websocket/templates/ws.html - ) + COMMAND ${CMAKE_COMMAND} -E + copy ${PROJECT_SOURCE_DIR}/websocket/templates/ws.html ${CMAKE_CURRENT_BINARY_DIR}/templates/ws.html + DEPENDS ${PROJECT_SOURCE_DIR}/websocket/templates/ws.html +) add_custom_target(example_ws_copy ALL DEPENDS ws.html) add_executable(example example.cpp) @@ -33,7 +32,7 @@ target_link_libraries(example ${Boost_LIBRARIES}) target_link_libraries(example ${CMAKE_THREAD_LIBS_INIT}) if (Tcmalloc_FOUND) -target_link_libraries(example ${Tcmalloc_LIBRARIES}) + target_link_libraries(example ${Tcmalloc_LIBRARIES}) endif(Tcmalloc_FOUND) add_executable(example_with_all example_with_all.cpp) @@ -42,21 +41,20 @@ target_link_libraries(example_with_all ${Boost_LIBRARIES}) target_link_libraries(example_with_all ${CMAKE_THREAD_LIBS_INIT}) add_custom_command(OUTPUT example_test.py - COMMAND ${CMAKE_COMMAND} -E - copy ${PROJECT_SOURCE_DIR}/example_test.py ${CMAKE_CURRENT_BINARY_DIR}/example_test.py - DEPENDS ${PROJECT_SOURCE_DIR}/example_test.py - ) + COMMAND ${CMAKE_COMMAND} -E + copy ${PROJECT_SOURCE_DIR}/example_test.py ${CMAKE_CURRENT_BINARY_DIR}/example_test.py + DEPENDS ${PROJECT_SOURCE_DIR}/example_test.py +) add_custom_target(example_copy ALL DEPENDS example_test.py) add_executable(example_chat example_chat.cpp) -#target_link_libraries(example_chat crow) target_link_libraries(example_chat ${Boost_LIBRARIES}) target_link_libraries(example_chat ${CMAKE_THREAD_LIBS_INIT}) add_custom_command(OUTPUT example_chat.html - COMMAND ${CMAKE_COMMAND} -E - copy ${PROJECT_SOURCE_DIR}/example_chat.html ${CMAKE_CURRENT_BINARY_DIR}/example_chat.html - DEPENDS ${PROJECT_SOURCE_DIR}/example_chat.html - ) + COMMAND ${CMAKE_COMMAND} -E + copy ${PROJECT_SOURCE_DIR}/example_chat.html ${CMAKE_CURRENT_BINARY_DIR}/example_chat.html + DEPENDS ${PROJECT_SOURCE_DIR}/example_chat.html +) add_custom_target(example_chat_copy ALL DEPENDS example_chat.html) #SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -pg" ) diff --git a/examples/example_chat.cpp b/examples/example_chat.cpp index d187f51..c510bb0 100644 --- a/examples/example_chat.cpp +++ b/examples/example_chat.cpp @@ -15,7 +15,7 @@ void broadcast(const string& msg) x["msgs"][0] = msgs.back(); x["last"] = msgs.size(); string body = crow::json::dump(x); - for(auto p:ress) + for(auto p : ress) { auto* res = p.first; CROW_LOG_DEBUG << res << " replied: " << body; |