diff options
| author | wr61 <wr61@e10066b5-e1e2-0310-b819-94efdf66514b> | 2006-03-04 11:40:36 +0000 |
|---|---|---|
| committer | wr61 <wr61@e10066b5-e1e2-0310-b819-94efdf66514b> | 2006-03-04 11:40:36 +0000 |
| commit | 26c19bbee814f431f55d32d25ee441ed37650c7c (patch) | |
| tree | a5935aee40be7e09f7634e50bd951d5d6cf446ed | |
| parent | e9a8f4935eb781257058527eab09f32ebed3abaa (diff) | |
| download | vdr-plugin-muggle-26c19bbee814f431f55d32d25ee441ed37650c7c.tar.gz vdr-plugin-muggle-26c19bbee814f431f55d32d25ee441ed37650c7c.tar.bz2 | |
eliminate warnings for compilation with -Wformat=2
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@931 e10066b5-e1e2-0310-b819-94efdf66514b
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | vdr_menu.c | 14 | ||||
| -rw-r--r-- | vdr_menu.h | 7 |
3 files changed, 15 insertions, 8 deletions
@@ -35,7 +35,7 @@ VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ pri ### The C++ compiler and options: CXX ?= g++-3.3 -CXXFLAGS ?= -fPIC -O0 -Wall -Woverloaded-virtual -Wno-deprecated -g +CXXFLAGS ?= -fPIC -O0 -Wall -Wformat=2 -Woverloaded-virtual -Wno-deprecated -g ### The directory environment: @@ -818,11 +818,15 @@ mgTree::BuildOsd () AddSelectionItems (selection()); } -void -mgMainMenu::Message1(const char *msg, const char *arg1) -{ - if (strlen(msg)==0) return; - asprintf (&m_message, tr (msg), arg1); +const char* +mgMainMenu::Message1(const char *msg, ...) +{ + if (strlen(msg)==0) return 0; + va_list ap; + va_start(ap, msg); + vasprintf(&m_message, tr(msg), ap); + va_end(ap); + return m_message; } @@ -175,8 +175,11 @@ class mgMainMenu:public cOsdMenu // only be shown at the end of the next mgMainMenu::ProcessKey // because that might do forcerefresh which overwrites the message void Message (const char *msg) { m_message = strdup(msg); } - void Message1 (const char *msg, const char *arg1); - void Message1 (const char *msg, std::string arg1) { Message1(msg,arg1.c_str()); } + const char* Message1 (const char *msg, ...) + __attribute__ ((format (printf, 2, 3))); + const char* Message1 (const char *msg, std::string arg1) + __attribute_format_arg__ (2) + { return Message1(msg,arg1.c_str()); } //! \brief Actions can request a new position. -1 means none wanted int newposition; |
