r8428 - software/gofind

Miriam Ruiz miriam at alioth.debian.org
Tue Nov 18 00:48:24 UTC 2008


Author: miriam
Date: 2008-11-18 00:48:23 +0000 (Tue, 18 Nov 2008)
New Revision: 8428

Modified:
   software/gofind/gui_cli.cpp
   software/gofind/guiplugin.h
Log:
Proper syntax for Comment() in plugins



Modified: software/gofind/gui_cli.cpp
===================================================================
--- software/gofind/gui_cli.cpp	2008-11-18 00:23:32 UTC (rev 8427)
+++ software/gofind/gui_cli.cpp	2008-11-18 00:48:23 UTC (rev 8428)
@@ -25,6 +25,9 @@
 #include <iostream>
 #include <string>
 
+#include <stdarg.h>
+#include <string.h>
+
 class GUIPlugInCLI : public GUIPlugIn
 {
  public:
@@ -38,9 +41,19 @@
 		std::cout << "GUIPlugInCLI() destroyed" << std::endl;
 	}
 
-	virtual void Comment(const char *msg)
+	virtual void Comment(const char *szFormat, ...)
 	{
-		std::cout << "##" << msg << std::endl;
+
+		char str[4096];
+		va_list arglist;
+
+		*str = '\0';
+
+		va_start(arglist, szFormat);
+		vsprintf(str + strlen(str), szFormat, arglist);
+		va_end(arglist);
+
+		std::cout << "##" << str << std::endl;
 	}
 };
 

Modified: software/gofind/guiplugin.h
===================================================================
--- software/gofind/guiplugin.h	2008-11-18 00:23:32 UTC (rev 8427)
+++ software/gofind/guiplugin.h	2008-11-18 00:48:23 UTC (rev 8428)
@@ -41,7 +41,7 @@
 
 	virtual ~GUIPlugIn();
 
-	virtual void Comment(const char *msg) = 0;
+	virtual void Comment(const char *szFormat, ...) = 0;
 };
 
 




More information about the Pkg-games-commits mailing list