fix warnings

git-svn-id: svn://10.0.0.236/trunk@38429 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
sspitzer%netscape.com
1999-07-06 22:43:25 +00:00
parent 9d7a392839
commit c066feacfa
10 changed files with 41 additions and 45 deletions

View File

@@ -413,14 +413,15 @@ nsMsgAttachmentHandler::SnarfAttachment(nsMsgCompFields *compFields)
// temp file where we will save this data
mFileSpec = nsMsgCreateTempFileSpec("nsmail.tmp");
if (! mFileSpec )
return (MK_OUT_OF_MEMORY);
return (NS_ERROR_OUT_OF_MEMORY);
mOutFile = new nsOutputFileStream(*mFileSpec, PR_WRONLY | PR_CREATE_FILE);
if (!mOutFile)
{
delete mFileSpec;
mFileSpec = nsnull;
return MK_UNABLE_TO_OPEN_TMP_FILE;
//return MK_UNABLE_TO_OPEN_TMP_FILE;
return NS_ERROR_FAILURE;
}
mURL->GetSpec(&url_string);
@@ -557,7 +558,7 @@ nsMsgAttachmentHandler::SnarfAttachment(nsMsgCompFields *compFields)
mFetcher = new nsURLFetcher();
if (!mFetcher)
{
return MK_OUT_OF_MEMORY;
return NS_ERROR_OUT_OF_MEMORY;
}
NS_ADDREF(mURL);

View File

@@ -205,7 +205,6 @@ LocateMessageFolder(nsIMsgIdentity *userIdentity,
nsresult rv = NS_OK;
nsIMsgFolder *msgFolder= nsnull;
PRUint32 cnt = 0;
PRUint32 subCnt = 0;
PRUint32 i;
PRBool fixed = PR_FALSE;
char *savePref = "";

View File

@@ -71,7 +71,7 @@ public:
static const nsIID& GetIID() { static nsIID iid = NS_IMSGCOPY_IID; return iid; }
nsMsgCopy();
~nsMsgCopy();
virtual ~nsMsgCopy();
// nsISupports interface
NS_DECL_ISUPPORTS

View File

@@ -870,7 +870,8 @@ int nsMsgComposeAndSend::HackAttachments(
const struct nsMsgAttachedFile *preloaded_attachments)
{
MWContext *x = NULL;
INTL_CharSetInfo c = LO_GetDocumentCharacterSetInfo(x);
INTL_CharSetInfo c;
c = LO_GetDocumentCharacterSetInfo(x);
if (preloaded_attachments)
NS_ASSERTION(!attachments, "not-null attachments");
if (attachments)
@@ -1087,7 +1088,7 @@ nsMsgComposeAndSend::InitCompositionFields(nsMsgCompFields *fields)
if (mCompFields)
mCompFields->AddRef();
else
return MK_OUT_OF_MEMORY;
return NS_ERROR_OUT_OF_MEMORY;
const char *cset = fields->GetCharacterSet();
// Make sure charset is sane...
@@ -1236,7 +1237,7 @@ nsMsgComposeAndSend::Init(
// see if we should continue
//
if (!fields)
return MK_OUT_OF_MEMORY;
return NS_ERROR_OUT_OF_MEMORY;
rv = InitCompositionFields(fields);
if (NS_FAILED(rv))
@@ -1293,7 +1294,7 @@ nsMsgComposeAndSend::Init(
{
char *newb = (char *) PR_Malloc (attachment1_body_length + 1);
if (! newb)
return MK_OUT_OF_MEMORY;
return NS_ERROR_OUT_OF_MEMORY;
nsCRT::memcpy (newb, attachment1_body, attachment1_body_length);
newb [attachment1_body_length] = 0;
m_attachment1_body = newb;
@@ -1395,7 +1396,7 @@ nsMsgComposeAndSend::DeliverFileAsMail()
Fail(MK_OUT_OF_MEMORY, eMsg);
NotifyListenersOnStopSending(nsnull, MK_OUT_OF_MEMORY, nsnull, nsnull);
PR_FREEIF(eMsg);
return MK_OUT_OF_MEMORY;
return NS_ERROR_OUT_OF_MEMORY;
}
PL_strcpy (buf, "");
@@ -1421,7 +1422,7 @@ nsMsgComposeAndSend::DeliverFileAsMail()
{
// RICHIE_TODO - message loss here?
nsMsgDisplayMessageByString("Unable to create SMTP listener service. Send failed.");
return MK_OUT_OF_MEMORY;
return NS_ERROR_OUT_OF_MEMORY;
}
mSendListener->SetMsgComposeAndSendObject(this);
@@ -1451,7 +1452,7 @@ nsMsgComposeAndSend::DeliverFileAsNews()
{
// RICHIE_TODO - message loss here?
nsMsgDisplayMessageByString("Unable to create NNTP listener service. News Delivery failed.");
return MK_OUT_OF_MEMORY;
return NS_ERROR_OUT_OF_MEMORY;
}
mSendListener->SetMsgComposeAndSendObject(this);
@@ -2307,7 +2308,6 @@ nsMsgComposeAndSend::MimeDoFCC(nsFileSpec *input_file,
char *ibuffer = 0;
PRInt32 ibuffer_size = TEN_K;
char *obuffer = 0;
PRInt32 obuffer_size = 0, obuffer_fp = 0;
PRInt32 n;
char *envelopeLine = nsMsgGetEnvelopeLine();
@@ -2368,7 +2368,7 @@ nsMsgComposeAndSend::MimeDoFCC(nsFileSpec *input_file,
if (!ibuffer)
{
status = MK_OUT_OF_MEMORY;
status = NS_ERROR_OUT_OF_MEMORY;
goto FAIL;
}
@@ -2470,7 +2470,7 @@ nsMsgComposeAndSend::MimeDoFCC(nsFileSpec *input_file,
char *buf = (char *) PR_Malloc (L);
if (!buf)
{
status = MK_OUT_OF_MEMORY;
status = NS_ERROR_OUT_OF_MEMORY;
goto FAIL;
}
@@ -2496,7 +2496,7 @@ nsMsgComposeAndSend::MimeDoFCC(nsFileSpec *input_file,
char *buf = (char *) PR_Malloc (L);
if (!buf)
{
status = MK_OUT_OF_MEMORY;
status = NS_ERROR_OUT_OF_MEMORY;
goto FAIL;
}
@@ -2547,7 +2547,7 @@ nsMsgComposeAndSend::MimeDoFCC(nsFileSpec *input_file,
orig_hap = 0;
if (!line)
{
status = MK_OUT_OF_MEMORY;
status = NS_ERROR_OUT_OF_MEMORY;
goto FAIL;
}
@@ -2649,7 +2649,7 @@ nsMsgComposeAndSend::StartMessageCopyOperation(nsIFileSpec *aFileSpec,
{
mCopyObj = new nsMsgCopy(); // SHERRY do_QueryInterface(new nsMsgCopy());
if (!mCopyObj)
return MK_OUT_OF_MEMORY;
return NS_ERROR_OUT_OF_MEMORY;
if (!mCompFields->GetFcc() || !*mCompFields->GetFcc())
return mCopyObj->StartCopyOperation(mUserIdentity, aFileSpec, mode,

View File

@@ -842,7 +842,7 @@ SEARCH_NEWLINE:
{
char *newh = (char*) PR_Realloc ((*header),
PL_strlen(*header) + L + 10);
if (!newh) return MK_OUT_OF_MEMORY;
if (!newh) return NS_ERROR_OUT_OF_MEMORY;
*header = newh;
newh = (*header) + PL_strlen (*header);
*newh++ = ',';
@@ -853,7 +853,7 @@ SEARCH_NEWLINE:
else
{
*header = (char *) PR_Malloc(L+1);
if (!*header) return MK_OUT_OF_MEMORY;
if (!*header) return NS_ERROR_OUT_OF_MEMORY;
nsCRT::memcpy((*header), value, L);
(*header)[L] = 0;
}
@@ -874,7 +874,7 @@ SEARCH_NEWLINE:
int L = buf - value;
char *draftInfo = (char*) PR_Malloc(L+1);
char *receipt = NULL;
if (!draftInfo) return MK_OUT_OF_MEMORY;
if (!draftInfo) return NS_ERROR_OUT_OF_MEMORY;
nsCRT::memcpy(draftInfo, value, L);
*(draftInfo+L)=0;
receipt = PL_strstr(draftInfo, "receipt=");

View File

@@ -1553,7 +1553,7 @@ mimeEmitterAddAttachmentField(MimeDisplayOptions *opt, const char *field, const
{
mime_stream_data *msd = GetMSD(opt);
if (!msd)
return -1;
return NS_ERROR_FAILURE;
if (msd->output_emitter)
{
@@ -1566,7 +1566,7 @@ mimeEmitterAddAttachmentField(MimeDisplayOptions *opt, const char *field, const
return emitter2->AddAttachmentField(field, value);
}
return -1;
return NS_ERROR_FAILURE;
}
extern "C" nsresult
@@ -1574,7 +1574,7 @@ mimeEmitterAddHeaderField(MimeDisplayOptions *opt, const char *field, const char
{
mime_stream_data *msd = GetMSD(opt);
if (!msd)
return -1;
return NS_ERROR_FAILURE;
if (msd->output_emitter)
{
@@ -1587,7 +1587,7 @@ mimeEmitterAddHeaderField(MimeDisplayOptions *opt, const char *field, const char
return emitter2->AddHeaderField(field, value);
}
return -1;
return NS_ERROR_FAILURE;
}
extern "C" nsresult
@@ -1595,7 +1595,7 @@ mimeEmitterStartAttachment(MimeDisplayOptions *opt, const char *name, const char
{
mime_stream_data *msd = GetMSD(opt);
if (!msd)
return -1;
return NS_ERROR_FAILURE;
if (msd->output_emitter)
{
@@ -1608,7 +1608,7 @@ mimeEmitterStartAttachment(MimeDisplayOptions *opt, const char *name, const char
return emitter2->StartAttachment(name, contentType, url);
}
return -1;
return NS_ERROR_FAILURE;
}
extern "C" nsresult
@@ -1616,7 +1616,7 @@ mimeEmitterEndAttachment(MimeDisplayOptions *opt)
{
mime_stream_data *msd = GetMSD(opt);
if (!msd)
return -1;
return NS_ERROR_FAILURE;
if (msd->output_emitter)
{
@@ -1629,7 +1629,7 @@ mimeEmitterEndAttachment(MimeDisplayOptions *opt)
return emitter2->EndAttachment();
}
return -1;
return NS_ERROR_FAILURE;
}
extern "C" nsresult
@@ -1637,7 +1637,7 @@ mimeEmitterStartBody(MimeDisplayOptions *opt, PRBool bodyOnly, const char *msgID
{
mime_stream_data *msd = GetMSD(opt);
if (!msd)
return -1;
return NS_ERROR_FAILURE;
if (msd->output_emitter)
{
@@ -1650,7 +1650,7 @@ mimeEmitterStartBody(MimeDisplayOptions *opt, PRBool bodyOnly, const char *msgID
return emitter2->StartBody(bodyOnly, msgID, outCharset);
}
return -1;
return NS_ERROR_FAILURE;
}
extern "C" nsresult
@@ -1658,7 +1658,7 @@ mimeEmitterEndBody(MimeDisplayOptions *opt)
{
mime_stream_data *msd = GetMSD(opt);
if (!msd)
return -1;
return NS_ERROR_FAILURE;
if (msd->output_emitter)
{
@@ -1671,7 +1671,7 @@ mimeEmitterEndBody(MimeDisplayOptions *opt)
return emitter2->EndBody();
}
return -1;
return NS_ERROR_FAILURE;
}
extern "C" nsresult
@@ -1679,7 +1679,7 @@ mimeEmitterEndHeader(MimeDisplayOptions *opt)
{
mime_stream_data *msd = GetMSD(opt);
if (!msd)
return -1;
return NS_ERROR_FAILURE;
if (msd->output_emitter)
{
@@ -1692,7 +1692,7 @@ mimeEmitterEndHeader(MimeDisplayOptions *opt)
return emitter2->EndHeader();
}
return -1;
return NS_ERROR_FAILURE;
}
extern "C" nsresult
@@ -1701,7 +1701,7 @@ mimeEmitterStartHeader(MimeDisplayOptions *opt, PRBool rootMailHeader, PRBool he
{
mime_stream_data *msd = GetMSD(opt);
if (!msd)
return -1;
return NS_ERROR_FAILURE;
if (msd->output_emitter)
{
@@ -1714,7 +1714,7 @@ mimeEmitterStartHeader(MimeDisplayOptions *opt, PRBool rootMailHeader, PRBool he
return emitter2->StartHeader(rootMailHeader, headerOnly, msgID, outCharset);
}
return -1;
return NS_ERROR_FAILURE;
}

View File

@@ -66,14 +66,10 @@ net_OpenExtCacheFatDB(char *filename)
int main(int argc, char **argv)
{
char url[4028];
struct stat stat_s;
net_CacheObject * cache_obj;
DB * ext_cache_database=0;
DBT key;
DBT data;
int len;
char *end;
memset(&cache_obj, 0, sizeof(net_CacheObject));

View File

@@ -42,7 +42,8 @@ PRIVATE int net_SaveToDiskWrite (NET_StreamClass *stream, CONST char* s, int32 l
*/
PRIVATE unsigned int net_SaveToDiskWriteReady (NET_StreamClass * stream)
{
DataObject *obj=stream->data_object;
DataObject *obj;
obj=stream->data_object;
return(MAX_WRITE_READY); /* always ready for writing */
}

View File

@@ -715,7 +715,8 @@ PRIVATE int pacf_read_config(void) {
/* Private stream object methods for receiving the proxy autoconfig file. */
PRIVATE int pacf_write(NET_StreamClass *stream, CONST char *buf, int32 len) {
PACF_Object *obj=stream->data_object;
PACF_Object *obj;
obj=stream->data_object;
if (len > 0) {
if (!pacf_src_buf)
pacf_src_buf = (char*)PR_Malloc(len + 1);
@@ -1009,7 +1010,6 @@ MODULE_PRIVATE int NET_LoadProxyConfig(char *autoconf_url,
MWContext *window_id,
Net_GetUrlExitFunc *exit_routine) {
URL_Struct *my_url_s = NULL;
char * global_url = NULL;
if (!autoconf_url)
return -1;

View File

@@ -1734,7 +1734,6 @@ NET_ScanForURLs(MSG_Pane* pane, const char *input, int32 input_size,
Bool line_is_citation = FALSE;
const char *cite_open1, *cite_close1;
const char *cite_open2, *cite_close2;
const char* color = NULL;
if (urls_only)
{