Permalink
Browse files

Address some assignment-related compiler warnings.

  • Loading branch information...
1 parent 6970474 commit 0080a855a74d51c1fd2cdcc977280bc68b7fb918 @jparise committed Sep 10, 2012
Showing with 9 additions and 9 deletions.
  1. +2 −2 python_handlers.c
  2. +4 −4 python_object.c
  3. +3 −3 python_streams.c
View
@@ -605,8 +605,8 @@ python_get_class_name(const zval *object, char **class_name,
* prefix the class name with "Python " to avoid confusion with native PHP
* classes.
*/
- if (attr = PyObject_GetAttrString(pip->object, key)) {
- if (str = PyObject_Str(attr)) {
+ if ((attr = PyObject_GetAttrString(pip->object, key))) {
+ if ((str = PyObject_Str(attr))) {
*class_name_len = sizeof("Python ") + PyString_GET_SIZE(str);
*class_name = (char *)emalloc(sizeof(char *) * *class_name_len);
zend_sprintf(*class_name, "Python %s", PyString_AS_STRING(str));
View
@@ -130,8 +130,8 @@ python_num_args(PyObject *callable TSRMLS_DC)
PHP_PYTHON_THREAD_ACQUIRE();
- if (func_code = PyObject_GetAttrString(callable, "func_code")) {
- if (co_argcount = PyObject_GetAttrString(func_code, "co_argcount")) {
+ if ((func_code = PyObject_GetAttrString(callable, "func_code"))) {
+ if ((co_argcount = PyObject_GetAttrString(func_code, "co_argcount"))) {
num_args = PyInt_AsLong(co_argcount);
Py_DECREF(co_argcount);
}
@@ -164,8 +164,8 @@ python_get_arg_info(PyObject *callable, zend_arg_info **arg_info TSRMLS_DC)
* The arguments are described by the object's func_code.co_varnames
* member. They're represented as a Python tuple.
*/
- if (func_code = PyObject_GetAttrString(callable, "func_code")) {
- if (co_varnames = PyObject_GetAttrString(func_code, "co_varnames")) {
+ if ((func_code = PyObject_GetAttrString(callable, "func_code"))) {
+ if ((co_varnames = PyObject_GetAttrString(func_code, "co_varnames"))) {
PyObject *arg;
int i, num_vars, start = 0;
View
@@ -94,7 +94,7 @@ OutputStream_writelines(OutputStream *self, PyObject *args)
if (iterator == NULL)
return NULL;
- while (item = PyIter_Next(iterator)) {
+ while ((item = PyIter_Next(iterator))) {
if (PyString_AsStringAndSize(item, &str, &len) != -1) {
ZEND_WRITE(str, len);
Py_DECREF(item);
@@ -253,8 +253,8 @@ ErrorStream_writelines(ErrorStream *self, PyObject *args)
if (iterator == NULL)
return NULL;
- while (item = PyIter_Next(iterator)) {
- if (str = PyString_AsString(item)) {
+ while ((item = PyIter_Next(iterator))) {
+ if ((str = PyString_AsString(item))) {
php_error(E_NOTICE, "%s", str);
Py_DECREF(item);
} else {

0 comments on commit 0080a85

Please sign in to comment.