Fixes for many shadowing problems as well as changes for more I18N support

This commit is contained in:
rhp%netscape.com 1999-05-13 21:53:58 +00:00
Родитель e4ee930f8c
Коммит dcadc23a39
10 изменённых файлов: 60 добавлений и 54 удалений

Просмотреть файл

@ -128,7 +128,7 @@ do \
static unsigned char *
xp_word_wrap(unsigned char *str, int maxColumn, int checkQuoting,
const char *prefix, int addCRLF)
const char *pfix, int addCRLF)
{
unsigned char *beginningOfLine;
int byteWidth;
@ -172,7 +172,7 @@ xp_word_wrap(unsigned char *str, int maxColumn, int checkQuoting,
if (*in)
{
NEW_LINE(addCRLF);
if (prefix) OUTPUTSTR(prefix);
if (pfix) OUTPUTSTR(pfix);
}
else
{
@ -196,7 +196,7 @@ xp_word_wrap(unsigned char *str, int maxColumn, int checkQuoting,
}
}
NEW_LINE(addCRLF);
if (prefix) OUTPUTSTR(prefix);
if (pfix) OUTPUTSTR(pfix);
continue;
}
byteWidth = PL_strlen((const char *) in);
@ -222,7 +222,7 @@ xp_word_wrap(unsigned char *str, int maxColumn, int checkQuoting,
}
in = lastBreakablePos;
OUTPUT_NEW_LINE(addCRLF);
if (prefix) OUTPUTSTR(prefix);
if (pfix) OUTPUTSTR(pfix);
continue;
}
}

Просмотреть файл

@ -118,8 +118,8 @@ MimeContainer_parse_eof (MimeObject *object, PRBool abort_p)
MimeObject *kid = cont->children[i];
if (kid && !kid->closed_p)
{
int status = kid->clazz->parse_eof(kid, abort_p);
if (status < 0) return status;
int lstatus = kid->clazz->parse_eof(kid, abort_p);
if (lstatus < 0) return lstatus;
}
}
}
@ -148,8 +148,8 @@ MimeContainer_parse_end (MimeObject *object, PRBool abort_p)
MimeObject *kid = cont->children[i];
if (kid && !kid->parsed_p)
{
int status = kid->clazz->parse_end(kid, abort_p);
if (status < 0) return status;
int lstatus = kid->clazz->parse_end(kid, abort_p);
if (lstatus < 0) return lstatus;
}
}
}

Просмотреть файл

@ -150,7 +150,7 @@ MimeExternalBody_parse_line (char *line, PRInt32 length, MimeObject *obj)
char *
MimeExternalBody_make_url(const char *ct,
const char *at, const char *exp, const char *size,
const char *at, const char *lexp, const char *size,
const char *perm, const char *dir, const char *mode,
const char *name, const char *url, const char *site,
const char *svr, const char *subj, const char *body)
@ -280,7 +280,7 @@ MimeExternalBody_parse_eof (MimeObject *obj, PRBool abort_p)
char *ct = MimeHeaders_get(obj->headers, HEADER_CONTENT_TYPE,
PR_FALSE, PR_FALSE);
char *at, *exp, *size, *perm;
char *at, *lexp, *size, *perm;
char *url, *dir, *mode, *name, *site, *svr, *subj;
char *h = 0, *lname = 0, *lurl = 0, *body = 0;
MimeHeaders *hdrs = 0;
@ -288,7 +288,7 @@ MimeExternalBody_parse_eof (MimeObject *obj, PRBool abort_p)
if (!ct) return MK_OUT_OF_MEMORY;
at = MimeHeaders_get_parameter(ct, "access-type", NULL, NULL);
exp = MimeHeaders_get_parameter(ct, "expiration", NULL, NULL);
lexp = MimeHeaders_get_parameter(ct, "expiration", NULL, NULL);
size = MimeHeaders_get_parameter(ct, "size", NULL, NULL);
perm = MimeHeaders_get_parameter(ct, "permission", NULL, NULL);
dir = MimeHeaders_get_parameter(ct, "directory", NULL, NULL);
@ -305,7 +305,7 @@ MimeExternalBody_parse_eof (MimeObject *obj, PRBool abort_p)
PR_TRUE, PR_FALSE);
h = (char *) PR_MALLOC((at ? PL_strlen(at) : 0) +
(exp ? PL_strlen(exp) : 0) +
(lexp ? PL_strlen(lexp) : 0) +
(size ? PL_strlen(size) : 0) +
(perm ? PL_strlen(perm) : 0) +
(dir ? PL_strlen(dir) : 0) +
@ -362,14 +362,14 @@ MimeExternalBody_parse_eof (MimeObject *obj, PRBool abort_p)
FROB("Size", size);
FROB("Mode", mode);
FROB("Permission", perm);
FROB("Expiration", exp);
FROB("Expiration", lexp);
FROB("Subject", subj);
# undef FROB
PL_strcpy(h, MSG_LINEBREAK);
status = MimeHeaders_parse_line(h, PL_strlen(h), hdrs);
if (status < 0) goto FAIL;
lurl = MimeExternalBody_make_url(ct, at, exp, size, perm, dir, mode,
lurl = MimeExternalBody_make_url(ct, at, lexp, size, perm, dir, mode,
name, url, site, svr, subj, bod->body);
if (lurl)
{
@ -438,7 +438,7 @@ MimeExternalBody_parse_eof (MimeObject *obj, PRBool abort_p)
PR_FREEIF(body);
PR_FREEIF(ct);
PR_FREEIF(at);
PR_FREEIF(exp);
PR_FREEIF(lexp);
PR_FREEIF(size);
PR_FREEIF(perm);
PR_FREEIF(dir);

Просмотреть файл

@ -290,10 +290,10 @@ MimeHeaders_build_heads_list(MimeHeaders *hdrs)
PR_ASSERT(hdrs->all_headers_fp <= hdrs->all_headers_size);
if (hdrs->all_headers_fp + 60 <= hdrs->all_headers_size)
{
char *s = (char *)PR_Realloc(hdrs->all_headers, hdrs->all_headers_fp);
if (s) /* can this ever fail? we're making it smaller... */
char *ls = (char *)PR_Realloc(hdrs->all_headers, hdrs->all_headers_fp);
if (ls) /* can this ever fail? we're making it smaller... */
{
hdrs->all_headers = s; /* in case it got relocated */
hdrs->all_headers = ls; /* in case it got relocated */
hdrs->all_headers_size = hdrs->all_headers_fp;
}
}

Просмотреть файл

@ -166,10 +166,10 @@ add_content_type_attribs(const char *content_type,
PRBool
force_inline_display(const char *content_type)
{
PRBool force_inline_display;
PRBool force_inline_disp;
find_content_type_attribs(content_type, &force_inline_display);
return (force_inline_display);
find_content_type_attribs(content_type, &force_inline_disp);
return (force_inline_disp);
}
/*
@ -1223,9 +1223,9 @@ MimeOptions_write(MimeDisplayOptions *opt, char *data, PRInt32 length,
else
{
char sep[] = "<HR WIDTH=\"90%\" SIZE=4>";
int status = opt->output_fn(sep, PL_strlen(sep), closure);
int lstatus = opt->output_fn(sep, PL_strlen(sep), closure);
opt->state->separator_suppressed_p = PR_FALSE;
if (status < 0) return status;
if (lstatus < 0) return lstatus;
}
}
if (user_visible_p)

Просмотреть файл

@ -166,7 +166,7 @@ MimeMultipartRelated_initialize(MimeObject* obj)
static PR_CALLBACK
PRIntn mime_multipart_related_nukehash(PLHashEntry *table,
PRIntn index, void *arg)
PRIntn indx, void *arg)
{
if (table->key)
PR_Free((char*) table->key);
@ -627,8 +627,8 @@ real_write(MimeMultipartRelated* relobj, char* buf, PRInt32 size)
#endif /* MIME_DRAFTS */
{
if (!closure) {
MimeObject* obj = (MimeObject*) relobj;
closure = obj->options->stream_closure;
MimeObject* lobj = (MimeObject*) relobj;
closure = lobj->options->stream_closure;
}
return relobj->real_output_fn(buf, size, closure);
}

Просмотреть файл

@ -256,7 +256,7 @@ HG09091
obj->options->write_html_p &&
obj->options->generate_header_html_fn)
{
int status = 0;
int lstatus = 0;
char *html = 0;
/* The generate_header_html_fn might return HTML, so it's important
@ -264,8 +264,8 @@ HG09091
make the MimeObject_write() call below. */
if (!obj->options->state->first_data_written_p)
{
status = MimeObject_output_init (obj, TEXT_HTML);
if (status < 0) return status;
lstatus = MimeObject_output_init (obj, TEXT_HTML);
if (lstatus < 0) return lstatus;
PR_ASSERT(obj->options->state->first_data_written_p);
}
@ -274,9 +274,9 @@ HG09091
msg->hdrs);
if (html)
{
status = MimeObject_write(obj, html, PL_strlen(html), PR_FALSE);
lstatus = MimeObject_write(obj, html, PL_strlen(html), PR_FALSE);
PR_Free(html);
if (status < 0) return status;
if (lstatus < 0) return lstatus;
}
}
@ -407,17 +407,21 @@ HG09091
)
{
char *charset = NULL;
char *ct = MimeHeaders_get (msg->hdrs, HEADER_CONTENT_TYPE,
char *lct = MimeHeaders_get (msg->hdrs, HEADER_CONTENT_TYPE,
PR_FALSE, PR_FALSE);
if (ct)
charset = MimeHeaders_get_parameter (ct, "charset", NULL, NULL);
if (lct)
charset = MimeHeaders_get_parameter (lct, "charset", NULL, NULL);
char *msgID = MimeHeaders_get (msg->hdrs, HEADER_MESSAGE_ID,
PR_FALSE, PR_FALSE);
mimeEmitter->StartBody((obj->options->headers == MimeHeadersNone), msgID);
char *outCharset = NULL;
if (!obj->options->force_user_charset) /* Only convert if the user prefs is false */
outCharset = "UTF-8";
mimeEmitter->StartBody((obj->options->headers == MimeHeadersNone), msgID, outCharset);
PR_FREEIF(msgID);
PR_FREEIF(ct);
PR_FREEIF(lct);
PR_FREEIF(charset);
}
@ -467,9 +471,9 @@ MimeMessage_parse_eof (MimeObject *obj, PRBool abort_p)
msg->hdrs);
if (html)
{
int status = MimeObject_write(obj, html, PL_strlen(html), PR_FALSE);
int lstatus = MimeObject_write(obj, html, PL_strlen(html), PR_FALSE);
PR_Free(html);
if (status < 0) return status;
if (lstatus < 0) return lstatus;
}
}
@ -575,7 +579,8 @@ MimeMessage_write_headers_html (MimeObject *obj)
mimeEmitter->StartHeader(
(obj == obj->options->state->root),
(obj->options->headers == MimeHeadersOnly),
msgID
msgID,
"UTF-8"
);
PR_FREEIF(msgID);

Просмотреть файл

@ -714,9 +714,9 @@ nsMimeURLUtils::MakeAbsoluteURL(char * absolute_url, char * relative_url, char *
* remove the stuff before and at the colon and treat it as a normal
* relative url
*/
char * colon = PL_strchr(relative_url, ':');
char * colon2 = PL_strchr(relative_url, ':');
relative_url = colon+1;
relative_url = colon2 + 1;
}
}

Просмотреть файл

@ -1065,13 +1065,14 @@ msg_extract_Header_address_names(const char *line)
int status = msg_parse_Header_addresses(line, &names, &addrs);
if (status <= 0)
return 0;
PRUint32 j1, j2;
s1 = names;
s2 = addrs;
for (i = 0; (int)i < status; i++)
{
PRUint32 j1 = PL_strlen(s1);
PRUint32 j2 = PL_strlen(s2);
j1 = PL_strlen(s1);
j2 = PL_strlen(s2);
s1 += j1 + 1;
s2 += j2 + 1;
size += (j1 ? j1 : j2) + 2;
@ -1090,8 +1091,8 @@ msg_extract_Header_address_names(const char *line)
s2 = addrs;
for (i = 0; (int)i < status; i++)
{
PRUint32 j1 = PL_strlen(s1);
PRUint32 j2 = PL_strlen(s2);
j1 = PL_strlen(s1);
j2 = PL_strlen(s2);
if (j1)
{
@ -1161,6 +1162,7 @@ msg_format_Header_addresses (const char *names, const char *addrs,
const char *s1, *s2;
PRUint32 i, size = 0;
PRUint32 column = 10;
PRUint32 j1, j2;
if (count <= 0)
return 0;
@ -1169,8 +1171,8 @@ msg_format_Header_addresses (const char *names, const char *addrs,
s2 = addrs;
for (i = 0; (int)i < count; i++)
{
PRUint32 j1 = PL_strlen(s1);
PRUint32 j2 = PL_strlen(s2);
j1 = PL_strlen(s1);
j2 = PL_strlen(s2);
s1 += j1 + 1;
s2 += j2 + 1;
size += j1 + j2 + 10;
@ -1186,8 +1188,8 @@ msg_format_Header_addresses (const char *names, const char *addrs,
for (i = 0; (int)i < count; i++)
{
char *o;
PRUint32 j1 = PL_strlen(s1);
PRUint32 j2 = PL_strlen(s2);
j1 = PL_strlen(s1);
j2 = PL_strlen(s2);
if ( wrap_lines_p && i > 0
&& (column + j1 + j2 + 3 + (((int)(i+1) < count) ? 2 : 0) > 76))

Просмотреть файл

@ -124,7 +124,6 @@ MimePluginInstance::DetermineOutputFormat(const char *url)
char *format = PL_strcasestr(url, "?outformat=");
char *part = PL_strcasestr(url, "?part=");
char *header = PL_strcasestr(url, "?header=");
char *ptr;
if (!format) format = PL_strcasestr(url, "&outformat=");
if (!part) part = PL_strcasestr(url, "&part=");
@ -175,8 +174,8 @@ MimePluginInstance::DetermineOutputFormat(const char *url)
{
if (header)
{
ptr = PL_strcasestr ("only", (header+PL_strlen("?header=")));
if (ptr)
char *ptr2 = PL_strcasestr ("only", (header+PL_strlen("?header=")));
if (ptr2)
{
PR_FREEIF(mOutputFormat);
mOutputFormat = PL_strdup("text/xml");