зеркало из https://github.com/mozilla/pjs.git
Bug 173634 flawfinder warnings in xp_str.h: kill xp_str.h, xp_path.h and clean out old/dead defines/code
r=mkaply sr=alecf Removing dead code guarded by: BUG_21013 MORK_USE_XP_STDLIB notdef OLDWAY UNREADY_CODE Removing *Apple*Decode* files which aren't being built
This commit is contained in:
Родитель
27f29bc43d
Коммит
17a1a59dd0
|
@ -160,7 +160,6 @@ extern void mork_assertion_signal(const char* inMessage);
|
|||
#define MORK_LIB_IMPL(return) return /*implementation return declaration*/
|
||||
|
||||
// { %%%%% begin standard c utility methods %%%%%
|
||||
/*define MORK_USE_XP_STDLIB 1*/
|
||||
|
||||
#if defined(MORK_WIN) || defined(MORK_UNIX) || defined(MORK_MAC) || defined(MORK_BEOS) || defined(MORK_OS2)
|
||||
#define MORK_USE_C_STDLIB 1
|
||||
|
@ -197,18 +196,6 @@ MORK_LIB(mork_size) mork_strlen(const void* inString);
|
|||
#define MORK_STRLEN(string) mork_strlen(string)
|
||||
#endif /*MORK_PROVIDE_STDLIB*/
|
||||
|
||||
#ifdef MORK_USE_XP_STDLIB
|
||||
#define MORK_MEMCMP(src1,src2,size) XP_MEMCMP(src1,src2,size)
|
||||
#define MORK_MEMCPY(dest,src,size) XP_MEMCPY(dest,src,size)
|
||||
#define MORK_MEMMOVE(dest,src,size) XP_MEMMOVE(dest,src,size)
|
||||
#define MORK_MEMSET(dest,byte,size) XP_MEMSET(dest,byte,size)
|
||||
#define MORK_STRCPY(dest,src) XP_STRCPY(dest,src)
|
||||
#define MORK_STRCMP(one,two) XP_STRCMP(one,two)
|
||||
#define MORK_STRNCMP(one,two,length) XP_STRNCMP(one,two,length)
|
||||
#define MORK_STRLEN(string) XP_STRLEN(string)
|
||||
#endif /*MORK_USE_XP_STDLIB*/
|
||||
|
||||
|
||||
// } %%%%% end standard c utility methods %%%%%
|
||||
|
||||
//3456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789
|
||||
|
|
|
@ -600,96 +600,6 @@ nsresult nsMsgSearchNewsEx::SaveProfile (const char *profileName)
|
|||
return err;
|
||||
}
|
||||
#endif // DOING_PROFILES
|
||||
#if OLDWAY
|
||||
// Callback from libnet
|
||||
SEARCH_API void MSG_AddNewsSearchHit (MWContext *context, const char *resultLine)
|
||||
{
|
||||
MSG_SearchFrame *frame = MSG_SearchFrame::FromContext (context);
|
||||
nsMsgSearchNewsEx *adapter = (nsMsgSearchNewsEx *) frame->GetRunningAdapter();
|
||||
if (adapter)
|
||||
{
|
||||
MessageHdrStruct hdr;
|
||||
XP_BZERO(&hdr, sizeof(hdr));
|
||||
|
||||
// Here we make the SEARCH result compatible with xover conventions. In SEARCH, the
|
||||
// group name and a ':' precede the article number, so try to skip over this stuff
|
||||
// before asking NeoMessageHdr to parse it
|
||||
char *xoverCompatLine = XP_STRCHR(resultLine, ':');
|
||||
if (xoverCompatLine)
|
||||
xoverCompatLine++;
|
||||
else
|
||||
xoverCompatLine = (char*) resultLine; //### casting away const
|
||||
|
||||
if (NeoMessageHdr::ParseLine ((char*) xoverCompatLine, &hdr)) //### casting away const
|
||||
{
|
||||
if (hdr.m_flags & kHasRe) // hack around which kind of flag we actually got
|
||||
{
|
||||
hdr.m_flags &= !kHasRe;
|
||||
hdr.m_flags |= MSG_FLAG_HAS_RE;
|
||||
}
|
||||
adapter->ReportHit (&hdr, XP_STRTOK((char*) resultLine, ":")); //### casting away const
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SEARCH_API nsresult MSG_SaveProfileStatus (MSG_Pane *searchPane, PRBool *cmdEnabled)
|
||||
{
|
||||
nsresult err = NS_OK;
|
||||
|
||||
NS_ABORT_IF_FALSE(cmdEnabled, "cmdEnabled cannot be NULL");
|
||||
if (cmdEnabled)
|
||||
{
|
||||
*cmdEnabled = PR_FALSE;
|
||||
MSG_SearchFrame *frame = MSG_SearchFrame::FromPane (searchPane);
|
||||
if (frame)
|
||||
*cmdEnabled = frame->GetSaveProfileStatus();
|
||||
}
|
||||
else
|
||||
err = NS_ERROR_NULL_POINTER;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
SEARCH_API nsresult MSG_SaveProfile (MSG_Pane *searchPane, const char * profileName)
|
||||
{
|
||||
nsresult err = NS_OK;
|
||||
|
||||
#ifdef _DEBUG
|
||||
PRBool enabled = PR_FALSE;
|
||||
MSG_SaveProfileStatus (searchPane, &enabled);
|
||||
NS_ENSURE_TRUE(enabled, SearchError_ScopeAgreement);
|
||||
#endif
|
||||
|
||||
if (profileName)
|
||||
{
|
||||
MSG_SearchFrame *frame = MSG_SearchFrame::FromPane (searchPane);
|
||||
NS_ASSERTION(frame, "frame cannot be NULL");
|
||||
if (frame)
|
||||
{
|
||||
nsMsgSearchNewsEx *adapter = frame->GetProfileAdapter();
|
||||
NS_ASSERTION(adapter, "adaptor cannot be NULL");
|
||||
if (adapter)
|
||||
err = adapter->SaveProfile (profileName);
|
||||
}
|
||||
}
|
||||
else
|
||||
err = NS_ERROR_NULL_POINTER;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
SEARCH_API int MSG_AddProfileGroup (MSG_Pane *pane, MSG_NewsHost* host,
|
||||
const char *groupName)
|
||||
{
|
||||
MSG_FolderInfoNews *group =
|
||||
pane->GetMaster()->AddProfileNewsgroup(host, groupName);
|
||||
return group ? 0 : -1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
nsresult nsMsgSearchValidityManager::InitNewsTable()
|
||||
{
|
||||
|
|
|
@ -1292,44 +1292,6 @@ PRInt32 nsSmtpProtocol::SendDataResponse()
|
|||
m_urlErrorState = NS_ERROR_BUT_DONT_SHOW_ALERT;
|
||||
return(NS_ERROR_SENDING_DATA_COMMAND);
|
||||
}
|
||||
#ifdef UNREADY_CODE
|
||||
#ifdef XP_UNIX
|
||||
{
|
||||
const char * FE_UsersRealMailAddress(void); /* definition */
|
||||
const char *real_name;
|
||||
char *s = 0;
|
||||
PRBool suppress_sender_header = PR_FALSE;
|
||||
|
||||
PREF_GetBoolPref ("mail.suppress_sender_header", &suppress_sender_header);
|
||||
if (!suppress_sender_header)
|
||||
{
|
||||
real_name = FE_UsersRealMailAddress();
|
||||
s = (real_name ? MSG_MakeFullAddress (NULL, real_name) : 0);
|
||||
if (real_name && !s)
|
||||
{
|
||||
m_urlErrorState = NS_ERROR_COULD_NOT_GET_UID;
|
||||
return(NS_ERROR_COULD_NOT_GET_UID);
|
||||
}
|
||||
if(real_name)
|
||||
{
|
||||
char buffer[512];
|
||||
PR_snprintf(buffer, sizeof(buffer), "Sender: %.256s" CRLF, real_name);
|
||||
NS_MsgSACat(command, buffer);
|
||||
if(!command)
|
||||
{
|
||||
m_urlErrorState = NS_ERROR_OUT_OF_MEMORY;
|
||||
return(NS_ERROR_OUT_OF_MEMORY);
|
||||
}
|
||||
|
||||
status = (int) NET_BlockingWrite(CE_SOCK, command, PL_strlen(command));
|
||||
if(status < 0)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* XP_UNIX */
|
||||
#endif /* UNREADY_CODE */
|
||||
|
||||
PR_FREEIF(command);
|
||||
|
||||
|
@ -1338,19 +1300,6 @@ PRInt32 nsSmtpProtocol::SendDataResponse()
|
|||
|
||||
UpdateStatus(SMTP_DELIV_MAIL);
|
||||
|
||||
#ifdef UNREADY_CODE
|
||||
/* get the size of the message */
|
||||
if(CE_URL_S->post_data_is_file)
|
||||
{
|
||||
XP_StatStruct stat_entry;
|
||||
|
||||
if(-1 != XP_Stat(CE_URL_S->post_data,
|
||||
&stat_entry,
|
||||
xpFileToPost))
|
||||
m_totalMessageSize = stat_entry.st_size;
|
||||
}
|
||||
else
|
||||
#endif /* UNREADY_CODE */
|
||||
{
|
||||
// m_runningURL->GetBodySize(&m_totalMessageSize);
|
||||
}
|
||||
|
@ -1406,21 +1355,6 @@ PRInt32 nsSmtpProtocol::SendPostData()
|
|||
"message sent; waiting for reply" status; FE_GraphProgress gets in
|
||||
the way of that. See bug #23414. */
|
||||
|
||||
#ifdef UNREADY_CODE
|
||||
unsigned long curtime;
|
||||
curtime = XP_TIME();
|
||||
if (curtime != m_LastTime) {
|
||||
FE_Progress(CE_WINDOW_ID, XP_ProgressText(m_totalMessageSize,
|
||||
m_totalAmountWritten,
|
||||
0, 0));
|
||||
m_LastTime = curtime;
|
||||
}
|
||||
|
||||
if(m_totalMessageSize)
|
||||
FE_SetProgressBarPercent(CE_WINDOW_ID,
|
||||
m_totalAmountWritten*100/m_totalMessageSize);
|
||||
#endif /* UNREADY_CODE */
|
||||
|
||||
return(status);
|
||||
}
|
||||
|
||||
|
|
|
@ -1518,13 +1518,8 @@ PRInt32 nsNNTPProtocol::NewsResponse(nsIInputStream * inputStream, PRUint32 leng
|
|||
/* almost correct */
|
||||
if(status > 1)
|
||||
{
|
||||
#ifdef UNREADY_CODE
|
||||
ce->bytes_received += status;
|
||||
FE_GraphProgress(ce->window_id, ce->URL_s, ce->bytes_received, status, ce->URL_s->content_length);
|
||||
#else
|
||||
mBytesReceived += status;
|
||||
mBytesReceivedSinceLastStatusUpdate += status;
|
||||
#endif
|
||||
}
|
||||
|
||||
m_previousResponseCode = m_responseCode;
|
||||
|
@ -1583,9 +1578,6 @@ PRInt32 nsNNTPProtocol::LoginResponse()
|
|||
AlertError(MK_NNTP_ERROR_MESSAGE, m_responseText);
|
||||
|
||||
m_nextState = NNTP_ERROR;
|
||||
#ifdef UNREADY_CODE
|
||||
cd->control_con->prev_cache = PR_FALSE; /* to keep if from reconnecting */
|
||||
#endif
|
||||
return MK_BAD_NNTP_CONNECTION;
|
||||
}
|
||||
|
||||
|
@ -2032,15 +2024,6 @@ PRInt32 nsNNTPProtocol::SendFirstNNTPCommand(nsIURI * url)
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef UNREADY_CODE
|
||||
#ifdef BUG_21013
|
||||
if(!FE_Confirm(ce->window_id, XP_GetString(XP_CONFIRM_SAVE_NEWSGROUPS)))
|
||||
{
|
||||
m_nextState = NEWS_ERROR;
|
||||
return(MK_INTERRUPTED);
|
||||
}
|
||||
#endif /* BUG_21013 */
|
||||
#endif
|
||||
PRBool xactive=PR_FALSE;
|
||||
rv = m_nntpServer->QueryExtension("XACTIVE",&xactive);
|
||||
if (NS_SUCCEEDED(rv) && xactive)
|
||||
|
@ -2148,11 +2131,6 @@ PRInt32 nsNNTPProtocol::SendFirstNNTPCommand(nsIURI * url)
|
|||
}
|
||||
}
|
||||
m_nextState = NNTP_RESPONSE;
|
||||
#ifdef UNREADY_CODE
|
||||
if (PL_strstr(ce->URL_s->address, "PROFILE NEW"))
|
||||
m_nextStateAfterResponse = NNTP_PROFILE_ADD_RESPONSE;
|
||||
else
|
||||
#endif
|
||||
m_nextStateAfterResponse = NNTP_PROFILE_DELETE_RESPONSE;
|
||||
}
|
||||
else if (m_typeWanted == IDS_WANTED)
|
||||
|
@ -2327,15 +2305,8 @@ PRInt32 nsNNTPProtocol::SendFirstNNTPCommandResponse()
|
|||
|
||||
/* start the graph progress indicator
|
||||
*/
|
||||
#ifdef UNREADY_CODE
|
||||
FE_GraphProgressInit(ce->window_id, ce->URL_s, ce->URL_s->content_length);
|
||||
#else
|
||||
NNTP_LOG_NOTE("start the graph progress indicator");
|
||||
#endif
|
||||
SetFlag(NNTP_DESTROY_PROGRESS_GRAPH);
|
||||
#ifdef UNREADY_CODE
|
||||
m_originalContentLength = ce->URL_s->content_length;
|
||||
#endif
|
||||
return(status);
|
||||
}
|
||||
|
||||
|
@ -2421,41 +2392,11 @@ PRInt32 nsNNTPProtocol::BeginArticle()
|
|||
|
||||
/* Set up the HTML stream
|
||||
*/
|
||||
#ifdef UNREADY_CODE
|
||||
ce->URL_s->content_type = nsCRT::strdup (MESSAGE_RFC822);
|
||||
#endif
|
||||
|
||||
#ifdef NO_ARTICLE_CACHEING
|
||||
ce->format_out = CLEAR_CACHE_BIT (ce->format_out);
|
||||
#endif
|
||||
|
||||
if (m_typeWanted == CANCEL_WANTED)
|
||||
{
|
||||
#ifdef UNREADY_CODE
|
||||
NS_ASSERTION(ce->format_out == FO_PRESENT, "format_out != FO_PRESENT");
|
||||
ce->format_out = FO_PRESENT;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Only put stuff in the fe_data if this URL is going to get
|
||||
passed to MIME_MessageConverter(), since that's the only
|
||||
thing that knows what to do with this structure. */
|
||||
#ifdef UNREADY_CODE
|
||||
if (CLEAR_CACHE_BIT(ce->format_out) == FO_PRESENT)
|
||||
{
|
||||
status = net_InitializeNewsFeData (ce);
|
||||
if (status < 0)
|
||||
{
|
||||
/* #### what error message? */
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
cd->stream = NET_StreamBuilder(ce->format_out, ce->URL_s, ce->window_id);
|
||||
NS_ASSERTION (cd->stream, "no stream");
|
||||
if (!cd->stream) return -1;
|
||||
#endif
|
||||
|
||||
// if we have a channel listener,
|
||||
// create a pipe to pump the message into...the output will go to whoever
|
||||
// is consuming the message display
|
||||
|
@ -2930,15 +2871,9 @@ PRInt32 nsNNTPProtocol::BeginNewsgroups()
|
|||
{
|
||||
PRInt32 status = 0;
|
||||
m_nextState = NNTP_NEWGROUPS;
|
||||
#ifdef UNREADY_CODE
|
||||
NET_Progress(ce->window_id, XP_GetString(XP_PROGRESS_RECEIVE_NEWSGROUP));
|
||||
|
||||
ce->bytes_received = 0;
|
||||
#else
|
||||
mBytesReceived = 0;
|
||||
mBytesReceivedSinceLastStatusUpdate = 0;
|
||||
m_startTime = PR_Now();
|
||||
#endif
|
||||
return(status);
|
||||
}
|
||||
|
||||
|
@ -3076,10 +3011,7 @@ PRInt32 nsNNTPProtocol::BeginReadNewsList()
|
|||
m_startTime = PR_Now();
|
||||
|
||||
PRInt32 status = 0;
|
||||
#ifdef UNREADY_CODE
|
||||
NET_Progress(ce->window_id, XP_GetString(XP_PROGRESS_RECEIVE_NEWSGROUP));
|
||||
#endif
|
||||
|
||||
|
||||
return(status);
|
||||
}
|
||||
|
||||
|
@ -3799,34 +3731,6 @@ PRInt32 nsNNTPProtocol::PostDataResponse()
|
|||
if (m_responseCode != MK_NNTP_RESPONSE_POST_OK)
|
||||
{
|
||||
AlertError(MK_NNTP_ERROR_MESSAGE,m_responseText);
|
||||
#ifdef UNREADY_CODE
|
||||
ce->URL_s->error_msg =
|
||||
NET_ExplainErrorDetails(MK_NNTP_ERROR_MESSAGE,
|
||||
m_responseText ? m_responseText : "");
|
||||
if (m_responseCode == MK_NNTP_RESPONSE_POST_FAILED
|
||||
&& MSG_GetPaneType(cd->pane) == MSG_COMPOSITIONPANE
|
||||
&& MSG_IsDuplicatePost(cd->pane) &&
|
||||
MSG_GetCompositionMessageID(cd->pane)) {
|
||||
/* The news server won't let us post. We suspect that we're submitting
|
||||
a duplicate post, and that's why it's failing. So, let's go see
|
||||
if there really is a message out there with the same message-id.
|
||||
If so, we'll just silently pretend everything went well. */
|
||||
PR_snprintf(cd->output_buffer, OUTPUT_BUFFER_SIZE, "STAT %s" CRLF,
|
||||
MSG_GetCompositionMessageID(cd->pane));
|
||||
m_nextState = NNTP_RESPONSE;
|
||||
m_nextStateAfterResponse = NNTP_CHECK_FOR_MESSAGE;
|
||||
NNTP_LOG_WRITE(cd->output_buffer);
|
||||
return (int) NET_BlockingWrite(ce->socket, cd->output_buffer,
|
||||
PL_strlen(cd->output_buffer));
|
||||
}
|
||||
|
||||
MSG_ClearCompositionMessageID(cd->pane); /* So that if the user tries
|
||||
to just post again, we
|
||||
won't immediately decide
|
||||
that this was a duplicate
|
||||
message and ignore the
|
||||
error. */
|
||||
#endif
|
||||
m_nextState = NEWS_ERROR;
|
||||
return(MK_NNTP_ERROR_MESSAGE);
|
||||
}
|
||||
|
@ -3847,9 +3751,6 @@ PRInt32 nsNNTPProtocol::CheckForArticle()
|
|||
/* The article isn't there, so the failure we had earlier wasn't due to
|
||||
a duplicate message-id. Return the error from that previous
|
||||
posting attempt (which is already in ce->URL_s->error_msg). */
|
||||
#ifdef UNREADY_CODE
|
||||
MSG_ClearCompositionMessageID(cd->pane);
|
||||
#endif
|
||||
return MK_NNTP_ERROR_MESSAGE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5731,10 +5731,6 @@ InternetSearchDataSource::ParseHTML(nsIURI *aURL, nsIRDFResource *mParent,
|
|||
|
||||
nsCOMPtr<nsIRDFResource> res;
|
||||
|
||||
// #define OLDWAY
|
||||
#ifdef OLDWAY
|
||||
rv = gRDFService->GetResource(nsCAutoString(hrefStr), getter_AddRefs(res));
|
||||
#else
|
||||
// save HREF attribute as URL
|
||||
if (NS_SUCCEEDED(rv = gRDFService->GetAnonymousResource(getter_AddRefs(res))))
|
||||
{
|
||||
|
@ -5748,7 +5744,7 @@ InternetSearchDataSource::ParseHTML(nsIURI *aURL, nsIRDFResource *mParent,
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (NS_FAILED(rv)) continue;
|
||||
|
||||
// set HTML response chunk
|
||||
|
@ -5849,9 +5845,6 @@ InternetSearchDataSource::ParseHTML(nsIURI *aURL, nsIRDFResource *mParent,
|
|||
|
||||
// look for Name (if it isn't already set)
|
||||
nsCOMPtr<nsIRDFNode> oldNameRes = nsnull;
|
||||
#ifdef OLDWAY
|
||||
mInner->GetTarget(res, kNC_Name, PR_TRUE, getter_AddRefs(oldNameRes));
|
||||
#endif
|
||||
if (!oldNameRes)
|
||||
{
|
||||
if (!nameStr.IsEmpty())
|
||||
|
@ -6005,9 +5998,6 @@ InternetSearchDataSource::ParseHTML(nsIURI *aURL, nsIRDFResource *mParent,
|
|||
|
||||
// look for Relevance (if it isn't already set)
|
||||
nsCOMPtr<nsIRDFNode> oldRelRes = nsnull;
|
||||
#ifdef OLDWAY
|
||||
mInner->GetTarget(res, kNC_Relevance, PR_TRUE, getter_AddRefs(oldRelRes));
|
||||
#endif
|
||||
if (!oldRelRes)
|
||||
{
|
||||
if (!relItem.IsEmpty())
|
||||
|
@ -6100,9 +6090,6 @@ InternetSearchDataSource::ParseHTML(nsIURI *aURL, nsIRDFResource *mParent,
|
|||
|
||||
// set reference to engine this came from (if it isn't already set)
|
||||
nsCOMPtr<nsIRDFNode> oldEngineRes = nsnull;
|
||||
#ifdef OLDWAY
|
||||
mInner->GetTarget(res, kNC_Engine, PR_TRUE, getter_AddRefs(oldEngineRes));
|
||||
#endif
|
||||
if (!oldEngineRes)
|
||||
{
|
||||
if (!engineStr.IsEmpty())
|
||||
|
|
Загрузка…
Ссылка в новой задаче