Revision: 5142
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5142&view=rev
Author:   jdh2358
Date:     2008-05-15 12:19:43 -0700 (Thu, 15 May 2008)

Log Message:
-----------
trying scanf for tcl pointer conversion

Modified Paths:
--------------
    trunk/matplotlib/src/_tkagg.cpp

Modified: trunk/matplotlib/src/_tkagg.cpp
===================================================================
--- trunk/matplotlib/src/_tkagg.cpp     2008-05-15 18:54:23 UTC (rev 5141)
+++ trunk/matplotlib/src/_tkagg.cpp     2008-05-15 19:19:43 UTC (rev 5142)
@@ -11,6 +11,7 @@
 
 #include <Python.h>
 #include <stdlib.h>
+#include <stdio.h>
 #include <sstream>
 
 #include "agg_basics.h"
@@ -47,6 +48,8 @@
 
     // vars for blitting
     PyObject* bboxo;
+
+    unsigned long aggl, bboxl;
     bool has_bbox;
     agg::int8u *destbuffer;
     double l,b,r,t;
@@ -73,10 +76,14 @@
         return TCL_ERROR;
     }
     /* get array (or object that can be converted to array) pointer */
-    std::stringstream agg_ptr_ss;
-    agg_ptr_ss.str(argv[2]);
-    agg_ptr_ss >> tmp_ptr;
-    aggo = (PyObject*)tmp_ptr;
+    sscanf (argv[2],"%lu",&aggl);
+    aggo = (PyObject*)aggl;
+    //aggo = (PyObject*)atol(argv[2]);
+
+    //std::stringstream agg_ptr_ss;
+    //agg_ptr_ss.str(argv[2]);
+    //agg_ptr_ss >> tmp_ptr;
+    //aggo = (PyObject*)tmp_ptr;
     RendererAgg *aggRenderer = (RendererAgg *)aggo;
     int srcheight = (int)aggRenderer->get_height();
 
@@ -90,10 +97,14 @@
     }
 
     /* check for bbox/blitting */
-    std::stringstream bbox_ptr_ss;
-    bbox_ptr_ss.str(argv[4]);
-    bbox_ptr_ss >> tmp_ptr;
-    bboxo = (PyObject*)tmp_ptr;
+    sscanf (argv[4],"%lu",&bboxl);
+    bboxo = (PyObject*)bboxl;
+
+    //bboxo = (PyObject*)atol(argv[4]);
+    //std::stringstream bbox_ptr_ss;
+    //bbox_ptr_ss.str(argv[4]);
+    //bbox_ptr_ss >> tmp_ptr;
+    //bboxo = (PyObject*)tmp_ptr;
     if (py_convert_bbox(bboxo, l, b, r, t)) {
       has_bbox = true;
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to