From: Václav Slavík Date: Tue, 31 Aug 1999 20:05:24 +0000 (+0000) Subject: ScanParam has only one parameter now X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/18027d49b9daea9f8808052d927246b4489b0ef9 ScanParam has only one parameter now git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3542 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/html/htmltag.h b/include/wx/html/htmltag.h index 750a2e8477..7b44f46e43 100644 --- a/include/wx/html/htmltag.h +++ b/include/wx/html/htmltag.h @@ -97,12 +97,14 @@ class WXDLLEXPORT wxHtmlTag : public wxObject //

GetParam("SRC") returns (WhaT.jpg) // (or ("WhaT.jpg") if with_commas == TRUE) - int ScanParam(const wxString& par, char *format, ...) const; + int ScanParam(const wxString& par, char *format, void *param) const; // Scans param like scanf() functions family do. // Example : ScanParam("COLOR", "\"#%X\"", &clr); // This is always with with_commas=FALSE // Returns number of scanned values // (like sscanf() does) + // NOTE: unlike scanf family, this function only accepts + // *one* parameter ! inline const wxString& GetAllParams() const {return m_Params;}; // Returns string containing all params. diff --git a/src/html/htmltag.cpp b/src/html/htmltag.cpp index a864e27fad..e173271235 100644 --- a/src/html/htmltag.cpp +++ b/src/html/htmltag.cpp @@ -239,33 +239,10 @@ wxString wxHtmlTag::GetParam(const wxString& par, bool with_commas) const -int wxHtmlTag::ScanParam(const wxString& par, char *format, ...) const +int wxHtmlTag::ScanParam(const wxString& par, char *format, void *param) const { - int retval; - va_list argptr; wxString parval = GetParam(par); - - va_start(argptr, format); - -//#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(__VISUALC__) -#ifndef HAVE_VSSCANF - retval = sscanf((const char*)parval, format, va_arg(argptr, void *)); -#else - retval = vsscanf((const char*)parval, format, argptr); -#endif - -/* - --- vsscanf is not defined under some compilers - if this module doesn't compile with your compiler, - modify the def statement and let me know. Thanks... - - So far wxHtml functions are scanning only _one_ value - so I workarounded this by supposing that there is only - one ...-parameter -*/ - - va_end(argptr); - return retval; + return sscanf((const char*)parval, format, param); } #endif