~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_bencode_c.pyx

  • Committer: Jelmer Vernooij
  • Author(s): Alexander Belchenko
  • Date: 2009-05-27 21:20:57 UTC
  • mto: (4398.5.1 bencode_serializer)
  • mto: This revision was merged to the branch mainline in revision 4410.
  • Revision ID: jelmer@samba.org-20090527212057-j7dy1ab71i20j6hk
Fix pyrex compatibility.

Show diffs side-by-side

added added

removed removed

Lines of Context:
104
104
        i = 0
105
105
        while ((self.tail[i] >= c'0' and self.tail[i] <= c'9') or 
106
106
               self.tail[i] == c'-') and i < self.size:
107
 
            i += 1
 
107
            i = i + 1
108
108
 
109
109
        if self.tail[i] != stop_char:
110
110
            raise ValueError("Stop character %c not found: %c" % 
297
297
        n = snprintf(self.tail, 32, '%d:', PyString_GET_SIZE(x))
298
298
        if n < 0:
299
299
            raise MemoryError('string %s too big to encode' % x)
300
 
        memcpy(<void *>self.tail+n, PyString_AS_STRING(x), 
 
300
        memcpy(<void *>(self.tail+n), PyString_AS_STRING(x),
301
301
               PyString_GET_SIZE(x))
302
302
        self._update_tail(n+PyString_GET_SIZE(x))
303
303
        return 1