Commit a8c1f439 authored by Fred Drake's avatar Fred Drake

Wrap some long lines, use only C89 /* */ comments, and add spaces around

some operators (style guide conformance).
parent 44cfbbd6
...@@ -1072,16 +1072,16 @@ static struct PyMethodDef xmlparse_methods[] = { ...@@ -1072,16 +1072,16 @@ static struct PyMethodDef xmlparse_methods[] = {
*/ */
static char template_buffer[257]; static char template_buffer[257];
PyObject * template_string=NULL; PyObject *template_string = NULL;
static void static void
init_template_buffer(void) init_template_buffer(void)
{ {
int i; int i;
for (i=0;i<256;i++) { for (i = 0; i < 256; i++) {
template_buffer[i]=i; template_buffer[i] = i;
} }
template_buffer[256]=0; template_buffer[256] = 0;
} }
int int
...@@ -1089,24 +1089,25 @@ PyUnknownEncodingHandler(void *encodingHandlerData, ...@@ -1089,24 +1089,25 @@ PyUnknownEncodingHandler(void *encodingHandlerData,
const XML_Char *name, const XML_Char *name,
XML_Encoding * info) XML_Encoding * info)
{ {
PyUnicodeObject * _u_string=NULL; PyUnicodeObject *_u_string = NULL;
int result=0; int result = 0;
int i; int i;
_u_string=(PyUnicodeObject *) PyUnicode_Decode(template_buffer, 256, name, "replace"); // Yes, supports only 8bit encodings /* Yes, supports only 8bit encodings */
_u_string = (PyUnicodeObject *)
PyUnicode_Decode(template_buffer, 256, name, "replace");
if (_u_string==NULL) { if (_u_string == NULL)
return result; return result;
}
for (i=0; i<256; i++) { for (i = 0; i < 256; i++) {
Py_UNICODE c = _u_string->str[i] ; // Stupid to access directly, but fast /* Stupid to access directly, but fast */
if (c==Py_UNICODE_REPLACEMENT_CHARACTER) { Py_UNICODE c = _u_string->str[i];
if (c == Py_UNICODE_REPLACEMENT_CHARACTER)
info->map[i] = -1; info->map[i] = -1;
} else { else
info->map[i] = c; info->map[i] = c;
} }
}
info->data = NULL; info->data = NULL;
info->convert = NULL; info->convert = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment