From 1d8f6e94e73c569f09a2bc8bd008d0ceb2e5b8cc Mon Sep 17 00:00:00 2001 From: Maxim Biro Date: Mon, 29 Jul 2013 20:45:53 -0400 Subject: [PATCH 1/2] Fixed formatting of some cmake files --- core/CMakeLists.txt | 14 +++++++------- other/bootstrap_serverdaemon/CMakeLists.txt | 6 ++++-- other/cmake/DHT_bootstrap.cmake | 3 ++- testing/CMakeLists.txt | 4 ++-- testing/cmake/DHT_cryptosendfiletest.cmake | 3 ++- testing/cmake/DHT_sendfiletest.cmake | 2 +- testing/cmake/DHT_test.cmake | 3 ++- testing/cmake/Lossless_UDP_testclient.cmake | 2 +- testing/cmake/Lossless_UDP_testserver.cmake | 2 +- testing/cmake/Messenger_test.cmake | 2 +- testing/cmake/nTox.cmake | 7 ++++--- .../{cmake/toxic.cmake => toxic/CMakeLists.txt} | 8 +++++--- 12 files changed, 32 insertions(+), 24 deletions(-) rename testing/{cmake/toxic.cmake => toxic/CMakeLists.txt} (62%) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 6ddd5b9b..420308d8 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -6,12 +6,12 @@ if(WIN32) endif() set(core_sources - DHT.c - network.c - Lossless_UDP.c - net_crypto.c - friend_requests.c - LAN_discovery.c - Messenger.c) + DHT.c + network.c + Lossless_UDP.c + net_crypto.c + friend_requests.c + LAN_discovery.c + Messenger.c) add_library(core ${core_sources}) diff --git a/other/bootstrap_serverdaemon/CMakeLists.txt b/other/bootstrap_serverdaemon/CMakeLists.txt index 6aa4dbee..57ba4841 100644 --- a/other/bootstrap_serverdaemon/CMakeLists.txt +++ b/other/bootstrap_serverdaemon/CMakeLists.txt @@ -4,7 +4,9 @@ project(DHT_bootstrap_daemon C) set(exe_name DHT_bootstrap_daemon) add_executable(${exe_name} - DHT_bootstrap_daemon.c) + DHT_bootstrap_daemon.c) + +target_link_libraries(${exe_name} + config) -target_link_libraries(${exe_name} config) linkCoreLibraries(${exe_name}) diff --git a/other/cmake/DHT_bootstrap.cmake b/other/cmake/DHT_bootstrap.cmake index e2b164ba..403522ab 100644 --- a/other/cmake/DHT_bootstrap.cmake +++ b/other/cmake/DHT_bootstrap.cmake @@ -4,6 +4,7 @@ project(DHT_bootstrap C) set(exe_name DHT_bootstrap) add_executable(${exe_name} - DHT_bootstrap.c ../testing/misc_tools.c) + DHT_bootstrap.c + ../testing/misc_tools.c) linkCoreLibraries(${exe_name}) diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt index 3085b0c5..86f95dc8 100644 --- a/testing/CMakeLists.txt +++ b/testing/CMakeLists.txt @@ -8,8 +8,8 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/DHT_test.cmake) include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Lossless_UDP_testclient.cmake) include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Lossless_UDP_testserver.cmake) include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Messenger_test.cmake) + if(NOT WIN32) include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/nTox.cmake) -include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/toxic.cmake) - + add_subdirectory(other) endif() diff --git a/testing/cmake/DHT_cryptosendfiletest.cmake b/testing/cmake/DHT_cryptosendfiletest.cmake index c98a2bcd..5470d02a 100644 --- a/testing/cmake/DHT_cryptosendfiletest.cmake +++ b/testing/cmake/DHT_cryptosendfiletest.cmake @@ -4,6 +4,7 @@ project(DHT_cryptosendfiletest C) set(exe_name DHT_cryptosendfiletest) add_executable(${exe_name} - DHT_cryptosendfiletest.c misc_tools.c) + DHT_cryptosendfiletest.c + misc_tools.c) linkCoreLibraries(${exe_name}) diff --git a/testing/cmake/DHT_sendfiletest.cmake b/testing/cmake/DHT_sendfiletest.cmake index 93737914..298db46c 100644 --- a/testing/cmake/DHT_sendfiletest.cmake +++ b/testing/cmake/DHT_sendfiletest.cmake @@ -4,6 +4,6 @@ project(DHT_sendfiletest C) set(exe_name DHT_sendfiletest) add_executable(${exe_name} - DHT_sendfiletest.c) + DHT_sendfiletest.c) linkCoreLibraries(${exe_name}) diff --git a/testing/cmake/DHT_test.cmake b/testing/cmake/DHT_test.cmake index 74fdf35d..bb5bf05f 100644 --- a/testing/cmake/DHT_test.cmake +++ b/testing/cmake/DHT_test.cmake @@ -4,6 +4,7 @@ project(DHT_test C) set(exe_name DHT_test) add_executable(${exe_name} - DHT_test.c misc_tools.c) + DHT_test.c + misc_tools.c) linkCoreLibraries(${exe_name}) diff --git a/testing/cmake/Lossless_UDP_testclient.cmake b/testing/cmake/Lossless_UDP_testclient.cmake index e894d228..5f651807 100644 --- a/testing/cmake/Lossless_UDP_testclient.cmake +++ b/testing/cmake/Lossless_UDP_testclient.cmake @@ -4,6 +4,6 @@ project(Lossless_UDP_testclient C) set(exe_name Lossless_UDP_testclient) add_executable(${exe_name} - Lossless_UDP_testclient.c) + Lossless_UDP_testclient.c) linkCoreLibraries(${exe_name}) diff --git a/testing/cmake/Lossless_UDP_testserver.cmake b/testing/cmake/Lossless_UDP_testserver.cmake index 04306c1a..26f9302e 100644 --- a/testing/cmake/Lossless_UDP_testserver.cmake +++ b/testing/cmake/Lossless_UDP_testserver.cmake @@ -4,6 +4,6 @@ project(Lossless_UDP_testserver C) set(exe_name Lossless_UDP_testserver) add_executable(${exe_name} - Lossless_UDP_testserver.c) + Lossless_UDP_testserver.c) linkCoreLibraries(${exe_name}) diff --git a/testing/cmake/Messenger_test.cmake b/testing/cmake/Messenger_test.cmake index b2f54d0a..15fcd77b 100644 --- a/testing/cmake/Messenger_test.cmake +++ b/testing/cmake/Messenger_test.cmake @@ -4,6 +4,6 @@ project(Messenger_test C) set(exe_name Messenger_test) add_executable(${exe_name} - Messenger_test.c misc_tools.c) + Messenger_test.c misc_tools.c) linkCoreLibraries(${exe_name}) diff --git a/testing/cmake/nTox.cmake b/testing/cmake/nTox.cmake index 4c6905e5..44476b8f 100644 --- a/testing/cmake/nTox.cmake +++ b/testing/cmake/nTox.cmake @@ -4,8 +4,9 @@ project(nTox C) set(exe_name nTox) add_executable(${exe_name} - nTox.c misc_tools.c) - -target_link_libraries(${exe_name} ncurses) + nTox.c misc_tools.c) + +target_link_libraries(${exe_name} + ncurses) linkCoreLibraries(${exe_name}) diff --git a/testing/cmake/toxic.cmake b/testing/toxic/CMakeLists.txt similarity index 62% rename from testing/cmake/toxic.cmake rename to testing/toxic/CMakeLists.txt index 1ffab788..43eb379a 100644 --- a/testing/cmake/toxic.cmake +++ b/testing/toxic/CMakeLists.txt @@ -4,8 +4,10 @@ project(toxic C) set(exe_name toxic) add_executable(${exe_name} - toxic/main.c toxic/prompt.c) - -target_link_libraries(${exe_name} curses) + toxic/main.c + toxic/prompt.c) + +target_link_libraries(${exe_name} + curses) linkCoreLibraries(${exe_name}) From 261f365e55d4711372f7053667aa368788eabea1 Mon Sep 17 00:00:00 2001 From: Maxim Biro Date: Mon, 29 Jul 2013 20:47:12 -0400 Subject: [PATCH 2/2] Fixed function signature --- core/network.c | 2 +- core/network.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/network.c b/core/network.c index aa16bda9..ced08207 100644 --- a/core/network.c +++ b/core/network.c @@ -169,7 +169,7 @@ void shutdown_networking() address should represent IPv4, IPv6 or a hostname on success returns a data in network byte order that can be used to set IP.i or IP_Port.ip.i on failure returns -1 */ -int resolve_addr(char *address) +int resolve_addr(const char *address) { struct addrinfo hints; memset(&hints, 0, sizeof(hints)); diff --git a/core/network.h b/core/network.h index aaaaa409..8af4b32f 100644 --- a/core/network.h +++ b/core/network.h @@ -125,7 +125,7 @@ void shutdown_networking(); address should represent IPv4, IPv6 or a hostname on success returns a data in network byte order that can be used to set IP.i or IP_Port.ip.i on failure returns -1 */ -int resolve_addr(char *address); +int resolve_addr(const char *address); #ifdef __cplusplus }