cec: fix linux compilation and warning after the recent changes
authorLars Op den Kamp <lars@opdenkamp.eu>
Fri, 10 Feb 2012 23:31:30 +0000 (00:31 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Fri, 10 Feb 2012 23:31:30 +0000 (00:31 +0100)
configure.ac
include/cecloader.h
src/cec-config/Makefile.am
src/cec-config/cec-config.cpp
src/lib/CECProcessor.cpp

index 17947effcd1ec0423095507bd4366ca8eca862d0..b40687a4c6598be45966fd309b726a979599f442 100644 (file)
@@ -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])
index bfb392978aa9506f6f1ac89b6e7b4977fd464270..1a75169154fed380f059d5f5e941cee3db2bac12 100644 (file)
@@ -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)
   {
index 33650c5119d012b1927478d2a1f6036e943e1340..a6c6c393d13af441e0b61369e86f1c9af59edb9d 100644 (file)
@@ -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
index 2897e2dddb740fc7f2bb6ceba00e5224510b97b5..a853f9169f2adda9c0ea8073052e93a694d446f4 100644 (file)
@@ -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())
index 2e345762b4dbacee216cdfe52055cc532bb0b433..00b25a26240062035a6f53284c6301d144c36b3b 100644 (file)
@@ -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;
 }