From 39b1216c4883c7a3a351283e61e58891699ef091 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Sat, 11 Feb 2012 00:31:30 +0100 Subject: [PATCH] cec: fix linux compilation and warning after the recent changes --- configure.ac | 2 +- include/cecloader.h | 5 +++-- src/cec-config/Makefile.am | 6 +++--- src/cec-config/cec-config.cpp | 2 +- src/lib/CECProcessor.cpp | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 17947ef..b40687a 100644 --- a/configure.ac +++ b/configure.ac @@ -34,4 +34,4 @@ CXXFLAGS="-fPIC -Wall -Wextra -Wno-missing-field-initializers $CXXFLAGS" AC_SUBST(REQUIRES) AC_CONFIG_FILES([src/lib/libcec.pc]) -AC_OUTPUT([Makefile src/lib/Makefile src/testclient/Makefile]) +AC_OUTPUT([Makefile src/lib/Makefile src/testclient/Makefile src/cec-config/Makefile]) diff --git a/include/cecloader.h b/include/cecloader.h index bfb3929..1a75169 100644 --- a/include/cecloader.h +++ b/include/cecloader.h @@ -158,9 +158,10 @@ CEC::ICECAdapter *LibCecInit(const char *strDeviceName, CEC::cec_device_type_lis /*! * @brief Create a new libCEC instance. * @param configuration The configuration to pass to libCEC + * @param strLib The name of and/or path to libCEC * @return An instance of ICECAdapter or NULL on error. */ -CEC::ICECAdapter *LibCecInitialise(const CEC::CecAdapterConfiguration &configuration) +CEC::ICECAdapter *LibCecInitialise(const CEC::libcec_configuration *configuration, const char *strLib = NULL) { if (!g_libCEC) { @@ -180,7 +181,7 @@ CEC::ICECAdapter *LibCecInitialise(const CEC::CecAdapterConfiguration &configura } } - typedef void* _LibCecInitialise(const CEC::CecAdapterConfiguration &); + typedef void* _LibCecInitialise(const CEC::libcec_configuration *); _LibCecInitialise* LibCecInitialise = (_LibCecInitialise*) dlsym(g_libCEC, "CECInitialise"); if (!LibCecInitialise) { diff --git a/src/cec-config/Makefile.am b/src/cec-config/Makefile.am index 33650c5..a6c6c39 100644 --- a/src/cec-config/Makefile.am +++ b/src/cec-config/Makefile.am @@ -1,5 +1,5 @@ bin_PROGRAMS = cec-config -cec_client_SOURCES = cec-config.cpp +cec_config_SOURCES = cec-config.cpp -cec_client_CPPFLAGS = -I@abs_top_srcdir@/include -cec_client_LDFLAGS = @LIBS_DL@ \ No newline at end of file +cec_config_CPPFLAGS = -I@abs_top_srcdir@/include +cec_config_LDFLAGS = @LIBS_DL@ \ No newline at end of file diff --git a/src/cec-config/cec-config.cpp b/src/cec-config/cec-config.cpp index 2897e2d..a853f91 100644 --- a/src/cec-config/cec-config.cpp +++ b/src/cec-config/cec-config.cpp @@ -343,7 +343,7 @@ bool PowerOnTV(uint64_t iTimeout = 60000) return currentTvPower == CEC_POWER_STATUS_ON; } -int main (int argc, char *argv[]) +int main (int UNUSED(argc), char *UNUSED(argv[])) { PrintToStdOut("=== USB-CEC Adapter Configuration ===\n"); if (!OpenConnection()) diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 2e34576..00b25a2 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -1375,7 +1375,7 @@ bool CCECProcessor::GetCurrentConfiguration(libcec_configuration *configuration) configuration->iPhysicalAddress = m_iPhysicalAddress; configuration->iHDMIPort = m_iHDMIPort; configuration->baseDevice = m_iBaseDevice; - snprintf(configuration->strDeviceName, 13, m_strDeviceName.c_str()); + snprintf(configuration->strDeviceName, 13, "%s", m_strDeviceName.c_str()); configuration->deviceTypes = m_types; return true; } -- 2.34.1