From a30d495f6e91f3bed0420bf76c19315fe0de8801 Mon Sep 17 00:00:00 2001 From: Jordan Augé Date: Tue, 5 Nov 2019 16:55:27 +0100 Subject: [HICN-382] Misc compilation issues on MacOS (incl. Catalina specific code) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4cb2378b2e44afbaedb984409a221b2e3f0e99b4 Signed-off-by: Jordan Augé --- .../network_framework/network_framework.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'ctrl/facemgr/src/interfaces') diff --git a/ctrl/facemgr/src/interfaces/network_framework/network_framework.c b/ctrl/facemgr/src/interfaces/network_framework/network_framework.c index 19fe7bbe2..01c40c0b7 100644 --- a/ctrl/facemgr/src/interfaces/network_framework/network_framework.c +++ b/ctrl/facemgr/src/interfaces/network_framework/network_framework.c @@ -224,17 +224,17 @@ dump_browse_result(nw_browse_result_t result, int indent) { /* Endpoint */ nw_endpoint_t browse_endpoint = nw_browse_result_copy_endpoint(result); - if (!bendpoint) { + if (!browse_endpoint) { ERROR("[network_framework.dump_result] Failed to retrieve endpoint from Bonjour browse result"); return; } - printfi(indent + 1, "Endpoint:") + printfi(indent + 1, "Endpoint:"); dump_endpoint(browse_endpoint, indent + 2); /* Interfaces */ - printfi(indent + 1, "Interfaces:") - nw_browse_result_enumerate_interfaces(result, ^(nw_interface_t interface) { - dump_interface(interface, index + 2); + printfi(indent + 1, "Interfaces:"); + nw_browse_result_enumerate_interfaces(result, (nw_browse_result_enumerate_interface_t) ^(nw_interface_t interface) { + dump_interface(interface, indent + 2); return true; }); } @@ -482,13 +482,13 @@ void on_interface_event(interface_t * interface, nw_interface_t iface) dump_browse_result(result, 2); printfi(1, "Result2:"); dump_browse_result(result2, 2); - printfi("Flag: %s\n", flag?"ON":"OFF"); + printfi(1, "Flag: %s\n", (flag?"ON":"OFF")); /* Changes */ nw_browse_result_change_t change = nw_browse_result_get_changes(result, result2); switch(change) { case nw_browse_result_change_identical: - printfi("The compared services are identical."); + printfi(2, "The compared services are identical."); break; case nw_browse_result_change_result_added: printfi(2, "A new service was discovered."); @@ -506,17 +506,12 @@ void on_interface_event(interface_t * interface, nw_interface_t iface) printfi(2, "The service was discovered over a new interface."); break; -nw_browse_result_change_interface_removed + case nw_browse_result_change_interface_removed: printfi(2, "The service was no longer discovered over a certain interface."); break; } }); - browser.browseResultsChangedHandler = { browseResults, _ in - for browseResult in browseResults { - print("Discovered \(browseResult.endpoint) over \(browseResult.interfaces)") - } - } nw_browser_start(browser); //#else //#warning "Bonjour discovery only available in MacOS 10.15+" -- cgit 1.2.3-korg