~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_dirstate_helpers_c.pyx

  • Committer: John Arbash Meinel
  • Date: 2007-07-11 21:57:05 UTC
  • mto: This revision was merged to the branch mainline in revision 2643.
  • Revision ID: john@arbash-meinel.com-20070711215705-x6l2fdioh050zxzp
Get rid of strchr in favor of memchr

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
 
48
48
 
49
49
cdef extern from "string.h":
50
 
    char *strchr(char *s1, char c)
51
50
    int strncmp(char *s1, char *s2, int len)
52
 
    int strcmp(char *s1, char *s2)
53
51
    void *memchr(void *s, int c, size_t len)
54
52
    int memcmp(void *b1, void *b2, size_t len)
55
53
    # ??? memrchr is a GNU extension :(
445
443
        """Return a pointer to the start of the next field."""
446
444
        cdef char *next
447
445
        next = self.cur
448
 
        # XXX: Change this to not use 'memchr' instead of 'strchr'
449
 
        self.cur = strchr(next, c'\0')
 
446
        self.cur = <char*>memchr(next, c'\0', self.end_str-next)
450
447
        size[0] = self.cur - next
451
448
        self.cur = self.cur + 1
452
449
        return next