This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Convert example plug-in to object interface


Hi,

I've committed the attached patch to eliminate some compiler warnings.
Okay, actually, the patch was not to fix the warnings, but it was time
that this plugin used the object interface instead of the older
argc/argv interface. Conveniently, this also whacked the compiler
warning. :-)

Thank you for pointing this out Ben (Elliston)!
Keith

ChangeLog:
2004-12-08  Keith Seitz  <kseitz@sources.redhat.com>
 
        From Ben Elliston (bje@gnu.org):
        * rhabout.c (extra_text): Convert to object interface.
        (Rhabout_Init): Use Tcl_CreateObjCommand instead of older
argc/argv
        Tcl_CreateCommand.

Index: plugins/rhabout/rhabout.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/plugins/rhabout/rhabout.c,v
retrieving revision 1.1
diff -u -p -r1.1 rhabout.c
--- plugins/rhabout/rhabout.c	14 Aug 2002 18:06:06 -0000	1.1
+++ plugins/rhabout/rhabout.c	8 Dec 2004 20:20:45 -0000
@@ -12,7 +12,7 @@
 
 int extra_text (ClientData clientData,
                 Tcl_Interp *interp,
-                int argc, char *argv[]);
+                int objc, Tcl_Obj *CONST objv[]);
 
 /* Here you actually do whatever you want, like calling your target 
    libraries etc.  Here we just return a string. */
@@ -20,7 +20,7 @@ int extra_text (ClientData clientData,
 int
 extra_text (ClientData clientData,
                 Tcl_Interp *interp,
-                int argc, char *argv[])
+                int objc, Tcl_Obj *CONST objv[])
 {
   interp->result = "\nThis is a sample plug-in\n";
   return TCL_OK;
@@ -32,8 +32,8 @@ int EXPORT
 Rhabout_Init (Tcl_Interp *interp)
 {
   /* Register your command as a Tcl command with this interpreter. */
-  Tcl_CreateCommand (interp, "rhabout_extra_text", extra_text,
-                     (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+  Tcl_CreateObjCommand (interp, "rhabout_extra_text", extra_text,
+                        (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
 
   /* Register this package */
   Tcl_PkgProvide (interp, "RHABOUT", "1.0");

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]