[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pyamf-commits
Subject:    [pyamf-commits] r1619 - pyamf/branches/gerard-cpyamf-225/cpyamf
From:       commits () pyamf ! org (SVN commit logs for PyAMF)
Date:       2008-08-28 8:50:13
Message-ID: 20080828085013.40A0924001 () mail ! collab ! eu
[Download RAW message or body]

Author: gerard
Date: 2008-08-28 10:50:13 +0200 (Thu, 28 Aug 2008)
New Revision: 1619

Modified:
   pyamf/branches/gerard-cpyamf-225/cpyamf/util.c
Log:
More 64-bit fixes.


Modified: pyamf/branches/gerard-cpyamf-225/cpyamf/util.c
===================================================================
--- pyamf/branches/gerard-cpyamf-225/cpyamf/util.c	2008-08-28 08:44:52 UTC (rev 1618)
+++ pyamf/branches/gerard-cpyamf-225/cpyamf/util.c	2008-08-28 08:50:13 UTC (rev 1619)
@@ -93,7 +93,7 @@
 unpack_int(BufferedByteStream *self, const char *buf, long num_bytes)
 {
     long x;
-    int bytes_left;
+    long bytes_left;
     const unsigned char *bytes;
 
     x = 0;
@@ -120,7 +120,7 @@
 }
 
 static int
-pack_uint(BufferedByteStream *self, unsigned long x, int num_bytes)
+pack_uint(BufferedByteStream *self, unsigned long x, long num_bytes)
 {
     char buf[num_bytes];
 
@@ -133,7 +133,7 @@
             return -1;
         }
     }
-    int i=num_bytes; 
+    long i=num_bytes; 
     while(i>0)
     {
         switch(self->endian)
@@ -157,7 +157,7 @@
 }
 
 static int
-pack_int(BufferedByteStream *self, long x, int num_bytes)
+pack_int(BufferedByteStream *self, long x, long num_bytes)
 {
     char buf[num_bytes];
 
@@ -172,7 +172,7 @@
             return -1;
         }
     }
-    int i=num_bytes; 
+    long i=num_bytes; 
     while(i>0)
     {
         switch(self->endian)
@@ -220,7 +220,7 @@
 BufferedByteStream_at_eof(BufferedByteStream *self)
 {
     PyObject *obj_remaining, *result;
-    int remaining;
+    long remaining;
 
     if(!self->buffer) {
         PyErr_SetString(PyExc_ValueError, "buffer is closed");
@@ -299,7 +299,7 @@
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O", kwlist, &obj_size))
         return NULL;
 
-    int size = 1;
+    long size = 1;
     if (obj_size)
         size = PyInt_AsLong(obj_size);
 
@@ -323,9 +323,9 @@
 {
     PyObject *obj_n = NULL;
     static char *kwlist[] = {"n", NULL};
-    int n = -1;
+    long n = -1;
     char *buf = NULL;
-    int chars_received;
+    long chars_received;
 
     if(!self->buffer) {
         PyErr_SetString(PyExc_ValueError, "buffer is closed");
@@ -357,7 +357,7 @@
 BufferedByteStream_readline(BufferedByteStream *self)
 {
     char *buf = NULL;
-    int len;
+    long len;
 
     if(!self->buffer) {
         PyErr_SetString(PyExc_ValueError, "buffer is closed");
@@ -373,7 +373,7 @@
 {
     PyObject *obj_sizehint = NULL;
     static char *kwlist[] = {"sizehint", NULL};
-    int sizehint = 0;
+    long sizehint = 0;
 
     if(!self->buffer) {
         PyErr_SetString(PyExc_ValueError, "buffer is closed");
@@ -396,7 +396,7 @@
 BufferedByteStream_write(BufferedByteStream *self, PyObject *obj)
 {
     char *buffer;
-    int length;
+    long length;
 
     if(!self->buffer) {
         PyErr_SetString(PyExc_ValueError, "buffer is closed");
@@ -949,7 +949,7 @@
 {
     long num_bytes;
     char* buf = NULL;
-    int n;
+    long n;
 
     if(!self->buffer) {
         PyErr_SetString(PyExc_ValueError, "buffer is closed");
@@ -975,7 +975,7 @@
 {
     PyObject *encoded_string = NULL;
     char *buf = NULL;
-    int len = -1;
+    long len = -1;
 
     if(!self->buffer) {
         PyErr_SetString(PyExc_ValueError, "buffer is closed");
@@ -1048,11 +1048,11 @@
     {NULL}
 };
 
-static int
+static long
 BufferedByteStream___len__(BufferedByteStream *self)
 {
     PyObject *cur_pos, *tmp, *end_pos;
-    int result;
+    long result;
 
     if(!self->buffer)
     {
@@ -1076,7 +1076,7 @@
     return result;
 }
 static PySequenceMethods BufferedByteStream_sequencemethods = {
-    (int(*)(PyObject*))BufferedByteStream___len__, /*sq_length*/
+    (long(*)(PyObject*))BufferedByteStream___len__, /*sq_length*/
     0, /*sq_concat*/
     0, /*sq_repeat*/
     0, /*sq_item*/
@@ -1186,7 +1186,7 @@
         {
             /* Copy data from a Python string */
             char *str = NULL;
-            int len = 0;
+            long len = 0;
             if (!PyString_AsStringAndSize(buf_obj, &str, &len))
             {
                 PycStringIO->cwrite(self->buffer, str, len);
@@ -1197,7 +1197,7 @@
             /* Copy data from a Python object with callable attribute getvalue. */
             PyObject *val = PyObject_CallMethod(buf_obj, "getvalue", NULL);
             char *str = NULL;
-            int len = 0;
+            long len = 0;
 
             val = PyObject_CallMethod(buf_obj, "getvalue", NULL);
             if (!PyString_AsStringAndSize(val, &str, &len))
@@ -1217,7 +1217,7 @@
 
             val = PyObject_CallMethod(buf_obj, "read", NULL);
             str = NULL;
-            int len = 0;
+            long len = 0;
             if (!PyString_AsStringAndSize(val, &str, &len))
                 PycStringIO->cwrite(self->buffer, str, len);
             Py_XDECREF(val);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic