fix warnings.

also Back() and Back(nsIWebShell *) existed, and this is bad.
Renamed Back(nsIWebShell *) to GoBack(nsIWebShell *).


git-svn-id: svn://10.0.0.236/trunk@35709 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
sspitzer%netscape.com 1999-06-16 06:38:44 +00:00
parent 0f43ffca1d
commit 3e326c02c9
11 changed files with 41 additions and 39 deletions

View File

@ -315,7 +315,7 @@ nsBrowserAppCore::SetDocumentCharset(const nsString& aCharset)
NS_IMETHODIMP
nsBrowserAppCore::Back()
{
Back(mContentAreaWebShell);
GoBack(mContentAreaWebShell);
return NS_OK;
}
@ -330,7 +330,7 @@ nsBrowserAppCore::Reload(nsURLReloadType aType)
NS_IMETHODIMP
nsBrowserAppCore::Forward()
{
Forward(mContentAreaWebShell);
GoForward(mContentAreaWebShell);
return NS_OK;
}
@ -872,7 +872,7 @@ nsBrowserAppCore::SetContentWindow(nsIDOMWindow* aWin)
nsAutoString str(name);
if (APP_DEBUG) {
printf("Attaching to Content WebShell [%s]\n", nsAutoCString(str));
printf("Attaching to Content WebShell [%s]\n", (const char *)nsAutoCString(str));
}
}
@ -904,7 +904,7 @@ nsBrowserAppCore::SetWebShellWindow(nsIDOMWindow* aWin)
nsAutoString str(name);
if (APP_DEBUG) {
printf("Attaching to WebShellWindow[%s]\n", nsAutoCString(str));
printf("Attaching to WebShellWindow[%s]\n", (const char *)nsAutoCString(str));
}
nsIWebShellContainer * webShellContainer;
@ -1211,19 +1211,19 @@ nsBrowserAppCore::OnEndURLLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP
nsBrowserAppCore::Back(nsIWebShell * aPrev)
nsBrowserAppCore::GoBack(nsIWebShell * aPrev)
{
if (mSHistory) {
mSHistory->Back(aPrev);
mSHistory->GoBack(aPrev);
}
return NS_OK;
}
NS_IMETHODIMP
nsBrowserAppCore::Forward(nsIWebShell * aPrev)
nsBrowserAppCore::GoForward(nsIWebShell * aPrev)
{
if (mSHistory) {
mSHistory->Forward(aPrev);
mSHistory->GoForward(aPrev);
}
return NS_OK;
}
@ -1380,7 +1380,6 @@ done:
return NS_OK;
}
//----------------------------------------------------------
static void BuildFileURL(const char * aFileName, nsString & aFileURL)
{
@ -1594,7 +1593,7 @@ nsBrowserAppCore::ExecuteScript(nsIScriptContext * aContext, const nsString& aSc
PRBool isUndefined = PR_FALSE;
nsString rVal;
if (APP_DEBUG) {
printf("Executing [%s]\n", nsAutoCString(aScript));
printf("Executing [%s]\n", (const char *)nsAutoCString(aScript));
}
aContext->EvaluateString(aScript, url, 0, rVal, &isUndefined);
}

View File

@ -133,9 +133,9 @@ class nsBrowserAppCore : public nsBaseAppCore,
// nsISessionHistory methods
NS_IMETHOD Forward(nsIWebShell * prev);
NS_IMETHOD GoForward(nsIWebShell * prev);
NS_IMETHOD Back(nsIWebShell * prev);
NS_IMETHOD GoBack(nsIWebShell * prev);
NS_IMETHOD canForward(PRBool &aResult);

View File

@ -52,12 +52,12 @@ public:
/**
* Go forward in history
*/
NS_IMETHOD Forward(nsIWebShell * aPrev) = 0;
NS_IMETHOD GoForward(nsIWebShell * aPrev) = 0;
/**
* Go Back in History
*/
NS_IMETHOD Back(nsIWebShell * aPrev) = 0;
NS_IMETHOD GoBack(nsIWebShell * aPrev) = 0;
/**
* Reload the current history entry

View File

@ -129,7 +129,7 @@ PR_STATIC_CALLBACK(JSBool)
XPConnectFactoryCreateInstance(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
nsIDOMXPConnectFactory *nativeThis = (nsIDOMXPConnectFactory*)JS_GetPrivate(cx, obj);
JSBool rBool = JS_FALSE;
//JSBool rBool = JS_FALSE;
nsISupports* nativeRet;
nsAutoString b0;

View File

@ -387,7 +387,7 @@ GenerateTree(nsIWebShell * aWebShell, nsHistoryEntry * aParent, nsISessionHistor
if (cnt > 0) {
for (int i=0; i<cnt; i++) {
nsIWebShell * childWS = nsnull;
nsHistoryEntry * hChild = nsnull;
//nsHistoryEntry * hChild = nsnull;
aWebShell->ChildAt(i, childWS);
if (childWS) {
@ -475,7 +475,8 @@ nsHistoryEntry::Load(nsIWebShell * aPrevEntry) {
nsHistoryEntry * cur=nsnull;
PRBool urlChanged = PR_FALSE;
int i = 0;
nsIWebShell * pWS = nsnull, *cWS=nsnull, *prev=nsnull;
//nsIWebShell * pWS = nsnull, *cWS=nsnull;
nsIWebShell *prev=nsnull;
PRBool result = PR_FALSE;
nsString* cSURL=nsnull, * pSURL=nsnull;
const PRUnichar * pURL=nsnull, * cURL=nsnull;
@ -498,7 +499,9 @@ nsHistoryEntry::Load(nsIWebShell * aPrevEntry) {
// NS_ADDREF(aPrevEntry);
if (!cur || !prev) {
#ifdef DEBUG
printf("SessionHistory::Load cur or prev is null, cur = %x, prev = %x\n", cur, prev);
#endif
return NS_ERROR_NULL_POINTER;
}
@ -554,7 +557,7 @@ nsHistoryEntry::Load(nsIWebShell * aPrevEntry) {
for (i=0; i<cnt; i++){
nsIWebShell * cws=nsnull, *pws=nsnull;
//nsIWebShell * cws=nsnull, *pws=nsnull;
nsHistoryEntry *cChild=nsnull;
nsIWebShell * pChild=nsnull;
@ -630,12 +633,12 @@ public:
/**
* Go forward in history
*/
NS_IMETHOD Forward(nsIWebShell * prev);
NS_IMETHOD GoForward(nsIWebShell * prev);
/**
* Go Back in History
*/
NS_IMETHOD Back(nsIWebShell * prev);
NS_IMETHOD GoBack(nsIWebShell * prev);
/**
* Reload the current history entry
@ -773,8 +776,7 @@ NS_IMPL_ISUPPORTS(nsSessionHistory, kISessionHistoryIID);
NS_IMETHODIMP
nsSessionHistory::add(nsIWebShell * aWebShell)
{
nsresult rv = NS_OK;
//nsresult rv = NS_OK;
nsHistoryEntry * hEntry = nsnull;
nsIWebShell * parent = nsnull;
@ -822,9 +824,9 @@ nsSessionHistory::add(nsIWebShell * aWebShell)
*/
for(int i=mHistoryLength-1; i>mHistoryCurrentIndex; i--) {
nsHistoryEntry * hEntry = (nsHistoryEntry *)mHistoryEntries.ElementAt(i);
//NS_IF_RELEASE(hEntry);
delete hEntry;
nsHistoryEntry * hEntry2 = (nsHistoryEntry *)mHistoryEntries.ElementAt(i);
//NS_IF_RELEASE(hEntry2);
delete hEntry2;
mHistoryEntries.RemoveElementAt(i);
mHistoryLength--;
}
@ -1286,10 +1288,10 @@ nsSessionHistory::Reload(nsURLReloadType aReloadType)
}
NS_IMETHODIMP
nsSessionHistory::Back(nsIWebShell * prev)
nsSessionHistory::GoBack(nsIWebShell * prev)
{
nsresult rv = NS_OK;
nsHistoryEntry * hEntry=nsnull;
//nsHistoryEntry * hEntry=nsnull;
if (mHistoryCurrentIndex <= 0)
return NS_ERROR_NULL_POINTER;
@ -1300,7 +1302,7 @@ nsSessionHistory::Back(nsIWebShell * prev)
}
NS_IMETHODIMP
nsSessionHistory::Forward(nsIWebShell * prev)
nsSessionHistory::GoForward(nsIWebShell * prev)
{
nsresult rv = NS_OK;
PRInt32 prevIndex = 0;
@ -1423,9 +1425,10 @@ nsSessionHistoryFactory::nsSessionHistoryFactory()
}
nsresult
nsSessionHistoryFactory::LockFactory(PRBool lock)
nsSessionHistoryFactory::LockFactory(PRBool aLock)
{
NS_ASSERTION(0,"this can't be right, fix me!");
printf("this can't be right, fix me!\n");
return NS_OK;
}

View File

@ -63,7 +63,7 @@ NS_IMPL_RELEASE(nsXULCommand)
nsresult
nsXULCommand::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{
nsresult rv = NS_NOINTERFACE;
//nsresult rv = NS_NOINTERFACE;
if (NULL == aInstancePtr) {
return NS_ERROR_NULL_POINTER;

View File

@ -685,7 +685,7 @@ nsFindComponent::FindNext(nsISupports *aContext, PRBool *aDidFind)
// For now, just record request to console.
Context *context = (Context*)aContext;
#ifdef DEBUG_FIND
printf( "nsFindComponent::FindNext\n\tkey=%s\n\tcaseSensitive=%ld\tsearchBackward=%ld\n",
printf( "nsFindComponent::FindNext\n\tkey=%s\n\tcaseSensitive=%d\tsearchBackward=%d\n",
(const char *)nsAutoCString( context->mSearchString ),
context->mCaseSensitive, context->mSearchBackwards);
#endif

View File

@ -70,8 +70,8 @@ public:
return mInstanceCount == 0 && mLockCount == 0;
}
// Lock/unlock (a factory).
static nsresult LockFactory( PRBool lock ) {
if (lock)
static nsresult LockFactory( PRBool aLock ) {
if (aLock)
PR_AtomicIncrement( &mLockCount );
else
PR_AtomicDecrement( &mLockCount );

View File

@ -134,7 +134,7 @@ struct nsUnknownContentDialog : public nsIXULWindowCallbacks,
mDocLoader( aDocLoader ) {
NS_INIT_REFCNT();
}
~nsUnknownContentDialog() {
virtual ~nsUnknownContentDialog() {
}
void SetWindow( nsIWebShellWindow *aWindow ) {
mWindow = aWindow;

View File

@ -229,13 +229,13 @@ nsDownloadProgressDialog::OnDataAvailable(nsIURL* aURL, nsIInputStream *aIStream
NS_IMETHODIMP
nsDownloadProgressDialog::OnStartBinding(nsIURL* aURL, const char *aContentType) {
nsresult rv = NS_OK;
//nsresult rv = NS_OK;
return NS_OK;
}
NS_IMETHODIMP
nsDownloadProgressDialog::OnProgress(nsIURL* aURL, PRUint32 aProgress, PRUint32 aProgressMax) {
nsresult rv = NS_OK;
//nsresult rv = NS_OK;
char buf[16];
PR_snprintf( buf, sizeof buf, "%lu", aProgressMax );
setAttribute( mDocument, "data.progress", "max", buf );
@ -246,7 +246,7 @@ nsDownloadProgressDialog::OnProgress(nsIURL* aURL, PRUint32 aProgress, PRUint32
NS_IMETHODIMP
nsDownloadProgressDialog::OnStatus(nsIURL* aURL, const PRUnichar* aMsg) {
nsresult rv = NS_OK;
//nsresult rv = NS_OK;
nsString msg = aMsg;
setAttribute( mDocument, "data.status", "value", aMsg );
return NS_OK;

View File

@ -107,7 +107,7 @@ public:
// nsDownloadProgressDialog stuff
nsDownloadProgressDialog( nsIURL *anInputURL, const nsFileSpec &anOutputFileName );
~nsDownloadProgressDialog();
virtual ~nsDownloadProgressDialog();
NS_IMETHOD Show();
protected: