~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_dirstate_helpers_pyx.pyx

  • Committer: Martin Pool
  • Date: 2010-02-17 06:25:37 UTC
  • mto: This revision was merged to the branch mainline in revision 5038.
  • Revision ID: mbp@sourcefrog.net-20100217062537-o7qkrvooff86v1iu
Avoid showing pointer in safe_string_from_size; not helpful and gives compiler warning

See https://code.edge.launchpad.net/~fullermd/bzr/dirstate-helpers-compiler-error/+merge/19138

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007, 2008 Canonical Ltd
 
1
# Copyright (C) 2007, 2008, 2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
156
156
        return None
157
157
    return <char*>found - <char*>_s
158
158
 
 
159
 
159
160
cdef object safe_string_from_size(char *s, Py_ssize_t size):
160
161
    if size < 0:
161
 
        # XXX: On 64-bit machines the <int> cast causes a C compiler warning.
162
162
        raise AssertionError(
163
 
            'tried to create a string with an invalid size: %d @0x%x'
164
 
            % (size, <int>s))
 
163
            'tried to create a string with an invalid size: %d'
 
164
            % (size))
165
165
    return PyString_FromStringAndSize(s, size)
166
166
 
167
167