Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bb66a20

Browse files
committed
Wrap some long lines, use only C89 /* */ comments, and add spaces around
some operators (style guide conformance).
1 parent 4a2261a commit bb66a20

1 file changed

Lines changed: 15 additions & 14 deletions

File tree

Modules/pyexpat.c

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,40 +1072,41 @@ static struct PyMethodDef xmlparse_methods[] = {
10721072
*/
10731073

10741074
static char template_buffer[257];
1075-
PyObject * template_string=NULL;
1075+
PyObject *template_string = NULL;
10761076

10771077
static void
10781078
init_template_buffer(void)
10791079
{
10801080
int i;
1081-
for (i=0;i<256;i++) {
1082-
template_buffer[i]=i;
1081+
for (i = 0; i < 256; i++) {
1082+
template_buffer[i] = i;
10831083
}
1084-
template_buffer[256]=0;
1084+
template_buffer[256] = 0;
10851085
}
10861086

10871087
int
10881088
PyUnknownEncodingHandler(void *encodingHandlerData,
10891089
const XML_Char *name,
10901090
XML_Encoding * info)
10911091
{
1092-
PyUnicodeObject * _u_string=NULL;
1093-
int result=0;
1092+
PyUnicodeObject *_u_string = NULL;
1093+
int result = 0;
10941094
int i;
10951095

1096-
_u_string=(PyUnicodeObject *) PyUnicode_Decode(template_buffer, 256, name, "replace"); // Yes, supports only 8bit encodings
1096+
/* Yes, supports only 8bit encodings */
1097+
_u_string = (PyUnicodeObject *)
1098+
PyUnicode_Decode(template_buffer, 256, name, "replace");
10971099

1098-
if (_u_string==NULL) {
1100+
if (_u_string == NULL)
10991101
return result;
1100-
}
11011102

1102-
for (i=0; i<256; i++) {
1103-
Py_UNICODE c = _u_string->str[i] ; // Stupid to access directly, but fast
1104-
if (c==Py_UNICODE_REPLACEMENT_CHARACTER) {
1103+
for (i = 0; i < 256; i++) {
1104+
/* Stupid to access directly, but fast */
1105+
Py_UNICODE c = _u_string->str[i];
1106+
if (c == Py_UNICODE_REPLACEMENT_CHARACTER)
11051107
info->map[i] = -1;
1106-
} else {
1108+
else
11071109
info->map[i] = c;
1108-
}
11091110
}
11101111

11111112
info->data = NULL;

0 commit comments

Comments
 (0)