]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/msw/streams.cpp
fixes w.r.t. size_t vs. int
[wxWidgets.git] / wxPython / src / msw / streams.cpp
index b0a643c58dcb824ab8f5816ec2c95feaf283361a..ca8e59dc22e3e465185d36600a368a8298666ac4 100644 (file)
@@ -89,7 +89,7 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
 #if PYTHON_API_VERSION >= 1009
     static char* wxStringErrorMsg = "String or Unicode type required";
 #else
-    static char* wxStringErrorMsg = "string type is required for parameter";
+    static char* wxStringErrorMsg = "String type required";
 #endif
   // C++
 // definitions of wxStringPtrList and wxPyInputStream
@@ -279,7 +279,7 @@ protected:
         if (bufsize == 0)
             return 0;
 
-        bool doSave = wxPyRestoreThread();
+        wxPyTState* state = wxPyBeginBlockThreads();
         PyObject* arglist = Py_BuildValue("(i)", bufsize);
         PyObject* result = PyEval_CallObject(read, arglist);
         Py_DECREF(arglist);
@@ -297,7 +297,7 @@ protected:
         }
         else
             m_lasterror = wxSTREAM_READ_ERROR;
-        wxPySaveThread(doSave);
+        wxPyEndBlockThreads(state);
         m_lastcount = o;
         return o;
     }
@@ -308,17 +308,17 @@ protected:
     }
 
     virtual off_t OnSysSeek(off_t off, wxSeekMode mode){
-        bool doSave = wxPyRestoreThread();
+        wxPyTState* state = wxPyBeginBlockThreads();
         PyObject*arglist = Py_BuildValue("(ii)", off, mode);
         PyObject*result = PyEval_CallObject(seek, arglist);
         Py_DECREF(arglist);
         Py_XDECREF(result);
-        wxPySaveThread(doSave);
+        wxPyEndBlockThreads(state);
         return OnSysTell();
     }
 
     virtual off_t OnSysTell() const{
-        bool doSave = wxPyRestoreThread();
+        wxPyTState* state = wxPyBeginBlockThreads();
         PyObject* arglist = Py_BuildValue("()");
         PyObject* result = PyEval_CallObject(tell, arglist);
         Py_DECREF(arglist);
@@ -327,7 +327,7 @@ protected:
             o = PyInt_AsLong(result);
             Py_DECREF(result);
         };
-        wxPySaveThread(doSave);
+        wxPyEndBlockThreads(state);
         return o;
     }
 
@@ -337,12 +337,12 @@ protected:
 
 public:
     ~wxPyCBInputStream() {
-        bool doSave = wxPyRestoreThread();
+        wxPyTState* state = wxPyBeginBlockThreads();
         Py_XDECREF(py);
         Py_XDECREF(read);
         Py_XDECREF(seek);
         Py_XDECREF(tell);
-        wxPySaveThread(doSave);
+        wxPyEndBlockThreads(state);
     }
 
     virtual size_t GetSize() {