Skip to content
This repository has been archived by the owner on Dec 6, 2018. It is now read-only.

Commit

Permalink
Address some integer type mismatches.
Browse files Browse the repository at this point in the history
  • Loading branch information
jparise committed Sep 10, 2012
1 parent 0080a85 commit 2a68953
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion php_python_internal.h
Expand Up @@ -110,6 +110,6 @@ int pip_pyobject_to_zval(PyObject *o, zval *zv TSRMLS_DC);
PyObject * pip_args_to_tuple(int argc, int start TSRMLS_DC);

/* Object Representations */
int python_str(PyObject *o, char **buffer, int *length TSRMLS_DC);
int python_str(PyObject *o, char **buffer, Py_ssize_t *length TSRMLS_DC);

#endif /* PHP_PYTHON_INTERNAL_H */
11 changes: 6 additions & 5 deletions python_convert.c
Expand Up @@ -86,7 +86,7 @@ pip_hash_to_dict(zval *hash TSRMLS_DC)
PyObject *dict, *integer;
zval **entry;
char *string_key;
long num_key;
unsigned long num_key;

PHP_PYTHON_THREAD_ASSERT();

Expand Down Expand Up @@ -136,7 +136,7 @@ pip_zobject_to_pyobject(zval *obj TSRMLS_DC)
PyObject *dict, *str;
zval **entry;
char *string_key;
long num_key;
unsigned long num_key;

PHP_PYTHON_THREAD_ASSERT();

Expand Down Expand Up @@ -164,7 +164,7 @@ pip_zobject_to_pyobject(zval *obj TSRMLS_DC)
PyDict_SetItemString(dict, string_key, item);
break;
case HASH_KEY_IS_LONG:
str = PyString_FromFormat("%d", num_key);
str = PyString_FromFormat("%lu", num_key);
PyObject_SetItem(dict, str, item);
Py_DECREF(str);
break;
Expand Down Expand Up @@ -309,7 +309,8 @@ pip_mapping_to_hash(PyObject *o, HashTable *ht TSRMLS_DC)
PyObject *keys, *key, *str, *item;
zval *v;
char *name;
int i, size, name_len;
int i, size;
Py_ssize_t name_len;
int status = FAILURE;

PHP_PYTHON_THREAD_ASSERT();
Expand Down Expand Up @@ -582,7 +583,7 @@ pip_args_to_tuple(int argc, int start TSRMLS_DC)
/* {{{ python_str(PyObject *o, char **buffer, int *length)
Returns the NUL-terminated string representation of a Python object. */
int
python_str(PyObject *o, char **buffer, int *length TSRMLS_DC)
python_str(PyObject *o, char **buffer, Py_ssize_t *length TSRMLS_DC)
{
PyObject *str;
int ret = -1;
Expand Down
2 changes: 1 addition & 1 deletion python_streams.c
Expand Up @@ -85,7 +85,7 @@ OutputStream_writelines(OutputStream *self, PyObject *args)
PyObject *iterator;
PyObject *item;
char *str;
int len;
Py_ssize_t len;

if (!PyArg_ParseTuple(args, "O:writelines", &sequence))
return NULL;
Expand Down

0 comments on commit 2a68953

Please sign in to comment.