comparison mercurial/parsers.c @ 28792:507136150d2b

parsers: fix istat macro to work with single line if statement
author Matt Fowles <matt.fowles@gmail.com>
date Tue, 05 Apr 2016 10:43:43 -0400
parents 1c658391b22f
children 284d742e5611
comparison
equal deleted inserted replaced
28791:277b4e6938fa 28792:507136150d2b
1027 1027
1028 if (obj == NULL) 1028 if (obj == NULL)
1029 return NULL; 1029 return NULL;
1030 1030
1031 #define istat(__n, __d) \ 1031 #define istat(__n, __d) \
1032 t = PyInt_FromSsize_t(self->__n); \ 1032 do { \
1033 if (!t) \ 1033 t = PyInt_FromSsize_t(self->__n); \
1034 goto bail; \ 1034 if (!t) \
1035 if (PyDict_SetItemString(obj, __d, t) == -1) \ 1035 goto bail; \
1036 goto bail; \ 1036 if (PyDict_SetItemString(obj, __d, t) == -1) \
1037 Py_DECREF(t); 1037 goto bail; \
1038 Py_DECREF(t); \
1039 } while (0)
1038 1040
1039 if (self->added) { 1041 if (self->added) {
1040 Py_ssize_t len = PyList_GET_SIZE(self->added); 1042 Py_ssize_t len = PyList_GET_SIZE(self->added);
1041 t = PyInt_FromSsize_t(len); 1043 t = PyInt_FromSsize_t(len);
1042 if (!t) 1044 if (!t)