~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_import_c_api.h

  • Committer: John Arbash Meinel
  • Date: 2009-10-12 21:44:27 UTC
  • mto: This revision was merged to the branch mainline in revision 4737.
  • Revision ID: john@arbash-meinel.com-20091012214427-zddi1kmc2jlf7v31
Py_ssize_t and its associated function typedefs are not available w/ python 2.4

So we define them in python-compat.h
Even further, gcc issued a warning for:
static int
_workaround_pyrex_096()
So we changed it to:
_workaround_pyrex_096(void)

Also, some python api funcs were incorrectly defined as 'char *' when they meant
'const char *'. Work around that with a (char *) cast, to avoid compiler warnings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
    PyObject *c_obj = NULL;
48
48
    const char *desc = NULL;
49
49
 
50
 
    d = PyObject_GetAttrString(module, _C_API_NAME);
 
50
    /* (char *) because Python2.4 defines this as (char *) rather than
 
51
     * (const char *)
 
52
     */
 
53
    d = PyObject_GetAttrString(module, (char *)_C_API_NAME);
51
54
    if (!d) {
52
55
        // PyObject_GetAttrString sets an appropriate exception
53
56
        goto bad;
94
97
{
95
98
    PyObject *type = NULL;
96
99
 
97
 
    type = PyObject_GetAttrString(module, class_name);
 
100
    type = PyObject_GetAttrString(module, (char *)class_name);
98
101
    if (!type) {
99
102
        goto bad;
100
103
    }
149
152
    struct type_description *cur_type;
150
153
    int ret_code;
151
154
    
152
 
    module = PyImport_ImportModule(module_name);
 
155
    module = PyImport_ImportModule((char *)module_name);
153
156
    if (!module)
154
157
        goto bad;
155
158
    if (functions != NULL) {