From 2f10b69f3e462153ec3efe4b712e28acfc0d730a Mon Sep 17 00:00:00 2001 From: "cyeh%netscape.com" Date: Thu, 24 Sep 1998 20:47:57 +0000 Subject: [PATCH] removing old NSPR20 #ifdefs git-svn-id: svn://10.0.0.236/trunk@10947 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/cmd/macfe/Composer/CSpellChecker.cp | 4 -- mozilla/cmd/macfe/applevnt/mplugin.cp | 4 -- mozilla/cmd/macfe/central/CBrowserContext.cp | 3 - mozilla/cmd/macfe/central/CNSContext.cp | 18 ------ mozilla/cmd/macfe/central/earlmgr.cp | 63 -------------------- mozilla/cmd/macfe/central/macfeprefs.h | 4 -- mozilla/cmd/macfe/central/mimages.cp | 3 - mozilla/cmd/macfe/central/uapp.cp | 42 ++----------- mozilla/cmd/macfe/utility/fredmem.cp | 3 - 9 files changed, 5 insertions(+), 139 deletions(-) diff --git a/mozilla/cmd/macfe/Composer/CSpellChecker.cp b/mozilla/cmd/macfe/Composer/CSpellChecker.cp index cbae888dad4..b3a987f4a05 100644 --- a/mozilla/cmd/macfe/Composer/CSpellChecker.cp +++ b/mozilla/cmd/macfe/Composer/CSpellChecker.cp @@ -988,11 +988,7 @@ void do_spellcheck( MWContext *mwcontext, CEditView *editView, CSimpleTextView * try { #ifdef USE_DYNAMIC_SC_LIB sc_create_func sc_createProc; -#ifndef NSPR20 - sc_createProc = (sc_create_func)PR_FindSymbol( "SC_Create", spellCheckerLib ); -#else sc_createProc = (sc_create_func)PR_FindSymbol( spellCheckerLib, "SC_Create" ); -#endif if ( sc_createProc == NULL ) { ErrorManager::PlainAlert( NO_SPELL_SHLB_FOUND ); diff --git a/mozilla/cmd/macfe/applevnt/mplugin.cp b/mozilla/cmd/macfe/applevnt/mplugin.cp index 73fbb77c676..09c4293857b 100644 --- a/mozilla/cmd/macfe/applevnt/mplugin.cp +++ b/mozilla/cmd/macfe/applevnt/mplugin.cp @@ -440,11 +440,7 @@ OSErr CPluginHandler::InitCodeResource(NPNetscapeFuncs* funcs, _np_handle* handl ThrowIf_(res != NS_OK); handle->userPlugin = plugin; } else { -#ifndef NSPR20 - fMainEntryFunc = (NPP_MainEntryUPP) PR_FindSymbol("mainRD", fLibrary); -#else fMainEntryFunc = (NPP_MainEntryUPP) PR_FindSymbol(fLibrary, "mainRD"); -#endif ThrowIfNil_(fMainEntryFunc); } } diff --git a/mozilla/cmd/macfe/central/CBrowserContext.cp b/mozilla/cmd/macfe/central/CBrowserContext.cp index f6699739497..6c615c524e4 100644 --- a/mozilla/cmd/macfe/central/CBrowserContext.cp +++ b/mozilla/cmd/macfe/central/CBrowserContext.cp @@ -21,9 +21,6 @@ #include "CBrowserContext.h" #include "CNSContextCallbacks.h" #include "CHTMLView.h" -#ifndef NSPR20 -#include "CNetwork.h" -#endif #include "UStdDialogs.h" #include "UFormElementFactory.h" #include "CAutoPtrXP.h" diff --git a/mozilla/cmd/macfe/central/CNSContext.cp b/mozilla/cmd/macfe/central/CNSContext.cp index 3502151bf4f..d8762d078c5 100644 --- a/mozilla/cmd/macfe/central/CNSContext.cp +++ b/mozilla/cmd/macfe/central/CNSContext.cp @@ -22,9 +22,6 @@ #include "CNSContext.h" #include "CNSContextCallbacks.h" #include "CHTMLView.h" -#ifndef NSPR20 -#include "CNetwork.h" -#endif #include "UStdDialogs.h" #include "CURLEditField.h" #include "CMochaHacks.h" @@ -788,11 +785,6 @@ void CNSContext::Alert( void CNSContext::SetCallNetlibAllTheTime(void) { -#ifndef NSPR20 - extern CNetworkDriver* gNetDriver; - Assert_(gNetDriver != NULL); - gNetDriver->SetCallAllTheTime(); -#endif } @@ -802,21 +794,11 @@ void CNSContext::SetCallNetlibAllTheTime(void) void CNSContext::ClearCallNetlibAllTheTime(void) { -#ifndef NSPR20 - extern CNetworkDriver* gNetDriver; - Assert_(gNetDriver != NULL); - gNetDriver->ClearCallAllTheTime(); -#endif } // A temporary abortion, we need this routine outside of MWContext function table void XP_ClearCallNetlibAllTheTime(MWContext *) { -#ifndef NSPR20 - extern CNetworkDriver* gNetDriver; - Assert_(gNetDriver != NULL); - gNetDriver->SetCallAllTheTime(); -#endif } // ΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡΡ diff --git a/mozilla/cmd/macfe/central/earlmgr.cp b/mozilla/cmd/macfe/central/earlmgr.cp index f1c4b35d190..43ba71b22fe 100644 --- a/mozilla/cmd/macfe/central/earlmgr.cp +++ b/mozilla/cmd/macfe/central/earlmgr.cp @@ -28,9 +28,6 @@ #include "uapp.h" #include "CNSContext.h" // Network -#ifndef NSPR20 -#include "CNetwork.h" -#endif // Netscape #include "secrng.h" // utilities @@ -44,12 +41,10 @@ extern "C" { #include "resgui.h" -#ifdef NSPR20 #include "prthread.h" PR_BEGIN_EXTERN_C PR_EXTERN(PRThread*) PR_GetPrimaryThread(void); PR_END_EXTERN_C -#endif /*----------------------------------------------------------------------------- Earl Manager @@ -99,26 +94,11 @@ void EarlManager::SpendTime( const EventRecord& /*inMacEvent*/) // appropriate time, and make sure that our priority is // low so that other java threads an run. -#ifndef NSPR20 - // If we don't have a gNetDriver then we better not call it - if (!gNetDriver) - return; - - PR_SetThreadPriority(PR_CurrentThread(), 0); - gNetDriver->SpendTime(); -#else PR_SetThreadPriority(PR_CurrentThread(), PR_PRIORITY_LOW); -#endif unsigned char dst; RNG_GenerateGlobalRandomBytes(&dst, 1); -#ifdef NSPR20_DISABLED - CSelectObject socketToCallWith; - if (gNetDriver->CanCallNetlib(socketToCallWith)) - NET_ProcessNet(MacToStdSocketID(socketToCallWith.fID), SocketSelectToFD_Type(socketToCallWith.fType)); -#else NET_PollSockets(); -#endif if ( fInterruptContext ) { NET_InterruptWindow( fInterruptContext ); @@ -303,78 +283,35 @@ int EarlManagerNetTicklerCallback(void) } } - -#ifdef NSPR20_DISABLED -int SocketSelectToFD_Type(SocketSelect s) -{ - switch (s) { - case eReadSocket: - case eExceptionSocket: - return NET_SOCKET_FD; - case eLocalFileSocket: - return NET_LOCAL_FILE_FD; - case eEverytimeSocket: - return NET_EVERYTIME_TYPE; - } - return 0; // Never reached -} -#endif - // FE Select routines void FE_SetReadSelect (MWContext * /* context */, int sd) { -#ifndef NSPR20 - gNetDriver->SetReadSelect(sd); -#endif } void FE_ClearReadSelect (MWContext */* context */, int sd) { -#ifndef NSPR20 - gNetDriver->ClearReadSelect(sd); -#endif } void FE_SetConnectSelect (MWContext */* context */, int sd) { -#ifndef NSPR20 - gNetDriver->SetConnectSelect(sd); -#endif } void FE_ClearConnectSelect(MWContext */* context */, int sd) { -#ifndef NSPR20 - gNetDriver->ClearConnectSelect(sd); -#endif } void FE_SetFileReadSelect (MWContext */* context */, int fd) { -#ifndef NSPR20 - gNetDriver->SetFileReadSelect(fd); -#endif } void FE_ClearFileReadSelect (MWContext */* context */, int fd) { -#ifndef NSPR20 - gNetDriver->ClearFileReadSelect(fd); -#endif } int FE_StartAsyncDNSLookup (MWContext */* context */, char * host_port, void ** hoststruct_ptr_ptr, int sock) { -#ifndef NSPR20 - *hoststruct_ptr_ptr = NULL; - int err = gNetDriver->StartAsyncDNSLookup(host_port, (struct hostent **)hoststruct_ptr_ptr, sock); - if (err == EAGAIN) // Because macsock knows nothing of netlib defines - return MK_WAITING_FOR_LOOKUP; - else - return err; -#endif return MK_WAITING_FOR_LOOKUP; } diff --git a/mozilla/cmd/macfe/central/macfeprefs.h b/mozilla/cmd/macfe/central/macfeprefs.h index e73f1815e2f..4704347623d 100644 --- a/mozilla/cmd/macfe/central/macfeprefs.h +++ b/mozilla/cmd/macfe/central/macfeprefs.h @@ -17,11 +17,7 @@ */ #include -#ifndef NSPR20 -#include "prmacros.h" -#else #include "prtypes.h" -#endif NSPR_BEGIN_EXTERN_C diff --git a/mozilla/cmd/macfe/central/mimages.cp b/mozilla/cmd/macfe/central/mimages.cp index b33e2ba643c..15470a1bc48 100644 --- a/mozilla/cmd/macfe/central/mimages.cp +++ b/mozilla/cmd/macfe/central/mimages.cp @@ -38,9 +38,6 @@ #include "uerrmgr.h" #include "resgui.h" #include "CIconCache.h" -#ifndef NSPR20 -#include "prglobal.h" -#endif #include "MacMemAllocator.h" #include "xlate.h" diff --git a/mozilla/cmd/macfe/central/uapp.cp b/mozilla/cmd/macfe/central/uapp.cp index d7a16d9eb0a..8603a8604b7 100644 --- a/mozilla/cmd/macfe/central/uapp.cp +++ b/mozilla/cmd/macfe/central/uapp.cp @@ -91,9 +91,6 @@ #include "LMenuSharing.h" #define MENU_SHARING_FIRST 40 -#ifndef NSPR20 -#include "CNetwork.h" -#endif #include "CEnvironment.h" #include "CWindowMenu.h" @@ -158,10 +155,7 @@ #include "InternetConfig.h" #include "il_strm.h" /* Image Library stream converters. */ -#ifdef MOCHA -//#include "libmocha.h" #include "CMochaHacks.h" -#endif PRThread* mozilla_thread; @@ -908,11 +902,6 @@ CFrontApp::CFrontApp() InitUTearOffPalette(this); CTearOffManager::GetDefaultManager()->AddListener(this); - // ₯Κnetwork -#ifndef NSPR20 - CNetworkDriver::CreateNetworkDriver(); -#endif - TheEarlManager.StartRepeating(); // WTSMManager::Initialize(); @@ -1060,23 +1049,12 @@ CFrontApp::~CFrontApp() PR_ProcessPendingEvents(mozilla_event_queue); //----- -#ifndef NSPR20 - if (gNetDriver && !fStartupAborted) - { - extern const char* CacheFilePrefix; - NET_CleanupCacheDirectory( "", CacheFilePrefix ); - NET_ShutdownNetLib(); - delete gNetDriver; - gNetDriver = NULL; - } -#else if (!fStartupAborted) { extern const char* CacheFilePrefix; NET_CleanupCacheDirectory( "", CacheFilePrefix ); NET_ShutdownNetLib(); } -#endif if (!fStartupAborted) CPrefs::DoWrite(); @@ -1663,11 +1641,8 @@ void CFrontApp::ProperStartup( FSSpec* file, short fileType ) possible. */ if ((PR_GetGCInfo() != NULL) && (PR_GetGCInfo()->finalizer != NULL)) -#ifndef NSPR20 - PR_SetThreadPriority(PR_GetGCInfo()->finalizer, 31); -#else - PR_SetThreadPriority(PR_GetGCInfo()->finalizer, PR_PRIORITY_URGENT); -#endif + + PR_SetThreadPriority(PR_GetGCInfo()->finalizer, PR_PRIORITY_URGENT); DestroySplashScreen(); if ( abortStartup == CPrefs::eRunAccountSetup ) @@ -3710,13 +3685,9 @@ void main( void ) #endif // NSPR/MOCHA Initialization -#ifndef NSPR20 - PR_Init("Navigator", 0,0,0); -#endif + mozilla_thread = PR_CurrentThread(); -#ifdef NSPR20 PR_SetThreadGCAble(); -#endif // ₯ initialize the memory manager // it's important that this is done VERY early @@ -4107,12 +4078,9 @@ CFrontApp::ProcessNextEvent() } #ifdef DAVIDM_SPEED2 -#ifndef NSPR20 - CSelectObject socketToCallWith; - Boolean doWNE = haveUserEvent || ::LMGetTicks() > sNextWNETicks || ( gNetDriver && !gNetDriver->CanCallNetlib(socketToCallWith) ); -#else + Boolean doWNE = haveUserEvent || ::LMGetTicks() > sNextWNETicks || NET_PollSockets(); -#endif // NSPR_20 + SetUpdateCommandStatus(false); if ( doWNE ) diff --git a/mozilla/cmd/macfe/utility/fredmem.cp b/mozilla/cmd/macfe/utility/fredmem.cp index 072fd9ce892..77324cae497 100644 --- a/mozilla/cmd/macfe/utility/fredmem.cp +++ b/mozilla/cmd/macfe/utility/fredmem.cp @@ -16,9 +16,6 @@ * Reserved. */ -#ifndef NSPR20 -#include "prmacos.h" -#endif #include "fredmem.h" #include "shist.h"