diff options
96 files changed, 1048 insertions, 874 deletions
| diff --git a/indra/integration_tests/llui_libtest/llui_libtest.cpp b/indra/integration_tests/llui_libtest/llui_libtest.cpp index 38aa1bbeb2..a0418f09d5 100755 --- a/indra/integration_tests/llui_libtest/llui_libtest.cpp +++ b/indra/integration_tests/llui_libtest/llui_libtest.cpp @@ -182,7 +182,7 @@ void export_test_floaters()  			// don't re-export other test floaters  			continue;  		} -		llinfos << "Converting " << filename << llendl; +		LL_INFOS() << "Converting " << filename << LL_ENDL;  		// Build a floater and output new attributes  		LLXMLNodePtr output_node = new LLXMLNode();  		LLFloater* floater = new LLFloater(LLSD()); @@ -194,7 +194,7 @@ void export_test_floaters()  		out_filename.resize(extension_pos);  		out_filename += "_new.xml"; -		llinfos << "Output: " << out_filename << llendl; +		LL_INFOS() << "Output: " << out_filename << LL_ENDL;  		LLFILE* floater_file = LLFile::fopen(out_filename.c_str(), "w");  		LLXMLNode::writeHeaderToFile(floater_file);  		output_node->writeToFile(floater_file); diff --git a/indra/linux_crash_logger/linux_crash_logger.cpp b/indra/linux_crash_logger/linux_crash_logger.cpp index 99d0ad7e14..3208894e96 100755 --- a/indra/linux_crash_logger/linux_crash_logger.cpp +++ b/indra/linux_crash_logger/linux_crash_logger.cpp @@ -29,19 +29,19 @@  int main(int argc, char **argv)  { -	llinfos << "Starting crash reporter." << llendl; +	LL_INFOS() << "Starting crash reporter." << LL_ENDL;  	LLCrashLoggerLinux app;  	app.parseCommandOptions(argc, argv);  	if (! app.init())  	{ -		llwarns << "Unable to initialize application." << llendl; +		LL_WARNS() << "Unable to initialize application." << LL_ENDL;  		return 1;  	}  	app.mainLoop();  	app.cleanup(); -	llinfos << "Crash reporter finished normally." << llendl; +	LL_INFOS() << "Crash reporter finished normally." << LL_ENDL;  	return 0;  } diff --git a/indra/linux_crash_logger/llcrashloggerlinux.cpp b/indra/linux_crash_logger/llcrashloggerlinux.cpp index 62465f9937..0bc534fde0 100755 --- a/indra/linux_crash_logger/llcrashloggerlinux.cpp +++ b/indra/linux_crash_logger/llcrashloggerlinux.cpp @@ -71,7 +71,7 @@ static BOOL do_ask_dialog(void)  #if LL_GTK  	gtk_disable_setlocale();  	if (!gtk_init_check(NULL, NULL)) { -		llinfos << "Could not initialize GTK for 'ask to send crash report' dialog; not sending report." << llendl; +		LL_INFOS() << "Could not initialize GTK for 'ask to send crash report' dialog; not sending report." << LL_ENDL;  		return FALSE;  	} diff --git a/indra/linux_updater/linux_updater.cpp b/indra/linux_updater/linux_updater.cpp index b7d30cc6d2..5c94deba02 100644 --- a/indra/linux_updater/linux_updater.cpp +++ b/indra/linux_updater/linux_updater.cpp @@ -317,9 +317,9 @@ gpointer worker_thread_cb(gpointer data)  				("secondlife-update-XXXXXX", &tmp_local_filename, &error);  			if (error != NULL)  			{ -				llerrs << "Unable to create temporary file: " +				LL_ERRS() << "Unable to create temporary file: "  					   << error->message -					   << llendl; +					   << LL_ENDL;  				g_error_free(error);  				throw 0; @@ -334,9 +334,9 @@ gpointer worker_thread_cb(gpointer data)  			package_file = fdopen(fd, "wb");  			if (package_file == NULL)  			{ -				llerrs << "Failed to create temporary file: " +				LL_ERRS() << "Failed to create temporary file: "  					   << app_state->file.c_str() -					   << llendl; +					   << LL_ENDL;  				gdk_threads_enter();  				display_error(app_state->window, @@ -347,12 +347,12 @@ gpointer worker_thread_cb(gpointer data)  			}  			// initialize curl and start downloading the package -			llinfos << "Downloading package: " << app_state->url << llendl; +			LL_INFOS() << "Downloading package: " << app_state->url << LL_ENDL;  			curl = curl_easy_init();  			if (curl == NULL)  			{ -				llerrs << "Failed to initialize libcurl" << llendl; +				LL_ERRS() << "Failed to initialize libcurl" << LL_ENDL;  				gdk_threads_enter();  				display_error(app_state->window, @@ -377,9 +377,9 @@ gpointer worker_thread_cb(gpointer data)  			if (result)  			{ -				llerrs << "Failed to download update: " +				LL_ERRS() << "Failed to download update: "  					   << app_state->url -					   << llendl; +					   << LL_ENDL;  				gdk_threads_enter();  				display_error(app_state->window, @@ -405,9 +405,9 @@ gpointer worker_thread_cb(gpointer data)  		// thread and show file chooser?  		if (!install_package(app_state->file.c_str(), app_state->dest_dir))  		{ -			llwarns << "Failed to install package to destination: " +			LL_WARNS() << "Failed to install package to destination: "  				<< app_state->dest_dir -				<< llendl; +				<< LL_ENDL;  			gdk_threads_enter();  			display_error(app_state->window, @@ -421,9 +421,9 @@ gpointer worker_thread_cb(gpointer data)  		// try to spawn the new viewer  		if (!spawn_viewer(app_state))  		{ -			llwarns << "Viewer was not installed properly in : " +			LL_WARNS() << "Viewer was not installed properly in : "  				<< app_state->dest_dir -				<< llendl; +				<< LL_ENDL;  			gdk_threads_enter();  			display_error(app_state->window, @@ -483,10 +483,10 @@ int  rename_with_sudo_fallback(const std::string& filename, const std::string& newname)  {  	int rtncode = ::rename(filename.c_str(), newname.c_str()); -	lldebugs << "rename result is: " << rtncode << " / " << errno << llendl; +	LL_DEBUGS() << "rename result is: " << rtncode << " / " << errno << LL_ENDL;  	if (rtncode && (EACCES == errno || EPERM == errno || EXDEV == errno))  	{ -		llinfos << "Permission problem in rename, or moving between different mount points.  Retrying as a mv under a sudo." << llendl; +		LL_INFOS() << "Permission problem in rename, or moving between different mount points.  Retrying as a mv under a sudo." << LL_ENDL;  		// failed due to permissions, try again as a gksudo or kdesu mv wrapper hack  		char *sudo_cmd = NULL;  		sudo_cmd = g_find_program_in_path("gksudo"); @@ -517,15 +517,15 @@ rename_with_sudo_fallback(const std::string& filename, const std::string& newnam  				if (!less_anal_gspawnsync(argv, &stderr_output,  							  &child_exit_status, &spawn_error))  				{ -					llwarns << "Failed to spawn child process: " +					LL_WARNS() << "Failed to spawn child process: "  						<< spawn_error->message -						<< llendl; +						<< LL_ENDL;  				}  				else if (child_exit_status)  				{ -					llwarns << "mv command failed: " +					LL_WARNS() << "mv command failed: "  						<< (stderr_output ? stderr_output : "(no reason given)") -						<< llendl; +						<< LL_ENDL;  				}  				else  				{ @@ -551,19 +551,19 @@ gboolean install_package(std::string package_file, std::string destination)  	tar_cmd = g_find_program_in_path("tar");  	if (!tar_cmd)  	{ -		llerrs << "`tar' was not found in $PATH" << llendl; +		LL_ERRS() << "`tar' was not found in $PATH" << LL_ENDL;  		return FALSE;  	} -	llinfos << "Found tar command: " << tar_cmd << llendl; +	LL_INFOS() << "Found tar command: " << tar_cmd << LL_ENDL;  	// Unpack the tarball in a temporary place first, then move it to  	// its final destination  	std::string tmp_dest_dir = gDirUtilp->getTempFilename();  	if (LLFile::mkdir(tmp_dest_dir, 0744))  	{ -		llerrs << "Failed to create directory: " +		LL_ERRS() << "Failed to create directory: "  		       << destination -		       << llendl; +		       << LL_ENDL;  		return FALSE;  	} @@ -579,7 +579,7 @@ gboolean install_package(std::string package_file, std::string destination)  		NULL,  	}; -	llinfos << "Untarring package: " << package_file << llendl; +	LL_INFOS() << "Untarring package: " << package_file << LL_ENDL;  	// store current SIGCHLD handler if there is one, replace with default  	// handler to make glib happy @@ -596,17 +596,17 @@ gboolean install_package(std::string package_file, std::string destination)  	if (!less_anal_gspawnsync(argv, &stderr_output,  				  &child_exit_status, &untar_error))  	{ -		llwarns << "Failed to spawn child process: " +		LL_WARNS() << "Failed to spawn child process: "  			<< untar_error->message -			<< llendl; +			<< LL_ENDL;  		return FALSE;  	}  	if (child_exit_status)  	{ -	 	llwarns << "Untar command failed: " +	 	LL_WARNS() << "Untar command failed: "  			<< (stderr_output ? stderr_output : "(no reason given)") -			<< llendl; +			<< LL_ENDL;  		return FALSE;  	} @@ -630,9 +630,9 @@ gboolean install_package(std::string package_file, std::string destination)  		if (rename_with_sudo_fallback(destination, backup_dir))  		{ -			llwarns << "Failed to move directory: '" +			LL_WARNS() << "Failed to move directory: '"  				<< destination << "' -> '" << backup_dir -				<< llendl; +				<< LL_ENDL;  			return FALSE;  		}  	} @@ -641,9 +641,9 @@ gboolean install_package(std::string package_file, std::string destination)  	// need to move it to its destination.  	if (rename_with_sudo_fallback(tmp_dest_dir, destination))  	{ -		llwarns << "Failed to move installation to the destination: " +		LL_WARNS() << "Failed to move installation to the destination: "  			<< destination -			<< llendl; +			<< LL_ENDL;  		return FALSE;  	} @@ -738,8 +738,8 @@ BOOL spawn_viewer(UpdaterAppState *app_state)  	if (!success)  	{ -		llwarns << "Failed to launch viewer: " << error->message -			<< llendl; +		LL_WARNS() << "Failed to launch viewer: " << error->message +			<< LL_ENDL;  	}  	if (error) g_error_free(error); @@ -840,7 +840,7 @@ int main(int argc, char **argv)  	// create UI  	updater_app_ui_init(app_state); -	//llinfos << "SAMPLE TRANSLATION IS: " << LLTrans::getString("LoginInProgress") << llendl; +	//LL_INFOS() << "SAMPLE TRANSLATION IS: " << LLTrans::getString("LoginInProgress") << LL_ENDL;  	// create download thread  	g_thread_create(GThreadFunc(worker_thread_cb), app_state, FALSE, NULL); diff --git a/indra/llaudio/llaudioengine_openal.cpp b/indra/llaudio/llaudioengine_openal.cpp index 34a057dcc0..e6ac586618 100755 --- a/indra/llaudio/llaudioengine_openal.cpp +++ b/indra/llaudio/llaudioengine_openal.cpp @@ -59,33 +59,33 @@ bool LLAudioEngine_OpenAL::init(const S32 num_channels, void* userdata)  	if(!alutInit(NULL, NULL))  	{ -		llwarns << "LLAudioEngine_OpenAL::init() ALUT initialization failed: " << alutGetErrorString (alutGetError ()) << llendl; +		LL_WARNS() << "LLAudioEngine_OpenAL::init() ALUT initialization failed: " << alutGetErrorString (alutGetError ()) << LL_ENDL;  		return false;  	} -	llinfos << "LLAudioEngine_OpenAL::init() OpenAL successfully initialized" << llendl; +	LL_INFOS() << "LLAudioEngine_OpenAL::init() OpenAL successfully initialized" << LL_ENDL; -	llinfos << "OpenAL version: " -		<< ll_safe_string(alGetString(AL_VERSION)) << llendl; -	llinfos << "OpenAL vendor: " -		<< ll_safe_string(alGetString(AL_VENDOR)) << llendl; -	llinfos << "OpenAL renderer: " -		<< ll_safe_string(alGetString(AL_RENDERER)) << llendl; +	LL_INFOS() << "OpenAL version: " +		<< ll_safe_string(alGetString(AL_VERSION)) << LL_ENDL; +	LL_INFOS() << "OpenAL vendor: " +		<< ll_safe_string(alGetString(AL_VENDOR)) << LL_ENDL; +	LL_INFOS() << "OpenAL renderer: " +		<< ll_safe_string(alGetString(AL_RENDERER)) << LL_ENDL;  	ALint major = alutGetMajorVersion ();  	ALint minor = alutGetMinorVersion (); -	llinfos << "ALUT version: " << major << "." << minor << llendl; +	LL_INFOS() << "ALUT version: " << major << "." << minor << LL_ENDL;  	ALCdevice *device = alcGetContextsDevice(alcGetCurrentContext());  	alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, &major);  	alcGetIntegerv(device, ALC_MAJOR_VERSION, 1, &minor); -	llinfos << "ALC version: " << major << "." << minor << llendl; +	LL_INFOS() << "ALC version: " << major << "." << minor << LL_ENDL; -	llinfos << "ALC default device: " +	LL_INFOS() << "ALC default device: "  		<< ll_safe_string(alcGetString(device,  					       ALC_DEFAULT_DEVICE_SPECIFIER)) -		<< llendl; +		<< LL_ENDL;  	return true;  } @@ -125,24 +125,24 @@ void LLAudioEngine_OpenAL::allocateListener()  	mListenerp = (LLListener *) new LLListener_OpenAL();  	if(!mListenerp)  	{ -		llwarns << "LLAudioEngine_OpenAL::allocateListener() Listener creation failed" << llendl; +		LL_WARNS() << "LLAudioEngine_OpenAL::allocateListener() Listener creation failed" << LL_ENDL;  	}  }  // virtual  void LLAudioEngine_OpenAL::shutdown()  { -	llinfos << "About to LLAudioEngine::shutdown()" << llendl; +	LL_INFOS() << "About to LLAudioEngine::shutdown()" << LL_ENDL;  	LLAudioEngine::shutdown(); -	llinfos << "About to alutExit()" << llendl; +	LL_INFOS() << "About to alutExit()" << LL_ENDL;  	if(!alutExit())  	{ -		llwarns << "Nuts." << llendl; -		llwarns << "LLAudioEngine_OpenAL::shutdown() ALUT shutdown failed: " << alutGetErrorString (alutGetError ()) << llendl; +		LL_WARNS() << "Nuts." << LL_ENDL; +		LL_WARNS() << "LLAudioEngine_OpenAL::shutdown() ALUT shutdown failed: " << alutGetErrorString (alutGetError ()) << LL_ENDL;  	} -	llinfos << "LLAudioEngine_OpenAL::shutdown() OpenAL successfully shut down" << llendl; +	LL_INFOS() << "LLAudioEngine_OpenAL::shutdown() OpenAL successfully shut down" << LL_ENDL;  	delete mListenerp;  	mListenerp = NULL; @@ -160,7 +160,7 @@ LLAudioChannel *LLAudioEngine_OpenAL::createChannel()  void LLAudioEngine_OpenAL::setInternalGain(F32 gain)  { -	//llinfos << "LLAudioEngine_OpenAL::setInternalGain() Gain: " << gain << llendl; +	//LL_INFOS() << "LLAudioEngine_OpenAL::setInternalGain() Gain: " << gain << LL_ENDL;  	alListenerf(AL_GAIN, gain);  } @@ -188,7 +188,7 @@ void LLAudioChannelOpenAL::play()  {  	if (mALSource == AL_NONE)  	{ -		llwarns << "Playing without a mALSource, aborting" << llendl; +		LL_WARNS() << "Playing without a mALSource, aborting" << LL_ENDL;  		return;  	} @@ -213,8 +213,8 @@ void LLAudioChannelOpenAL::playSynced(LLAudioChannel *channelp)  			alGetSourcef(masterchannelp->mALSource, AL_SEC_OFFSET,  				     &master_offset); -			llinfos << "Syncing with master at " << master_offset -				<< "sec" << llendl; +			LL_INFOS() << "Syncing with master at " << master_offset +				<< "sec" << LL_ENDL;  			// *TODO: detect when this fails, maybe use AL_SAMPLE_  			alSourcef(mALSource, AL_SEC_OFFSET, master_offset);  		} @@ -334,18 +334,18 @@ bool LLAudioBufferOpenAL::loadWAV(const std::string& filename)  		ALenum error = alutGetError();   		if (gDirUtilp->fileExists(filename))  		{ -			llwarns << +			LL_WARNS() <<  				"LLAudioBufferOpenAL::loadWAV() Error loading "  				<< filename -				<< " " << alutGetErrorString(error) << llendl; +				<< " " << alutGetErrorString(error) << LL_ENDL;  		}  		else  		{  			// It's common for the file to not actually exist. -			lldebugs << +			LL_DEBUGS() <<  				"LLAudioBufferOpenAL::loadWAV() Error loading "  				 << filename -				 << " " << alutGetErrorString(error) << llendl; +				 << " " << alutGetErrorString(error) << LL_ENDL;  		}  		return false;  	} @@ -369,7 +369,7 @@ U32 LLAudioBufferOpenAL::getLength()  bool LLAudioEngine_OpenAL::initWind()  {  	ALenum error; -	llinfos << "LLAudioEngine_OpenAL::initWind() start" << llendl; +	LL_INFOS() << "LLAudioEngine_OpenAL::initWind() start" << LL_ENDL;  	mNumEmptyWindALBuffers = MAX_NUM_WIND_BUFFERS; @@ -379,7 +379,7 @@ bool LLAudioEngine_OpenAL::initWind()  	if((error=alGetError()) != AL_NO_ERROR)  	{ -		llwarns << "LLAudioEngine_OpenAL::initWind() Error creating wind sources: "<<error<<llendl; +		LL_WARNS() << "LLAudioEngine_OpenAL::initWind() Error creating wind sources: "<<error<<LL_ENDL;  	}  	mWindGen = new LLWindGen<WIND_SAMPLE_T>; @@ -392,18 +392,18 @@ bool LLAudioEngine_OpenAL::initWind()  	if(mWindBuf==NULL)  	{ -		llerrs << "LLAudioEngine_OpenAL::initWind() Error creating wind memory buffer" << llendl; +		LL_ERRS() << "LLAudioEngine_OpenAL::initWind() Error creating wind memory buffer" << LL_ENDL;  		return false;  	} -	llinfos << "LLAudioEngine_OpenAL::initWind() done" << llendl; +	LL_INFOS() << "LLAudioEngine_OpenAL::initWind() done" << LL_ENDL;  	return true;  }  void LLAudioEngine_OpenAL::cleanupWind()  { -	llinfos << "LLAudioEngine_OpenAL::cleanupWind()" << llendl; +	LL_INFOS() << "LLAudioEngine_OpenAL::cleanupWind()" << LL_ENDL;  	if (mWindSource != AL_NONE)  	{ @@ -479,7 +479,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)  	mNumEmptyWindALBuffers = llmin(mNumEmptyWindALBuffers + processed * 3 - unprocessed, MAX_NUM_WIND_BUFFERS-unprocessed);  	mNumEmptyWindALBuffers = llmax(mNumEmptyWindALBuffers, 0); -	//llinfos << "mNumEmptyWindALBuffers: " << mNumEmptyWindALBuffers	<<" (" << unprocessed << ":" << processed << ")" << llendl; +	//LL_INFOS() << "mNumEmptyWindALBuffers: " << mNumEmptyWindALBuffers	<<" (" << unprocessed << ":" << processed << ")" << LL_ENDL;  	while(processed--) // unqueue old buffers  	{ @@ -490,7 +490,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)  		error = alGetError();  		if(error != AL_NO_ERROR)  		{ -			llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (unqueuing) buffers" << llendl; +			LL_WARNS() << "LLAudioEngine_OpenAL::updateWind() error swapping (unqueuing) buffers" << LL_ENDL;  		}  		else  		{ @@ -506,7 +506,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)  		alGenBuffers(1,&buffer);  		if((error=alGetError()) != AL_NO_ERROR)  		{ -			llwarns << "LLAudioEngine_OpenAL::updateWind() Error creating wind buffer: " << error << llendl; +			LL_WARNS() << "LLAudioEngine_OpenAL::updateWind() Error creating wind buffer: " << error << LL_ENDL;  			break;  		} @@ -519,14 +519,14 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)  		error = alGetError();  		if(error != AL_NO_ERROR)  		{ -			llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (bufferdata) buffers" << llendl; +			LL_WARNS() << "LLAudioEngine_OpenAL::updateWind() error swapping (bufferdata) buffers" << LL_ENDL;  		}  		alSourceQueueBuffers(mWindSource, 1, &buffer);  		error = alGetError();  		if(error != AL_NO_ERROR)  		{ -			llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (queuing) buffers" << llendl; +			LL_WARNS() << "LLAudioEngine_OpenAL::updateWind() error swapping (queuing) buffers" << LL_ENDL;  		}  		--mNumEmptyWindALBuffers; @@ -538,7 +538,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)  	{  		alSourcePlay(mWindSource); -		lldebugs << "Wind had stopped - probably ran out of buffers - restarting: " << (unprocessed+mNumEmptyWindALBuffers) << " now queued." << llendl; +		LL_DEBUGS() << "Wind had stopped - probably ran out of buffers - restarting: " << (unprocessed+mNumEmptyWindALBuffers) << " now queued." << LL_ENDL;  	}  } diff --git a/indra/llaudio/lllistener_openal.cpp b/indra/llaudio/lllistener_openal.cpp index b3d4b02f09..9dd4c86854 100755 --- a/indra/llaudio/lllistener_openal.cpp +++ b/indra/llaudio/lllistener_openal.cpp @@ -41,13 +41,13 @@ LLListener_OpenAL::~LLListener_OpenAL()  void LLListener_OpenAL::translate(LLVector3 offset)  { -	//llinfos << "LLListener_OpenAL::translate() : " << offset << llendl; +	//LL_INFOS() << "LLListener_OpenAL::translate() : " << offset << LL_ENDL;  	LLListener::translate(offset);  }  void LLListener_OpenAL::setPosition(LLVector3 pos)  { -	//llinfos << "LLListener_OpenAL::setPosition() : " << pos << llendl; +	//LL_INFOS() << "LLListener_OpenAL::setPosition() : " << pos << LL_ENDL;  	LLListener::setPosition(pos);  } @@ -58,7 +58,7 @@ void LLListener_OpenAL::setVelocity(LLVector3 vel)  void LLListener_OpenAL::orient(LLVector3 up, LLVector3 at)  { -	//llinfos << "LLListener_OpenAL::orient() up: " << up << " at: " << at << llendl; +	//LL_INFOS() << "LLListener_OpenAL::orient() up: " << up << " at: " << at << LL_ENDL;  	LLListener::orient(up, at);  } @@ -84,7 +84,7 @@ void LLListener_OpenAL::commitDeferredChanges()  void LLListener_OpenAL::setDopplerFactor(F32 factor)  { -	//llinfos << "LLListener_OpenAL::setDopplerFactor() : " << factor << llendl; +	//LL_INFOS() << "LLListener_OpenAL::setDopplerFactor() : " << factor << LL_ENDL;  	alDopplerFactor(factor);  } @@ -92,7 +92,7 @@ F32 LLListener_OpenAL::getDopplerFactor()  {  	ALfloat factor;  	factor = alGetFloat(AL_DOPPLER_FACTOR); -	//llinfos << "LLListener_OpenAL::getDopplerFactor() : " << factor << llendl; +	//LL_INFOS() << "LLListener_OpenAL::getDopplerFactor() : " << factor << LL_ENDL;  	return factor;  } diff --git a/indra/llcharacter/llkeyframewalkmotion.cpp b/indra/llcharacter/llkeyframewalkmotion.cpp index 8c9477f80d..65c1fcd99d 100755 --- a/indra/llcharacter/llkeyframewalkmotion.cpp +++ b/indra/llcharacter/llkeyframewalkmotion.cpp @@ -383,7 +383,7 @@ BOOL LLFlyAdjustMotion::onUpdate(F32 time, U8* joint_mask)  	F32 target_roll = llclamp(ang_vel.mV[VZ], -4.f, 4.f) * roll_factor;  	// roll is critically damped interpolation between current roll and angular velocity-derived target roll -	mRoll = LLSmoothInterpolation::lerp(mRoll, target_roll, LLUnits::Milliseconds::fromValue(100)); +	mRoll = LLSmoothInterpolation::lerp(mRoll, target_roll, U32Milliseconds(100));  	LLQuaternion roll(mRoll, LLVector3(0.f, 0.f, 1.f));  	mPelvisState->setRotation(roll); diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 6f128d0a20..1b1aada8c1 100755 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -449,7 +449,7 @@ namespace LLError  			mTimeFunction(NULL),  			mFileRecorder(NULL),  			mFixedBufferRecorder(NULL), -			mShouldLogCallCounter(NULL) +			mShouldLogCallCounter(0)  		{}  		~Settings() @@ -548,12 +548,12 @@ namespace LLError  #else  #if LL_LINUX  		// gross, but typeid comparison seems to always fail here with gcc4.1 -		if (0 != strcmp(site.mClassInfo.name(), typeid(NoClassInfo).name())) +		if (0 != strcmp(mClassInfo.name(), typeid(NoClassInfo).name()))  #else -		if (site.mClassInfo != typeid(NoClassInfo)) +		if (mClassInfo != typeid(NoClassInfo))  #endif // LL_LINUX  		{ -			mFunctionString = className(site.mClassInfo) + "::"; +			mFunctionString = className(mClassInfo) + "::";  		}  #endif  		mFunctionString += std::string(mFunction) + ":"; @@ -1065,8 +1065,8 @@ namespace LLError  		s.mShouldLogCallCounter++; -		std::string& class_name = className(site.mClassInfo); -		std::string& function_name = functionName(site.mFunction); +		const std::string& class_name = className(site.mClassInfo); +		std::string function_name = functionName(site.mFunction);  #if LL_LINUX  		// gross, but typeid comparison seems to always fail here with gcc4.1  		if (0 != strcmp(site.mClassInfo.name(), typeid(NoClassInfo).name())) diff --git a/indra/llcommon/llerror.h b/indra/llcommon/llerror.h index 7810676388..af76a7653a 100755 --- a/indra/llcommon/llerror.h +++ b/indra/llcommon/llerror.h @@ -308,7 +308,7 @@ typedef LLError::NoClassInfo _LL_CLASS_TO_LOG;  #define lllog(level, once, ...)																	          \  	do {                                                                                                  \  		const char* tags[] = {"", ##__VA_ARGS__};													      \ -		size_t tag_count = LL_ARRAY_SIZE(tags) - 1;														  \ +		::size_t tag_count = LL_ARRAY_SIZE(tags) - 1;													  \  		static LLError::CallSite _site(                                                                   \  		    level, __FILE__, __LINE__, typeid(_LL_CLASS_TO_LOG), __FUNCTION__, once, &tags[1], tag_count);\  		if (LL_UNLIKELY(_site.shouldLog()))			                                                      \ diff --git a/indra/llcommon/llfasttimer.cpp b/indra/llcommon/llfasttimer.cpp index 8f86a1dfbc..5f92c66f47 100755 --- a/indra/llcommon/llfasttimer.cpp +++ b/indra/llcommon/llfasttimer.cpp @@ -339,7 +339,7 @@ void TimeBlock::logStats()  		}  		call_count++; -		LLUnit<F64, LLUnits::Seconds> total_time(0); +		F64Seconds total_time(0);  		LLSD sd;  		{ @@ -382,11 +382,11 @@ void TimeBlock::dumpCurTimes()  		++it)  	{  		TimeBlock* timerp = (*it); -		LLUnit<F64, LLUnits::Seconds> total_time = last_frame_recording.getSum(*timerp); +		F64Seconds total_time = last_frame_recording.getSum(*timerp);  		U32 num_calls = last_frame_recording.getSum(timerp->callCount());  		// Don't bother with really brief times, keep output concise -		if (total_time < LLUnits::Milliseconds::fromValue(0.1f)) continue; +		if (total_time < F32Milliseconds(0.1f)) continue;  		std::ostringstream out_str;  		TimeBlock* parent_timerp = timerp; @@ -466,11 +466,11 @@ void TimeBlockAccumulator::reset( const TimeBlockAccumulator* other )  	}  } -LLUnit<F64, LLUnits::Seconds> BlockTimer::getElapsedTime() +F64Seconds BlockTimer::getElapsedTime()  {  	U64 total_time = TimeBlock::getCPUClockCount64() - mStartTime; -	return LLUnits::Seconds::fromValue((F64)total_time / (F64)TimeBlock::countsPerSecond()); +	return F64Seconds((F64)total_time / (F64)TimeBlock::countsPerSecond());  } diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index 73c40749ed..ccf71c3f4c 100755 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -48,7 +48,7 @@ public:  	BlockTimer(TimeBlock& timer);  	~BlockTimer(); -	LLUnit<F64, LLUnits::Seconds> getElapsedTime(); +	F64Seconds getElapsedTime();  private: diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp index a9256124f2..c59b61471a 100755 --- a/indra/llcommon/llmemory.cpp +++ b/indra/llcommon/llmemory.cpp @@ -47,11 +47,11 @@  //static  char* LLMemory::reserveMem = 0; -U32 LLMemory::sAvailPhysicalMemInKB = U32_MAX ; -U32 LLMemory::sMaxPhysicalMemInKB = 0; -U32 LLMemory::sAllocatedMemInKB = 0; -U32 LLMemory::sAllocatedPageSizeInKB = 0 ; -U32 LLMemory::sMaxHeapSizeInKB = U32_MAX ; +U32Kibibytes LLMemory::sAvailPhysicalMemInKB(U32_MAX); +U32Kibibytes LLMemory::sMaxPhysicalMemInKB(0); +U32Kibibytes LLMemory::sAllocatedMemInKB(0); +U32Kibibytes LLMemory::sAllocatedPageSizeInKB(0); +U32Kibibytes LLMemory::sMaxHeapSizeInKB(U32_MAX);  BOOL LLMemory::sEnableMemoryFailurePrevention = FALSE;  #if __DEBUG_PRIVATE_MEM__ @@ -116,7 +116,7 @@ void LLMemory::updateMemoryInfo()  	sAllocatedMemInKB = (U32)(counters.WorkingSetSize / 1024) ;  	sAllocatedPageSizeInKB = (U32)(counters.PagefileUsage / 1024) ; -	U32 avail_phys, avail_virtual; +	U32Kibibytes avail_phys, avail_virtual;  	LLMemoryInfo::getAvailableMemoryKB(avail_phys, avail_virtual) ;  	sMaxPhysicalMemInKB = llmin(avail_phys + sAllocatedMemInKB, sMaxHeapSizeInKB); @@ -232,19 +232,19 @@ bool LLMemory::isMemoryPoolLow()  }  //static  -U32 LLMemory::getAvailableMemKB()  +U32Kibibytes LLMemory::getAvailableMemKB()   {  	return sAvailPhysicalMemInKB ;  }  //static  -U32 LLMemory::getMaxMemKB()  +U32Kibibytes LLMemory::getMaxMemKB()   {  	return sMaxPhysicalMemInKB ;  }  //static  -U32 LLMemory::getAllocatedMemKB()  +U32Kibibytes LLMemory::getAllocatedMemKB()   {  	return sAllocatedMemInKB ;  } diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index a24d97576f..c45c7ed213 100755 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -27,6 +27,7 @@  #define LLMEMORY_H  #include "linden_common.h" +#include "llunit.h"  #if !LL_WINDOWS  #include <stdint.h>  #endif @@ -170,17 +171,17 @@ public:  	static void logMemoryInfo(BOOL update = FALSE);  	static bool isMemoryPoolLow(); -	static U32 getAvailableMemKB() ; -	static U32 getMaxMemKB() ; -	static U32 getAllocatedMemKB() ; +	static U32Kibibytes getAvailableMemKB() ; +	static U32Kibibytes getMaxMemKB() ; +	static U32Kibibytes getAllocatedMemKB() ;  private:  	static char* reserveMem; -	static U32 sAvailPhysicalMemInKB ; -	static U32 sMaxPhysicalMemInKB ; -	static U32 sAllocatedMemInKB; -	static U32 sAllocatedPageSizeInKB ; +	static U32Kibibytes sAvailPhysicalMemInKB ; +	static U32Kibibytes sMaxPhysicalMemInKB ; +	static U32Kibibytes sAllocatedMemInKB; +	static U32Kibibytes sAllocatedPageSizeInKB ; -	static U32 sMaxHeapSizeInKB; +	static U32Kibibytes sMaxHeapSizeInKB;  	static BOOL sEnableMemoryFailurePrevention;  }; diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index cad02f491a..8f7e60fb68 100755 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -832,7 +832,7 @@ LLMemoryInfo::LLMemoryInfo()  }  #if LL_WINDOWS -static U32 LLMemoryAdjustKBResult(U32 inKB) +static U32Kibibytes LLMemoryAdjustKBResult(U32Kibibytes inKB)  {  	// Moved this here from llfloaterabout.cpp @@ -843,16 +843,16 @@ static U32 LLMemoryAdjustKBResult(U32 inKB)  	// returned from the GetMemoryStatusEx function.  Here we keep the  	// original adjustment from llfoaterabout.cpp until this can be  	// fixed somehow. -	inKB += 1024; +	inKB += U32Mibibytes(1);  	return inKB;  }  #endif -U32 LLMemoryInfo::getPhysicalMemoryKB() const +U32Kibibytes LLMemoryInfo::getPhysicalMemoryKB() const  {  #if LL_WINDOWS -	return LLMemoryAdjustKBResult(mStatsMap["Total Physical KB"].asInteger()); +	return LLMemoryAdjustKBResult(U32Kibibytes(mStatsMap["Total Physical KB"].asInteger()));  #elif LL_DARWIN  	// This might work on Linux as well.  Someone check... @@ -862,17 +862,17 @@ U32 LLMemoryInfo::getPhysicalMemoryKB() const  	size_t len = sizeof(phys);	  	sysctl(mib, 2, &phys, &len, NULL, 0); -	return (U32)(phys >> 10); +	return U32Bytes(phys);  #elif LL_LINUX  	U64 phys = 0;  	phys = (U64)(getpagesize()) * (U64)(get_phys_pages()); -	return (U32)(phys >> 10); +	return U32Bytes(phys);  #elif LL_SOLARIS  	U64 phys = 0;  	phys = (U64)(getpagesize()) * (U64)(sysconf(_SC_PHYS_PAGES)); -	return (U32)(phys >> 10); +	return U32Bytes(phys);  #else  	return 0; @@ -880,24 +880,24 @@ U32 LLMemoryInfo::getPhysicalMemoryKB() const  #endif  } -U32 LLMemoryInfo::getPhysicalMemoryClamped() const +U32Bytes LLMemoryInfo::getPhysicalMemoryClamped() const  {  	// Return the total physical memory in bytes, but clamp it  	// to no more than U32_MAX -	U32 phys_kb = getPhysicalMemoryKB(); +	U32Bytes phys_kb = getPhysicalMemoryKB();  	if (phys_kb >= 4194304 /* 4GB in KB */)  	{ -		return U32_MAX; +		return U32Bytes(U32_MAX);  	}  	else  	{ -		return phys_kb << 10; +		return phys_kb;  	}  }  //static -void LLMemoryInfo::getAvailableMemoryKB(U32& avail_physical_mem_kb, U32& avail_virtual_mem_kb) +void LLMemoryInfo::getAvailableMemoryKB(U32Kibibytes& avail_physical_mem_kb, U32Kibibytes& avail_virtual_mem_kb)  {  #if LL_WINDOWS  	// Sigh, this shouldn't be a static method, then we wouldn't have to diff --git a/indra/llcommon/llsys.h b/indra/llcommon/llsys.h index aa60fc9b2e..ad4f243d05 100755 --- a/indra/llcommon/llsys.h +++ b/indra/llcommon/llsys.h @@ -112,15 +112,15 @@ public:  	LLMemoryInfo(); ///< Default constructor  	void stream(std::ostream& s) const;	///< output text info to s -	U32 getPhysicalMemoryKB() const; ///< Memory size in KiloBytes +	U32Kibibytes getPhysicalMemoryKB() const;   	/*! Memory size in bytes, if total memory is >= 4GB then U32_MAX will  	**  be returned.  	*/ -	U32 getPhysicalMemoryClamped() const; ///< Memory size in clamped bytes +	U32Bytes getPhysicalMemoryClamped() const; ///< Memory size in clamped bytes  	//get the available memory infomation in KiloBytes. -	static void getAvailableMemoryKB(U32& avail_physical_mem_kb, U32& avail_virtual_mem_kb); +	static void getAvailableMemoryKB(U32Kibibytes& avail_physical_mem_kb, U32Kibibytes& avail_virtual_mem_kb);  	// Retrieve a map of memory statistics. The keys of the map are platform-  	// dependent. The values are in kilobytes to try to avoid integer overflow. diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp index a2c5f3d699..74f3a7f587 100755 --- a/indra/llcommon/lltimer.cpp +++ b/indra/llcommon/lltimer.cpp @@ -262,7 +262,7 @@ LLUnitImplicit<U64, LLUnits::Microseconds> totalTime()  	}  	// Return the total clock tick count in microseconds. -	return LLUnits::Microseconds::fromValue(gTotalTimeClockCount*gClocksToMicroseconds); +	return U64Microseconds(gTotalTimeClockCount*gClocksToMicroseconds);  } diff --git a/indra/llcommon/lltraceaccumulators.h b/indra/llcommon/lltraceaccumulators.h index ef73bd3091..73da6bd2d8 100644 --- a/indra/llcommon/lltraceaccumulators.h +++ b/indra/llcommon/lltraceaccumulators.h @@ -418,7 +418,7 @@ namespace LLTrace  	class TimeBlockAccumulator  	{  	public: -		typedef LLUnit<F64, LLUnits::Seconds> value_t; +		typedef F64Seconds value_t;  		typedef TimeBlockAccumulator self_t;  		// fake classes that allows us to view different facets of underlying statistic @@ -429,7 +429,7 @@ namespace LLTrace  		struct SelfTimeFacet  		{ -			typedef LLUnit<F64, LLUnits::Seconds> value_t; +			typedef F64Seconds value_t;  		};  		TimeBlockAccumulator(); @@ -492,7 +492,7 @@ namespace LLTrace  		struct ChildMemFacet  		{ -			typedef LLUnit<F64, LLUnits::Bytes> value_t; +			typedef F64Bytes value_t;  		};  		MemStatAccumulator() diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp index 42d97ce314..bc98eebf31 100644 --- a/indra/llcommon/lltracerecording.cpp +++ b/indra/llcommon/lltracerecording.cpp @@ -95,7 +95,7 @@ void Recording::handleReset()  {  	mBuffers.write()->reset(); -	mElapsedSeconds = LLUnits::Seconds::fromValue(0.0); +	mElapsedSeconds = F64Seconds(0.0);  	mSamplingTimer.reset();  } @@ -128,17 +128,17 @@ void Recording::appendRecording( Recording& other )  	mElapsedSeconds += other.mElapsedSeconds;  } -LLUnit<F64, LLUnits::Seconds> Recording::getSum(const TraceType<TimeBlockAccumulator>& stat) +F64Seconds Recording::getSum(const TraceType<TimeBlockAccumulator>& stat)  {  	const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()]; -	return LLUnits::Seconds::fromValue((F64)(accumulator.mTotalTimeCounter - accumulator.mStartTotalTimeCounter)  +	return F64Seconds((F64)(accumulator.mTotalTimeCounter - accumulator.mStartTotalTimeCounter)   				/ (F64)LLTrace::TimeBlock::countsPerSecond());  } -LLUnit<F64, LLUnits::Seconds> Recording::getSum(const TraceType<TimeBlockAccumulator::SelfTimeFacet>& stat) +F64Seconds Recording::getSum(const TraceType<TimeBlockAccumulator::SelfTimeFacet>& stat)  {  	const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()]; -	return LLUnits::Seconds::fromValue((F64)(accumulator.mSelfTimeCounter) / (F64)LLTrace::TimeBlock::countsPerSecond()); +	return F64Seconds((F64)(accumulator.mSelfTimeCounter) / (F64)LLTrace::TimeBlock::countsPerSecond());  } @@ -147,19 +147,19 @@ U32 Recording::getSum(const TraceType<TimeBlockAccumulator::CallCountFacet>& sta  	return mBuffers->mStackTimers[stat.getIndex()].mCalls;  } -LLUnit<F64, LLUnits::Seconds> Recording::getPerSec(const TraceType<TimeBlockAccumulator>& stat) +F64Seconds Recording::getPerSec(const TraceType<TimeBlockAccumulator>& stat)  {  	const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()]; -	return LLUnits::Seconds::fromValue((F64)(accumulator.mTotalTimeCounter - accumulator.mStartTotalTimeCounter)  +	return F64Seconds((F64)(accumulator.mTotalTimeCounter - accumulator.mStartTotalTimeCounter)   				/ ((F64)LLTrace::TimeBlock::countsPerSecond() * mElapsedSeconds.value()));  } -LLUnit<F64, LLUnits::Seconds> Recording::getPerSec(const TraceType<TimeBlockAccumulator::SelfTimeFacet>& stat) +F64Seconds Recording::getPerSec(const TraceType<TimeBlockAccumulator::SelfTimeFacet>& stat)  {  	const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()]; -	return LLUnits::Seconds::fromValue((F64)(accumulator.mSelfTimeCounter)  +	return F64Seconds((F64)(accumulator.mSelfTimeCounter)   			/ ((F64)LLTrace::TimeBlock::countsPerSecond() * mElapsedSeconds.value()));  } @@ -168,54 +168,54 @@ F32 Recording::getPerSec(const TraceType<TimeBlockAccumulator::CallCountFacet>&  	return (F32)mBuffers->mStackTimers[stat.getIndex()].mCalls / mElapsedSeconds.value();  } -LLUnit<F64, LLUnits::Bytes> Recording::getMin(const TraceType<MemStatAccumulator>& stat) +F64Bytes Recording::getMin(const TraceType<MemStatAccumulator>& stat)  { -	return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mSize.getMin()); +	return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mSize.getMin());  } -LLUnit<F64, LLUnits::Bytes> Recording::getMean(const TraceType<MemStatAccumulator>& stat) +F64Bytes Recording::getMean(const TraceType<MemStatAccumulator>& stat)  { -	return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mSize.getMean()); +	return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mSize.getMean());  } -LLUnit<F64, LLUnits::Bytes> Recording::getMax(const TraceType<MemStatAccumulator>& stat) +F64Bytes Recording::getMax(const TraceType<MemStatAccumulator>& stat)  { -	return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mSize.getMax()); +	return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mSize.getMax());  } -LLUnit<F64, LLUnits::Bytes> Recording::getStandardDeviation(const TraceType<MemStatAccumulator>& stat) +F64Bytes Recording::getStandardDeviation(const TraceType<MemStatAccumulator>& stat)  { -	return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mSize.getStandardDeviation()); +	return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mSize.getStandardDeviation());  } -LLUnit<F64, LLUnits::Bytes> Recording::getLastValue(const TraceType<MemStatAccumulator>& stat) +F64Bytes Recording::getLastValue(const TraceType<MemStatAccumulator>& stat)  { -	return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mSize.getLastValue()); +	return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mSize.getLastValue());  } -LLUnit<F64, LLUnits::Bytes> Recording::getMin(const TraceType<MemStatAccumulator::ChildMemFacet>& stat) +F64Bytes Recording::getMin(const TraceType<MemStatAccumulator::ChildMemFacet>& stat)  { -	return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mChildSize.getMin()); +	return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mChildSize.getMin());  } -LLUnit<F64, LLUnits::Bytes> Recording::getMean(const TraceType<MemStatAccumulator::ChildMemFacet>& stat) +F64Bytes Recording::getMean(const TraceType<MemStatAccumulator::ChildMemFacet>& stat)  { -	return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mChildSize.getMean()); +	return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mChildSize.getMean());  } -LLUnit<F64, LLUnits::Bytes> Recording::getMax(const TraceType<MemStatAccumulator::ChildMemFacet>& stat) +F64Bytes Recording::getMax(const TraceType<MemStatAccumulator::ChildMemFacet>& stat)  { -	return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mChildSize.getMax()); +	return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mChildSize.getMax());  } -LLUnit<F64, LLUnits::Bytes> Recording::getStandardDeviation(const TraceType<MemStatAccumulator::ChildMemFacet>& stat) +F64Bytes Recording::getStandardDeviation(const TraceType<MemStatAccumulator::ChildMemFacet>& stat)  { -	return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mChildSize.getStandardDeviation()); +	return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mChildSize.getStandardDeviation());  } -LLUnit<F64, LLUnits::Bytes> Recording::getLastValue(const TraceType<MemStatAccumulator::ChildMemFacet>& stat) +F64Bytes Recording::getLastValue(const TraceType<MemStatAccumulator::ChildMemFacet>& stat)  { -	return LLUnits::Bytes::fromValue(mBuffers->mMemStats[stat.getIndex()].mChildSize.getLastValue()); +	return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mChildSize.getLastValue());  }  U32 Recording::getSum(const TraceType<MemStatAccumulator::AllocationCountFacet>& stat) @@ -427,9 +427,9 @@ void PeriodicRecording::appendPeriodicRecording( PeriodicRecording& other )  	getCurRecording().setPlayState(getPlayState());  } -LLUnit<F64, LLUnits::Seconds> PeriodicRecording::getDuration() const +F64Seconds PeriodicRecording::getDuration() const  { -	LLUnit<F64, LLUnits::Seconds> duration; +	F64Seconds duration;  	size_t num_periods = mRecordingPeriods.size();  	for (size_t i = 1; i <= num_periods; i++)  	{ diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h index 3722a61327..f5fb2bf561 100644 --- a/indra/llcommon/lltracerecording.h +++ b/indra/llcommon/lltracerecording.h @@ -166,26 +166,26 @@ namespace LLTrace  		void makeUnique() { mBuffers.makeUnique(); }  		// Timer accessors -		LLUnit<F64, LLUnits::Seconds> getSum(const TraceType<TimeBlockAccumulator>& stat); -		LLUnit<F64, LLUnits::Seconds> getSum(const TraceType<TimeBlockAccumulator::SelfTimeFacet>& stat); +		F64Seconds getSum(const TraceType<TimeBlockAccumulator>& stat); +		F64Seconds getSum(const TraceType<TimeBlockAccumulator::SelfTimeFacet>& stat);  		U32 getSum(const TraceType<TimeBlockAccumulator::CallCountFacet>& stat); -		LLUnit<F64, LLUnits::Seconds> getPerSec(const TraceType<TimeBlockAccumulator>& stat); -		LLUnit<F64, LLUnits::Seconds> getPerSec(const TraceType<TimeBlockAccumulator::SelfTimeFacet>& stat); +		F64Seconds getPerSec(const TraceType<TimeBlockAccumulator>& stat); +		F64Seconds getPerSec(const TraceType<TimeBlockAccumulator::SelfTimeFacet>& stat);  		F32 getPerSec(const TraceType<TimeBlockAccumulator::CallCountFacet>& stat);  		// Memory accessors -		LLUnit<F64, LLUnits::Bytes> getMin(const TraceType<MemStatAccumulator>& stat); -		LLUnit<F64, LLUnits::Bytes> getMean(const TraceType<MemStatAccumulator>& stat); -		LLUnit<F64, LLUnits::Bytes> getMax(const TraceType<MemStatAccumulator>& stat); -		LLUnit<F64, LLUnits::Bytes> getStandardDeviation(const TraceType<MemStatAccumulator>& stat); -		LLUnit<F64, LLUnits::Bytes> getLastValue(const TraceType<MemStatAccumulator>& stat); - -		LLUnit<F64, LLUnits::Bytes> getMin(const TraceType<MemStatAccumulator::ChildMemFacet>& stat); -		LLUnit<F64, LLUnits::Bytes> getMean(const TraceType<MemStatAccumulator::ChildMemFacet>& stat); -		LLUnit<F64, LLUnits::Bytes> getMax(const TraceType<MemStatAccumulator::ChildMemFacet>& stat); -		LLUnit<F64, LLUnits::Bytes> getStandardDeviation(const TraceType<MemStatAccumulator::ChildMemFacet>& stat); -		LLUnit<F64, LLUnits::Bytes> getLastValue(const TraceType<MemStatAccumulator::ChildMemFacet>& stat); +		F64Bytes getMin(const TraceType<MemStatAccumulator>& stat); +		F64Bytes getMean(const TraceType<MemStatAccumulator>& stat); +		F64Bytes getMax(const TraceType<MemStatAccumulator>& stat); +		F64Bytes getStandardDeviation(const TraceType<MemStatAccumulator>& stat); +		F64Bytes getLastValue(const TraceType<MemStatAccumulator>& stat); + +		F64Bytes getMin(const TraceType<MemStatAccumulator::ChildMemFacet>& stat); +		F64Bytes getMean(const TraceType<MemStatAccumulator::ChildMemFacet>& stat); +		F64Bytes getMax(const TraceType<MemStatAccumulator::ChildMemFacet>& stat); +		F64Bytes getStandardDeviation(const TraceType<MemStatAccumulator::ChildMemFacet>& stat); +		F64Bytes getLastValue(const TraceType<MemStatAccumulator::ChildMemFacet>& stat);  		U32 getSum(const TraceType<MemStatAccumulator::AllocationCountFacet>& stat);  		U32 getSum(const TraceType<MemStatAccumulator::DeallocationCountFacet>& stat); @@ -295,7 +295,7 @@ namespace LLTrace  		U32 getSampleCount(const TraceType<EventAccumulator>& stat); -		LLUnit<F64, LLUnits::Seconds> getDuration() const { return mElapsedSeconds; } +		F64Seconds getDuration() const { return mElapsedSeconds; }  	protected:  		friend class ThreadRecorder; @@ -310,7 +310,7 @@ namespace LLTrace  		class ThreadRecorder* getThreadRecorder();   		LLTimer											mSamplingTimer; -		LLUnit<F64, LLUnits::Seconds>					mElapsedSeconds; +		F64Seconds					mElapsedSeconds;  		LLCopyOnWritePointer<AccumulatorBufferGroup>	mBuffers;  		bool											mInHandOff; @@ -325,7 +325,7 @@ namespace LLTrace  		void nextPeriod();  		size_t getNumRecordedPeriods() { return mNumPeriods; } -		LLUnit<F64, LLUnits::Seconds> getDuration() const; +		F64Seconds getDuration() const;  		void appendPeriodicRecording(PeriodicRecording& other);  		void appendRecording(Recording& recording); @@ -347,7 +347,7 @@ namespace LLTrace  			for (S32 i = 1; i <= num_periods; i++)  			{  				Recording& recording = getPrevRecording(i); -				num_samples += Recording.getSampleCount(stat); +				num_samples += recording.getSampleCount(stat);  			}  			return num_samples;          } @@ -366,7 +366,7 @@ namespace LLTrace  			typename T::value_t min_val = std::numeric_limits<typename T::value_t>::max();  			for (S32 i = 1; i <= num_periods; i++)  			{ -				Recording& recording = getPrevRecording(i) +				Recording& recording = getPrevRecording(i);  				min_val = llmin(min_val, recording.getSum(stat));  			}  			return min_val; @@ -398,7 +398,7 @@ namespace LLTrace  			size_t total_periods = mNumPeriods;  			num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); -			RelatedTypes<typename T::value_t>::fractional_t min_val = std::numeric_limits<F64>::max(); +			typename RelatedTypes<typename T::value_t>::fractional_t min_val = std::numeric_limits<F64>::max();  			for (S32 i = 1; i <= num_periods; i++)  			{  				Recording& recording = getPrevRecording(i); @@ -485,7 +485,7 @@ namespace LLTrace  			size_t total_periods = mNumPeriods;  			num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); -			typename RelatedTypes<T::value_t>::fractional_t mean = 0; +			typename RelatedTypes<typename T::value_t>::fractional_t mean(0);  			for (S32 i = 1; i <= num_periods; i++)  			{ @@ -495,9 +495,9 @@ namespace LLTrace  					mean += recording.getSum(stat);  				}  			} -			return RelatedTypes<T::value_t>::fractional_t(num_periods -														? mean / num_periods -														: NaN); +			return (num_periods +				? typename RelatedTypes<typename T::value_t>::fractional_t(mean / num_periods) +				: typename RelatedTypes<typename T::value_t>::fractional_t(NaN));  		}  		template<typename T> @@ -525,7 +525,7 @@ namespace LLTrace  			size_t total_periods = mNumPeriods;  			num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); -			typename RelatedTypes<T::value_t>::fractional_t mean = 0; +			typename RelatedTypes<typename T::value_t>::fractional_t mean = 0;  			for (S32 i = 1; i <= num_periods; i++)  			{ @@ -536,9 +536,9 @@ namespace LLTrace  				}  			} -			return RelatedTypes<T::value_t>::fractional_t(num_periods -														? mean / num_periods -														: NaN); +			return (num_periods +				? typename RelatedTypes<typename T::value_t>::fractional_t(mean / num_periods) +				: typename RelatedTypes<typename T::value_t>::fractional_t(NaN));  		}  		template<typename T> diff --git a/indra/llcommon/llunit.h b/indra/llcommon/llunit.h index b135be48fa..b62bebc440 100644 --- a/indra/llcommon/llunit.h +++ b/indra/llcommon/llunit.h @@ -39,7 +39,7 @@ struct LLUnit  	typedef STORAGE_TYPE storage_t;  	// value initialization -	LLUnit(storage_t value = storage_t()) +	explicit LLUnit(storage_t value = storage_t())  	:	mValue(value)  	{} @@ -643,7 +643,58 @@ LL_DECLARE_DERIVED_UNIT(Megabytes, * 1000,		Gigabytes, "GB");  LL_DECLARE_DERIVED_UNIT(Bytes, * 1024,			Kibibytes, "KiB");  LL_DECLARE_DERIVED_UNIT(Kibibytes, * 1024,		Mibibytes, "MiB");  LL_DECLARE_DERIVED_UNIT(Mibibytes, * 1024,		Gibibytes, "GiB"); +} + +typedef LLUnit<F32, LLUnits::Bytes>     F32Bytes; +typedef LLUnit<F32, LLUnits::Kilobytes> F32Kilobytes; +typedef LLUnit<F32, LLUnits::Megabytes> F32Megabytes; +typedef LLUnit<F32, LLUnits::Gigabytes> F32Gigabytes; +typedef LLUnit<F32, LLUnits::Kibibytes> F32Kibibytes; +typedef LLUnit<F32, LLUnits::Mibibytes> F32Mibibytes; +typedef LLUnit<F32, LLUnits::Gibibytes> F32Gibibytes; + +typedef LLUnit<F64, LLUnits::Bytes>     F64Bytes; +typedef LLUnit<F64, LLUnits::Kilobytes> F64Kilobytes; +typedef LLUnit<F64, LLUnits::Megabytes> F64Megabytes; +typedef LLUnit<F64, LLUnits::Gigabytes> F64Gigabytes; +typedef LLUnit<F64, LLUnits::Kibibytes> F64Kibibytes; +typedef LLUnit<F64, LLUnits::Mibibytes> F64Mibibytes; +typedef LLUnit<F64, LLUnits::Gibibytes> F64Gibibytes; + +typedef LLUnit<S32, LLUnits::Bytes>     S32Bytes; +typedef LLUnit<S32, LLUnits::Kilobytes> S32Kilobytes; +typedef LLUnit<S32, LLUnits::Megabytes> S32Megabytes; +typedef LLUnit<S32, LLUnits::Gigabytes> S32Gigabytes; +typedef LLUnit<S32, LLUnits::Kibibytes> S32Kibibytes; +typedef LLUnit<S32, LLUnits::Mibibytes> S32Mibibytes; +typedef LLUnit<S32, LLUnits::Gibibytes> S32Gibibytes; + +typedef LLUnit<U32, LLUnits::Bytes>     U32Bytes; +typedef LLUnit<U32, LLUnits::Kilobytes> U32Kilobytes; +typedef LLUnit<U32, LLUnits::Megabytes> U32Megabytes; +typedef LLUnit<U32, LLUnits::Gigabytes> U32Gigabytes; +typedef LLUnit<U32, LLUnits::Kibibytes> U32Kibibytes; +typedef LLUnit<U32, LLUnits::Mibibytes> U32Mibibytes; +typedef LLUnit<U32, LLUnits::Gibibytes> U32Gibibytes; + +typedef LLUnit<S64, LLUnits::Bytes>     S64Bytes; +typedef LLUnit<S64, LLUnits::Kilobytes> S64Kilobytes; +typedef LLUnit<S64, LLUnits::Megabytes> S64Megabytes; +typedef LLUnit<S64, LLUnits::Gigabytes> S64Gigabytes; +typedef LLUnit<S64, LLUnits::Kibibytes> S64Kibibytes; +typedef LLUnit<S64, LLUnits::Mibibytes> S64Mibibytes; +typedef LLUnit<S64, LLUnits::Gibibytes> S64Gibibytes; + +typedef LLUnit<U64, LLUnits::Bytes>     U64Bytes; +typedef LLUnit<U64, LLUnits::Kilobytes> U64Kilobytes; +typedef LLUnit<U64, LLUnits::Megabytes> U64Megabytes; +typedef LLUnit<U64, LLUnits::Gigabytes> U64Gigabytes; +typedef LLUnit<U64, LLUnits::Kibibytes> U64Kibibytes; +typedef LLUnit<U64, LLUnits::Mibibytes> U64Mibibytes; +typedef LLUnit<U64, LLUnits::Gibibytes> U64Gibibytes; +namespace LLUnits +{  LL_DECLARE_DERIVED_UNIT(Bytes, / 8,				Bits, "b");  LL_DECLARE_DERIVED_UNIT(Bits, * 1000,			Kilobits, "Kb");  LL_DECLARE_DERIVED_UNIT(Kilobits, * 1000,		Megabits, "Mb"); @@ -651,7 +702,58 @@ LL_DECLARE_DERIVED_UNIT(Megabits, * 1000,		Gigabits, "Gb");  LL_DECLARE_DERIVED_UNIT(Bits, * 1024,			Kibibits, "Kib");  LL_DECLARE_DERIVED_UNIT(Kibibits, * 1024,		Mibibits, "Mib");    LL_DECLARE_DERIVED_UNIT(Mibibits, * 1024,		Gibibits, "Gib"); +} + +typedef LLUnit<F32, LLUnits::Bits>     F32Bits; +typedef LLUnit<F32, LLUnits::Kilobits> F32Kilobits; +typedef LLUnit<F32, LLUnits::Megabits> F32Megabits; +typedef LLUnit<F32, LLUnits::Gigabits> F32Gigabits; +typedef LLUnit<F32, LLUnits::Kibibits> F32Kibibits; +typedef LLUnit<F32, LLUnits::Mibibits> F32Mibibits; +typedef LLUnit<F32, LLUnits::Gibibits> F32Gibibits; +					 +typedef LLUnit<F64, LLUnits::Bits>     F64Bits; +typedef LLUnit<F64, LLUnits::Kilobits> F64Kilobits; +typedef LLUnit<F64, LLUnits::Megabits> F64Megabits; +typedef LLUnit<F64, LLUnits::Gigabits> F64Gigabits; +typedef LLUnit<F64, LLUnits::Kibibits> F64Kibibits; +typedef LLUnit<F64, LLUnits::Mibibits> F64Mibibits; +typedef LLUnit<F64, LLUnits::Gibibits> F64Gibibits; + +typedef LLUnit<S32, LLUnits::Bits>     S32Bits; +typedef LLUnit<S32, LLUnits::Kilobits> S32Kilobits; +typedef LLUnit<S32, LLUnits::Megabits> S32Megabits; +typedef LLUnit<S32, LLUnits::Gigabits> S32Gigabits; +typedef LLUnit<S32, LLUnits::Kibibits> S32Kibibits; +typedef LLUnit<S32, LLUnits::Mibibits> S32Mibibits; +typedef LLUnit<S32, LLUnits::Gibibits> S32Gibibits; + +typedef LLUnit<U32, LLUnits::Bits>     U32Bits; +typedef LLUnit<U32, LLUnits::Kilobits> U32Kilobits; +typedef LLUnit<U32, LLUnits::Megabits> U32Megabits; +typedef LLUnit<U32, LLUnits::Gigabits> U32Gigabits; +typedef LLUnit<U32, LLUnits::Kibibits> U32Kibibits; +typedef LLUnit<U32, LLUnits::Mibibits> U32Mibibits; +typedef LLUnit<U32, LLUnits::Gibibits> U32Gibibits; + +typedef LLUnit<S64, LLUnits::Bits>     S64Bits; +typedef LLUnit<S64, LLUnits::Kilobits> S64Kilobits; +typedef LLUnit<S64, LLUnits::Megabits> S64Megabits; +typedef LLUnit<S64, LLUnits::Gigabits> S64Gigabits; +typedef LLUnit<S64, LLUnits::Kibibits> S64Kibibits; +typedef LLUnit<S64, LLUnits::Mibibits> S64Mibibits; +typedef LLUnit<S64, LLUnits::Gibibits> S64Gibibits; + +typedef LLUnit<U64, LLUnits::Bits>     U64Bits; +typedef LLUnit<U64, LLUnits::Kilobits> U64Kilobits; +typedef LLUnit<U64, LLUnits::Megabits> U64Megabits; +typedef LLUnit<U64, LLUnits::Gigabits> U64Gigabits; +typedef LLUnit<U64, LLUnits::Kibibits> U64Kibibits; +typedef LLUnit<U64, LLUnits::Mibibits> U64Mibibits; +typedef LLUnit<U64, LLUnits::Gibibits> U64Gibibits; +namespace LLUnits +{  LL_DECLARE_BASE_UNIT(Seconds, "s");  LL_DECLARE_DERIVED_UNIT(Seconds, * 60,			Minutes, "min");  LL_DECLARE_DERIVED_UNIT(Minutes, * 60,			Hours, "h"); @@ -659,12 +761,97 @@ LL_DECLARE_DERIVED_UNIT(Hours, * 24,			Days, "d");  LL_DECLARE_DERIVED_UNIT(Seconds, / 1000,		Milliseconds, "ms");  LL_DECLARE_DERIVED_UNIT(Milliseconds, / 1000,	Microseconds, "\x09\x3cs");  LL_DECLARE_DERIVED_UNIT(Microseconds, / 1000,	Nanoseconds, "ns"); +} +typedef LLUnit<F32, LLUnits::Seconds>      F32Seconds; +typedef LLUnit<F32, LLUnits::Minutes>      F32Minutes; +typedef LLUnit<F32, LLUnits::Hours>        F32Hours; +typedef LLUnit<F32, LLUnits::Days>         F32Days; +typedef LLUnit<F32, LLUnits::Milliseconds> F32Milliseconds; +typedef LLUnit<F32, LLUnits::Microseconds> F32Microseconds; +typedef LLUnit<F32, LLUnits::Nanoseconds>  F32Nanoseconds; + +typedef LLUnit<F64, LLUnits::Seconds>      F64Seconds; +typedef LLUnit<F64, LLUnits::Minutes>      F64Minutes; +typedef LLUnit<F64, LLUnits::Hours>        F64Hours; +typedef LLUnit<F64, LLUnits::Days>         F64Days; +typedef LLUnit<F64, LLUnits::Milliseconds> F64Milliseconds; +typedef LLUnit<F64, LLUnits::Microseconds> F64Microseconds; +typedef LLUnit<F64, LLUnits::Nanoseconds>  F64Nanoseconds; + +typedef LLUnit<S32, LLUnits::Seconds>      S32Seconds; +typedef LLUnit<S32, LLUnits::Minutes>      S32Minutes; +typedef LLUnit<S32, LLUnits::Hours>        S32Hours; +typedef LLUnit<S32, LLUnits::Days>         S32Days; +typedef LLUnit<S32, LLUnits::Milliseconds> S32Milliseconds; +typedef LLUnit<S32, LLUnits::Microseconds> S32Microseconds; +typedef LLUnit<S32, LLUnits::Nanoseconds>  S32Nanoseconds; + +typedef LLUnit<U32, LLUnits::Seconds>      U32Seconds; +typedef LLUnit<U32, LLUnits::Minutes>      U32Minutes; +typedef LLUnit<U32, LLUnits::Hours>        U32Hours; +typedef LLUnit<U32, LLUnits::Days>         U32Days; +typedef LLUnit<U32, LLUnits::Milliseconds> U32Milliseconds; +typedef LLUnit<U32, LLUnits::Microseconds> U32Microseconds; +typedef LLUnit<U32, LLUnits::Nanoseconds>  U32Nanoseconds; + +typedef LLUnit<S64, LLUnits::Seconds>      S64Seconds; +typedef LLUnit<S64, LLUnits::Minutes>      S64Minutes; +typedef LLUnit<S64, LLUnits::Hours>        S64Hours; +typedef LLUnit<S64, LLUnits::Days>         S64Days; +typedef LLUnit<S64, LLUnits::Milliseconds> S64Milliseconds; +typedef LLUnit<S64, LLUnits::Microseconds> S64Microseconds; +typedef LLUnit<S64, LLUnits::Nanoseconds>  S64Nanoseconds; +					 +typedef LLUnit<U64, LLUnits::Seconds>      U64Seconds; +typedef LLUnit<U64, LLUnits::Minutes>      U64Minutes; +typedef LLUnit<U64, LLUnits::Hours>        U64Hours; +typedef LLUnit<U64, LLUnits::Days>         U64Days; +typedef LLUnit<U64, LLUnits::Milliseconds> U64Milliseconds; +typedef LLUnit<U64, LLUnits::Microseconds> U64Microseconds; +typedef LLUnit<U64, LLUnits::Nanoseconds>  U64Nanoseconds; + +namespace LLUnits +{  LL_DECLARE_BASE_UNIT(Meters, "m");  LL_DECLARE_DERIVED_UNIT(Meters, * 1000,			Kilometers, "km");  LL_DECLARE_DERIVED_UNIT(Meters, / 100,			Centimeters, "cm");  LL_DECLARE_DERIVED_UNIT(Meters, / 1000,			Millimeters, "mm"); +} + +typedef LLUnit<F32, LLUnits::Meters>      F32Meters; +typedef LLUnit<F32, LLUnits::Kilometers>  F32Kilometers; +typedef LLUnit<F32, LLUnits::Centimeters> F32Centimeters; +typedef LLUnit<F32, LLUnits::Millimeters> F32Millimeters; + +typedef LLUnit<F64, LLUnits::Meters>      F64Meters; +typedef LLUnit<F64, LLUnits::Kilometers>  F64Kilometers; +typedef LLUnit<F64, LLUnits::Centimeters> F64Centimeters; +typedef LLUnit<F64, LLUnits::Millimeters> F64Millimeters; + +typedef LLUnit<S32, LLUnits::Meters>      S32Meters; +typedef LLUnit<S32, LLUnits::Kilometers>  S32Kilometers; +typedef LLUnit<S32, LLUnits::Centimeters> S32Centimeters; +typedef LLUnit<S32, LLUnits::Millimeters> S32Millimeters; +typedef LLUnit<U32, LLUnits::Meters>      U32Meters; +typedef LLUnit<U32, LLUnits::Kilometers>  U32Kilometers; +typedef LLUnit<U32, LLUnits::Centimeters> U32Centimeters; +typedef LLUnit<U32, LLUnits::Millimeters> U32Millimeters; + +typedef LLUnit<S64, LLUnits::Meters>      S64Meters; +typedef LLUnit<S64, LLUnits::Kilometers>  S64Kilometers; +typedef LLUnit<S64, LLUnits::Centimeters> S64Centimeters; +typedef LLUnit<S64, LLUnits::Millimeters> S64Millimeters; + +typedef LLUnit<U64, LLUnits::Meters>      U64Meters; +typedef LLUnit<U64, LLUnits::Kilometers>  U64Kilometers; +typedef LLUnit<U64, LLUnits::Centimeters> U64Centimeters; +typedef LLUnit<U64, LLUnits::Millimeters> U64Millimeters; + +namespace LLUnits +{ +// rare units  LL_DECLARE_BASE_UNIT(Hertz, "Hz");  LL_DECLARE_DERIVED_UNIT(Hertz, * 1000,			Kilohertz, "KHz");  LL_DECLARE_DERIVED_UNIT(Kilohertz, * 1000,		Megahertz, "MHz"); diff --git a/indra/llcommon/tests/llunits_test.cpp b/indra/llcommon/tests/llunits_test.cpp index b0309585aa..8546bcbc54 100644 --- a/indra/llcommon/tests/llunits_test.cpp +++ b/indra/llcommon/tests/llunits_test.cpp @@ -112,7 +112,7 @@ namespace tut  	void units_object_t::test<4>()  	{  		// exercise math operations -		LLUnit<F32, Quatloos> quatloos = 1.f; +		LLUnit<F32, Quatloos> quatloos(1.f);  		quatloos *= 4.f;  		ensure(quatloos == 4);  		quatloos = quatloos * 2; diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp index 18154d4b0d..2bb78ea839 100755 --- a/indra/llinventory/llparcel.cpp +++ b/indra/llinventory/llparcel.cpp @@ -1082,7 +1082,7 @@ void LLParcel::startSale(const LLUUID& buyer_id, BOOL is_buyer_group)  		mGroupID.setNull();  	}  	mSaleTimerExpires.start(); -	mSaleTimerExpires.setTimerExpirySec(LLUnits::Microseconds::fromValue(DEFAULT_USEC_SALE_TIMEOUT)); +	mSaleTimerExpires.setTimerExpirySec(U64Microseconds(DEFAULT_USEC_SALE_TIMEOUT));  	mStatus = OS_LEASE_PENDING;  	mClaimDate = time(NULL);  	setAuctionID(0); diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h index 2f83836501..29db799154 100755 --- a/indra/llmath/llmath.h +++ b/indra/llmath/llmath.h @@ -30,6 +30,7 @@  #include <cmath>  #include <cstdlib>  #include <vector> +#include <limits>  #include "lldefs.h"  //#include "llstl.h" // *TODO: Remove when LLString is gone  //#include "llstring.h" // *TODO: Remove when LLString is gone @@ -83,10 +84,6 @@ const F32	OO_LN2		= 1.4426950408889634073599246810019f;  const F32	F_ALMOST_ZERO	= 0.0001f;  const F32	F_ALMOST_ONE	= 1.0f - F_ALMOST_ZERO; -const F64	NaN				= std::numeric_limits<double>::quiet_NaN(); -const F64	INFINITY		= std::numeric_limits<double>::infinity(); -const F64	MINUS_INFINITY	= std::numeric_limits<double>::infinity() * -1.0; -  // BUG: Eliminate in favor of F_APPROXIMATELY_ZERO above?  const F32 FP_MAG_THRESHOLD = 0.0000001f; diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp index fe97501658..413266a29d 100755 --- a/indra/llmessage/llassetstorage.cpp +++ b/indra/llmessage/llassetstorage.cpp @@ -194,8 +194,8 @@ LLSD LLAssetRequest::getTerseDetails() const  	sd["asset_id"] = getUUID();  	sd["type_long"] = LLAssetType::lookupHumanReadable(getType());  	sd["type"] = LLAssetType::lookup(getType()); -	sd["time"] = mTime; -	time_t timestamp = (time_t) mTime; +	sd["time"] = mTime.value(); +	time_t timestamp = (time_t) mTime.value();  	std::ostringstream time_string;  	time_string << ctime(×tamp);  	sd["time_string"] = time_string.str(); @@ -341,7 +341,7 @@ void LLAssetStorage::checkForTimeouts()  void LLAssetStorage::_cleanupRequests(BOOL all, S32 error)  { -	F64 mt_secs = LLMessageSystem::getMessageTimeSeconds(); +	F64Seconds mt_secs = LLMessageSystem::getMessageTimeSeconds();  	request_list_t timed_out;  	S32 rt; diff --git a/indra/llmessage/llassetstorage.h b/indra/llmessage/llassetstorage.h index 6ffd7ad309..6ed1027cee 100755 --- a/indra/llmessage/llassetstorage.h +++ b/indra/llmessage/llassetstorage.h @@ -119,8 +119,8 @@ public:  	BOOL	mIsTemp;  	BOOL	mIsLocal;  	BOOL	mIsUserWaiting;		// We don't want to try forever if a user is waiting for a result. -	F64		mTime;				// Message system time -	F64		mTimeout;			// Amount of time before timing out. +	F64Seconds		mTime;				// Message system time +	F64Seconds		mTimeout;			// Amount of time before timing out.  	BOOL    mIsPriority;  	BOOL	mDataSentInFirstPacket;  	BOOL	mDataIsInVFS; @@ -163,7 +163,7 @@ public:  	void	*mUserData;  	LLHost  mHost;  	BOOL	mIsTemp; -	F64		mTime;				// Message system time +	F64Seconds	mTime;				// Message system time  	BOOL    mIsPriority;  	BOOL	mDataSentInFirstPacket;  	BOOL	mDataIsInVFS; @@ -193,7 +193,7 @@ public:  	void	*mUserData;  	LLHost  mHost;  	BOOL	mIsTemp; -	F64		mTime;				// Message system time +	F64Seconds	mTime;				// Message system time  	BOOL    mIsPriority;  	BOOL	mDataSentInFirstPacket;  	BOOL	mDataIsInVFS; diff --git a/indra/llmessage/llcircuit.cpp b/indra/llmessage/llcircuit.cpp index 00e9266d47..1ace4d9b70 100755 --- a/indra/llmessage/llcircuit.cpp +++ b/indra/llmessage/llcircuit.cpp @@ -60,12 +60,12 @@  const S32 PING_START_BLOCK = 3;		// How many pings behind we have to be to consider ourself blocked.  const S32 PING_RELEASE_BLOCK = 2;	// How many pings behind we have to be to consider ourself unblocked. -const F32 TARGET_PERIOD_LENGTH = 5.f;	// seconds -const F32 LL_DUPLICATE_SUPPRESSION_TIMEOUT = 60.f; //seconds - this can be long, as time-based cleanup is +const F32Seconds TARGET_PERIOD_LENGTH(5.f); +const F32Seconds LL_DUPLICATE_SUPPRESSION_TIMEOUT(60.f); //this can be long, as time-based cleanup is  													// only done when wrapping packetids, now...  LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id,  -							 const F32 circuit_heartbeat_interval, const F32 circuit_timeout) +							 const F32Seconds circuit_heartbeat_interval, const F32Seconds circuit_timeout)  :	mHost (host),  	mWrapID(0),  	mPacketsOutID(0),  @@ -84,7 +84,7 @@ LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id,  	mPingsInTransit(0),  	mLastPingID(0),  	mPingDelay(INITIAL_PING_VALUE_MSEC),  -	mPingDelayAveraged((F32)INITIAL_PING_VALUE_MSEC),  +	mPingDelayAveraged(INITIAL_PING_VALUE_MSEC),   	mUnackedPacketCount(0),  	mUnackedPacketBytes(0),  	mLastPacketInTime(0.0), @@ -110,13 +110,13 @@ LLCircuitData::LLCircuitData(const LLHost &host, TPACKETID in_id,  {  	// Need to guarantee that this time is up to date, we may be creating a circuit even though we haven't been  	//  running a message system loop. -	F64 mt_sec = LLMessageSystem::getMessageTimeSeconds(TRUE); +	F64Seconds mt_sec = LLMessageSystem::getMessageTimeSeconds(TRUE);  	F32 distribution_offset = ll_frand();  	mPingTime = mt_sec;  	mLastPingSendTime = mt_sec + mHeartbeatInterval * distribution_offset;  	mLastPingReceivedTime = mt_sec; -	mNextPingSendTime = mLastPingSendTime + 0.95*mHeartbeatInterval + ll_frand(0.1f*mHeartbeatInterval); +	mNextPingSendTime = mLastPingSendTime + 0.95*mHeartbeatInterval + F32Seconds(ll_frand(0.1f*mHeartbeatInterval.value()));  	mPeriodTime = mt_sec;  	mLocalEndPointID.generate(); @@ -268,7 +268,7 @@ void LLCircuitData::ackReliablePacket(TPACKETID packet_num) -S32 LLCircuitData::resendUnackedPackets(const F64 now) +S32 LLCircuitData::resendUnackedPackets(const F64Seconds now)  {  	S32 resent_packets = 0;  	LLReliablePacket *packetp; @@ -355,7 +355,7 @@ S32 LLCircuitData::resendUnackedPackets(const F64 now)  			// The new method, retry time based on ping  			if (packetp->mPingBasedRetry)  			{ -				packetp->mExpirationTime = now + llmax(LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS, (LL_RELIABLE_TIMEOUT_FACTOR * getPingDelayAveraged())); +				packetp->mExpirationTime = now + llmax(LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS, F32Seconds(LL_RELIABLE_TIMEOUT_FACTOR * getPingDelayAveraged()));  			}  			else  			{ @@ -427,10 +427,11 @@ S32 LLCircuitData::resendUnackedPackets(const F64 now)  } -LLCircuit::LLCircuit(const F32 circuit_heartbeat_interval, const F32 circuit_timeout) : mLastCircuit(NULL),   -	mHeartbeatInterval(circuit_heartbeat_interval), mHeartbeatTimeout(circuit_timeout) -{ -} +LLCircuit::LLCircuit(const F32Seconds circuit_heartbeat_interval, const F32Seconds circuit_timeout)  +:	mLastCircuit(NULL),   +	mHeartbeatInterval(circuit_heartbeat_interval),  +	mHeartbeatTimeout(circuit_timeout) +{}  LLCircuit::~LLCircuit()  { @@ -521,17 +522,17 @@ void LLCircuitData::setAllowTimeout(BOOL allow)  // Reset per-period counters if necessary.  void LLCircuitData::checkPeriodTime()  { -	F64 mt_sec = LLMessageSystem::getMessageTimeSeconds(); -	F64 period_length = mt_sec - mPeriodTime; +	F64Seconds mt_sec = LLMessageSystem::getMessageTimeSeconds(); +	F64Seconds period_length = mt_sec - mPeriodTime;  	if ( period_length > TARGET_PERIOD_LENGTH)  	{ -		F32 bps_in = (F32)(mBytesInThisPeriod * 8.f / period_length); +		F32 bps_in = F32Bits(mBytesInThisPeriod).value() / period_length.value();  		if (bps_in > mPeakBPSIn)  		{  			mPeakBPSIn = bps_in;  		} -		F32 bps_out = (F32)(mBytesOutThisPeriod * 8.f / period_length); +		F32 bps_out = F32Bits(mBytesOutThisPeriod).value() / period_length.value();  		if (bps_out > mPeakBPSOut)  		{  			mPeakBPSOut = bps_out; @@ -541,7 +542,7 @@ void LLCircuitData::checkPeriodTime()  		mBytesOutLastPeriod	= mBytesOutThisPeriod;  		mBytesInThisPeriod	= 0;  		mBytesOutThisPeriod	= 0; -		mLastPeriodLength	= (F32)period_length; +		mLastPeriodLength	= period_length;  		mPeriodTime = mt_sec;  	} @@ -584,7 +585,7 @@ void LLCircuitData::addReliablePacket(S32 mSocket, U8 *buf_ptr, S32 buf_len, LLR  void LLCircuit::resendUnackedPackets(S32& unacked_list_length, S32& unacked_list_size)  { -	F64 now = LLMessageSystem::getMessageTimeSeconds(); +	F64Seconds now = LLMessageSystem::getMessageTimeSeconds();  	unacked_list_length = 0;  	unacked_list_size = 0; @@ -726,7 +727,7 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent)  		}  		else if (!receive_resent) // don't freak out over out-of-order reliable resends  		{ -			U64 time = LLMessageSystem::getMessageTimeUsecs(); +			U64Microseconds time = LLMessageSystem::getMessageTimeUsecs();  			TPACKETID index = mPacketsInID;  			S32 gap_count = 0;  			if ((index < id) && ((id - index) < 16)) @@ -742,7 +743,7 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent)  					}  //						LL_INFOS() << "adding potential lost: " << index << LL_ENDL; -					mPotentialLostPackets[index] = time; +					mPotentialLostPackets[index] = time.value();  					index++;  					index = index % LL_MAX_OUT_PACKET_ID;  					gap_count++; @@ -780,7 +781,7 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent)  void LLCircuit::updateWatchDogTimers(LLMessageSystem *msgsys)  { -	F64 cur_time = LLMessageSystem::getMessageTimeSeconds(); +	F64Seconds cur_time = LLMessageSystem::getMessageTimeSeconds();  	S32 count = mPingSet.size();  	S32 cur = 0; @@ -818,7 +819,7 @@ void LLCircuit::updateWatchDogTimers(LLMessageSystem *msgsys)  			if (cdp->updateWatchDogTimers(msgsys))              {  				// Randomize our pings a bit by doing some up to 5% early or late -				F64 dt = 0.95f*mHeartbeatInterval + ll_frand(0.1f*mHeartbeatInterval); +				F64Seconds dt = 0.95f*mHeartbeatInterval + F32Seconds(ll_frand(0.1f*mHeartbeatInterval.value()));  				// Remove it, and reinsert it with the new next ping time.  				// Always remove before changing the sorting key. @@ -846,7 +847,7 @@ void LLCircuit::updateWatchDogTimers(LLMessageSystem *msgsys)  BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys)  { -	F64 cur_time = LLMessageSystem::getMessageTimeSeconds(); +	F64Seconds cur_time = LLMessageSystem::getMessageTimeSeconds();  	mLastPingSendTime = cur_time;  	if (!checkCircuitTimeout()) @@ -963,12 +964,12 @@ BOOL LLCircuitData::updateWatchDogTimers(LLMessageSystem *msgsys)  	// be considered lost  	LLCircuitData::packet_time_map::iterator it; -	U64 timeout = (U64)(1000000.0*llmin(LL_MAX_LOST_TIMEOUT, getPingDelayAveraged() * LL_LOST_TIMEOUT_FACTOR)); +	U64Microseconds timeout = llmin(LL_MAX_LOST_TIMEOUT, F32Seconds(getPingDelayAveraged()) * LL_LOST_TIMEOUT_FACTOR); -	U64 mt_usec = LLMessageSystem::getMessageTimeUsecs(); +	U64Microseconds mt_usec = LLMessageSystem::getMessageTimeUsecs();  	for (it = mPotentialLostPackets.begin(); it != mPotentialLostPackets.end(); )  	{ -		U64 delta_t_usec = mt_usec - (*it).second; +		U64Microseconds delta_t_usec = mt_usec - (*it).second;  		if (delta_t_usec > timeout)  		{  			// let's call this one a loss! @@ -1014,7 +1015,7 @@ void LLCircuitData::clearDuplicateList(TPACKETID oldest_id)  	// Do timeout checks on everything with an ID > mHighestPacketID.  	// This should be empty except for wrapping IDs.  Thus, this should be  	// highly rare. -	U64 mt_usec = LLMessageSystem::getMessageTimeUsecs(); +	U64Microseconds mt_usec = LLMessageSystem::getMessageTimeUsecs();  	packet_time_map::iterator pit;  	for(pit = mRecentlyReceivedReliablePackets.upper_bound(mHighestPacketID); @@ -1025,8 +1026,8 @@ void LLCircuitData::clearDuplicateList(TPACKETID oldest_id)  		{  			LL_WARNS() << "Probably incorrectly timing out non-wrapped packets!" << LL_ENDL;  		} -		U64 delta_t_usec = mt_usec - (*pit).second; -		F64 delta_t_sec = delta_t_usec * SEC_PER_USEC; +		U64Microseconds delta_t_usec = mt_usec - (*pit).second; +		F64Seconds delta_t_sec = delta_t_usec;  		if (delta_t_sec > LL_DUPLICATE_SUPPRESSION_TIMEOUT)  		{  			// enough time has elapsed we're not likely to get a duplicate on this one @@ -1043,7 +1044,7 @@ void LLCircuitData::clearDuplicateList(TPACKETID oldest_id)  BOOL LLCircuitData::checkCircuitTimeout()  { -	F64 time_since_last_ping = LLMessageSystem::getMessageTimeSeconds() - mLastPingReceivedTime; +	F64Seconds time_since_last_ping = LLMessageSystem::getMessageTimeSeconds() - mLastPingReceivedTime;  	// Nota Bene: This needs to be turned off if you are debugging multiple simulators  	if (time_since_last_ping > mHeartbeatTimeout) @@ -1139,40 +1140,40 @@ std::ostream& operator<<(std::ostream& s, LLCircuitData& circuit)  	F32 age = circuit.mExistenceTimer.getElapsedTimeF32();  	using namespace std; -	s << "Circuit " << circuit.mHost << " "; -	s << circuit.mRemoteID << " "; -	s << (circuit.mbAlive ? "Alive" : "Not Alive") << " "; -	s << (circuit.mbAllowTimeout ? "Timeout Allowed" : "Timeout Not Allowed"); -	s << endl; - -	s << " Packets Lost: " << circuit.mPacketsLost; -	s << " Measured Ping: " << circuit.mPingDelay; -	s << " Averaged Ping: " << circuit.mPingDelayAveraged; -	s << endl; - -	s << "Global In/Out " << S32(age) << " sec"; -	s << " KBytes: " << circuit.mBytesIn / 1024 << "/" << circuit.mBytesOut / 1024; -	s << " Kbps: "; -	s << S32(circuit.mBytesIn * 8.f / circuit.mExistenceTimer.getElapsedTimeF32() / 1024.f); -	s << "/"; -	s << S32(circuit.mBytesOut * 8.f / circuit.mExistenceTimer.getElapsedTimeF32() / 1024.f); -	s << " Packets: " << circuit.mPacketsIn << "/" << circuit.mPacketsOut; -	s << endl; - -	s << "Recent In/Out   " << S32(circuit.mLastPeriodLength) << " sec"; -	s << " KBytes: "; -	s << circuit.mBytesInLastPeriod / 1024; -	s << "/"; -	s << circuit.mBytesOutLastPeriod / 1024; -	s << " Kbps: "; -	s << S32(circuit.mBytesInLastPeriod * 8.f / circuit.mLastPeriodLength / 1024.f); -	s << "/"; -	s << S32(circuit.mBytesOutLastPeriod * 8.f / circuit.mLastPeriodLength / 1024.f); -	s << " Peak kbps: "; -	s << S32(circuit.mPeakBPSIn / 1024.f); -	s << "/"; -	s << S32(circuit.mPeakBPSOut / 1024.f); -	s << endl; +	s << "Circuit " << circuit.mHost << " " +		<< circuit.mRemoteID << " " +		<< (circuit.mbAlive ? "Alive" : "Not Alive") << " " +		<< (circuit.mbAllowTimeout ? "Timeout Allowed" : "Timeout Not Allowed") +		<< endl; + +	s << " Packets Lost: " << circuit.mPacketsLost +		<< " Measured Ping: " << circuit.mPingDelay +		<< " Averaged Ping: " << circuit.mPingDelayAveraged +		<< endl; + +	s << "Global In/Out " << S32(age) << " sec" +		<< " KBytes: " << circuit.mBytesIn.valueInUnits<LLUnits::Kibibytes>() << "/" << circuit.mBytesOut.valueInUnits<LLUnits::Kibibytes>() +		<< " Kbps: " +		<< S32(circuit.mBytesIn.valueInUnits<LLUnits::Kibibits>() / circuit.mExistenceTimer.getElapsedTimeF32().value()) +		<< "/" +		<< S32(circuit.mBytesOut.valueInUnits<LLUnits::Kibibits>() / circuit.mExistenceTimer.getElapsedTimeF32().value()) +		<< " Packets: " << circuit.mPacketsIn << "/" << circuit.mPacketsOut +		<< endl; + +	s << "Recent In/Out   " << circuit.mLastPeriodLength +		<< " KBytes: " +		<< circuit.mBytesInLastPeriod.valueInUnits<LLUnits::Kibibytes>() +		<< "/" +		<< circuit.mBytesOutLastPeriod.valueInUnits<LLUnits::Kibibytes>() +		<< " Kbps: " +		<< (S32)(circuit.mBytesInLastPeriod.valueInUnits<LLUnits::Kibibits>() / circuit.mLastPeriodLength.value()) +		<< "/" +		<< (S32)(circuit.mBytesOutLastPeriod.valueInUnits<LLUnits::Kibibits>() / circuit.mLastPeriodLength.value()) +		<< " Peak kbps: " +		<< S32(circuit.mPeakBPSIn / 1024.f) +		<< "/" +		<< S32(circuit.mPeakBPSOut / 1024.f) +		<< endl;  	return s;  } @@ -1256,10 +1257,10 @@ void LLCircuitData::setPacketInID(TPACKETID id)  void LLCircuitData::pingTimerStop(const U8 ping_id)  { -	F64 mt_secs = LLMessageSystem::getMessageTimeSeconds(); +	F64Seconds mt_secs = LLMessageSystem::getMessageTimeSeconds();  	// Nota Bene: no averaging of ping times until we get a feel for how this works -	F64 time = mt_secs - mPingTime; +	F64Seconds time = mt_secs - mPingTime;  	if (time == 0.0)  	{  		// Ack, we got our ping response on the same frame! Sigh, let's get a real time otherwise @@ -1276,7 +1277,7 @@ void LLCircuitData::pingTimerStop(const U8 ping_id)  		delta_ping += 256;  	} -	U32 msec = (U32) ((delta_ping*mHeartbeatInterval  + time) * 1000.f); +	U32Milliseconds msec = delta_ping*mHeartbeatInterval + time;  	setPingDelay(msec);  	mPingsInTransit = delta_ping; @@ -1305,13 +1306,13 @@ U32 LLCircuitData::getPacketsIn() const  } -S32 LLCircuitData::getBytesIn() const +S32Bytes LLCircuitData::getBytesIn() const  {  	return mBytesIn;  } -S32 LLCircuitData::getBytesOut() const +S32Bytes LLCircuitData::getBytesOut() const  {  	return mBytesOut;  } @@ -1353,41 +1354,41 @@ BOOL LLCircuitData::getAllowTimeout() const  } -U32 LLCircuitData::getPingDelay() const +U32Milliseconds LLCircuitData::getPingDelay() const  {  	return mPingDelay;  } -F32 LLCircuitData::getPingInTransitTime() +F32Milliseconds LLCircuitData::getPingInTransitTime()  {  	// This may be inaccurate in the case of a circuit that was "dead" and then revived,  	// but only until the first round trip ping is sent - djs -	F32 time_since_ping_was_sent = 0; +	F32Milliseconds time_since_ping_was_sent(0);  	if (mPingsInTransit)  	{ -		time_since_ping_was_sent =  (F32)((mPingsInTransit*mHeartbeatInterval - 1)  -			+ (LLMessageSystem::getMessageTimeSeconds() - mPingTime))*1000.f; +		time_since_ping_was_sent =  ((mPingsInTransit*mHeartbeatInterval - 1)  +			+ (LLMessageSystem::getMessageTimeSeconds() - mPingTime));  	}  	return time_since_ping_was_sent;  } -void LLCircuitData::setPingDelay(U32 ping) +void LLCircuitData::setPingDelay(U32Milliseconds ping)  {  	mPingDelay = ping; -	mPingDelayAveraged = llmax((F32)ping, getPingDelayAveraged()); +	mPingDelayAveraged = llmax((F32Milliseconds)ping, getPingDelayAveraged());  	mPingDelayAveraged = ((1.f - LL_AVERAGED_PING_ALPHA) * mPingDelayAveraged)  -						  + (LL_AVERAGED_PING_ALPHA * (F32) ping); +						  + (LL_AVERAGED_PING_ALPHA * (F32Milliseconds) ping);  	mPingDelayAveraged = llclamp(mPingDelayAveraged,   								 LL_AVERAGED_PING_MIN,  								 LL_AVERAGED_PING_MAX);  } -F32 LLCircuitData::getPingDelayAveraged() +F32Milliseconds LLCircuitData::getPingDelayAveraged()  {  	return llmin(llmax(getPingInTransitTime(), mPingDelayAveraged), LL_AVERAGED_PING_MAX);  } diff --git a/indra/llmessage/llcircuit.h b/indra/llmessage/llcircuit.h index 11d4e1b11c..bc29805859 100755 --- a/indra/llmessage/llcircuit.h +++ b/indra/llmessage/llcircuit.h @@ -44,10 +44,10 @@  // Constants  //  const F32 LL_AVERAGED_PING_ALPHA = 0.2f;  // relaxation constant on ping running average -const F32 LL_AVERAGED_PING_MAX = 2000;    // msec -const F32 LL_AVERAGED_PING_MIN =  100;    // msec  // IW: increased to avoid retransmits when a process is slow +const F32Milliseconds LL_AVERAGED_PING_MAX(2000);     +const F32Milliseconds LL_AVERAGED_PING_MIN(100);    // increased to avoid retransmits when a process is slow -const U32 INITIAL_PING_VALUE_MSEC = 1000; // initial value for the ping delay, or for ping delay for an unknown circuit +const U32Milliseconds INITIAL_PING_VALUE_MSEC(1000); // initial value for the ping delay, or for ping delay for an unknown circuit  const TPACKETID LL_MAX_OUT_PACKET_ID = 0x01000000;  const int LL_ERR_CIRCUIT_GONE   = -23017; @@ -77,10 +77,10 @@ class LLCircuitData  {  public:  	LLCircuitData(const LLHost &host, TPACKETID in_id,  -				  const F32 circuit_heartbeat_interval, const F32 circuit_timeout); +				  const F32Seconds circuit_heartbeat_interval, const F32Seconds circuit_timeout);  	~LLCircuitData(); -	S32		resendUnackedPackets(const F64 now); +	S32		resendUnackedPackets(const F64Seconds now);  	void	clearDuplicateList(TPACKETID oldest_id); @@ -106,18 +106,18 @@ public:  	// mLocalEndPointID should only ever be setup in the LLCircuitData constructor  	const		LLUUID& getLocalEndPointID() const { return mLocalEndPointID; } -	U32		getPingDelay() const; +	U32Milliseconds	getPingDelay() const;  	S32				getPingsInTransit() const			{ return mPingsInTransit; }  	// ACCESSORS  	BOOL		isAlive() const;  	BOOL		isBlocked() const;  	BOOL		getAllowTimeout() const; -	F32			getPingDelayAveraged(); -	F32			getPingInTransitTime(); +	F32Milliseconds	getPingDelayAveraged(); +	F32Milliseconds	getPingInTransitTime();  	U32			getPacketsIn() const; -	S32			getBytesIn() const; -	S32			getBytesOut() const; +	S32Bytes	getBytesIn() const; +	S32Bytes	getBytesOut() const;  	U32			getPacketsOut() const;  	U32			getPacketsLost() const;  	TPACKETID	getPacketOutID() const; @@ -125,10 +125,10 @@ public:  	F32			getAgeInSeconds() const;  	S32			getUnackedPacketCount() const	{ return mUnackedPacketCount; }  	S32			getUnackedPacketBytes() const	{ return mUnackedPacketBytes; } -	F64         getNextPingSendTime() const { return mNextPingSendTime; } +	F64Seconds  getNextPingSendTime() const { return mNextPingSendTime; }      U32         getLastPacketGap() const { return mLastPacketGap; }      LLHost      getHost() const { return mHost; } -	F64			getLastPacketInTime() const		{ return mLastPacketInTime;	} +	F64Seconds	getLastPacketInTime() const		{ return mLastPacketInTime;	}  	LLThrottleGroup &getThrottleGroup()		{	return mThrottles; } @@ -164,7 +164,7 @@ protected:  	TPACKETID		nextPacketOutID();  	void				setPacketInID(TPACKETID id);  	void					checkPacketInID(TPACKETID id, BOOL receive_resent); -	void			setPingDelay(U32 ping); +	void			setPingDelay(U32Milliseconds ping);  	BOOL			checkCircuitTimeout();	// Return FALSE if the circuit is dead and should be cleaned up  	void			addBytesIn(S32 bytes); @@ -219,20 +219,20 @@ protected:  	BOOL	mBlocked;					// Blocked is true if the circuit is hosed, i.e. far behind on pings  	// Not sure what the difference between this and mLastPingSendTime is -	F64		mPingTime;					// Time at which a ping was sent. +	F64Seconds	mPingTime;					// Time at which a ping was sent. -	F64		mLastPingSendTime;			// Time we last sent a ping -	F64		mLastPingReceivedTime;		// Time we last received a ping -	F64     mNextPingSendTime;          // Time to try and send the next ping -	S32		mPingsInTransit;			// Number of pings in transit -	U8		mLastPingID;				// ID of the last ping that we sent out +	F64Seconds	mLastPingSendTime;			// Time we last sent a ping +	F64Seconds	mLastPingReceivedTime;		// Time we last received a ping +	F64Seconds  mNextPingSendTime;          // Time to try and send the next ping +	S32			mPingsInTransit;			// Number of pings in transit +	U8			mLastPingID;				// ID of the last ping that we sent out  	// Used for determining the resend time for reliable resends. -	U32		mPingDelay;             // raw ping delay -	F32		mPingDelayAveraged;     // averaged ping delay (fast attack/slow decay) +	U32Milliseconds		mPingDelay;             // raw ping delay +	F32Milliseconds		mPingDelayAveraged;     // averaged ping delay (fast attack/slow decay) -	typedef std::map<TPACKETID, U64> packet_time_map; +	typedef std::map<TPACKETID, U64Microseconds> packet_time_map;  	packet_time_map							mPotentialLostPackets;  	packet_time_map							mRecentlyReceivedReliablePackets; @@ -247,7 +247,7 @@ protected:  	S32										mUnackedPacketCount;  	S32										mUnackedPacketBytes; -	F64										mLastPacketInTime;		// Time of last packet arrival +	F64Seconds								mLastPacketInTime;		// Time of last packet arrival  	LLUUID									mLocalEndPointID; @@ -259,24 +259,24 @@ protected:  	U32		mPacketsOut;  	U32		mPacketsIn;  	S32		mPacketsLost; -	S32		mBytesIn; -	S32		mBytesOut; - -	F32		mLastPeriodLength;		// seconds -	S32		mBytesInLastPeriod; -	S32		mBytesOutLastPeriod; -	S32		mBytesInThisPeriod; -	S32		mBytesOutThisPeriod; +	S32Bytes	mBytesIn, +				mBytesOut; + +	F32Seconds	mLastPeriodLength;	 +	S32Bytes	mBytesInLastPeriod; +	S32Bytes	mBytesOutLastPeriod; +	S32Bytes	mBytesInThisPeriod; +	S32Bytes	mBytesOutThisPeriod;  	F32		mPeakBPSIn;				// bits per second, max of all period bps  	F32		mPeakBPSOut;			// bits per second, max of all period bps -	F64		mPeriodTime; +	F64Seconds	mPeriodTime;  	LLTimer	mExistenceTimer;	    // initialized when circuit created, used to track bandwidth numbers  	S32		mCurrentResendCount;	// Number of resent packets since last spam      U32     mLastPacketGap;         // Gap in sequence number of last packet. -	const F32 mHeartbeatInterval; -	const F32 mHeartbeatTimeout; +	const F32Seconds mHeartbeatInterval; +	const F32Seconds mHeartbeatTimeout;  }; @@ -286,7 +286,7 @@ class LLCircuit  {  public:  	// CREATORS -	LLCircuit(const F32 circuit_heartbeat_interval, const F32 circuit_timeout); +	LLCircuit(const F32Seconds circuit_heartbeat_interval, const F32Seconds circuit_timeout);  	~LLCircuit();  	// ACCESSORS @@ -341,7 +341,7 @@ protected:  	mutable LLCircuitData* mLastCircuit;  private: -	const F32 mHeartbeatInterval; -	const F32 mHeartbeatTimeout; +	const F32Seconds mHeartbeatInterval; +	const F32Seconds mHeartbeatTimeout;  };  #endif diff --git a/indra/llmessage/llhttpassetstorage.cpp b/indra/llmessage/llhttpassetstorage.cpp index 0479f0fd32..d9b537941b 100755 --- a/indra/llmessage/llhttpassetstorage.cpp +++ b/indra/llmessage/llhttpassetstorage.cpp @@ -1064,7 +1064,7 @@ void LLHTTPAssetStorage::bumpTimedOutUploads()  {  	bool user_waiting=FALSE; -	F64 mt_secs = LLMessageSystem::getMessageTimeSeconds(); +	F64Seconds mt_secs = LLMessageSystem::getMessageTimeSeconds();  	if (mPendingUploads.size())  	{ diff --git a/indra/llmessage/llpacketack.cpp b/indra/llmessage/llpacketack.cpp index f08d3404ea..c3c022c297 100755 --- a/indra/llmessage/llpacketack.cpp +++ b/indra/llmessage/llpacketack.cpp @@ -50,7 +50,7 @@ LLReliablePacket::LLReliablePacket(  		mHost = params->mHost;  		mRetries = params->mRetries;  		mPingBasedRetry = params->mPingBasedRetry; -		mTimeout = params->mTimeout; +		mTimeout = F32Seconds(params->mTimeout);  		mCallback = params->mCallback;  		mCallbackData = params->mCallbackData;  		mMessageName = params->mMessageName; @@ -59,13 +59,13 @@ LLReliablePacket::LLReliablePacket(  	{  		mRetries = 0;  		mPingBasedRetry = TRUE; -		mTimeout = 0.f; +		mTimeout = F32Seconds(0.f);  		mCallback = NULL;  		mCallbackData = NULL;  		mMessageName = NULL;  	} -	mExpirationTime = (F64)((S64)totalTime())/1000000.0 + mTimeout; +	mExpirationTime = (F64Seconds)totalTime() + mTimeout;  	mPacketID = ntohl(*((U32*)(&buf_ptr[PHL_PACKET_ID])));  	mSocket = socket; diff --git a/indra/llmessage/llpacketack.h b/indra/llmessage/llpacketack.h index 2ef3c48e44..0a5604f74f 100755 --- a/indra/llmessage/llpacketack.h +++ b/indra/llmessage/llpacketack.h @@ -28,6 +28,7 @@  #define LL_LLPACKETACK_H  #include "llhost.h" +#include "llunit.h"  class LLReliablePacketParams  { @@ -35,7 +36,7 @@ public:  	LLHost mHost;  	S32 mRetries;  	BOOL mPingBasedRetry; -	F32 mTimeout; +	F32Seconds mTimeout;  	void (*mCallback)(void **,S32);  	void** mCallbackData;  	char* mMessageName; @@ -63,7 +64,7 @@ public:  		const LLHost& host,  		S32 retries,  		BOOL ping_based_retry, -		F32 timeout,  +		F32Seconds timeout,   		void (*callback)(void**,S32),  		void** callback_data, char* name)  	{ @@ -98,7 +99,7 @@ protected:  	LLHost mHost;  	S32 mRetries;  	BOOL mPingBasedRetry; -	F32 mTimeout; +	F32Seconds mTimeout;  	void (*mCallback)(void**,S32);  	void** mCallbackData;  	char* mMessageName; @@ -108,7 +109,7 @@ protected:  	TPACKETID mPacketID; -	F64 mExpirationTime; +	F64Seconds mExpirationTime;  };  #endif diff --git a/indra/llmessage/llthrottle.cpp b/indra/llmessage/llthrottle.cpp index 181c594205..00eaa7e2ec 100755 --- a/indra/llmessage/llthrottle.cpp +++ b/indra/llmessage/llthrottle.cpp @@ -53,8 +53,8 @@ F32 LLThrottle::getAvailable()  {  	// use a temporary bits_available  	// since we don't want to change mBitsAvailable every time -	F32 elapsed_time = (F32)(LLMessageSystem::getMessageTimeSeconds() - mLastSendTime); -	return mAvailable + (mRate * elapsed_time); +	F32Seconds elapsed_time = LLMessageSystem::getMessageTimeSeconds() - mLastSendTime; +	return mAvailable + (mRate * elapsed_time.value());  }  BOOL LLThrottle::checkOverflow(const F32 amount) @@ -65,8 +65,8 @@ BOOL LLThrottle::checkOverflow(const F32 amount)  	// use a temporary bits_available  	// since we don't want to change mBitsAvailable every time -	F32 elapsed_time =  (F32)(LLMessageSystem::getMessageTimeSeconds() - mLastSendTime); -	F32 amount_available = mAvailable + (mRate * elapsed_time); +	F32Seconds elapsed_time =  LLMessageSystem::getMessageTimeSeconds() - mLastSendTime; +	F32 amount_available = mAvailable + (mRate * elapsed_time.value());  	if ((amount_available >= lookahead_amount) || (amount_available > amount))  	{ @@ -80,17 +80,17 @@ BOOL LLThrottle::checkOverflow(const F32 amount)  BOOL LLThrottle::throttleOverflow(const F32 amount)  { -	F32 elapsed_time; +	F32Seconds elapsed_time;  	F32 lookahead_amount;  	BOOL retval = TRUE;  	lookahead_amount = mRate * mLookaheadSecs; -	F64 mt_sec = LLMessageSystem::getMessageTimeSeconds(); -	elapsed_time = (F32)(mt_sec - mLastSendTime); +	F64Seconds mt_sec = LLMessageSystem::getMessageTimeSeconds(); +	elapsed_time = mt_sec - mLastSendTime;  	mLastSendTime = mt_sec; -	mAvailable += mRate * elapsed_time; +	mAvailable += mRate * elapsed_time.value();  	if (mAvailable >= lookahead_amount)  	{ @@ -222,7 +222,7 @@ void LLThrottleGroup::unpackThrottle(LLDataPacker &dp)  // into NOT resetting the system.  void LLThrottleGroup::resetDynamicAdjust()  { -	F64 mt_sec = LLMessageSystem::getMessageTimeSeconds(); +	F64Seconds mt_sec = LLMessageSystem::getMessageTimeSeconds();  	S32 i;  	for (i = 0; i < TC_EOF; i++)  	{ @@ -269,8 +269,8 @@ S32		LLThrottleGroup::getAvailable(S32 throttle_cat)  	// use a temporary bits_available  	// since we don't want to change mBitsAvailable every time -	F32 elapsed_time = (F32)(LLMessageSystem::getMessageTimeSeconds() - mLastSendTime[throttle_cat]); -	F32 bits_available = mBitsAvailable[throttle_cat] + (category_bps * elapsed_time); +	F32Seconds elapsed_time = LLMessageSystem::getMessageTimeSeconds() - mLastSendTime[throttle_cat]; +	F32 bits_available = mBitsAvailable[throttle_cat] + (category_bps * elapsed_time.value());  	if (bits_available >= lookahead_bits)  	{ @@ -294,8 +294,8 @@ BOOL LLThrottleGroup::checkOverflow(S32 throttle_cat, F32 bits)  	// use a temporary bits_available  	// since we don't want to change mBitsAvailable every time -	F32 elapsed_time = (F32)(LLMessageSystem::getMessageTimeSeconds() - mLastSendTime[throttle_cat]); -	F32 bits_available = mBitsAvailable[throttle_cat] + (category_bps * elapsed_time); +	F32Seconds elapsed_time = LLMessageSystem::getMessageTimeSeconds() - mLastSendTime[throttle_cat]; +	F32 bits_available = mBitsAvailable[throttle_cat] + (category_bps * elapsed_time.value());  	if (bits_available >= lookahead_bits)  	{ @@ -315,7 +315,7 @@ BOOL LLThrottleGroup::checkOverflow(S32 throttle_cat, F32 bits)  BOOL LLThrottleGroup::throttleOverflow(S32 throttle_cat, F32 bits)  { -	F32 elapsed_time; +	F32Seconds elapsed_time;  	F32 category_bps;  	F32 lookahead_bits;  	BOOL retval = TRUE; @@ -323,10 +323,10 @@ BOOL LLThrottleGroup::throttleOverflow(S32 throttle_cat, F32 bits)  	category_bps = mCurrentBPS[throttle_cat];  	lookahead_bits = category_bps * THROTTLE_LOOKAHEAD_TIME; -	F64 mt_sec = LLMessageSystem::getMessageTimeSeconds(); -	elapsed_time = (F32)(mt_sec - mLastSendTime[throttle_cat]); +	F64Seconds mt_sec = LLMessageSystem::getMessageTimeSeconds(); +	elapsed_time = mt_sec - mLastSendTime[throttle_cat];  	mLastSendTime[throttle_cat] = mt_sec; -	mBitsAvailable[throttle_cat] += category_bps * elapsed_time; +	mBitsAvailable[throttle_cat] += category_bps * elapsed_time.value();  	if (mBitsAvailable[throttle_cat] >= lookahead_bits)  	{ @@ -365,7 +365,7 @@ BOOL LLThrottleGroup::dynamicAdjust()  	S32 i; -	F64 mt_sec = LLMessageSystem::getMessageTimeSeconds(); +	F64Seconds mt_sec = LLMessageSystem::getMessageTimeSeconds();  	// Only dynamically adjust every few seconds  	if ((mt_sec - mDynamicAdjustTime) < DYNAMIC_ADJUST_TIME) diff --git a/indra/llmessage/llthrottle.h b/indra/llmessage/llthrottle.h index ed0aeb4602..e43e54f61b 100755 --- a/indra/llmessage/llthrottle.h +++ b/indra/llmessage/llthrottle.h @@ -50,7 +50,7 @@ private:  	F32 mLookaheadSecs;	// Seconds to look ahead, maximum  	F32	mRate;	// BPS available, dynamically adjusted  	F32	mAvailable;	// Bits available to send right now on each channel -	F64	mLastSendTime;		// Time since last send on this channel +	F64Seconds	mLastSendTime;		// Time since last send on this channel  };  typedef enum e_throttle_categories @@ -93,8 +93,8 @@ protected:  	F32		mBitsSentThisPeriod[TC_EOF];	// Sent in this dynamic allocation period  	F32		mBitsSentHistory[TC_EOF];		// Sent before this dynamic allocation period, adjusted to one period length -	F64		mLastSendTime[TC_EOF];		// Time since last send on this channel -	F64		mDynamicAdjustTime;	// Only dynamic adjust every 2 seconds or so. +	F64Seconds	mLastSendTime[TC_EOF];		// Time since last send on this channel +	F64Seconds	mDynamicAdjustTime;	// Only dynamic adjust every 2 seconds or so.  }; diff --git a/indra/llmessage/lltransfermanager.cpp b/indra/llmessage/lltransfermanager.cpp index e647df1c11..71be13ab18 100755 --- a/indra/llmessage/lltransfermanager.cpp +++ b/indra/llmessage/lltransfermanager.cpp @@ -815,7 +815,7 @@ void LLTransferSourceChannel::updateTransfers()  		gMessageSystem->addS32("Status", status);  		gMessageSystem->addBinaryData("Data", datap, data_size);  		sent_bytes = gMessageSystem->getCurrentSendTotal(); -		gMessageSystem->sendReliable(getHost(), LL_DEFAULT_RELIABLE_RETRIES, TRUE, 0.f, +		gMessageSystem->sendReliable(getHost(), LL_DEFAULT_RELIABLE_RETRIES, TRUE, F32Seconds(0.f),  									 LLTransferManager::reliablePacketCallback, (void**)cb_uuid);  		// Do bookkeeping for the throttle diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index 2b377670f1..1f4dd11f73 100755 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -238,7 +238,7 @@ LLMessageSystem::LLMessageSystem(const std::string& filename, U32 port,  								 S32 version_patch,  								 bool failure_is_fatal,  								 const F32 circuit_heartbeat_interval, const F32 circuit_timeout) : -	mCircuitInfo(circuit_heartbeat_interval, circuit_timeout), +	mCircuitInfo(F32Seconds(circuit_heartbeat_interval), F32Seconds(circuit_timeout)),  	mLastMessageFromTrustedMessageService(false)  {  	init(); @@ -303,11 +303,11 @@ LLMessageSystem::LLMessageSystem(const std::string& filename, U32 port,  	mPollInfop->mPollFD.desc.s = aprSocketp;  	mPollInfop->mPollFD.client_data = NULL; -	F64 mt_sec = getMessageTimeSeconds(); +	F64Seconds mt_sec = getMessageTimeSeconds();  	mResendDumpTime = mt_sec;  	mMessageCountTime = mt_sec;  	mCircuitPrintTime = mt_sec; -	mCurrentMessageTimeSeconds = mt_sec; +	mCurrentMessageTime = F64Seconds(mt_sec);  	// Constants for dumping output based on message processing time/count  	mNumMessageCounts = 0; @@ -531,7 +531,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )  	{  		// This is the first message being handled after a resetReceiveCounts,  		// we must be starting the message processing loop.  Reset the timers. -		mCurrentMessageTimeSeconds = totalTime() * SEC_PER_USEC; +		mCurrentMessageTime = totalTime();  		mMessageCountTime = getMessageTimeSeconds();  	} @@ -758,7 +758,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count )  		}  	} while (!valid_packet && receive_size > 0); -	F64 mt_sec = getMessageTimeSeconds(); +	F64Seconds mt_sec = getMessageTimeSeconds();  	// Check to see if we need to print debug info  	if ((mt_sec - mCircuitPrintTime) > mCircuitPrintFreq)  	{ @@ -789,7 +789,7 @@ S32	LLMessageSystem::getReceiveBytes() const  void LLMessageSystem::processAcks()  { -	F64 mt_sec = getMessageTimeSeconds(); +	F64Seconds mt_sec = getMessageTimeSeconds();  	{  		gTransferManager.updateTransfers(); @@ -836,7 +836,7 @@ void LLMessageSystem::processAcks()  		if (mMaxMessageTime >= 0.f)  		{  			// This is one of the only places where we're required to get REAL message system time. -			mReceiveTime = (F32)(getMessageTimeSeconds(TRUE) - mMessageCountTime); +			mReceiveTime = getMessageTimeSeconds(TRUE) - mMessageCountTime;  			if (mReceiveTime > mMaxMessageTime)  			{  				dump = TRUE; @@ -1010,13 +1010,13 @@ S32 LLMessageSystem::sendReliable(const LLHost &host)  S32 LLMessageSystem::sendSemiReliable(const LLHost &host, void (*callback)(void **,S32), void ** callback_data)  { -	F32 timeout; +	F32Seconds timeout;  	LLCircuitData *cdp = mCircuitInfo.findCircuit(host);  	if (cdp)  	{  		timeout = llmax(LL_MINIMUM_SEMIRELIABLE_TIMEOUT_SECONDS, -						LL_SEMIRELIABLE_TIMEOUT_FACTOR * cdp->getPingDelayAveraged()); +						F32Seconds(LL_SEMIRELIABLE_TIMEOUT_FACTOR * cdp->getPingDelayAveraged()));  	}  	else  	{ @@ -1032,7 +1032,7 @@ S32 LLMessageSystem::sendSemiReliable(const LLHost &host, void (*callback)(void  S32 LLMessageSystem::sendReliable(	const LLHost &host,   									S32 retries,   									BOOL ping_based_timeout, -									F32 timeout,  +									F32Seconds timeout,   									void (*callback)(void **,S32),   									void ** callback_data)  { @@ -1041,11 +1041,11 @@ S32 LLMessageSystem::sendReliable(	const LLHost &host,  	    LLCircuitData *cdp = mCircuitInfo.findCircuit(host);  	    if (cdp)  	    { -		    timeout = llmax(LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS, LL_RELIABLE_TIMEOUT_FACTOR * cdp->getPingDelayAveraged()); +		    timeout = llmax(LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS, F32Seconds(LL_RELIABLE_TIMEOUT_FACTOR * cdp->getPingDelayAveraged()));  	    }  	    else  	    { -		    timeout = llmax(LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS, LL_RELIABLE_TIMEOUT_FACTOR * LL_AVERAGED_PING_MAX); +		    timeout = llmax(LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS, F32Seconds(LL_RELIABLE_TIMEOUT_FACTOR * LL_AVERAGED_PING_MAX));  	    }  	} @@ -1077,7 +1077,7 @@ void LLMessageSystem::forwardReliable(const U32 circuit_code)  S32 LLMessageSystem::forwardReliable(	const LLHost &host,   										S32 retries,   										BOOL ping_based_timeout, -										F32 timeout,  +										F32Seconds timeout,   										void (*callback)(void **,S32),   										void ** callback_data)  { @@ -1087,13 +1087,13 @@ S32 LLMessageSystem::forwardReliable(	const LLHost &host,  S32 LLMessageSystem::flushSemiReliable(const LLHost &host, void (*callback)(void **,S32), void ** callback_data)  { -	F32 timeout;  +	F32Seconds timeout;   	LLCircuitData *cdp = mCircuitInfo.findCircuit(host);  	if (cdp)  	{  		timeout = llmax(LL_MINIMUM_SEMIRELIABLE_TIMEOUT_SECONDS, -						LL_SEMIRELIABLE_TIMEOUT_FACTOR * cdp->getPingDelayAveraged()); +						F32Seconds(LL_SEMIRELIABLE_TIMEOUT_FACTOR * cdp->getPingDelayAveraged()));  	}  	else  	{ @@ -3389,15 +3389,15 @@ void LLMessageSystem::dumpPacketToLog()  //static -U64 LLMessageSystem::getMessageTimeUsecs(const BOOL update) +U64Microseconds LLMessageSystem::getMessageTimeUsecs(const BOOL update)  {  	if (gMessageSystem)  	{  		if (update)  		{ -			gMessageSystem->mCurrentMessageTimeSeconds = totalTime()*SEC_PER_USEC; +			gMessageSystem->mCurrentMessageTime = totalTime();  		} -		return (U64)(gMessageSystem->mCurrentMessageTimeSeconds * USEC_PER_SEC); +		return gMessageSystem->mCurrentMessageTime;  	}  	else  	{ @@ -3406,19 +3406,19 @@ U64 LLMessageSystem::getMessageTimeUsecs(const BOOL update)  }  //static -F64 LLMessageSystem::getMessageTimeSeconds(const BOOL update) +F64Seconds LLMessageSystem::getMessageTimeSeconds(const BOOL update)  {  	if (gMessageSystem)  	{  		if (update)  		{ -			gMessageSystem->mCurrentMessageTimeSeconds = totalTime()*SEC_PER_USEC; +			gMessageSystem->mCurrentMessageTime = totalTime();  		} -		return gMessageSystem->mCurrentMessageTimeSeconds; +		return gMessageSystem->mCurrentMessageTime;  	}  	else  	{ -		return totalTime()*SEC_PER_USEC; +		return F64Seconds(totalTime());  	}  } diff --git a/indra/llmessage/message.h b/indra/llmessage/message.h index af0eb109e3..75eccc7f75 100755 --- a/indra/llmessage/message.h +++ b/indra/llmessage/message.h @@ -142,18 +142,14 @@ enum EPacketHeaderLayout  const S32 LL_DEFAULT_RELIABLE_RETRIES = 3; -const F32 LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS = 1.f; -const F32 LL_MINIMUM_SEMIRELIABLE_TIMEOUT_SECONDS = 1.f; -const F32 LL_PING_BASED_TIMEOUT_DUMMY = 0.0f; - -// *NOTE: Maybe these factors shouldn't include the msec to sec conversion -// implicitly. -// However, all units should be MKS. -const F32 LL_SEMIRELIABLE_TIMEOUT_FACTOR	= 5.f / 1000.f;		// factor * averaged ping -const F32 LL_RELIABLE_TIMEOUT_FACTOR		= 5.f / 1000.f;      // factor * averaged ping -const F32 LL_FILE_XFER_TIMEOUT_FACTOR		= 5.f / 1000.f;      // factor * averaged ping -const F32 LL_LOST_TIMEOUT_FACTOR			= 16.f / 1000.f;     // factor * averaged ping for marking packets "Lost" -const F32 LL_MAX_LOST_TIMEOUT				= 5.f;				// Maximum amount of time before considering something "lost" +const F32Seconds LL_MINIMUM_RELIABLE_TIMEOUT_SECONDS(1.f); +const F32Seconds LL_MINIMUM_SEMIRELIABLE_TIMEOUT_SECONDS(1.f); +const F32Seconds LL_PING_BASED_TIMEOUT_DUMMY(0.0f); + +const F32 LL_SEMIRELIABLE_TIMEOUT_FACTOR	= 5.f;		// averaged ping +const F32 LL_RELIABLE_TIMEOUT_FACTOR		= 5.f;		// averaged ping +const F32 LL_LOST_TIMEOUT_FACTOR			= 16.f;     // averaged ping for marking packets "Lost" +const F32Seconds LL_MAX_LOST_TIMEOUT(5.f);				// Maximum amount of time before considering something "lost"  const S32 MAX_MESSAGE_COUNT_NUM = 1024; @@ -270,7 +266,7 @@ public:  	BOOL                mSendReliable;              // does the outgoing message require a pos ack?  	LLCircuit 	 		mCircuitInfo; -	F64					mCircuitPrintTime;	    // used to print circuit debug info every couple minutes +	F64Seconds			mCircuitPrintTime;	    // used to print circuit debug info every couple minutes  	F32					mCircuitPrintFreq;	    // seconds  	std::map<U64, U32>	mIPPortToCircuitCode; @@ -469,7 +465,7 @@ public:  	S32	sendReliable(	const LLHost &host,   							S32 retries,   							BOOL ping_based_retries, -							F32 timeout,  +							F32Seconds timeout,   							void (*callback)(void **,S32),   							void ** callback_data); @@ -489,7 +485,7 @@ public:  		const LLHost &host,   		S32 retries,   		BOOL ping_based_timeout, -		F32 timeout,  +		F32Seconds timeout,   		void (*callback)(void **,S32),   		void ** callback_data); @@ -683,8 +679,8 @@ public:  	void setMaxMessageTime(const F32 seconds);	// Max time to process messages before warning and dumping (neg to disable)  	void setMaxMessageCounts(const S32 num);	// Max number of messages before dumping (neg to disable) -	static U64 getMessageTimeUsecs(const BOOL update = FALSE);	// Get the current message system time in microseconds -	static F64 getMessageTimeSeconds(const BOOL update = FALSE); // Get the current message system time in seconds +	static U64Microseconds getMessageTimeUsecs(const BOOL update = FALSE);	// Get the current message system time in microseconds +	static F64Seconds getMessageTimeSeconds(const BOOL update = FALSE); // Get the current message system time in seconds  	static void setTimeDecodes(BOOL b);  	static void setTimeDecodesSpamThreshold(F32 seconds);  @@ -783,16 +779,16 @@ private:  	BOOL	mbError;  	S32	mErrorCode; -	F64										mResendDumpTime; // The last time we dumped resends +	F64Seconds										mResendDumpTime; // The last time we dumped resends  	LLMessageCountInfo mMessageCountList[MAX_MESSAGE_COUNT_NUM];  	S32 mNumMessageCounts; -	F32 mReceiveTime; -	F32 mMaxMessageTime; // Max number of seconds for processing messages +	F32Seconds mReceiveTime; +	F32Seconds mMaxMessageTime; // Max number of seconds for processing messages  	S32 mMaxMessageCounts; // Max number of messages to process before dumping. -	F64 mMessageCountTime; +	F64Seconds mMessageCountTime; -	F64 mCurrentMessageTimeSeconds; // The current "message system time" (updated the first call to checkMessages after a resetReceiveCount +	F64Seconds mCurrentMessageTime; // The current "message system time" (updated the first call to checkMessages after a resetReceiveCount  	// message system exceptions  	typedef std::pair<msg_exception_callback, void*> exception_t; diff --git a/indra/llprimitive/llprimlinkinfo.h b/indra/llprimitive/llprimlinkinfo.h index 82c50cfe2f..bee25975f1 100755 --- a/indra/llprimitive/llprimlinkinfo.h +++ b/indra/llprimitive/llprimlinkinfo.h @@ -274,28 +274,28 @@ S32 LLPrimLinkInfo< DATA_TYPE >::merge(LLPrimLinkInfo& other_info)  //	other_info.computeBoundingSphere();  //	if ( other_radius != other_info.mBoundingSphere.getRadius() )  //	{ -//		llinfos << "Other bounding sphere changed!!" << llendl; +//		LL_INFOS() << "Other bounding sphere changed!!" << LL_ENDL;  //	}  //	F32 this_radius = mBoundingSphere.getRadius();  //	computeBoundingSphere();  //	if ( this_radius != mBoundingSphere.getRadius() )  //	{ -//		llinfos << "This bounding sphere changed!!" << llendl; +//		LL_INFOS() << "This bounding sphere changed!!" << LL_ENDL;  //	}  	F32 max_span = get_max_linkable_span(mBoundingSphere, other_info.mBoundingSphere);  	//  F32 center_dist = (mBoundingSphere.getCenter() - other_info.mBoundingSphere.getCenter()).length(); -	//	llinfos << "objects are " << center_dist << "m apart" << llendl; +	//	LL_INFOS() << "objects are " << center_dist << "m apart" << LL_ENDL;  	F32 span = get_span(mBoundingSphere, other_info.mBoundingSphere);  	F32 span_limit = max_span + (2.f * other_info.mBoundingSphere.getRadius());  	if (span > span_limit)  	{  		// there is no way any piece of other_info could link with this one -		// llinfos << "span too large:  " << span << " vs. " << span_limit << llendl; +		// LL_INFOS() << "span too large:  " << span << " vs. " << span_limit << LL_ENDL;  		return 0;  	} diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 1d1beafff8..b63ee7f9f9 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -51,9 +51,9 @@ U32 wpo2(U32 i);  U32 LLImageGL::sUniqueCount				= 0;  U32 LLImageGL::sBindCount				= 0; -LLUnit<S32, LLUnits::Bytes> LLImageGL::sGlobalTextureMemory(0); -LLUnit<S32, LLUnits::Bytes> LLImageGL::sBoundTextureMemory(0); -LLUnit<S32, LLUnits::Bytes> LLImageGL::sCurBoundTextureMemory(0); +S32Bytes LLImageGL::sGlobalTextureMemory(0); +S32Bytes LLImageGL::sBoundTextureMemory(0); +S32Bytes LLImageGL::sCurBoundTextureMemory(0);  S32 LLImageGL::sCount					= 0;  LLImageGL::dead_texturelist_t LLImageGL::sDeadTextureList[LLTexUnit::TT_NONE];  U32 LLImageGL::sCurTexName = 1; @@ -249,7 +249,7 @@ void LLImageGL::updateStats(F32 current_time)  	LLFastTimer t(FTM_IMAGE_UPDATE_STATS);  	sLastFrameTime = current_time;  	sBoundTextureMemory = sCurBoundTextureMemory; -	sCurBoundTextureMemory = LLUnits::Bytes::fromValue(0); +	sCurBoundTextureMemory = S32Bytes(0);  }  //static diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index c38b8d3cfa..035d42c3ad 100755 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -246,9 +246,9 @@ public:  	static F32 sLastFrameTime;  	// Global memory statistics -	static LLUnit<S32, LLUnits::Bytes> sGlobalTextureMemory;	// Tracks main memory texmem -	static LLUnit<S32, LLUnits::Bytes> sBoundTextureMemory;	// Tracks bound texmem for last completed frame -	static LLUnit<S32, LLUnits::Bytes> sCurBoundTextureMemory;		// Tracks bound texmem for current frame +	static S32Bytes sGlobalTextureMemory;	// Tracks main memory texmem +	static S32Bytes sBoundTextureMemory;	// Tracks bound texmem for last completed frame +	static S32Bytes sCurBoundTextureMemory;		// Tracks bound texmem for current frame  	static U32 sBindCount;					// Tracks number of texture binds for current frame  	static U32 sUniqueCount;				// Tracks number of unique texture binds for current frame  	static BOOL sGlobalUseAnisotropic; diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index f335b5dec3..224c2b918d 100755 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -1443,7 +1443,7 @@ void LLScrollListCtrl::drawItems()  		LLColor4 highlight_color = LLColor4::white;  		static LLUICachedControl<F32> type_ahead_timeout ("TypeAheadTimeout", 0); -		highlight_color.mV[VALPHA] = clamp_rescale(mSearchTimer.getElapsedTimeF32(), type_ahead_timeout * 0.7f, type_ahead_timeout, 0.4f, 0.f); +		highlight_color.mV[VALPHA] = clamp_rescale(mSearchTimer.getElapsedTimeF32(), type_ahead_timeout * 0.7f, type_ahead_timeout(), 0.4f, 0.f);  		S32 first_line = mScrollLines;  		S32 last_line = llmin((S32)mItemList.size() - 1, mScrollLines + getLinesPerPage()); diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index b564ad5cee..4c64cc944e 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -44,12 +44,12 @@  // rate at which to update display of value that is rapidly changing  const F32 MEAN_VALUE_UPDATE_TIME = 1.f / 4.f;   // time between value changes that qualifies as a "rapid change" -const LLUnit<F32, LLUnits::Seconds>	RAPID_CHANGE_THRESHOLD = 0.2f;  +const F32Seconds	RAPID_CHANGE_THRESHOLD(0.2f);   // maximum number of rapid changes in RAPID_CHANGE_WINDOW before switching over to displaying the mean   // instead of latest value  const S32 MAX_RAPID_CHANGES_PER_SEC = 10;  // period of time over which to measure rapid changes -const LLUnit<F32, LLUnits::Seconds> RAPID_CHANGE_WINDOW = 1.f; +const F32Seconds RAPID_CHANGE_WINDOW(1.f);  F32 calc_tick_value(F32 min, F32 max)  { @@ -250,12 +250,12 @@ BOOL LLStatBar::handleMouseDown(S32 x, S32 y, MASK mask)  }  template<typename T> -S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const T& stat, const LLUnit<F32, LLUnits::Seconds> time_period) +S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const T& stat, const F32Seconds time_period)  { -	LLUnit<F32, LLUnits::Seconds>	elapsed_time, +	F32Seconds	elapsed_time,  									time_since_value_changed;  	S32 num_rapid_changes = 0; -	const LLUnit<F32, LLUnits::Seconds>	RAPID_CHANGE_THRESHOLD = LLUnits::Seconds::fromValue(0.3f); +	const F32Seconds	RAPID_CHANGE_THRESHOLD = F32Seconds(0.3f);  	F64 last_value = periodic_recording.getPrevRecording(1).getLastValue(stat);  	for (S32 i = 2; i < periodic_recording.getNumRecordedPeriods(); i++) @@ -277,9 +277,9 @@ S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const  	return num_rapid_changes;  } -S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const LLTrace::TraceType<LLTrace::CountAccumulator>& stat, const LLUnit<F32, LLUnits::Seconds> time_period) +S32 calc_num_rapid_changes(LLTrace::PeriodicRecording& periodic_recording, const LLTrace::TraceType<LLTrace::CountAccumulator>& stat, const F32Seconds time_period)  { -	LLUnit<F32, LLUnits::Seconds>	elapsed_time, +	F32Seconds	elapsed_time,  		time_since_value_changed;  	S32 num_rapid_changes = 0; diff --git a/indra/llvfs/lldir_linux.cpp b/indra/llvfs/lldir_linux.cpp index 4edd078640..7a4034c228 100755 --- a/indra/llvfs/lldir_linux.cpp +++ b/indra/llvfs/lldir_linux.cpp @@ -49,7 +49,7 @@ static std::string getCurrentUserHome(char* fallback)  	}  	else  	{ -		llinfos << "Couldn't detect home directory from passwd - trying $HOME" << llendl; +		LL_INFOS() << "Couldn't detect home directory from passwd - trying $HOME" << LL_ENDL;  		const char *const home_env = getenv("HOME");	/* Flawfinder: ignore */   		if (home_env)  		{ @@ -57,7 +57,7 @@ static std::string getCurrentUserHome(char* fallback)  		}  		else  		{ -			llwarns << "Couldn't detect home directory!  Falling back to " << fallback << llendl; +			LL_WARNS() << "Couldn't detect home directory!  Falling back to " << fallback << LL_ENDL;  		}  	} @@ -76,11 +76,11 @@ LLDir_Linux::LLDir_Linux()  	if (getcwd(tmp_str, LL_MAX_PATH) == NULL)  	{  		strcpy(tmp_str, "/tmp"); -		llwarns << "Could not get current directory; changing to " -				<< tmp_str << llendl; +		LL_WARNS() << "Could not get current directory; changing to " +				<< tmp_str << LL_ENDL;  		if (chdir(tmp_str) == -1)  		{ -			llerrs << "Could not change directory to " << tmp_str << llendl; +			LL_ERRS() << "Could not change directory to " << tmp_str << LL_ENDL;  		}  	} @@ -98,8 +98,8 @@ LLDir_Linux::LLDir_Linux()      {  		// ...we're in a dev checkout  		mSkinBaseDir = mExecutableDir.substr(0, build_dir_pos) + "/indra/newview/skins"; -		llinfos << "Running in dev checkout with mSkinBaseDir " -		 << mSkinBaseDir << llendl; +		LL_INFOS() << "Running in dev checkout with mSkinBaseDir " +		 << mSkinBaseDir << LL_ENDL;      }      else      { @@ -187,8 +187,8 @@ void LLDir_Linux::initAppDirs(const std::string &app_name,  	{  		if (errno != EEXIST)  		{ -			llwarns << "Couldn't create app user dir " << mOSUserAppDir << llendl; -			llwarns << "Default to base dir" << mOSUserDir << llendl; +			LL_WARNS() << "Couldn't create app user dir " << mOSUserAppDir << LL_ENDL; +			LL_WARNS() << "Default to base dir" << mOSUserDir << LL_ENDL;  			mOSUserAppDir = mOSUserDir;  		}  	} @@ -198,7 +198,7 @@ void LLDir_Linux::initAppDirs(const std::string &app_name,  	{  		if (errno != EEXIST)  		{ -			llwarns << "Couldn't create LL_PATH_LOGS dir " << getExpandedFilename(LL_PATH_LOGS,"") << llendl; +			LL_WARNS() << "Couldn't create LL_PATH_LOGS dir " << getExpandedFilename(LL_PATH_LOGS,"") << LL_ENDL;  		}  	} @@ -207,7 +207,7 @@ void LLDir_Linux::initAppDirs(const std::string &app_name,  	{  		if (errno != EEXIST)  		{ -			llwarns << "Couldn't create LL_PATH_USER_SETTINGS dir " << getExpandedFilename(LL_PATH_USER_SETTINGS,"") << llendl; +			LL_WARNS() << "Couldn't create LL_PATH_USER_SETTINGS dir " << getExpandedFilename(LL_PATH_USER_SETTINGS,"") << LL_ENDL;  		}  	} @@ -216,7 +216,7 @@ void LLDir_Linux::initAppDirs(const std::string &app_name,  	{  		if (errno != EEXIST)  		{ -			llwarns << "Couldn't create LL_PATH_CACHE dir " << getExpandedFilename(LL_PATH_CACHE,"") << llendl; +			LL_WARNS() << "Couldn't create LL_PATH_CACHE dir " << getExpandedFilename(LL_PATH_CACHE,"") << LL_ENDL;  		}  	} @@ -247,7 +247,7 @@ std::string LLDir_Linux::getCurPath()  	char tmp_str[LL_MAX_PATH];	/* Flawfinder: ignore */   	if (getcwd(tmp_str, LL_MAX_PATH) == NULL)  	{ -		llwarns << "Could not get current directory" << llendl; +		LL_WARNS() << "Could not get current directory" << LL_ENDL;  		tmp_str[0] = '\0';  	}  	return tmp_str; diff --git a/indra/llvfs/lldir_mac.cpp b/indra/llvfs/lldir_mac.cpp index c5041d434c..b4900e5f0c 100755 --- a/indra/llvfs/lldir_mac.cpp +++ b/indra/llvfs/lldir_mac.cpp @@ -100,8 +100,8 @@ LLDir_Mac::LLDir_Mac()  			// ...we're in a dev checkout  			mSkinBaseDir = mExecutableDir.substr(0, build_dir_pos)  				+ "/indra/newview/skins"; -			llinfos << "Running in dev checkout with mSkinBaseDir " -				<< mSkinBaseDir << llendl; +			LL_INFOS() << "Running in dev checkout with mSkinBaseDir " +				<< mSkinBaseDir << LL_ENDL;  		}  		else  		{ diff --git a/indra/llvfs/lldir_solaris.cpp b/indra/llvfs/lldir_solaris.cpp index a97d72d539..b43b2f27ce 100755 --- a/indra/llvfs/lldir_solaris.cpp +++ b/indra/llvfs/lldir_solaris.cpp @@ -52,7 +52,7 @@ static std::string getCurrentUserHome(char* fallback)  	}  	else  	{ -		llinfos << "Couldn't detect home directory from passwd - trying $HOME" << llendl; +		LL_INFOS() << "Couldn't detect home directory from passwd - trying $HOME" << LL_ENDL;  		const char *const home_env = getenv("HOME");	/* Flawfinder: ignore */   		if (home_env)  		{ @@ -60,7 +60,7 @@ static std::string getCurrentUserHome(char* fallback)  		}  		else  		{ -			llwarns << "Couldn't detect home directory!  Falling back to " << fallback << llendl; +			LL_WARNS() << "Couldn't detect home directory!  Falling back to " << fallback << LL_ENDL;  		}  	} @@ -79,11 +79,11 @@ LLDir_Solaris::LLDir_Solaris()  	if (getcwd(tmp_str, LL_MAX_PATH) == NULL)  	{  		strcpy(tmp_str, "/tmp"); -		llwarns << "Could not get current directory; changing to " -				<< tmp_str << llendl; +		LL_WARNS() << "Could not get current directory; changing to " +				<< tmp_str << LL_ENDL;  		if (chdir(tmp_str) == -1)  		{ -			llerrs << "Could not change directory to " << tmp_str << llendl; +			LL_ERRS() << "Could not change directory to " << tmp_str << LL_ENDL;  		}  	} @@ -101,12 +101,12 @@ LLDir_Solaris::LLDir_Solaris()  	sprintf(path, "/proc/%d/psinfo", (int)getpid());  	int proc_fd = -1;  	if((proc_fd = open(path, O_RDONLY)) == -1){ -		llwarns << "unable to open " << path << llendl; +		LL_WARNS() << "unable to open " << path << LL_ENDL;  		return;  	}  	psinfo_t proc_psinfo;  	if(read(proc_fd, &proc_psinfo, sizeof(psinfo_t)) != sizeof(psinfo_t)){ -		llwarns << "Unable to read " << path << llendl; +		LL_WARNS() << "Unable to read " << path << LL_ENDL;  		close(proc_fd);  		return;  	} @@ -114,13 +114,13 @@ LLDir_Solaris::LLDir_Solaris()  	close(proc_fd);  	mExecutableFilename = strdup(proc_psinfo.pr_fname); -	llinfos << "mExecutableFilename = [" << mExecutableFilename << "]" << llendl; +	LL_INFOS() << "mExecutableFilename = [" << mExecutableFilename << "]" << LL_ENDL;  	sprintf(path, "/proc/%d/path/a.out", (int)getpid());  	char execpath[LL_MAX_PATH];  	if(readlink(path, execpath, LL_MAX_PATH) == -1){ -		llwarns << "Unable to read link from " << path << llendl; +		LL_WARNS() << "Unable to read link from " << path << LL_ENDL;  		return;  	} @@ -130,7 +130,7 @@ LLDir_Solaris::LLDir_Solaris()  	*p = NULL;  	mExecutablePathAndName = strdup(execpath); -	llinfos << "mExecutablePathAndName = [" << mExecutablePathAndName << "]" << llendl; +	LL_INFOS() << "mExecutablePathAndName = [" << mExecutablePathAndName << "]" << LL_ENDL;  	//NOTE: Why force people to cd into the package directory?  	//      Look for SECONDLIFE env variable and use it, if set. @@ -151,7 +151,7 @@ LLDir_Solaris::LLDir_Solaris()  			*s = (char)NULL;  			mExecutableDir = strdup(execpath); -			llinfos << "mExecutableDir = [" << mExecutableDir << "]" << llendl; +			LL_INFOS() << "mExecutableDir = [" << mExecutableDir << "]" << LL_ENDL;  		}  	} @@ -205,8 +205,8 @@ void LLDir_Solaris::initAppDirs(const std::string &app_name,  	{  		if (errno != EEXIST)  		{ -			llwarns << "Couldn't create app user dir " << mOSUserAppDir << llendl; -			llwarns << "Default to base dir" << mOSUserDir << llendl; +			LL_WARNS() << "Couldn't create app user dir " << mOSUserAppDir << LL_ENDL; +			LL_WARNS() << "Default to base dir" << mOSUserDir << LL_ENDL;  			mOSUserAppDir = mOSUserDir;  		}  	} @@ -216,7 +216,7 @@ void LLDir_Solaris::initAppDirs(const std::string &app_name,  	{  		if (errno != EEXIST)  		{ -			llwarns << "Couldn't create LL_PATH_LOGS dir " << getExpandedFilename(LL_PATH_LOGS,"") << llendl; +			LL_WARNS() << "Couldn't create LL_PATH_LOGS dir " << getExpandedFilename(LL_PATH_LOGS,"") << LL_ENDL;  		}  	} @@ -225,7 +225,7 @@ void LLDir_Solaris::initAppDirs(const std::string &app_name,  	{  		if (errno != EEXIST)  		{ -			llwarns << "Couldn't create LL_PATH_USER_SETTINGS dir " << getExpandedFilename(LL_PATH_USER_SETTINGS,"") << llendl; +			LL_WARNS() << "Couldn't create LL_PATH_USER_SETTINGS dir " << getExpandedFilename(LL_PATH_USER_SETTINGS,"") << LL_ENDL;  		}  	} @@ -234,7 +234,7 @@ void LLDir_Solaris::initAppDirs(const std::string &app_name,  	{  		if (errno != EEXIST)  		{ -			llwarns << "Couldn't create LL_PATH_CACHE dir " << getExpandedFilename(LL_PATH_CACHE,"") << llendl; +			LL_WARNS() << "Couldn't create LL_PATH_CACHE dir " << getExpandedFilename(LL_PATH_CACHE,"") << LL_ENDL;  		}  	} @@ -265,7 +265,7 @@ std::string LLDir_Solaris::getCurPath()  	char tmp_str[LL_MAX_PATH];	/* Flawfinder: ignore */   	if (getcwd(tmp_str, LL_MAX_PATH) == NULL)  	{ -		llwarns << "Could not get current directory" << llendl; +		LL_WARNS() << "Could not get current directory" << LL_ENDL;  		tmp_str[0] = '\0';  	}  	return tmp_str; diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 97637c937f..cac364844b 100755 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -624,22 +624,22 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits  			if(aglDescribeRenderer(rendererInfo, AGL_VIDEO_MEMORY, &result))  			{ -				//				llinfos << "createContext: aglDescribeRenderer(AGL_VIDEO_MEMORY) returned " << result << llendl; +				//				LL_INFOS() << "createContext: aglDescribeRenderer(AGL_VIDEO_MEMORY) returned " << result << LL_ENDL;  				gGLManager.mVRAM = result / (1024 * 1024);  			}  			else  			{ -				//				llinfos << "createContext: aglDescribeRenderer(AGL_VIDEO_MEMORY) failed." << llendl; +				//				LL_INFOS() << "createContext: aglDescribeRenderer(AGL_VIDEO_MEMORY) failed." << LL_ENDL;  			}  			// This could be useful at some point, if it takes into account the memory already used by screen buffers, etc...  			if(aglDescribeRenderer(rendererInfo, AGL_TEXTURE_MEMORY, &result))  			{ -				//				llinfos << "createContext: aglDescribeRenderer(AGL_TEXTURE_MEMORY) returned " << result << llendl; +				//				LL_INFOS() << "createContext: aglDescribeRenderer(AGL_TEXTURE_MEMORY) returned " << result << LL_ENDL;  			}  			else  			{ -				//				llinfos << "createContext: aglDescribeRenderer(AGL_TEXTURE_MEMORY) failed." << llendl; +				//				LL_INFOS() << "createContext: aglDescribeRenderer(AGL_TEXTURE_MEMORY) failed." << LL_ENDL;  			}  			aglDestroyRendererInfo(rendererInfo); @@ -1188,7 +1188,7 @@ BOOL LLWindowMacOSX::getPosition(LLCoordScreen *position)  	}  	else  	{ -		llerrs << "LLWindowMacOSX::getPosition(): no window and not fullscreen!" << llendl; +		LL_ERRS() << "LLWindowMacOSX::getPosition(): no window and not fullscreen!" << LL_ENDL;  	}  	return (err == noErr); @@ -1214,7 +1214,7 @@ BOOL LLWindowMacOSX::getSize(LLCoordScreen *size)  	}  	else  	{ -		llerrs << "LLWindowMacOSX::getPosition(): no window and not fullscreen!" << llendl; +		LL_ERRS() << "LLWindowMacOSX::getPosition(): no window and not fullscreen!" << LL_ENDL;  	}  	return (err == noErr); @@ -1240,7 +1240,7 @@ BOOL LLWindowMacOSX::getSize(LLCoordWindow *size)  	}  	else  	{ -		llerrs << "LLWindowMacOSX::getPosition(): no window and not fullscreen!" << llendl; +		LL_ERRS() << "LLWindowMacOSX::getPosition(): no window and not fullscreen!" << LL_ENDL;  	}  	return (err == noErr); @@ -1284,7 +1284,7 @@ BOOL LLWindowMacOSX::setSizeImpl(const LLCoordWindow size)  		}  		else  		{ -			llinfos << "Error setting size" << err << llendl; +			LL_INFOS() << "Error setting size" << err << LL_ENDL;  			return FALSE;  		}  	} @@ -1410,11 +1410,11 @@ void LLWindowMacOSX::setMouseClipping( BOOL b )  	if(b)  	{ -		//		llinfos << "setMouseClipping(TRUE)" << llendl; +		//		LL_INFOS() << "setMouseClipping(TRUE)" << LL_ENDL;  	}  	else  	{ -		//		llinfos << "setMouseClipping(FALSE)" << llendl; +		//		LL_INFOS() << "setMouseClipping(FALSE)" << LL_ENDL;  	}  	adjustCursorDecouple(); @@ -1432,7 +1432,7 @@ BOOL LLWindowMacOSX::setCursorPosition(const LLCoordWindow position)  	CGPoint newPosition; -	//	llinfos << "setCursorPosition(" << screen_pos.mX << ", " << screen_pos.mY << ")" << llendl; +	//	LL_INFOS() << "setCursorPosition(" << screen_pos.mX << ", " << screen_pos.mY << ")" << LL_ENDL;  	newPosition.x = screen_pos.mX;  	newPosition.y = screen_pos.mY; @@ -1484,7 +1484,7 @@ BOOL LLWindowMacOSX::getCursorPosition(LLCoordWindow *position)  	// gets the mouse location in local coordinates  	::GetMouse(&cursor_point); -//	lldebugs << "getCursorPosition(): cursor is at " << cursor_point.h << ", " << cursor_point.v << "  port origin: " << portrect.left << ", " << portrect.top << llendl; +//	LL_DEBUGS() << "getCursorPosition(): cursor is at " << cursor_point.h << ", " << cursor_point.v << "  port origin: " << portrect.left << ", " << portrect.top << LL_ENDL;  	::SetPort(save); @@ -1518,7 +1518,7 @@ void LLWindowMacOSX::adjustCursorDecouple(bool warpingMouse)  			// The cursor should be decoupled.  Make sure it is.  			if(!mCursorDecoupled)  			{ -				//			llinfos << "adjustCursorDecouple: decoupling cursor" << llendl; +				//			LL_INFOS() << "adjustCursorDecouple: decoupling cursor" << LL_ENDL;  				CGAssociateMouseAndMouseCursorPosition(false);  				mCursorDecoupled = true;  				FlushSpecificEventsFromQueue(GetCurrentEventQueue(), mMoveEventCampartorUPP, NULL); @@ -1531,7 +1531,7 @@ void LLWindowMacOSX::adjustCursorDecouple(bool warpingMouse)  		// The cursor should not be decoupled.  Make sure it isn't.  		if(mCursorDecoupled)  		{ -			//			llinfos << "adjustCursorDecouple: recoupling cursor" << llendl; +			//			LL_INFOS() << "adjustCursorDecouple: recoupling cursor" << LL_ENDL;  			CGAssociateMouseAndMouseCursorPosition(true);  			mCursorDecoupled = false;  		} @@ -1636,7 +1636,7 @@ void LLWindowMacOSX::flashIcon(F32 seconds)  		else  		{  			// This is very not-fatal (only problem is the icon will not bounce), but we'd like to find out about it somehow... -			llinfos << "NMInstall failed with error code " << err << llendl; +			LL_INFOS() << "NMInstall failed with error code " << err << LL_ENDL;  		}  	}  } @@ -2666,28 +2666,28 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e  			break;  		case kEventWindowHidden: -			//					llinfos << "LLWindowMacOSX: Deactivating on hide" << llendl; +			//					LL_INFOS() << "LLWindowMacOSX: Deactivating on hide" << LL_ENDL;  			mMinimized = TRUE;  			mCallbacks->handleActivate(this, false);  			//					result = noErr;  			break;  		case kEventWindowShown: -			//					llinfos << "LLWindowMacOSX: Activating on show" << llendl; +			//					LL_INFOS() << "LLWindowMacOSX: Activating on show" << LL_ENDL;  			mMinimized = FALSE;  			mCallbacks->handleActivate(this, true);  			//					result = noErr;  			break;  		case kEventWindowCollapsed: -			//					llinfos << "LLWindowMacOSX: Deactivating on collapse" << llendl; +			//					LL_INFOS() << "LLWindowMacOSX: Deactivating on collapse" << LL_ENDL;  			mMinimized = TRUE;  			mCallbacks->handleActivate(this, false);  			//					result = noErr;  			break;  		case kEventWindowExpanded: -			//					llinfos << "LLWindowMacOSX: Activating on expand" << llendl; +			//					LL_INFOS() << "LLWindowMacOSX: Activating on expand" << LL_ENDL;  			mMinimized = FALSE;  			mCallbacks->handleActivate(this, true);  			//					result = noErr; @@ -2853,7 +2853,7 @@ const char* cursorIDToName(int id)  		case UI_CURSOR_TOOLNO:							return "UI_CURSOR_NO";  	} -	llerrs << "cursorIDToName: unknown cursor id" << id << llendl; +	LL_ERRS() << "cursorIDToName: unknown cursor id" << id << LL_ENDL;  	return "UI_CURSOR_ARROW";  } @@ -3036,14 +3036,14 @@ void LLWindowMacOSX::hideCursor()  {  	if(!mCursorHidden)  	{ -		//		llinfos << "hideCursor: hiding" << llendl; +		//		LL_INFOS() << "hideCursor: hiding" << LL_ENDL;  		mCursorHidden = TRUE;  		mHideCursorPermanent = TRUE;  		::HideCursor();  	}  	else  	{ -		//		llinfos << "hideCursor: already hidden" << llendl; +		//		LL_INFOS() << "hideCursor: already hidden" << LL_ENDL;  	}  	adjustCursorDecouple(); @@ -3053,14 +3053,14 @@ void LLWindowMacOSX::showCursor()  {  	if(mCursorHidden)  	{ -		//		llinfos << "showCursor: showing" << llendl; +		//		LL_INFOS() << "showCursor: showing" << LL_ENDL;  		mCursorHidden = FALSE;  		mHideCursorPermanent = FALSE;  		::ShowCursor();  	}  	else  	{ -		//		llinfos << "showCursor: already visible" << llendl; +		//		LL_INFOS() << "showCursor: already visible" << LL_ENDL;  	}  	adjustCursorDecouple(); @@ -3272,14 +3272,14 @@ void LLWindowMacOSX::spawnWebBrowser(const std::string& escaped_url, bool async)  	if (!found)  	{ -		llwarns << "spawn_web_browser called for url with protocol not on whitelist: " << escaped_url << llendl; +		LL_WARNS() << "spawn_web_browser called for url with protocol not on whitelist: " << escaped_url << LL_ENDL;  		return;  	}  	OSStatus result = noErr;  	CFURLRef urlRef = NULL; -	llinfos << "Opening URL " << escaped_url << llendl; +	LL_INFOS() << "Opening URL " << escaped_url << LL_ENDL;  	CFStringRef	stringRef = CFStringCreateWithCString(NULL, escaped_url.c_str(), kCFStringEncodingUTF8);  	if (stringRef) @@ -3299,14 +3299,14 @@ void LLWindowMacOSX::spawnWebBrowser(const std::string& escaped_url, bool async)  		if (result != noErr)  		{ -			llinfos << "Error " << result << " on open." << llendl; +			LL_INFOS() << "Error " << result << " on open." << LL_ENDL;  		}  		CFRelease(urlRef);  	}  	else  	{ -		llinfos << "Error: couldn't create URL." << llendl; +		LL_INFOS() << "Error: couldn't create URL." << LL_ENDL;  	}  } @@ -3359,7 +3359,7 @@ LLSD LLWindowMacOSX::getNativeKeyData()  	} -	lldebugs << "native key data is: " << result << llendl; +	LL_DEBUGS() << "native key data is: " << result << LL_ENDL;  	return result;  } @@ -3560,7 +3560,7 @@ OSErr LLWindowMacOSX::dragTrackingHandler(DragTrackingMessage message, WindowRef  	OSErr result = noErr;  	LLWindowMacOSX *self = (LLWindowMacOSX*)handlerRefCon; -	lldebugs << "drag tracking handler, message = " << message << llendl; +	LL_DEBUGS() << "drag tracking handler, message = " << message << LL_ENDL;  	switch(message)  	{ diff --git a/indra/llwindow/llwindowmesaheadless.cpp b/indra/llwindow/llwindowmesaheadless.cpp index 11c22ac94e..4b01f7a979 100755 --- a/indra/llwindow/llwindowmesaheadless.cpp +++ b/indra/llwindow/llwindowmesaheadless.cpp @@ -46,7 +46,7 @@ LLWindowMesaHeadless::LLWindowMesaHeadless(LLWindowCallbacks* callbacks,  {  	if (use_gl)  	{ -		llinfos << "MESA Init" << llendl; +		LL_INFOS() << "MESA Init" << LL_ENDL;  		mMesaContext = OSMesaCreateContextExt( GL_RGBA, 32, 0, 0, NULL );  		/* Allocate the image buffer */ @@ -58,7 +58,7 @@ LLWindowMesaHeadless::LLWindowMesaHeadless(LLWindowCallbacks* callbacks,  		/* Bind the buffer to the context and make it current */  		if (!OSMesaMakeCurrent( mMesaContext, mMesaBuffer, MESA_CHANNEL_TYPE, width, height ))  		{ -			llerrs << "MESA: OSMesaMakeCurrent failed!" << llendl; +			LL_ERRS() << "MESA: OSMesaMakeCurrent failed!" << LL_ENDL;  		}  		llverify(gGLManager.initGL()); diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 205466e936..bb77a24590 100755 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -109,7 +109,7 @@ bool LLWindowSDL::ll_try_gtk_init(void)  	if (!done_setlocale)  	{ -		llinfos << "Starting GTK Initialization." << llendl; +		LL_INFOS() << "Starting GTK Initialization." << LL_ENDL;  		maybe_lock_display();  		gtk_disable_setlocale();  		maybe_unlock_display(); @@ -124,20 +124,20 @@ bool LLWindowSDL::ll_try_gtk_init(void)  		gtk_is_good = gtk_init_check(NULL, NULL);  		maybe_unlock_display();  		if (!gtk_is_good) -			llwarns << "GTK Initialization failed." << llendl; +			LL_WARNS() << "GTK Initialization failed." << LL_ENDL;  	}  	if (gtk_is_good && !done_gtk_diag)  	{ -		llinfos << "GTK Initialized." << llendl; -		llinfos << "- Compiled against GTK version " +		LL_INFOS() << "GTK Initialized." << LL_ENDL; +		LL_INFOS() << "- Compiled against GTK version "  			<< GTK_MAJOR_VERSION << "."  			<< GTK_MINOR_VERSION << "." -			<< GTK_MICRO_VERSION << llendl; -		llinfos << "- Running against GTK version " +			<< GTK_MICRO_VERSION << LL_ENDL; +		LL_INFOS() << "- Running against GTK version "  			<< gtk_major_version << "."  			<< gtk_minor_version << "." -			<< gtk_micro_version << llendl; +			<< gtk_micro_version << LL_ENDL;  		maybe_lock_display();  		const gchar* gtk_warning = gtk_check_version(  			GTK_MAJOR_VERSION, @@ -146,11 +146,11 @@ bool LLWindowSDL::ll_try_gtk_init(void)  		maybe_unlock_display();  		if (gtk_warning)  		{ -			llwarns << "- GTK COMPATIBILITY WARNING: " << -				gtk_warning << llendl; +			LL_WARNS() << "- GTK COMPATIBILITY WARNING: " << +				gtk_warning << LL_ENDL;  			gtk_is_good = FALSE;  		} else { -			llinfos << "- GTK version is good." << llendl; +			LL_INFOS() << "- GTK version is good." << LL_ENDL;  		}  		done_gtk_diag = TRUE; @@ -278,7 +278,7 @@ static int x11_detect_VRAM_kb_fp(FILE *fp, const char *prefix_str)  	char line_buf[line_buf_size];  	while (fgets(line_buf, line_buf_size, fp))  	{ -		//lldebugs << "XLOG: " << line_buf << llendl; +		//LL_DEBUGS() << "XLOG: " << line_buf << LL_ENDL;  		// Why the ad-hoc parser instead of using a regex?  Our  		// favourite regex implementation - libboost_regex - is @@ -353,8 +353,8 @@ static int x11_detect_VRAM_kb()  	fp = fopen(fname.c_str(), "r");  	if (fp)  	{ -		llinfos << "Looking in " << fname -			<< " for VRAM info..." << llendl; +		LL_INFOS() << "Looking in " << fname +			<< " for VRAM info..." << LL_ENDL;  		rtn = x11_detect_VRAM_kb_fp(fp, ": VideoRAM: ");  		fclose(fp);  		if (0 == rtn) @@ -378,8 +378,8 @@ static int x11_detect_VRAM_kb()  	}  	else  	{ -		llinfos << "Could not open " << fname -			<< " - skipped." << llendl;	 +		LL_INFOS() << "Could not open " << fname +			<< " - skipped." << LL_ENDL;	  		// Try old XFree86 log otherwise  		fname = x_log_location;  		fname += "XFree86."; @@ -388,8 +388,8 @@ static int x11_detect_VRAM_kb()  		fp = fopen(fname.c_str(), "r");  		if (fp)  		{ -			llinfos << "Looking in " << fname -				<< " for VRAM info..." << llendl; +			LL_INFOS() << "Looking in " << fname +				<< " for VRAM info..." << LL_ENDL;  			rtn = x11_detect_VRAM_kb_fp(fp, ": VideoRAM: ");  			fclose(fp);  			if (0 == rtn) @@ -404,8 +404,8 @@ static int x11_detect_VRAM_kb()  		}  		else  		{ -			llinfos << "Could not open " << fname -				<< " - skipped." << llendl; +			LL_INFOS() << "Could not open " << fname +				<< " - skipped." << LL_ENDL;  		}  	}  	return rtn; @@ -417,8 +417,8 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B  {  	//bool			glneedsinit = false; -	llinfos << "createContext, fullscreen=" << fullscreen << -	    " size=" << width << "x" << height << llendl; +	LL_INFOS() << "createContext, fullscreen=" << fullscreen << +	    " size=" << width << "x" << height << LL_ENDL;  	// captures don't survive contexts  	mGrabbyKeyFlags = 0; @@ -426,28 +426,28 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B  	if (SDL_Init(SDL_INIT_VIDEO) < 0)  	{ -		llinfos << "sdl_init() failed! " << SDL_GetError() << llendl; +		LL_INFOS() << "sdl_init() failed! " << SDL_GetError() << LL_ENDL;  		setupFailure("sdl_init() failure,  window creation error", "error", OSMB_OK);  		return false;  	}  	SDL_version c_sdl_version;  	SDL_VERSION(&c_sdl_version); -	llinfos << "Compiled against SDL " +	LL_INFOS() << "Compiled against SDL "  		<< int(c_sdl_version.major) << "."  		<< int(c_sdl_version.minor) << "." -		<< int(c_sdl_version.patch) << llendl; +		<< int(c_sdl_version.patch) << LL_ENDL;  	const SDL_version *r_sdl_version;  	r_sdl_version = SDL_Linked_Version(); -	llinfos << " Running against SDL " +	LL_INFOS() << " Running against SDL "  		<< int(r_sdl_version->major) << "."  		<< int(r_sdl_version->minor) << "." -		<< int(r_sdl_version->patch) << llendl; +		<< int(r_sdl_version->patch) << LL_ENDL;  	const SDL_VideoInfo *video_info = SDL_GetVideoInfo( );  	if (!video_info)  	{ -		llinfos << "SDL_GetVideoInfo() failed! " << SDL_GetError() << llendl; +		LL_INFOS() << "SDL_GetVideoInfo() failed! " << SDL_GetError() << LL_ENDL;  		setupFailure("SDL_GetVideoInfo() failed, Window creation error", "Error", OSMB_OK);  		return FALSE;  	} @@ -455,7 +455,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B  	if (video_info->current_h > 0)  	{  		mOriginalAspectRatio = (float)video_info->current_w / (float)video_info->current_h; -		llinfos << "Original aspect ratio was " << video_info->current_w << ":" << video_info->current_h << "=" << mOriginalAspectRatio << llendl; +		LL_INFOS() << "Original aspect ratio was " << video_info->current_w << ":" << video_info->current_h << "=" << mOriginalAspectRatio << LL_ENDL;  	}  	SDL_EnableUNICODE(1); @@ -525,7 +525,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B  	if (mFullscreen)  	{ -		llinfos << "createContext: setting up fullscreen " << width << "x" << height << llendl; +		LL_INFOS() << "createContext: setting up fullscreen " << width << "x" << height << LL_ENDL;  		// If the requested width or height is 0, find the best default for the monitor.  		if((width == 0) || (height == 0)) @@ -543,18 +543,18 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B  				U32 closestWidth = 0;  				int i; -				llinfos << "createContext: searching for a display mode, original aspect is " << mOriginalAspectRatio << llendl; +				LL_INFOS() << "createContext: searching for a display mode, original aspect is " << mOriginalAspectRatio << LL_ENDL;  				for(i=0; i < resolutionCount; i++)  				{  					F32 aspect = (F32)resolutionList[i].mWidth / (F32)resolutionList[i].mHeight; -					llinfos << "createContext: width " << resolutionList[i].mWidth << " height " << resolutionList[i].mHeight << " aspect " << aspect << llendl; +					LL_INFOS() << "createContext: width " << resolutionList[i].mWidth << " height " << resolutionList[i].mHeight << " aspect " << aspect << LL_ENDL;  					if( (resolutionList[i].mHeight >= 700) && (resolutionList[i].mHeight <= 800) &&  						(fabs(aspect - mOriginalAspectRatio) < fabs(closestAspect - mOriginalAspectRatio)))  					{ -						llinfos << " (new closest mode) " << llendl; +						LL_INFOS() << " (new closest mode) " << LL_ENDL;  						// This is the closest mode we've seen yet.  						closestWidth = resolutionList[i].mWidth; @@ -590,15 +590,15 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B  			mFullscreenBits    = mWindow->format->BitsPerPixel;  			mFullscreenRefresh = -1; -			llinfos << "Running at " << mFullscreenWidth +			LL_INFOS() << "Running at " << mFullscreenWidth  				<< "x"   << mFullscreenHeight  				<< "x"   << mFullscreenBits  				<< " @ " << mFullscreenRefresh -				<< llendl; +				<< LL_ENDL;  		}  		else  		{ -			llwarns << "createContext: fullscreen creation failure. SDL: " << SDL_GetError() << llendl; +			LL_WARNS() << "createContext: fullscreen creation failure. SDL: " << SDL_GetError() << LL_ENDL;  			// No fullscreen support  			mFullscreen = FALSE;  			mFullscreenWidth   = -1; @@ -618,7 +618,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B  		if (height == 0)  		    width = 768; -		llinfos << "createContext: creating window " << width << "x" << height << "x" << bits << llendl; +		LL_INFOS() << "createContext: creating window " << width << "x" << height << "x" << bits << LL_ENDL;  		mWindow = SDL_SetVideoMode(width, height, bits, sdlflags);  		if (!mWindow && bits > 16)  		{ @@ -628,13 +628,13 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B  		if (!mWindow)  		{ -			llwarns << "createContext: window creation failure. SDL: " << SDL_GetError() << llendl; +			LL_WARNS() << "createContext: window creation failure. SDL: " << SDL_GetError() << LL_ENDL;  			setupFailure("Window creation error", "Error", OSMB_OK);  			return FALSE;  		}  	} else if (!mFullscreen && (mWindow != NULL))  	{ -		llinfos << "createContext: SKIPPING - !fullscreen, but +mWindow " << width << "x" << height << "x" << bits << llendl; +		LL_INFOS() << "createContext: SKIPPING - !fullscreen, but +mWindow " << width << "x" << height << "x" << bits << LL_ENDL;  	}  	// Detect video memory size. @@ -642,7 +642,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B  	gGLManager.mVRAM = x11_detect_VRAM_kb() / 1024;  	if (gGLManager.mVRAM != 0)  	{ -		llinfos << "X11 log-parser detected " << gGLManager.mVRAM << "MB VRAM." << llendl; +		LL_INFOS() << "X11 log-parser detected " << gGLManager.mVRAM << "MB VRAM." << LL_ENDL;  	} else  # endif // LL_X11  	{ @@ -652,7 +652,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B  		gGLManager.mVRAM = video_info->video_mem / 1024;  		if (gGLManager.mVRAM != 0)  		{ -			llinfos << "SDL detected " << gGLManager.mVRAM << "MB VRAM." << llendl; +			LL_INFOS() << "SDL detected " << gGLManager.mVRAM << "MB VRAM." << LL_ENDL;  		}  	}  	// If VRAM is not detected, that is handled later @@ -670,13 +670,13 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B  	glGetIntegerv(GL_DEPTH_BITS, &depthBits);  	glGetIntegerv(GL_STENCIL_BITS, &stencilBits); -	llinfos << "GL buffer:" << llendl; -        llinfos << "  Red Bits " << S32(redBits) << llendl; -        llinfos << "  Green Bits " << S32(greenBits) << llendl; -        llinfos << "  Blue Bits " << S32(blueBits) << llendl; -	llinfos	<< "  Alpha Bits " << S32(alphaBits) << llendl; -	llinfos	<< "  Depth Bits " << S32(depthBits) << llendl; -	llinfos	<< "  Stencil Bits " << S32(stencilBits) << llendl; +	LL_INFOS() << "GL buffer:" << LL_ENDL; +        LL_INFOS() << "  Red Bits " << S32(redBits) << LL_ENDL; +        LL_INFOS() << "  Green Bits " << S32(greenBits) << LL_ENDL; +        LL_INFOS() << "  Blue Bits " << S32(blueBits) << LL_ENDL; +	LL_INFOS()	<< "  Alpha Bits " << S32(alphaBits) << LL_ENDL; +	LL_INFOS()	<< "  Depth Bits " << S32(depthBits) << LL_ENDL; +	LL_INFOS()	<< "  Stencil Bits " << S32(stencilBits) << LL_ENDL;  	GLint colorBits = redBits + greenBits + blueBits + alphaBits;  	// fixme: actually, it's REALLY important for picking that we get at @@ -741,14 +741,14 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B  		}  		else  		{ -			llwarns << "We're not running under X11?  Wild." -				<< llendl; +			LL_WARNS() << "We're not running under X11?  Wild." +				<< LL_ENDL;  		}  	}  	else  	{ -		llwarns << "We're not running under any known WM.  Wild." -			<< llendl; +		LL_WARNS() << "We're not running under any known WM.  Wild." +			<< LL_ENDL;  	}  #endif // LL_X11 @@ -759,7 +759,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B  	// We need to do this here, once video is init'd  	if (-1 == SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY,  				      SDL_DEFAULT_REPEAT_INTERVAL)) -	    llwarns << "Couldn't enable key-repeat: " << SDL_GetError() <<llendl; +	    LL_WARNS() << "Couldn't enable key-repeat: " << SDL_GetError() <<LL_ENDL;  	// Don't need to get the current gamma, since there's a call that restores it to the system defaults.  	return TRUE; @@ -772,7 +772,7 @@ BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL  	const BOOL needsRebuild = TRUE;  // Just nuke the context and start over.  	BOOL result = true; -	llinfos << "switchContext, fullscreen=" << fullscreen << llendl; +	LL_INFOS() << "switchContext, fullscreen=" << fullscreen << LL_ENDL;  	stop_glerror();  	if(needsRebuild)  	{ @@ -795,7 +795,7 @@ BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL  void LLWindowSDL::destroyContext()  { -	llinfos << "destroyContext begins" << llendl; +	LL_INFOS() << "destroyContext begins" << LL_ENDL;  #if LL_X11  	mSDL_Display = NULL; @@ -805,9 +805,9 @@ void LLWindowSDL::destroyContext()  #endif // LL_X11  	// Clean up remaining GL state before blowing away window -	llinfos << "shutdownGL begins" << llendl; +	LL_INFOS() << "shutdownGL begins" << LL_ENDL;  	gGLManager.shutdownGL(); -	llinfos << "SDL_QuitSS/VID begins" << llendl; +	LL_INFOS() << "SDL_QuitSS/VID begins" << LL_ENDL;  	SDL_QuitSubSystem(SDL_INIT_VIDEO);  // *FIX: this might be risky...  	mWindow = NULL; @@ -1081,12 +1081,12 @@ BOOL LLWindowSDL::setCursorPosition(const LLCoordWindow position)  		return FALSE;  	} -	//llinfos << "setCursorPosition(" << screen_pos.mX << ", " << screen_pos.mY << ")" << llendl; +	//LL_INFOS() << "setCursorPosition(" << screen_pos.mX << ", " << screen_pos.mY << ")" << LL_ENDL;  	// do the actual forced cursor move.  	SDL_WarpMouse(screen_pos.mX, screen_pos.mY); -	//llinfos << llformat("llcw %d,%d -> scr %d,%d", position.mX, position.mY, screen_pos.mX, screen_pos.mY) << llendl; +	//LL_INFOS() << llformat("llcw %d,%d -> scr %d,%d", position.mX, position.mY, screen_pos.mX, screen_pos.mY) << LL_ENDL;  	return result;  } @@ -1171,7 +1171,7 @@ void LLWindowSDL::beforeDialog()  	running_x11 = (mSDL_XWindowID != None);  #endif //LL_X11 -	llinfos << "LLWindowSDL::beforeDialog()" << llendl; +	LL_INFOS() << "LLWindowSDL::beforeDialog()" << LL_ENDL;  	if (SDLReallyCaptureInput(FALSE)) // must ungrab input so popup works!  	{ @@ -1214,7 +1214,7 @@ void LLWindowSDL::afterDialog()  	running_x11 = (mSDL_XWindowID != None);  #endif //LL_X11 -	llinfos << "LLWindowSDL::afterDialog()" << llendl; +	LL_INFOS() << "LLWindowSDL::afterDialog()" << LL_ENDL;  	maybe_unlock_display(); @@ -1238,7 +1238,7 @@ void LLWindowSDL::x11_set_urgent(BOOL urgent)  	{  		XWMHints *wm_hints; -		llinfos << "X11 hint for urgency, " << urgent << llendl; +		LL_INFOS() << "X11 hint for urgency, " << urgent << LL_ENDL;  		maybe_lock_display();  		wm_hints = XGetWMHints(mSDL_Display, mSDL_XWindowID); @@ -1261,9 +1261,9 @@ void LLWindowSDL::x11_set_urgent(BOOL urgent)  void LLWindowSDL::flashIcon(F32 seconds)  {  #if !LL_X11 -	llinfos << "Stub LLWindowSDL::flashIcon(" << seconds << ")" << llendl; +	LL_INFOS() << "Stub LLWindowSDL::flashIcon(" << seconds << ")" << LL_ENDL;  #else	 -	llinfos << "X11 LLWindowSDL::flashIcon(" << seconds << ")" << llendl; +	LL_INFOS() << "X11 LLWindowSDL::flashIcon(" << seconds << ")" << LL_ENDL;  	F32 remaining_time = mFlashTimer.getRemainingTimeF32();  	if (remaining_time < seconds) @@ -1530,7 +1530,7 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture)  	if (mReallyCapturedCount < 0) // yuck, imbalance.  	{  		mReallyCapturedCount = 0; -		llwarns << "ReallyCapture count was < 0" << llendl; +		LL_WARNS() << "ReallyCapture count was < 0" << LL_ENDL;  	}  	if (!mFullscreen) /* only bother if we're windowed anyway */ @@ -1550,7 +1550,7 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture)  			int result;  			if (wantmode == SDL_GRAB_ON)  			{ -				//llinfos << "X11 POINTER GRABBY" << llendl; +				//LL_INFOS() << "X11 POINTER GRABBY" << LL_ENDL;  				//newmode = SDL_WM_GrabInput(wantmode);  				maybe_lock_display();  				result = XGrabPointer(mSDL_Display, mSDL_XWindowID, @@ -1564,7 +1564,7 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture)  					newmode = SDL_GRAB_OFF;  			} else if (wantmode == SDL_GRAB_OFF)  			{ -				//llinfos << "X11 POINTER UNGRABBY" << llendl; +				//LL_INFOS() << "X11 POINTER UNGRABBY" << LL_ENDL;  				newmode = SDL_GRAB_OFF;  				//newmode = SDL_WM_GrabInput(SDL_GRAB_OFF); @@ -1625,7 +1625,7 @@ U32 LLWindowSDL::SDLCheckGrabbyKeys(SDLKey keysym, BOOL gain)  	else  		mGrabbyKeyFlags &= ~mask; -	//llinfos << "mGrabbyKeyFlags=" << mGrabbyKeyFlags << llendl; +	//LL_INFOS() << "mGrabbyKeyFlags=" << mGrabbyKeyFlags << LL_ENDL;  	/* 0 means we don't need to mousegrab, otherwise grab. */  	return mGrabbyKeyFlags; @@ -1655,7 +1655,7 @@ void check_vm_bloat()  			res = getdelim(&ptr, &dummy, ' ', fp);  			if (-1 == res)  			{ -				llwarns << "Unable to parse " << STATS_FILE << llendl; +				LL_WARNS() << "Unable to parse " << STATS_FILE << LL_ENDL;  				goto finally;  			}  			free(ptr); @@ -1666,7 +1666,7 @@ void check_vm_bloat()  		llassert(ptr);  		if (-1 == res)  		{ -			llwarns << "Unable to parse " << STATS_FILE << llendl; +			LL_WARNS() << "Unable to parse " << STATS_FILE << LL_ENDL;  			goto finally;  		}  		this_vm_size = atoll(ptr); @@ -1677,25 +1677,25 @@ void check_vm_bloat()  		llassert(ptr);  		if (-1 == res)  		{ -			llwarns << "Unable to parse " << STATS_FILE << llendl; +			LL_WARNS() << "Unable to parse " << STATS_FILE << LL_ENDL;  			goto finally;  		}  		this_rss_size = getpagesize() * atoll(ptr);  		free(ptr);  		ptr = NULL; -		llinfos << "VM SIZE IS NOW " << (this_vm_size/(1024*1024)) << " MB, RSS SIZE IS NOW " << (this_rss_size/(1024*1024)) << " MB" << llendl; +		LL_INFOS() << "VM SIZE IS NOW " << (this_vm_size/(1024*1024)) << " MB, RSS SIZE IS NOW " << (this_rss_size/(1024*1024)) << " MB" << LL_ENDL;  		if (llabs(last_vm_size - this_vm_size) >  		    significant_vm_difference)  		{  			if (this_vm_size > last_vm_size)  			{ -				llwarns << "VM size grew by " << (this_vm_size - last_vm_size)/(1024*1024) << " MB in last frame" << llendl; +				LL_WARNS() << "VM size grew by " << (this_vm_size - last_vm_size)/(1024*1024) << " MB in last frame" << LL_ENDL;  			}  			else  			{ -				llinfos << "VM size shrank by " << (last_vm_size - this_vm_size)/(1024*1024) << " MB in last frame" << llendl; +				LL_INFOS() << "VM size shrank by " << (last_vm_size - this_vm_size)/(1024*1024) << " MB in last frame" << LL_ENDL;  			}  		} @@ -1704,11 +1704,11 @@ void check_vm_bloat()  		{  			if (this_rss_size > last_rss_size)  			{ -				llwarns << "RSS size grew by " << (this_rss_size - last_rss_size)/(1024*1024) << " MB in last frame" << llendl; +				LL_WARNS() << "RSS size grew by " << (this_rss_size - last_rss_size)/(1024*1024) << " MB in last frame" << LL_ENDL;  			}  			else  			{ -				llinfos << "RSS size shrank by " << (last_rss_size - this_rss_size)/(1024*1024) << " MB in last frame" << llendl; +				LL_INFOS() << "RSS size shrank by " << (last_rss_size - this_rss_size)/(1024*1024) << " MB in last frame" << LL_ENDL;  			}  		} @@ -1905,8 +1905,8 @@ void LLWindowSDL::gatherInput()              case SDL_VIDEORESIZE:  // *FIX: handle this?              { -		llinfos << "Handling a resize event: " << event.resize.w << -			"x" << event.resize.h << llendl; +		LL_INFOS() << "Handling a resize event: " << event.resize.w << +			"x" << event.resize.h << LL_ENDL;  		S32 width = llmax(event.resize.w, (S32)mMinWindowWidth);  		S32 height = llmax(event.resize.h, (S32)mMinWindowHeight); @@ -1916,7 +1916,7 @@ void LLWindowSDL::gatherInput()  		if (!mWindow)  		{  			// *FIX: More informative dialog? -			llinfos << "Could not recreate context after resize! Quitting..." << llendl; +			LL_INFOS() << "Could not recreate context after resize! Quitting..." << LL_ENDL;  			if(mCallbacks->handleCloseRequest(this))      			{      				// Get the app to initiate cleanup. @@ -1957,11 +1957,11 @@ void LLWindowSDL::gatherInput()  				mIsMinimized = (!event.active.gain);  				mCallbacks->handleActivate(this, !mIsMinimized); -				llinfos << "SDL deiconification state switched to " << BOOL(event.active.gain) << llendl; +				LL_INFOS() << "SDL deiconification state switched to " << BOOL(event.active.gain) << LL_ENDL;  			}  			else  			{ -				llinfos << "Ignored bogus redundant SDL deiconification state switch to " << BOOL(event.active.gain) << llendl; +				LL_INFOS() << "Ignored bogus redundant SDL deiconification state switch to " << BOOL(event.active.gain) << LL_ENDL;  			}                  }                  break; @@ -1975,7 +1975,7 @@ void LLWindowSDL::gatherInput()      			}                  break;  	default: -		//llinfos << "Unhandled SDL event type " << event.type << llendl; +		//LL_INFOS() << "Unhandled SDL event type " << event.type << LL_ENDL;  		break;          }      } @@ -2003,8 +2003,8 @@ static SDL_Cursor *makeSDLCursorFromBMP(const char *filename, int hotx, int hoty  	if (bmpsurface && bmpsurface->w%8==0)  	{  		SDL_Surface *cursurface; -		lldebugs << "Loaded cursor file " << filename << " " -			 << bmpsurface->w << "x" << bmpsurface->h << llendl; +		LL_DEBUGS() << "Loaded cursor file " << filename << " " +			 << bmpsurface->w << "x" << bmpsurface->h << LL_ENDL;  		cursurface = SDL_CreateRGBSurface (SDL_SWSURFACE,  						   bmpsurface->w,  						   bmpsurface->h, @@ -2056,12 +2056,12 @@ static SDL_Cursor *makeSDLCursorFromBMP(const char *filename, int hotx, int hoty  			delete[] cursor_data;  			delete[] cursor_mask;  		} else { -			llwarns << "CURSOR BLIT FAILURE, cursurface: " << cursurface << llendl; +			LL_WARNS() << "CURSOR BLIT FAILURE, cursurface: " << cursurface << LL_ENDL;  		}  		SDL_FreeSurface(cursurface);  		SDL_FreeSurface(bmpsurface);  	} else { -		llwarns << "CURSOR LOAD FAILURE " << filename << llendl; +		LL_WARNS() << "CURSOR LOAD FAILURE " << filename << LL_ENDL;  	}  	return sdlcursor; @@ -2087,7 +2087,7 @@ void LLWindowSDL::updateCursor()  			if (sdlcursor)  				SDL_SetCursor(sdlcursor);  		} else { -			llwarns << "Tried to set invalid cursor number " << mNextCursor << llendl; +			LL_WARNS() << "Tried to set invalid cursor number " << mNextCursor << LL_ENDL;  		}  		mCurrentCursor = mNextCursor;  	} @@ -2149,7 +2149,7 @@ void LLWindowSDL::initCursors()  	mSDLCursors[UI_CURSOR_TOOLNO] = makeSDLCursorFromBMP("llno.BMP",8,8);  	if (getenv("LL_ATI_MOUSE_CURSOR_BUG") != NULL) { -		llinfos << "Disabling cursor updating due to LL_ATI_MOUSE_CURSOR_BUG" << llendl; +		LL_INFOS() << "Disabling cursor updating due to LL_ATI_MOUSE_CURSOR_BUG" << LL_ENDL;  		ATIbug = true;  	}  } @@ -2170,7 +2170,7 @@ void LLWindowSDL::quitCursors()  	} else {  		// SDL doesn't refcount cursors, so if the window has  		// already been destroyed then the cursors have gone with it. -		llinfos << "Skipping quitCursors: mWindow already gone." << llendl; +		LL_INFOS() << "Skipping quitCursors: mWindow already gone." << LL_ENDL;  		for (i=0; i<UI_CURSOR_COUNT; ++i)  			mSDLCursors[i] = NULL;  	} @@ -2181,31 +2181,31 @@ void LLWindowSDL::captureMouse()  	// SDL already enforces the semantics that captureMouse is  	// used for, i.e. that we continue to get mouse events as long  	// as a button is down regardless of whether we left the -	// window, and in a less obnoxious way than SDL_WM_GrabInput +	// window, and in a less obnoxious way than SDL_WM_GrabInput	  	// which would confine the cursor to the window too. -	lldebugs << "LLWindowSDL::captureMouse" << llendl; +	LL_DEBUGS() << "LLWindowSDL::captureMouse" << LL_ENDL;  }  void LLWindowSDL::releaseMouse()  {  	// see LWindowSDL::captureMouse() -	lldebugs << "LLWindowSDL::releaseMouse" << llendl; +	LL_DEBUGS() << "LLWindowSDL::releaseMouse" << LL_ENDL;  }  void LLWindowSDL::hideCursor()  {  	if(!mCursorHidden)  	{ -		// llinfos << "hideCursor: hiding" << llendl; +		// LL_INFOS() << "hideCursor: hiding" << LL_ENDL;  		mCursorHidden = TRUE;  		mHideCursorPermanent = TRUE;  		SDL_ShowCursor(0);  	}  	else  	{ -		// llinfos << "hideCursor: already hidden" << llendl; +		// LL_INFOS() << "hideCursor: already hidden" << LL_ENDL;  	}  } @@ -2213,14 +2213,14 @@ void LLWindowSDL::showCursor()  {  	if(mCursorHidden)  	{ -		// llinfos << "showCursor: showing" << llendl; +		// LL_INFOS() << "showCursor: showing" << LL_ENDL;  		mCursorHidden = FALSE;  		mHideCursorPermanent = FALSE;  		SDL_ShowCursor(1);  	}  	else  	{ -		// llinfos << "showCursor: already visible" << llendl; +		// LL_INFOS() << "showCursor: already visible" << LL_ENDL;  	}  } @@ -2291,7 +2291,7 @@ S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 typ  	{  		GtkWidget *win = NULL; -		llinfos << "Creating a dialog because we're in windowed mode and GTK is happy." << llendl; +		LL_INFOS() << "Creating a dialog because we're in windowed mode and GTK is happy." << LL_ENDL;  		GtkDialogFlags flags = GTK_DIALOG_MODAL;  		GtkMessageType messagetype; @@ -2350,7 +2350,7 @@ S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 typ  		gtk_widget_show_all (win);  		gtk_main(); -		//llinfos << "response: " << response << llendl; +		//LL_INFOS() << "response: " << response << LL_ENDL;  		switch (response)  		{  		case GTK_RESPONSE_OK:     rtn = OSBTN_OK; break; @@ -2366,8 +2366,8 @@ S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 typ  	}  	else  	{ -		llinfos << "MSGBOX: " << caption << ": " << text << llendl; -		llinfos << "Skipping dialog because we're in fullscreen mode or GTK is not happy." << llendl; +		LL_INFOS() << "MSGBOX: " << caption << ": " << text << LL_ENDL; +		LL_INFOS() << "Skipping dialog because we're in fullscreen mode or GTK is not happy." << LL_ENDL;  		rtn = OSBTN_OK;  	} @@ -2493,7 +2493,7 @@ BOOL LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b)  #else  S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 type)  { -	llinfos << "MSGBOX: " << caption << ": " << text << llendl; +	LL_INFOS() << "MSGBOX: " << caption << ": " << text << LL_ENDL;  	return 0;  } @@ -2521,7 +2521,7 @@ void exec_cmd(const std::string& cmd, const std::string& arg)  		// end ourself by running the command  		execv(cmd.c_str(), argv);	/* Flawfinder: ignore */  		// if execv returns at all, there was a problem. -		llwarns << "execv failure when trying to start " << cmd << llendl; +		LL_WARNS() << "execv failure when trying to start " << cmd << LL_ENDL;  		_exit(1); // _exit because we don't want atexit() clean-up!  	} else {  		if (pid > 0) @@ -2530,7 +2530,7 @@ void exec_cmd(const std::string& cmd, const std::string& arg)  			int childExitStatus;  			waitpid(pid, &childExitStatus, 0);  		} else { -			llwarns << "fork failure." << llendl; +			LL_WARNS() << "fork failure." << LL_ENDL;  		}  	}  } @@ -2553,11 +2553,11 @@ void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async)  	if (!found)  	{ -		llwarns << "spawn_web_browser called for url with protocol not on whitelist: " << escaped_url << llendl; +		LL_WARNS() << "spawn_web_browser called for url with protocol not on whitelist: " << escaped_url << LL_ENDL;  		return;  	} -	llinfos << "spawn_web_browser: " << escaped_url << llendl; +	LL_INFOS() << "spawn_web_browser: " << escaped_url << LL_ENDL;  #if LL_LINUX || LL_SOLARIS  # if LL_X11 @@ -2580,7 +2580,7 @@ void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async)  	exec_cmd(cmd, arg);  #endif // LL_LINUX || LL_SOLARIS -	llinfos << "spawn_web_browser returning." << llendl; +	LL_INFOS() << "spawn_web_browser returning." << LL_ENDL;  } @@ -2615,7 +2615,7 @@ void LLWindowSDL::bringToFront()  {  	// This is currently used when we are 'launched' to a specific  	// map position externally. -	llinfos << "bringToFront" << llendl; +	LL_INFOS() << "bringToFront" << LL_ENDL;  #if LL_X11  	if (mSDL_Display && !mFullscreen)  	{ @@ -2650,7 +2650,7 @@ std::vector<std::string> LLWindowSDL::getDynamicFallbackFontList()  	FcFontSet *fs = NULL;  	FcPattern *sortpat = NULL; -	llinfos << "Getting system font list from FontConfig..." << llendl; +	LL_INFOS() << "Getting system font list from FontConfig..." << LL_ENDL;  	// If the user has a system-wide language preference, then favor  	// fonts from that language group.  This doesn't affect the types @@ -2667,9 +2667,9 @@ std::vector<std::string> LLWindowSDL::getDynamicFallbackFontList()  			LL_INFOS("AppInit") << "Location " << locale->country << LL_ENDL;  			LL_INFOS("AppInit") << "Variant " << locale->variant << LL_ENDL; -			llinfos << "Preferring fonts of language: " +			LL_INFOS() << "Preferring fonts of language: "  				<< locale->lang -				<< llendl; +				<< LL_ENDL;  			sort_order = "lang=" + std::string(locale->lang) + ":"  				+ sort_order;  		} @@ -2678,7 +2678,7 @@ std::vector<std::string> LLWindowSDL::getDynamicFallbackFontList()  	if (!FcInit())  	{ -		llwarns << "FontConfig failed to initialize." << llendl; +		LL_WARNS() << "FontConfig failed to initialize." << LL_ENDL;  		rtns.push_back(final_fallback);  		return rtns;  	} @@ -2715,14 +2715,14 @@ std::vector<std::string> LLWindowSDL::getDynamicFallbackFontList()  		FcFontSetDestroy (fs);  	} -	lldebugs << "Using font list: " << llendl; +	LL_DEBUGS() << "Using font list: " << LL_ENDL;  	for (std::vector<std::string>::iterator it = rtns.begin();  		 it != rtns.end();  		 ++it)  	{ -		lldebugs << "  file: " << *it << llendl; +		LL_DEBUGS() << "  file: " << *it << LL_ENDL;  	} -	llinfos << "Using " << rtns.size() << "/" << found_font_count << " system fonts." << llendl; +	LL_INFOS() << "Using " << rtns.size() << "/" << found_font_count << " system fonts." << LL_ENDL;  	rtns.push_back(final_fallback);  	return rtns; diff --git a/indra/mac_crash_logger/mac_crash_logger.cpp b/indra/mac_crash_logger/mac_crash_logger.cpp index 6add74556f..a5f349fd0b 100755 --- a/indra/mac_crash_logger/mac_crash_logger.cpp +++ b/indra/mac_crash_logger/mac_crash_logger.cpp @@ -37,7 +37,7 @@ int main(int argc, char **argv)  	if (! app.init())  	{ -		llwarns << "Unable to initialize application." << llendl; +		LL_WARNS() << "Unable to initialize application." << LL_ENDL;  		return 1;  	}      if (app.getCrashBehavior() != CRASH_BEHAVIOR_ALWAYS_SEND) @@ -49,7 +49,7 @@ int main(int argc, char **argv)  	app.cleanup(); -	llinfos << "Crash reporter finished normally." << llendl; +	LL_INFOS() << "Crash reporter finished normally." << LL_ENDL;  	return 0;  } diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 0a1a78c5b4..339a8f1ab0 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -324,7 +324,7 @@ BOOL				gUseWireframe = FALSE;  LLVFS* gStaticVFS = NULL;  LLMemoryInfo gSysMemory; -U64 gMemoryAllocated = 0; // updated in display_stats() in llviewerdisplay.cpp +U64Bytes gMemoryAllocated(0); // updated in display_stats() in llviewerdisplay.cpp  std::string gLastVersionChannel; @@ -3329,8 +3329,8 @@ void LLAppViewer::writeSystemInfo()  	gDebugInfo["CPUInfo"]["CPUSSE"] = gSysCPU.hasSSE();  	gDebugInfo["CPUInfo"]["CPUSSE2"] = gSysCPU.hasSSE2(); -	gDebugInfo["RAMInfo"]["Physical"] = (LLSD::Integer)(gSysMemory.getPhysicalMemoryKB()); -	gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer)(gMemoryAllocated>>10); // MB -> KB +	gDebugInfo["RAMInfo"]["Physical"] = (LLSD::Integer)(gSysMemory.getPhysicalMemoryKB().value()); +	gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer)(gMemoryAllocated.valueInUnits<LLUnits::Kibibytes>());  	gDebugInfo["OSInfo"] = getOSInfo().getOSStringSimple();  	// The user is not logged on yet, but record the current grid choice login url diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 60a1045f58..10452e64e2 100755 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -367,7 +367,7 @@ class LLVFS;  extern LLVFS	*gStaticVFS;  extern LLMemoryInfo gSysMemory; -extern U64 gMemoryAllocated; +extern U64Bytes gMemoryAllocated;  extern std::string gLastVersionChannel; diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp index b16bb573e1..80f249612a 100755 --- a/indra/newview/llappviewerlinux.cpp +++ b/indra/newview/llappviewerlinux.cpp @@ -87,7 +87,7 @@ int main( int argc, char **argv )  	bool ok = viewer_app_ptr->init();  	if(!ok)  	{ -		llwarns << "Application init failed." << llendl; +		LL_WARNS() << "Application init failed." << LL_ENDL;  		return -1;  	} @@ -207,7 +207,7 @@ void viewerappapi_init(ViewerAppAPI *server)  			}  			else   			{ -				llwarns << "Unable to register service name: " << error->message << llendl; +				LL_WARNS() << "Unable to register service name: " << error->message << LL_ENDL;  			}  			g_object_unref(serverproxy); @@ -226,7 +226,7 @@ gboolean viewer_app_api_GoSLURL(ViewerAppAPI *obj, gchar *slurl, gboolean **succ  {  	bool success = false; -	llinfos << "Was asked to go to slurl: " << slurl << llendl; +	LL_INFOS() << "Was asked to go to slurl: " << slurl << LL_ENDL;  	std::string url = slurl;  	LLMediaCtrl* web = NULL; @@ -292,14 +292,14 @@ bool LLAppViewerLinux::sendURLToOtherInstance(const std::string& url)  		}  		else  		{ -			llinfos << "Call-out to other instance failed (perhaps not running): " << error->message << llendl; +			LL_INFOS() << "Call-out to other instance failed (perhaps not running): " << error->message << LL_ENDL;  		}  		g_object_unref(G_OBJECT(remote_object));  	}  	else  	{ -		llwarns << "Couldn't connect to session bus: " << error->message << llendl; +		LL_WARNS() << "Couldn't connect to session bus: " << error->message << LL_ENDL;  	}  	if (error) @@ -343,7 +343,7 @@ void LLAppViewerLinux::handleCrashReporting(bool reportFreeze)  		if (pid == 0)  		{ // child  			execv(cmd.c_str(), cmdargv);		/* Flawfinder: Ignore */ -			llwarns << "execv failure when trying to start " << cmd << llendl; +			LL_WARNS() << "execv failure when trying to start " << cmd << LL_ENDL;  			_exit(1); // avoid atexit()  		} else {  			if (pid > 0) @@ -352,7 +352,7 @@ void LLAppViewerLinux::handleCrashReporting(bool reportFreeze)  				int childExitStatus;  				waitpid(pid, &childExitStatus, 0);  			} else { -				llwarns << "fork failure." << llendl; +				LL_WARNS() << "fork failure." << LL_ENDL;  			}  		}  	} @@ -371,7 +371,7 @@ void LLAppViewerLinux::handleCrashReporting(bool reportFreeze)  		if (pid == 0)  		{ // child  			execv(cmd.c_str(), (char* const*) cmdargv);		/* Flawfinder: ignore */ -			llwarns << "execv failure when trying to start " << cmd << llendl; +			LL_WARNS() << "execv failure when trying to start " << cmd << LL_ENDL;  			_exit(1); // avoid atexit()  		}   		else @@ -386,7 +386,7 @@ void LLAppViewerLinux::handleCrashReporting(bool reportFreeze)  			}   			else  			{ -				llwarns << "fork failure." << llendl; +				LL_WARNS() << "fork failure." << LL_ENDL;  			}  		}  		// Sometimes signals don't seem to quit the viewer.  Also, we may diff --git a/indra/newview/llappviewerlinux_api_dbus.cpp b/indra/newview/llappviewerlinux_api_dbus.cpp index 32e7e0a83d..6ac30bd9b8 100755 --- a/indra/newview/llappviewerlinux_api_dbus.cpp +++ b/indra/newview/llappviewerlinux_api_dbus.cpp @@ -35,9 +35,9 @@ extern "C" {  #include "apr_dso.h"  } -#define DEBUGMSG(...) do { lldebugs << llformat(__VA_ARGS__) << llendl; } while(0) -#define INFOMSG(...) do { llinfos << llformat(__VA_ARGS__) << llendl; } while(0) -#define WARNMSG(...) do { llwarns << llformat(__VA_ARGS__) << llendl; } while(0) +#define DEBUGMSG(...) do { LL_DEBUGS() << llformat(__VA_ARGS__) << LL_ENDL; } while(0) +#define INFOMSG(...) do { LL_INFOS() << llformat(__VA_ARGS__) << LL_ENDL; } while(0) +#define WARNMSG(...) do { LL_WARNS() << llformat(__VA_ARGS__) << LL_ENDL; } while(0)  #define LL_DBUS_SYM(REQUIRED, DBUSSYM, RTN, ...) RTN (*ll##DBUSSYM)(__VA_ARGS__) = NULL  #include "llappviewerlinux_api_dbus_syms_raw.inc" diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 4d340cafa9..8d6d52185a 100755 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -72,9 +72,9 @@ int main( int argc, char **argv )  	// Set the working dir to <bundle>/Contents/Resources  	if (chdir(gDirUtilp->getAppRODataDir().c_str()) == -1)  	{ -		llwarns << "Could not change directory to " +		LL_WARNS() << "Could not change directory to "  				<< gDirUtilp->getAppRODataDir() << ": " << strerror(errno) -				<< llendl; +				<< LL_ENDL;  	}  	LLAppViewerMacOSX* viewer_app_ptr = new LLAppViewerMacOSX(); @@ -88,7 +88,7 @@ int main( int argc, char **argv )  	bool ok = viewer_app_ptr->init();  	if(!ok)  	{ -		llwarns << "Application init failed." << llendl; +		LL_WARNS() << "Application init failed." << LL_ENDL;  		return -1;  	} @@ -154,7 +154,7 @@ bool LLAppViewerMacOSX::initParseCommandLine(LLCommandLineParser& clp)  	llifstream ifs(filename, llifstream::binary);  	if (!ifs.is_open())  	{ -		llwarns << "Unable to open file" << filename << llendl; +		LL_WARNS() << "Unable to open file" << filename << LL_ENDL;  		return false;  	} @@ -561,13 +561,13 @@ void init_apple_menu(const char* product)  	if(AEInstallEventHandler('GURL', 'GURL', NewAEEventHandlerUPP(AEGURLHandler),0, false) != noErr)  	{  		// Couldn't install AppleEvent handler.  This error shouldn't be fatal. -		llinfos << "Couldn't install 'GURL' AppleEvent handler.  Continuing..." << llendl; +		LL_INFOS() << "Couldn't install 'GURL' AppleEvent handler.  Continuing..." << LL_ENDL;  	}  	// Install a handler for 'quit' AppleEvents.  This makes quitting the application from the dock work.  	if(AEInstallEventHandler(kCoreEventClass, kAEQuitApplication, NewAEEventHandlerUPP(AEQuitHandler),0, false) != noErr)  	{  		// Couldn't install AppleEvent handler.  This error shouldn't be fatal. -		llinfos << "Couldn't install Quit AppleEvent handler.  Continuing..." << llendl; +		LL_INFOS() << "Couldn't install Quit AppleEvent handler.  Continuing..." << LL_ENDL;  	}  } diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index 8dd148e304..9311056a27 100755 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -39,7 +39,7 @@ const int CONVERSATION_LIFETIME = 30; // lifetime of LLConversation is 30 days b  struct ConversationParams : public LLInitParam::Block<ConversationParams>  { -	Mandatory<LLUnit<U64, LLUnits::Seconds> >	time; +	Mandatory<U64Seconds >	time;  	Mandatory<std::string>						timestamp;  	Mandatory<SessionType>						conversation_type;  	Mandatory<std::string>						conversation_name, @@ -113,7 +113,7 @@ void LLConversation::onIMFloaterShown(const LLUUID& session_id)  }  // static -const std::string LLConversation::createTimestamp(const LLUnit<U64, LLUnits::Seconds>& utc_time) +const std::string LLConversation::createTimestamp(const U64Seconds& utc_time)  {  	std::string timeStr;  	LLSD substitution; @@ -132,7 +132,7 @@ const std::string LLConversation::createTimestamp(const LLUnit<U64, LLUnits::Sec  bool LLConversation::isOlderThan(U32 days) const  { -	LLUnit<U64, LLUnits::Seconds> now = time_corrected(); +	U64Seconds now(time_corrected());  	LLUnit<U32, LLUnits::Days> age = now - mTime;  	return age > days; @@ -535,7 +535,7 @@ bool LLConversationLog::loadFromFile(const std::string& filename)  				history_file_name);  		ConversationParams params; -		params.time(time) +		params.time(LLUnits::Seconds::fromValue(time))  			.conversation_type((SessionType)stype)  			.has_offline_ims(has_offline_ims)  			.conversation_name(conv_name_buffer) diff --git a/indra/newview/llconversationlog.h b/indra/newview/llconversationlog.h index 5d94cb6497..fd6ad9ad66 100755 --- a/indra/newview/llconversationlog.h +++ b/indra/newview/llconversationlog.h @@ -55,7 +55,7 @@ public:  	const LLUUID&		getSessionID()			const	{ return mSessionID; }  	const LLUUID&		getParticipantID()		const	{ return mParticipantID; }  	const std::string&	getTimestamp()			const	{ return mTimestamp; } -	const LLUnit<U64, LLUnits::Seconds>& +	const U64Seconds&  						getTime()				const	{ return mTime; }  	bool				hasOfflineMessages()	const	{ return mHasOfflineIMs; } @@ -76,7 +76,7 @@ public:  	/*  	 * returns string representation(in form of: mm/dd/yyyy hh:mm) of time when conversation was started  	 */ -	static const std::string createTimestamp(const LLUnit<U64, LLUnits::Seconds>& utc_time); +	static const std::string createTimestamp(const U64Seconds& utc_time);  private: @@ -88,7 +88,7 @@ private:  	boost::signals2::connection mIMFloaterShowedConnection; -	LLUnit<U64, LLUnits::Seconds> mTime; // last interaction time +	U64Seconds mTime; // last interaction time  	SessionType		mConversationType;  	std::string		mConversationName;  	std::string		mHistoryFileName; diff --git a/indra/newview/llconversationloglist.cpp b/indra/newview/llconversationloglist.cpp index bd5e0b8f88..93719ac7fb 100755 --- a/indra/newview/llconversationloglist.cpp +++ b/indra/newview/llconversationloglist.cpp @@ -518,8 +518,8 @@ bool LLConversationLogListNameComparator::doCompare(const LLConversationLogListI  bool LLConversationLogListDateComparator::doCompare(const LLConversationLogListItem* conversation1, const LLConversationLogListItem* conversation2) const  { -	LLUnit<U64, LLUnits::Seconds> date1 = conversation1->getConversation()->getTime(); -	LLUnit<U64, LLUnits::Seconds> date2 = conversation2->getConversation()->getTime(); +	U64Seconds date1 = conversation1->getConversation()->getTime(); +	U64Seconds date2 = conversation2->getConversation()->getTime();  	const LLUUID& id1 = conversation1->getConversation()->getParticipantID();  	const LLUUID& id2 = conversation2->getConversation()->getParticipantID(); diff --git a/indra/newview/llface.inl b/indra/newview/llface.inl index 85c35a88f3..c37b77d2cd 100755 --- a/indra/newview/llface.inl +++ b/indra/newview/llface.inl @@ -77,7 +77,7 @@ inline S32	LLFace::getColors     (LLStrider<LLColor4U> &colors)  		if (!mBackupMem)  		{  			printDebugInfo(); -			llerrs << "No backup memory for face" << llendl; +			LL_ERRS() << "No backup memory for face" << LL_ENDL;  		}  		colorp = (LLColor4U*)(mBackupMem + (4 * mIndicesCount) + (mGeomCount * mDrawPoolp->getStride()));  		colors = colorp; @@ -89,7 +89,7 @@ inline S32	LLFace::getColors     (LLStrider<LLColor4U> &colors)  		if (!mDrawPoolp->getColorStrider(colors, mGeomIndex))  		{  			printDebugInfo(); -			llerrs << "No color pointer for a color strider!" << llendl; +			LL_ERRS() << "No color pointer for a color strider!" << LL_ENDL;  		}  		mDrawPoolp->setDirtyColors();  		return mGeomIndex; @@ -107,7 +107,7 @@ inline S32	LLFace::getTexCoords  (LLStrider<LLVector2> &texCoords, S32 pass )  		if (!mBackupMem)  		{  			printDebugInfo(); -			llerrs << "No backup memory for face" << llendl; +			LL_ERRS() << "No backup memory for face" << LL_ENDL;  		}  		texCoords = (LLVector2*)(mBackupMem + (4 * mIndicesCount) + mDrawPoolp->mDataOffsets[LLDrawPool::DATA_TEX_COORDS0 + pass]);  		texCoords.setStride( mDrawPoolp->getStride()); diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index bb9e474098..725a2f2daf 100755 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -260,7 +260,7 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask)  		TimerBarRow& row = mHoverBarIndex == 0 ? mAverageTimerRow : mTimerBarRows[mScrollIndex + mHoverBarIndex - 1];  		TimerBar* hover_bar = NULL; -		LLUnit<F32, LLUnits::Seconds> mouse_time_offset = ((F32)(x - mBarRect.mLeft) / (F32)mBarRect.getWidth()) * mTotalTimeDisplay; +		F32Seconds mouse_time_offset = ((F32)(x - mBarRect.mLeft) / (F32)mBarRect.getWidth()) * mTotalTimeDisplay;  		for (int bar_index = 0, end_index = LLInstanceTracker<LLTrace::TimeBlock>::instanceCount();   			bar_index < end_index;   			++bar_index) @@ -317,11 +317,11 @@ static std::string get_tooltip(TimeBlock& timer, S32 history_index, PeriodicReco  	if (history_index == 0)  	{  		// by default, show average number of call -		tooltip = llformat("%s (%d ms, %d calls)", timer.getName().c_str(), (S32)LLUnit<F64, LLUnits::Milliseconds>(frame_recording.getPeriodMean (timer, RUNNING_AVERAGE_WIDTH)).value(), (S32)frame_recording.getPeriodMean(timer.callCount(), RUNNING_AVERAGE_WIDTH)); +		tooltip = llformat("%s (%d ms, %d calls)", timer.getName().c_str(), (S32)F64Milliseconds(frame_recording.getPeriodMean (timer, RUNNING_AVERAGE_WIDTH)).value(), (S32)frame_recording.getPeriodMean(timer.callCount(), RUNNING_AVERAGE_WIDTH));  	}  	else  	{ -		tooltip = llformat("%s (%d ms, %d calls)", timer.getName().c_str(), (S32)LLUnit<F64, LLUnits::Milliseconds>(frame_recording.getPrevRecording(history_index).getSum(timer)).value(), (S32)frame_recording.getPrevRecording(history_index).getSum(timer.callCount())); +		tooltip = llformat("%s (%d ms, %d calls)", timer.getName().c_str(), (S32)F64Milliseconds(frame_recording.getPrevRecording(history_index).getSum(timer)).value(), (S32)frame_recording.getPrevRecording(history_index).getSum(timer.callCount()));  	}  	return tooltip;  } @@ -996,7 +996,7 @@ void LLFastTimerView::printLineStats()  			}  			first = false; -			LLUnit<F32, LLUnits::Seconds> ticks; +			F32Seconds ticks;  			if (mStatsIndex == 0)  			{  				ticks = mRecording.getPeriodMean(*idp, RUNNING_AVERAGE_WIDTH); @@ -1005,7 +1005,7 @@ void LLFastTimerView::printLineStats()  			{  				ticks = mRecording.getPrevRecording(mStatsIndex).getSum(*idp);  			} -			LLUnit<F32, LLUnits::Milliseconds> ms = ticks; +			F32Milliseconds ms = ticks;  			timer_stat += llformat("%.1f",ms.value()); @@ -1029,7 +1029,7 @@ void LLFastTimerView::drawLineGraph()  	LLLocalClipRect clip(mGraphRect);  	//normalize based on last frame's maximum -	static LLUnit<F32, LLUnits::Seconds> max_time = 0.000001; +	static F32Seconds max_time(0.000001);  	static U32 max_calls = 0;  	static F32 alpha_interp = 0.f; @@ -1060,7 +1060,7 @@ void LLFastTimerView::drawLineGraph()  		}  	} -	LLUnit<F32, LLUnits::Seconds> cur_max = 0; +	F32Seconds cur_max(0);  	U32 cur_max_calls = 0;  	for(timer_tree_iterator_t it = begin_timer_tree(FTM_FRAME);  		it != end_timer_tree(); @@ -1101,7 +1101,7 @@ void LLFastTimerView::drawLineGraph()  			j--)  		{  			LLTrace::Recording& recording = mRecording.getPrevRecording(j); -			LLUnit<F32, LLUnits::Seconds> time = llmax(recording.getSum(*idp), LLUnits::Seconds::fromValue(0.000001)); +			F32Seconds time = llmax(recording.getSum(*idp), F64Seconds(0.000001));  			U32 calls = recording.getSum(idp->callCount());  			if (is_hover_timer) @@ -1146,7 +1146,7 @@ void LLFastTimerView::drawLineGraph()  	max_time = lerp(max_time.value(), cur_max.value(), LLSmoothInterpolation::getInterpolant(0.1f));  	if (llabs((max_time - cur_max).value()) <= 1)  	{ -		max_time = llmax(LLUnits::Microseconds::fromValue(1.f), LLUnits::Microseconds::fromValue(cur_max)); +		max_time = llmax(F32Microseconds(1.f), F32Microseconds(cur_max));  	}  	max_calls = llround(lerp((F32)max_calls, (F32) cur_max_calls, LLSmoothInterpolation::getInterpolant(0.1f))); @@ -1179,7 +1179,7 @@ void LLFastTimerView::drawLineGraph()  	switch(mDisplayType)  	{  	case DISPLAY_TIME: -		axis_label = llformat("%4.2f ms", LLUnit<F32, LLUnits::Milliseconds>(max_time).value()); +		axis_label = llformat("%4.2f ms", F32Milliseconds(max_time).value());  		break;  	case DISPLAY_CALLS:  		axis_label = llformat("%d calls", (int)max_calls); @@ -1230,7 +1230,7 @@ void LLFastTimerView::drawLegend()  			llassert(idp->getIndex() < sTimerColors.size());  			gl_rect_2d(bar_rect, sTimerColors[idp->getIndex()]); -			LLUnit<F32, LLUnits::Milliseconds> ms = 0; +			F32Milliseconds ms(0);  			S32 calls = 0;  			if (mHoverBarIndex > 0 && mHoverID)  			{ @@ -1240,7 +1240,7 @@ void LLFastTimerView::drawLegend()  			}  			else  			{ -				ms = LLUnit<F64, LLUnits::Seconds>(mRecording.getPeriodMean(*idp, RUNNING_AVERAGE_WIDTH)); +				ms = F64Seconds(mRecording.getPeriodMean(*idp, RUNNING_AVERAGE_WIDTH));  				calls = (S32)mRecording.getPeriodMean(idp->callCount(), RUNNING_AVERAGE_WIDTH);  			} @@ -1346,7 +1346,7 @@ void LLFastTimerView::drawTicks()  {  	// Draw MS ticks  	{ -		LLUnit<U32, LLUnits::Milliseconds> ms = mTotalTimeDisplay; +		U32Milliseconds ms = mTotalTimeDisplay;  		std::string tick_label;  		S32 x;  		S32 barw = mBarRect.getWidth(); @@ -1423,7 +1423,7 @@ void LLFastTimerView::updateTotalTime()  		mTotalTimeDisplay = mRecording.getPeriodMax(FTM_FRAME, 20);  		break;  	default: -		mTotalTimeDisplay = LLUnits::Milliseconds::fromValue(100); +		mTotalTimeDisplay = F64Milliseconds(100);  		break;  	} @@ -1511,14 +1511,14 @@ void LLFastTimerView::drawBars()  static LLFastTimer::DeclareTimer FTM_UPDATE_TIMER_BAR_WIDTHS("Update timer bar widths"); -LLUnit<F32, LLUnits::Seconds> LLFastTimerView::updateTimerBarWidths(LLTrace::TimeBlock* time_block, TimerBarRow& row, S32 history_index, U32& bar_index) +F32Seconds LLFastTimerView::updateTimerBarWidths(LLTrace::TimeBlock* time_block, TimerBarRow& row, S32 history_index, U32& bar_index)  {  	LLFastTimer _(FTM_UPDATE_TIMER_BAR_WIDTHS); -	const LLUnit<F32, LLUnits::Seconds> self_time = history_index == -1 +	const F32Seconds self_time = history_index == -1  										? mRecording.getPeriodMean(time_block->selfTime(), RUNNING_AVERAGE_WIDTH)   										: mRecording.getPrevRecording(history_index).getSum(time_block->selfTime()); -	LLUnit<F32, LLUnits::Seconds> full_time = self_time; +	F32Seconds full_time = self_time;  	// reserve a spot for this bar to be rendered before its children  	// even though we don't know its size yet @@ -1544,7 +1544,7 @@ S32 LLFastTimerView::updateTimerBarOffsets(LLTrace::TimeBlock* time_block, Timer  	LLFastTimer _(FTM_UPDATE_TIMER_BAR_FRACTIONS);  	TimerBar& timer_bar = row.mBars[timer_bar_index]; -	const LLUnit<F32, LLUnits::Seconds> bar_time = timer_bar.mTotalTime - timer_bar.mSelfTime; +	const F32Seconds bar_time = timer_bar.mTotalTime - timer_bar.mSelfTime;  	timer_bar.mChildrenStart = timer_bar.mSelfStart + timer_bar.mSelfTime / 2;  	timer_bar.mChildrenEnd = timer_bar.mChildrenStart + timer_bar.mTotalTime - timer_bar.mSelfTime; diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h index 9d88bb2d3f..d184aae03d 100755 --- a/indra/newview/llfasttimerview.h +++ b/indra/newview/llfasttimerview.h @@ -87,7 +87,7 @@ private:  			mFirstChild(false),  			mLastChild(false)  		{} -		LLUnit<F32, LLUnits::Seconds>	mTotalTime, +		F32Seconds	mTotalTime,  										mSelfTime,  										mChildrenStart,  										mChildrenEnd, @@ -113,7 +113,7 @@ private:  		TimerBar*	mBars;  	}; -	LLUnit<F32, LLUnits::Seconds> updateTimerBarWidths(LLTrace::TimeBlock* time_block, TimerBarRow& row, S32 history_index, U32& bar_index); +	F32Seconds updateTimerBarWidths(LLTrace::TimeBlock* time_block, TimerBarRow& row, S32 history_index, U32& bar_index);  	S32 updateTimerBarOffsets(LLTrace::TimeBlock* time_block, TimerBarRow& row, S32 timer_bar_index = 0);  	S32 drawBar(LLRect bar_rect, TimerBarRow& row, S32 image_width, S32 image_height, bool hovered = false, bool visible = true, S32 bar_index = 0);  	void setPauseState(bool pause_state); @@ -128,7 +128,7 @@ private:  		DISPLAY_HZ  	}								mDisplayType;  	bool							mPauseHistory; -	LLUnit<F64, LLUnits::Seconds>	mAllTimeMax, +	F64Seconds	mAllTimeMax,  									mTotalTimeDisplay;  	S32								mScrollIndex,  									mHoverBarIndex, diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 84f0d115ae..ad94949863 100755 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -259,7 +259,7 @@ LLSD LLFloaterAbout::getInfo()  	// CPU  	info["CPU"] = gSysCPU.getCPUString(); -	info["MEMORY_MB"] = LLSD::Integer(gSysMemory.getPhysicalMemoryKB() / 1024); +	info["MEMORY_MB"] = LLSD::Integer(gSysMemory.getPhysicalMemoryKB().valueInUnits<LLUnits::Mibibytes>());  	// Moved hack adjustment to Windows memory size into llsys.cpp  	info["OS_VERSION"] = LLAppViewer::instance()->getOSInfo().getOSString();  	info["GRAPHICS_CARD_VENDOR"] = (const char*)(glGetString(GL_VENDOR)); diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp index 116bd241c4..adb490d524 100755 --- a/indra/newview/llfloaterhardwaresettings.cpp +++ b/indra/newview/llfloaterhardwaresettings.cpp @@ -89,10 +89,10 @@ void LLFloaterHardwareSettings::refresh()  void LLFloaterHardwareSettings::refreshEnabledState()  { -	S32 min_tex_mem = LLViewerTextureList::getMinVideoRamSetting(); -	S32 max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(); -	getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMinValue(min_tex_mem); -	getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMaxValue(max_tex_mem); +	S32Mibibytes min_tex_mem = LLViewerTextureList::getMinVideoRamSetting(); +	S32Mibibytes max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(); +	getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMinValue(min_tex_mem.value()); +	getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMaxValue(max_tex_mem.value());  	if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") ||  		!gGLManager.mHasVertexBufferObject) diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 59272d721f..34ccab0302 100755 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -159,7 +159,7 @@ LLFloaterIMPanel::LLFloaterIMPanel(const std::string& session_label,  		mCallBackEnabled = LLVoiceClient::getInstance()->isSessionCallBackPossible(mSessionUUID);  		break;  	default: -		llwarns << "Unknown session type" << llendl; +		LL_WARNS() << "Unknown session type" << LL_ENDL;  		xml_filename = "floater_instant_message.xml";  		break;  	} @@ -396,8 +396,8 @@ public:  	void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content)  	{ -		llwarns << "Error inviting all agents to session [status:"  -				<< statusNum << "]: " << content << llendl; +		LL_WARNS() << "Error inviting all agents to session [status:"  +				<< statusNum << "]: " << content << LL_ENDL;  		//throw something back to the viewer here?  	} @@ -417,7 +417,7 @@ BOOL LLFloaterIMPanel::inviteToSession(const std::vector<LLUUID>& ids)  	if( isInviteAllowed() && (count > 0) )  	{ -		llinfos << "LLFloaterIMPanel::inviteToSession() - inviting participants" << llendl; +		LL_INFOS() << "LLFloaterIMPanel::inviteToSession() - inviting participants" << LL_ENDL;  		std::string url = region->getCapability("ChatSessionRequest"); @@ -439,9 +439,9 @@ BOOL LLFloaterIMPanel::inviteToSession(const std::vector<LLUUID>& ids)  	}  	else  	{ -		llinfos << "LLFloaterIMPanel::inviteToSession -" +		LL_INFOS() << "LLFloaterIMPanel::inviteToSession -"  				<< " no need to invite agents for " -				<< mDialog << llendl; +				<< mDialog << LL_ENDL;  		// successful add, because everyone that needed to get added  		// was added.  	} @@ -778,7 +778,7 @@ void LLFloaterIMPanel::sendMsg()  		&& (mDialog == IM_NOTHING_SPECIAL)  		&& mOtherParticipantUUID.isNull())  	{ -		llinfos << "Cannot send IM to everyone unless you're a god." << llendl; +		LL_INFOS() << "Cannot send IM to everyone unless you're a god." << LL_ENDL;  		return;  	} diff --git a/indra/newview/llinspect.cpp b/indra/newview/llinspect.cpp index 14382e82d7..e6cb068613 100755 --- a/indra/newview/llinspect.cpp +++ b/indra/newview/llinspect.cpp @@ -59,7 +59,7 @@ void LLInspect::draw()  	}  	else if (mCloseTimer.getStarted())  	{ -		F32 alpha = clamp_rescale(mCloseTimer.getElapsedTimeF32(), 0.f, FADE_TIME, 1.f, 0.f); +		F32 alpha = clamp_rescale(mCloseTimer.getElapsedTimeF32(), 0.f, FADE_TIME(), 1.f, 0.f);  		LLViewDrawContext context(alpha);  		LLFloater::draw();  		if (mCloseTimer.getElapsedTimeF32() > FADE_TIME) diff --git a/indra/newview/llscenemonitor.cpp b/indra/newview/llscenemonitor.cpp index f0c7a220a4..ecee801e8e 100644 --- a/indra/newview/llscenemonitor.cpp +++ b/indra/newview/llscenemonitor.cpp @@ -525,7 +525,7 @@ void LLSceneMonitor::dumpToFile(std::string file_name)  	PeriodicRecording& scene_load_recording = mSceneLoadRecording.getResults();  	const U32 frame_count = scene_load_recording.getNumRecordedPeriods(); -	LLUnit<F64, LLUnits::Seconds> frame_time; +	F64Seconds frame_time;  	os << "Stat";  	for (S32 frame = 1; frame <= frame_count; frame++) diff --git a/indra/newview/llsrv.cpp b/indra/newview/llsrv.cpp index 567c2a0158..8b9aead165 100755 --- a/indra/newview/llsrv.cpp +++ b/indra/newview/llsrv.cpp @@ -35,7 +35,7 @@ struct Responder : public LLAres::UriRewriteResponder  	void rewriteResult(const std::vector<std::string> &uris) {  		for (size_t i = 0; i < uris.size(); i++)  		{ -			llinfos << "[" << i << "] " << uris[i] << llendl; +			LL_INFOS() << "[" << i << "] " << uris[i] << LL_ENDL;  		}  		mUris = uris;  	} diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 3335ff6631..fdd289c823 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1429,7 +1429,7 @@ bool idle_startup()  		LL_DEBUGS("AppInit") << "Initializing camera..." << LL_ENDL;  		gFrameTime    = totalTime(); -		LLUnit<F32, LLUnits::Seconds> last_time = gFrameTimeSeconds; +		F32Seconds last_time = gFrameTimeSeconds;  		gFrameTimeSeconds = (gFrameTime - gStartTime);  		gFrameIntervalSeconds = gFrameTimeSeconds - last_time; @@ -1507,7 +1507,7 @@ bool idle_startup()  			gFirstSim,  			gSavedSettings.getS32("UseCircuitCodeMaxRetries"),  			FALSE, -			gSavedSettings.getF32("UseCircuitCodeTimeout"), +			(F32Seconds)gSavedSettings.getF32("UseCircuitCodeTimeout"),  			use_circuit_callback,  			NULL); diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 17703fcc21..07ff1de702 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -66,7 +66,7 @@  bool LLTextureFetchDebugger::sDebuggerEnabled = false;  LLTrace::EventStatHandle<LLUnit<F32, LLUnits::Percent> > LLTextureFetch::sCacheHitRate("texture_cache_hits"); -LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Milliseconds> > LLTextureFetch::sCacheReadLatency("texture_cache_read_latency"); +LLTrace::EventStatHandle<F64Milliseconds > LLTextureFetch::sCacheReadLatency("texture_cache_read_latency");  ////////////////////////////////////////////////////////////////////////////// @@ -1888,12 +1888,11 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe  	if (log_to_viewer_log || log_to_sim)  	{ -		U64 timeNow = LLTimer::getTotalTime();  		mFetcher->mTextureInfo.setRequestStartTime(mID, mMetricsStartTime.value());  		mFetcher->mTextureInfo.setRequestType(mID, LLTextureInfoDetails::REQUEST_TYPE_HTTP);  		mFetcher->mTextureInfo.setRequestSize(mID, mRequestedSize);  		mFetcher->mTextureInfo.setRequestOffset(mID, mRequestedOffset); -		mFetcher->mTextureInfo.setRequestCompleteTimeAndLog(mID, timeNow); +		mFetcher->mTextureInfo.setRequestCompleteTimeAndLog(mID, LLTimer::getTotalTime());  	}  	bool success = true; @@ -2394,7 +2393,7 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image  	  mFetcherLocked(FALSE)  {  	mMaxBandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS"); -	mTextureInfo.setUpLogging(gSavedSettings.getBOOL("LogTextureDownloadsToViewerLog"), gSavedSettings.getBOOL("LogTextureDownloadsToSimulator"), LLUnits::Bytes::fromValue(gSavedSettings.getU32("TextureLoggingThreshold"))); +	mTextureInfo.setUpLogging(gSavedSettings.getBOOL("LogTextureDownloadsToViewerLog"), gSavedSettings.getBOOL("LogTextureDownloadsToSimulator"), U32Bytes(gSavedSettings.getU32("TextureLoggingThreshold")));  	LLTextureFetchDebugger::sDebuggerEnabled = gSavedSettings.getBOOL("TextureFetchDebuggerEnabled");  	if(LLTextureFetchDebugger::isEnabled()) @@ -2762,7 +2761,7 @@ bool LLTextureFetch::getRequestFinished(const LLUUID& id, S32& discard_level,  			discard_level = worker->mDecodedDiscard;  			raw = worker->mRawImage;  			aux = worker->mAuxImage; -			LLUnit<F32, LLUnits::Seconds> cache_read_time = worker->mCacheReadTime; +			F32Seconds cache_read_time(worker->mCacheReadTime);  			if (cache_read_time != 0.f)  			{  				record(sCacheReadLatency, cache_read_time); @@ -3373,7 +3372,7 @@ bool LLTextureFetch::receiveImagePacket(const LLHost& host, const LLUUID& id, U1  		if (log_to_viewer_log || log_to_sim)  		{ -			LLUnit<U64, LLUnits::Microseconds> timeNow = LLTimer::getTotalTime(); +			U64Microseconds timeNow = LLTimer::getTotalTime();  			mTextureInfo.setRequestSize(id, worker->mFileSize);  			mTextureInfo.setRequestCompleteTimeAndLog(id, timeNow);  		} diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 38272b40dc..78b13cdd80 100755 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -107,10 +107,10 @@ public:  	bool receiveImagePacket(const LLHost& host, const LLUUID& id, U16 packet_num, U16 data_size, U8* data);      // Threads:  T* (but not safe) -	void setTextureBandwidth(LLUnit<F32, LLUnits::Kibibits> bandwidth) { mTextureBandwidth = bandwidth; } +	void setTextureBandwidth(F32Kibibits bandwidth) { mTextureBandwidth = bandwidth; }      // Threads:  T* (but not safe) -	LLUnit<F32, LLUnits::Kibibits> getTextureBandwidth() { return mTextureBandwidth; } +	F32Kibibits getTextureBandwidth() { return mTextureBandwidth; }      // Threads:  T*  	BOOL isFromLocalCache(const LLUUID& id); @@ -310,7 +310,7 @@ private:  	LLMutex mNetworkQueueMutex; //to protect mNetworkQueue, mHTTPTextureQueue and mCancelQueue.  	static LLTrace::EventStatHandle<LLUnit<F32, LLUnits::Percent> > sCacheHitRate; -	static LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Milliseconds> > sCacheReadLatency; +	static LLTrace::EventStatHandle<F64Milliseconds > sCacheReadLatency;  	LLTextureCache* mTextureCache;  	LLImageDecodeThread* mImageDecodeThread; @@ -325,12 +325,12 @@ private:  	queue_t mHTTPTextureQueue;											// Mfnq  	typedef std::map<LLHost,std::set<LLUUID> > cancel_queue_t;  	cancel_queue_t mCancelQueue;										// Mfnq -	LLUnit<F32, LLUnits::Kibibits> mTextureBandwidth;					// <none> -	LLUnit<F32, LLUnits::Kibibits> mMaxBandwidth;						// Mfnq +	F32Kibibits mTextureBandwidth;					// <none> +	F32Kibibits mMaxBandwidth;						// Mfnq  	LLTextureInfo mTextureInfo;  	// XXX possible delete -	LLUnit<U32, LLUnits::Bits> mHTTPTextureBits;												// Mfnq +	U32Bits mHTTPTextureBits;												// Mfnq  	// XXX possible delete  	//debug use diff --git a/indra/newview/lltextureinfo.cpp b/indra/newview/lltextureinfo.cpp index cd6e7ff464..6906f82c1c 100755 --- a/indra/newview/lltextureinfo.cpp +++ b/indra/newview/lltextureinfo.cpp @@ -33,8 +33,8 @@  static LLTrace::CountStatHandle<S32> sTextureDownloadsStarted("texture_downloads_started", "number of texture downloads initiated");  static LLTrace::CountStatHandle<S32> sTextureDownloadsCompleted("texture_downloads_completed", "number of texture downloads completed"); -static LLTrace::CountStatHandle<LLUnit<S32, LLUnits::Bytes> > sTextureDataDownloaded("texture_data_downloaded", "amount of texture data downloaded"); -static LLTrace::CountStatHandle<LLUnit<U32, LLUnits::Milliseconds> > sTexureDownloadTime("texture_download_time", "amount of time spent fetching textures"); +static LLTrace::CountStatHandle<S32Bytes > sTextureDataDownloaded("texture_data_downloaded", "amount of texture data downloaded"); +static LLTrace::CountStatHandle<U32Milliseconds > sTexureDownloadTime("texture_download_time", "amount of time spent fetching textures");  LLTextureInfo::LLTextureInfo() :   	mLogTextureDownloadsToViewerLog(false), @@ -46,11 +46,11 @@ LLTextureInfo::LLTextureInfo() :  	mRecording.start();  } -void LLTextureInfo::setUpLogging(bool writeToViewerLog, bool sendToSim, LLUnit<U32, LLUnits::Bytes> textureLogThreshold) +void LLTextureInfo::setUpLogging(bool writeToViewerLog, bool sendToSim, U32Bytes textureLogThreshold)  {  	mLogTextureDownloadsToViewerLog = writeToViewerLog;  	mLogTextureDownloadsToSimulator = sendToSim; -	mTextureLogThreshold = LLUnit<U32, LLUnits::Bytes>(textureLogThreshold); +	mTextureLogThreshold = U32Bytes(textureLogThreshold);  }  LLTextureInfo::~LLTextureInfo() @@ -126,7 +126,7 @@ void LLTextureInfo::setRequestType(const LLUUID& id, LLTextureInfoDetails::LLReq  	mTextures[id]->mType = type;  } -void LLTextureInfo::setRequestCompleteTimeAndLog(const LLUUID& id, LLUnit<U64, LLUnits::Microseconds> completeTime) +void LLTextureInfo::setRequestCompleteTimeAndLog(const LLUUID& id, U64Microseconds completeTime)  {  	if (!has(id))  	{ @@ -160,7 +160,7 @@ void LLTextureInfo::setRequestCompleteTimeAndLog(const LLUUID& id, LLUnit<U64, L  			    << " end="      << details.mCompleteTime  			    << " size="     << details.mSize  			    << " offset="   << details.mOffset -			    << " length="   << LLUnit<U32, LLUnits::Milliseconds>(details.mCompleteTime - details.mStartTime) +			    << " length="   << U32Milliseconds(details.mCompleteTime - details.mStartTime)  			    << " protocol=" << protocol  			    << LL_ENDL;  	} @@ -193,7 +193,7 @@ LLSD LLTextureInfo::getAverages()  {  	LLSD averagedTextureData;  	S32 averageDownloadRate; -	LLUnit<U32, LLUnits::Milliseconds> download_time = mRecording.getSum(sTexureDownloadTime); +	U32Milliseconds download_time = mRecording.getSum(sTexureDownloadTime);  	if(download_time == 0)  	{  		averageDownloadRate = 0; @@ -219,11 +219,11 @@ void LLTextureInfo::resetTextureStatistics()  	mCurrentStatsBundleStartTime = LLTimer::getTotalTime();  } -LLUnit<U32, LLUnits::Microseconds> LLTextureInfo::getRequestStartTime(const LLUUID& id) +U32Microseconds LLTextureInfo::getRequestStartTime(const LLUUID& id)  {  	if (!has(id))  	{ -		return 0; +		return U32Microseconds(0);  	}  	else  	{ @@ -232,11 +232,11 @@ LLUnit<U32, LLUnits::Microseconds> LLTextureInfo::getRequestStartTime(const LLUU  	}  } -LLUnit<U32, LLUnits::Bytes> LLTextureInfo::getRequestSize(const LLUUID& id) +U32Bytes LLTextureInfo::getRequestSize(const LLUUID& id)  {  	if (!has(id))  	{ -		return 0; +		return U32Bytes(0);  	}  	else  	{ @@ -271,11 +271,11 @@ LLTextureInfoDetails::LLRequestType LLTextureInfo::getRequestType(const LLUUID&  	}  } -LLUnit<U32, LLUnits::Microseconds> LLTextureInfo::getRequestCompleteTime(const LLUUID& id) +U32Microseconds LLTextureInfo::getRequestCompleteTime(const LLUUID& id)  {  	if (!has(id))  	{ -		return 0; +		return U32Microseconds(0);  	}  	else  	{ diff --git a/indra/newview/lltextureinfo.h b/indra/newview/lltextureinfo.h index a861a12668..176f2cbb74 100755 --- a/indra/newview/lltextureinfo.h +++ b/indra/newview/lltextureinfo.h @@ -38,18 +38,18 @@ public:  	LLTextureInfo();  	~LLTextureInfo(); -	void setUpLogging(bool writeToViewerLog, bool sendToSim, LLUnit<U32, LLUnits::Bytes> textureLogThreshold); +	void setUpLogging(bool writeToViewerLog, bool sendToSim, U32Bytes textureLogThreshold);  	bool has(const LLUUID& id);  	void setRequestStartTime(const LLUUID& id, U64 startTime);  	void setRequestSize(const LLUUID& id, U32 size);  	void setRequestOffset(const LLUUID& id, U32 offset);  	void setRequestType(const LLUUID& id, LLTextureInfoDetails::LLRequestType type); -	void setRequestCompleteTimeAndLog(const LLUUID& id, LLUnit<U64, LLUnits::Microseconds> completeTime); -	LLUnit<U32, LLUnits::Microseconds>getRequestStartTime(const LLUUID& id); -	LLUnit<U32, LLUnits::Bytes> getRequestSize(const LLUUID& id); +	void setRequestCompleteTimeAndLog(const LLUUID& id, U64Microseconds completeTime); +	U32Microseconds getRequestStartTime(const LLUUID& id); +	U32Bytes getRequestSize(const LLUUID& id);  	U32 getRequestOffset(const LLUUID& id);  	LLTextureInfoDetails::LLRequestType getRequestType(const LLUUID& id); -	LLUnit<U32, LLUnits::Microseconds> getRequestCompleteTime(const LLUUID& id); +	U32Microseconds getRequestCompleteTime(const LLUUID& id);  	void resetTextureStatistics();  	U32 getTextureInfoMapSize();  	LLSD getAverages(); @@ -62,8 +62,8 @@ private:  	bool										mLogTextureDownloadsToViewerLog,  												mLogTextureDownloadsToSimulator;  	std::string									mTextureDownloadProtocol; -	LLUnit<U32, LLUnits::Bytes>					mTextureLogThreshold;  -	LLUnit<U64, LLUnits::Microseconds>			mCurrentStatsBundleStartTime; +	U32Bytes					mTextureLogThreshold;  +	U64Microseconds			mCurrentStatsBundleStartTime;  	LLTrace::Recording							mRecording;  }; diff --git a/indra/newview/lltextureinfodetails.h b/indra/newview/lltextureinfodetails.h index 28e957a7df..0ad95eb94e 100755 --- a/indra/newview/lltextureinfodetails.h +++ b/indra/newview/lltextureinfodetails.h @@ -39,10 +39,10 @@ struct LLTextureInfoDetails  		REQUEST_TYPE_UDP  	}; -	LLUnit<U32, LLUnits::Microseconds>	mStartTime, +	U32Microseconds	mStartTime,  										mCompleteTime;  	U32									mOffset; -	LLUnit<U32, LLUnits::Bytes>			mSize; +	U32Bytes			mSize;  	LLRequestType						mType;  	LLTextureInfoDetails(); diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 501914a52f..f39d41c2b8 100755 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -507,17 +507,17 @@ private:  void LLGLTexMemBar::draw()  { -	LLUnit<S32, LLUnits::Mibibytes> bound_mem = LLViewerTexture::sBoundTextureMemory; - 	LLUnit<S32, LLUnits::Mibibytes> max_bound_mem = LLViewerTexture::sMaxBoundTextureMem; -	LLUnit<S32, LLUnits::Mibibytes> total_mem = LLViewerTexture::sTotalTextureMemory; -	LLUnit<S32, LLUnits::Mibibytes> max_total_mem = LLViewerTexture::sMaxTotalTextureMem; +	S32Mibibytes bound_mem = LLViewerTexture::sBoundTextureMemory; + 	S32Mibibytes max_bound_mem = LLViewerTexture::sMaxBoundTextureMem; +	S32Mibibytes total_mem = LLViewerTexture::sTotalTextureMemory; +	S32Mibibytes max_total_mem = LLViewerTexture::sMaxTotalTextureMem;  	F32 discard_bias = LLViewerTexture::sDesiredDiscardBias; -	F32 cache_usage = (F32)LLUnit<F32, LLUnits::Mibibytes>(LLAppViewer::getTextureCache()->getUsage()).value() ; -	F32 cache_max_usage = (F32)LLUnit<F32, LLUnits::Mibibytes>(LLAppViewer::getTextureCache()->getMaxUsage()).value() ; +	F32 cache_usage = (F32)F32Mibibytes(LLAppViewer::getTextureCache()->getUsage()).value() ; +	F32 cache_max_usage = (F32)F32Mibibytes(LLAppViewer::getTextureCache()->getMaxUsage()).value() ;  	S32 line_height = LLFontGL::getFontMonospace()->getLineHeight();  	S32 v_offset = 0;//(S32)((texture_bar_height + 2.2f) * mTextureView->mNumTextureBars + 2.0f); -	LLUnit<F32, LLUnits::Bytes> total_texture_downloaded = gTotalTextureData; -	LLUnit<F32, LLUnits::Bytes> total_object_downloaded = gTotalObjectData; +	F32Bytes total_texture_downloaded = gTotalTextureData; +	F32Bytes total_object_downloaded = gTotalObjectData;  	U32 total_http_requests = LLAppViewer::getTextureFetch()->getTotalNumHTTPRequests();  	U32 total_active_cached_objects = LLWorld::getInstance()->getNumOfActiveCachedObjects();  	U32 total_objects = gObjectList.getNumObjects(); @@ -586,8 +586,8 @@ void LLGLTexMemBar::draw()  	left = 550; -	LLUnit<F32, LLUnits::Kibibits> bandwidth = LLAppViewer::getTextureFetch()->getTextureBandwidth(); -	LLUnit<F32, LLUnits::Kibibits> max_bandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS"); +	F32Kibibits bandwidth = LLAppViewer::getTextureFetch()->getTextureBandwidth(); +	F32Kibibits max_bandwidth(gSavedSettings.getF32("ThrottleBandwidthKBPS"));  	color = bandwidth > max_bandwidth ? LLColor4::red : bandwidth > max_bandwidth*.75f ? LLColor4::yellow : text_color;  	color[VALPHA] = text_color[VALPHA];  	text = llformat("BW:%.0f/%.0f",bandwidth.value(), max_bandwidth.value()); diff --git a/indra/newview/lltoolview.cpp b/indra/newview/lltoolview.cpp index 8c40ff3cb3..678e2c241a 100755 --- a/indra/newview/lltoolview.cpp +++ b/indra/newview/lltoolview.cpp @@ -179,7 +179,7 @@ LLToolContainer* LLToolView::findToolContainer( LLTool *tool )  			return contain;  		}  	} -	llerrs << "LLToolView::findToolContainer - tool not found" << llendl; +	LL_ERRS() << "LLToolView::findToolContainer - tool not found" << LL_ENDL;  	return NULL;  } diff --git a/indra/newview/llviewerassetstats.cpp b/indra/newview/llviewerassetstats.cpp index 579567bb14..e009863002 100755 --- a/indra/newview/llviewerassetstats.cpp +++ b/indra/newview/llviewerassetstats.cpp @@ -233,7 +233,7 @@ namespace LLViewerAssetStatsFF  		&sDequeuedAssetRequestsOther              	}; -	static LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Seconds> >	sResponseAssetRequestsTempTextureHTTP   ("assetresponsetimestemptexturehttp", +	static LLTrace::EventStatHandle<F64Seconds >	sResponseAssetRequestsTempTextureHTTP   ("assetresponsetimestemptexturehttp",  																							"Time spent responding to temporary texture asset http requests"),  													sResponseAssetRequestsTempTextureUDP    ("assetresponsetimestemptextureudp",   																							"Time spent responding to temporary texture asset udp requests"), @@ -250,7 +250,7 @@ namespace LLViewerAssetStatsFF  													sResponsedAssetRequestsOther            ("assetresponsetimesother",   																							"Time spent responding to other asset requests"); -	static LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Seconds> >* sResponse[EVACCount] = { +	static LLTrace::EventStatHandle<F64Seconds >* sResponse[EVACCount] = {  		&sResponseAssetRequestsTempTextureHTTP,     		&sResponseAssetRequestsTempTextureUDP,    		&sResponseAssetRequestsNonTempTextureHTTP, @@ -487,10 +487,10 @@ void LLViewerAssetStats::getStats(AssetStats& stats, bool compact_output)  		grid_from_region_handle(it->first, &grid_x, &grid_y);  		r	.grid_x(grid_x)  			.grid_y(grid_y) -			.duration(LLUnit<F64, LLUnits::Microseconds>(rec.getDuration()).value()); +			.duration(F64Microseconds(rec.getDuration()).value());  	} -	stats.duration(mCurRecording ? LLUnit<F64, LLUnits::Microseconds>(mCurRecording->getDuration()).value() : 0.0); +	stats.duration(mCurRecording ? F64Microseconds(mCurRecording->getDuration()).value() : 0.0);  }  LLSD LLViewerAssetStats::asLLSD(bool compact_output) @@ -540,7 +540,7 @@ void record_response(LLViewerAssetType::EType at, bool with_http, bool is_temp,  {  	const EViewerAssetCategories eac(asset_type_to_category(at, with_http, is_temp)); -	record(*sResponse[int(eac)], LLUnit<F64, LLUnits::Microseconds>(duration)); +	record(*sResponse[int(eac)], F64Microseconds(duration));  }  void init() diff --git a/indra/newview/llviewerassetstats.h b/indra/newview/llviewerassetstats.h index a42060d4d8..aaa299bf4b 100755 --- a/indra/newview/llviewerassetstats.h +++ b/indra/newview/llviewerassetstats.h @@ -82,7 +82,7 @@ public:  	 * for compatibility with the pre-existing timestamp on the texture  	 * fetcher class, LLTextureFetch.  	 */ -	typedef LLUnit<U64, LLUnits::Microseconds> duration_t; +	typedef U64Microseconds duration_t;  	/**  	 * Type for the region identifier used in stats.  Currently uses diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 5523b541a9..d0491450dc 100755 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -287,7 +287,7 @@ static bool handleMaxPartCountChanged(const LLSD& newvalue)  static bool handleVideoMemoryChanged(const LLSD& newvalue)  { -	gTextureList.updateMaxResidentTexMem(newvalue.asInteger()); +	gTextureList.updateMaxResidentTexMem(S32Mibibytes(newvalue.asInteger()));  	return true;  } diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 965c6ffbc6..cb5078b988 100755 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -221,8 +221,8 @@ void display_stats()  	if (mem_log_freq > 0.f && gRecentMemoryTime.getElapsedTimeF32() >= mem_log_freq)  	{  		gMemoryAllocated = LLMemory::getCurrentRSS(); -		U32 memory = (U32)(gMemoryAllocated / (1024*1024)); -		LL_INFOS() << llformat("MEMORY: %d MB", memory) << LL_ENDL; +		U32Mibibytes memory = gMemoryAllocated; +		LL_INFOS() << llformat("MEMORY: %d MB", memory.value()) << LL_ENDL;  		LLMemory::logMemoryInfo(TRUE) ;  		gRecentMemoryTime.reset();  	} diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index f12df23a36..6c435bf147 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4487,18 +4487,18 @@ void send_agent_update(BOOL force_send, BOOL send_reliable)  // *TODO: Remove this dependency, or figure out a better way to handle  // this hack. -extern LLUnit<U32, LLUnits::Bits> gObjectData; +extern U32Bits gObjectData;  void process_object_update(LLMessageSystem *mesgsys, void **user_data)  {	  	// Update the data counters  	if (mesgsys->getReceiveCompressedSize())  	{ -		gObjectData += (LLUnit<U32, LLUnits::Bytes>)mesgsys->getReceiveCompressedSize(); +		gObjectData += (U32Bytes)mesgsys->getReceiveCompressedSize();  	}  	else  	{ -		gObjectData += (LLUnit<U32, LLUnits::Bytes>)mesgsys->getReceiveSize(); +		gObjectData += (U32Bytes)mesgsys->getReceiveSize();  	}  	// Update the object... @@ -4510,11 +4510,11 @@ void process_compressed_object_update(LLMessageSystem *mesgsys, void **user_data  	// Update the data counters  	if (mesgsys->getReceiveCompressedSize())  	{ -		gObjectData += (LLUnit<U32, LLUnits::Bytes>)mesgsys->getReceiveCompressedSize(); +		gObjectData += (U32Bytes)mesgsys->getReceiveCompressedSize();  	}  	else  	{ -		gObjectData += (LLUnit<U32, LLUnits::Bytes>)mesgsys->getReceiveSize(); +		gObjectData += (U32Bytes)mesgsys->getReceiveSize();  	}  	// Update the object... @@ -4526,11 +4526,11 @@ void process_cached_object_update(LLMessageSystem *mesgsys, void **user_data)  	// Update the data counters  	if (mesgsys->getReceiveCompressedSize())  	{ -		gObjectData += (LLUnit<U32, LLUnits::Bytes>)mesgsys->getReceiveCompressedSize(); +		gObjectData += (U32Bytes)mesgsys->getReceiveCompressedSize();  	}  	else  	{ -		gObjectData += (LLUnit<U32, LLUnits::Bytes>)mesgsys->getReceiveSize(); +		gObjectData += (U32Bytes)mesgsys->getReceiveSize();  	}  	// Update the object... @@ -4542,11 +4542,11 @@ void process_terse_object_update_improved(LLMessageSystem *mesgsys, void **user_  {  	if (mesgsys->getReceiveCompressedSize())  	{ -		gObjectData += (LLUnit<U32, LLUnits::Bytes>)mesgsys->getReceiveCompressedSize(); +		gObjectData += (U32Bytes)mesgsys->getReceiveCompressedSize();  	}  	else  	{ -		gObjectData += (LLUnit<U32, LLUnits::Bytes>)mesgsys->getReceiveSize(); +		gObjectData += (U32Bytes)mesgsys->getReceiveSize();  	}  	gObjectList.processCompressedObjectUpdate(mesgsys, user_data, OUT_TERSE_IMPROVED); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 3d75f86154..b054e519e0 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -119,8 +119,8 @@ BOOL		LLViewerObject::sPulseEnabled(FALSE);  BOOL		LLViewerObject::sUseSharedDrawables(FALSE); // TRUE  // sMaxUpdateInterpolationTime must be greater than sPhaseOutUpdateInterpolationTime -F64			LLViewerObject::sMaxUpdateInterpolationTime = 3.0;		// For motion interpolation: after X seconds with no updates, don't predict object motion -F64			LLViewerObject::sPhaseOutUpdateInterpolationTime = 2.0;	// For motion interpolation: after Y seconds with no updates, taper off motion prediction +F64Seconds	LLViewerObject::sMaxUpdateInterpolationTime(3.0);		// For motion interpolation: after X seconds with no updates, don't predict object motion +F64Seconds	LLViewerObject::sPhaseOutUpdateInterpolationTime(2.0);	// For motion interpolation: after Y seconds with no updates, taper off motion prediction  std::map<std::string, U32> LLViewerObject::sObjectDataMap; @@ -2190,7 +2190,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,  		LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(mesgsys->getSender());  		if (cdp)  		{ -			F32 ping_delay = 0.5f * mTimeDilation * ( ((F32)cdp->getPingDelay()) * 0.001f + gFrameDTClamped); +			F32 ping_delay = 0.5f * mTimeDilation * ( ((F32)cdp->getPingDelay().valueInUnits<LLUnits::Seconds>()) + gFrameDTClamped);  			LLVector3 diff = getVelocity() * ping_delay;   			new_pos_parent += diff;  		} @@ -2491,7 +2491,7 @@ void LLViewerObject::interpolateLinearMotion(const F64 & time, const F32 & dt)  				if (cdp)  				{  					// Find out how many seconds since last packet arrived on the circuit -					F64 time_since_last_packet = LLMessageSystem::getMessageTimeSeconds() - cdp->getLastPacketInTime(); +					F64Seconds time_since_last_packet = LLMessageSystem::getMessageTimeSeconds() - cdp->getLastPacketInTime();  					if (!cdp->isAlive() ||		// Circuit is dead or blocked  						 cdp->isBlocked() ||	// or doesn't seem to be getting any packets diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 5556a4c7d3..3943709049 100755 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -780,7 +780,7 @@ protected:  	mutable LLVector3		mPositionRegion;  	mutable LLVector3		mPositionAgent; -	static void setPhaseOutUpdateInterpolationTime(F32 value)	{ sPhaseOutUpdateInterpolationTime = (F64) value;	} +	static void setPhaseOutUpdateInterpolationTime(F32 value)	{ sPhaseOutUpdateInterpolationTime = (F64Seconds) value;	}  	static void setMaxUpdateInterpolationTime(F32 value)		{ sMaxUpdateInterpolationTime = (F64) value;	}  	static void	setVelocityInterpolate(BOOL value)		{ sVelocityInterpolate = value;	} @@ -789,8 +789,8 @@ protected:  private:	  	static S32 sNumObjects; -	static F64 sPhaseOutUpdateInterpolationTime;	// For motion interpolation -	static F64 sMaxUpdateInterpolationTime;			// For motion interpolation +	static F64Seconds sPhaseOutUpdateInterpolationTime;	// For motion interpolation +	static F64Seconds sMaxUpdateInterpolationTime;			// For motion interpolation  	static BOOL sVelocityInterpolate;  	static BOOL sPingInterpolate; diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index e8f68527e9..4643430c6b 100755 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -995,13 +995,13 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)  	// update global timer  	F32 last_time = gFrameTimeSeconds; -	LLUnit<U64, LLUnits::Microseconds> time = totalTime();				 // this will become the new gFrameTime when the update is done +	U64Microseconds time = totalTime();				 // this will become the new gFrameTime when the update is done  	// Time _can_ go backwards, for example if the user changes the system clock.  	// It doesn't cause any fatal problems (just some oddness with stats), so we shouldn't assert here.  //	llassert(time > gFrameTime); -	LLUnit<F64, LLUnits::Seconds> time_diff = time - gFrameTime; +	F64Seconds time_diff = time - gFrameTime;  	gFrameTime	= time; -	LLUnit<F64, LLUnits::Seconds> time_since_start = gFrameTime - gStartTime; +	F64Seconds time_since_start = gFrameTime - gStartTime;  	gFrameTimeSeconds = time_since_start;  	gFrameIntervalSeconds = gFrameTimeSeconds - last_time; diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 9d2a333b1b..e07c2aa8d0 100755 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -401,7 +401,7 @@ public:  	LLWind  mWind;  	LLViewerParcelOverlay	*mParcelOverlay; -	F32		mBitsReceived; +	F32Bits	mBitsReceived;  	F32		mPacketsReceived;  	LLMatrix4 mRenderMatrix; @@ -436,14 +436,14 @@ private:  	BOOL mIsEstateManager;  	U32		mPacketsIn; -	U32		mBitsIn; -	U32		mLastBitsIn; +	U32Bits	mBitsIn, +			mLastBitsIn;  	U32		mLastPacketsIn;  	U32		mPacketsOut;  	U32		mLastPacketsOut;  	S32		mPacketsLost;  	S32		mLastPacketsLost; -	U32		mPingDelay; +	U32Milliseconds		mPingDelay;  	F32		mDeltaTime;				// Time since last measurement of lastPackets, Bits, etc  	U64		mRegionFlags;			// includes damage flags diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 8cb519b098..bb2c13df33 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -95,7 +95,7 @@ LLTrace::CountStatHandle<LLUnit<F64, LLUnits::Kilotriangles> >  LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Kilotriangles> >  							TRIANGLES_DRAWN_PER_FRAME("trianglesdrawnperframestat"); -LLTrace::CountStatHandle<LLUnit<F64, LLUnits::Kibibytes> >	 +LLTrace::CountStatHandle<F64Kibibytes >	  							ACTIVE_MESSAGE_DATA_RECEIVED("activemessagedatareceived", "Message system data received on all active regions"),  							LAYERS_NETWORK_DATA_RECEIVED("layersdatareceived", "Network data received for layer data (terrain)"),  							OBJECT_NETWORK_DATA_RECEIVED("objectdatareceived", "Network data received for objects"), @@ -104,7 +104,7 @@ LLTrace::CountStatHandle<LLUnit<F64, LLUnits::Kibibytes> >  							MESSAGE_SYSTEM_DATA_IN("messagedatain", "Incoming message system network data"),  							MESSAGE_SYSTEM_DATA_OUT("messagedataout", "Outgoing message system network data"); -LLTrace::CountStatHandle<LLUnit<F64, LLUnits::Seconds> >	 +LLTrace::CountStatHandle<F64Seconds >	  							SIM_20_FPS_TIME("sim20fpstime", "Seconds with sim FPS below 20"),  							SIM_PHYSICS_20_FPS_TIME("simphysics20fpstime", "Seconds with physics FPS below 20"),  							LOSS_5_PERCENT_TIME("loss5percenttime", "Seconds with packet loss > 5%"); @@ -152,15 +152,15 @@ LLTrace::SampleStatHandle<LLUnit<F32, LLUnits::Percent> >  static LLTrace::SampleStatHandle<bool>   							CHAT_BUBBLES("chatbubbles", "Chat Bubbles Enabled"); -LLTrace::SampleStatHandle<LLUnit<F64, LLUnits::Megabytes> >	GL_TEX_MEM("gltexmemstat"), +LLTrace::SampleStatHandle<F64Megabytes >	GL_TEX_MEM("gltexmemstat"),  															GL_BOUND_MEM("glboundmemstat"),  															RAW_MEM("rawmemstat"),  															FORMATTED_MEM("formattedmemstat"); -LLTrace::SampleStatHandle<LLUnit<F64, LLUnits::Kibibytes> >	DELTA_BANDWIDTH("deltabandwidth", "Increase/Decrease in bandwidth based on packet loss"), +LLTrace::SampleStatHandle<F64Kibibytes >	DELTA_BANDWIDTH("deltabandwidth", "Increase/Decrease in bandwidth based on packet loss"),  															MAX_BANDWIDTH("maxbandwidth", "Max bandwidth setting"); -SimMeasurement<LLUnit<F64, LLUnits::Milliseconds> >	SIM_FRAME_TIME("simframemsec", "", LL_SIM_STAT_FRAMEMS), +SimMeasurement<F64Milliseconds >	SIM_FRAME_TIME("simframemsec", "", LL_SIM_STAT_FRAMEMS),  													SIM_NET_TIME("simnetmsec", "", LL_SIM_STAT_NETMS),  													SIM_OTHER_TIME("simsimothermsec", "", LL_SIM_STAT_SIMOTHERMS),  													SIM_PHYSICS_TIME("simsimphysicsmsec", "", LL_SIM_STAT_SIMPHYSICSMS), @@ -175,10 +175,10 @@ SimMeasurement<LLUnit<F64, LLUnits::Milliseconds> >	SIM_FRAME_TIME("simframemsec  													SIM_SLEEP_TIME("simsleepmsec", "", LL_SIM_STAT_SIMSLEEPTIME),  													SIM_PUMP_IO_TIME("simpumpiomsec", "", LL_SIM_STAT_IOPUMPTIME); -SimMeasurement<LLUnit<F64, LLUnits::Kilobytes> >	SIM_UNACKED_BYTES("simtotalunackedbytes", "", LL_SIM_STAT_TOTAL_UNACKED_BYTES); -SimMeasurement<LLUnit<F64, LLUnits::Megabytes> >	SIM_PHYSICS_MEM("physicsmemoryallocated", "", LL_SIM_STAT_SIMPHYSICSMEMORY); +SimMeasurement<F64Kilobytes >	SIM_UNACKED_BYTES("simtotalunackedbytes", "", LL_SIM_STAT_TOTAL_UNACKED_BYTES); +SimMeasurement<F64Megabytes >	SIM_PHYSICS_MEM("physicsmemoryallocated", "", LL_SIM_STAT_SIMPHYSICSMEMORY); -LLTrace::SampleStatHandle<LLUnit<F64, LLUnits::Milliseconds> >	FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), +LLTrace::SampleStatHandle<F64Milliseconds >	FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"),  																FRAMETIME_SLEW("frametimeslew", "Average delta between frame time and mean"),  																SIM_PING("simpingstat"); @@ -186,7 +186,7 @@ LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Meters> > AGENT_POSITION_SNAP("age  LLTrace::EventStatHandle<>	LOADING_WEARABLES_LONG_DELAY("loadingwearableslongdelay", "Wearables took too long to load"); -LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Milliseconds> >	REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"), +LLTrace::EventStatHandle<F64Milliseconds >	REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"),  																FRAME_STACKTIME("framestacktime", "FRAME_SECS"),  																UPDATE_STACKTIME("updatestacktime", "UPDATE_SECS"),  																NETWORK_STACKTIME("networkstacktime", "NETWORK_SECS"), @@ -194,7 +194,7 @@ LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Milliseconds> >	REGION_CROSSING_TI  																REBUILD_STACKTIME("rebuildstacktime", "REBUILD_SECS"),  																RENDER_STACKTIME("renderstacktime", "RENDER_SECS"); -LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Seconds> >	AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearance"), +LLTrace::EventStatHandle<F64Seconds >	AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearance"),  															TOOLBOX_TIME("toolboxtime", "Seconds using Toolbox"),  															MOUSELOOK_TIME("mouselooktime", "Seconds in Mouselook"),  															FPS_10_TIME("fps10time", "Seconds below 10 FPS"), @@ -219,7 +219,7 @@ void LLViewerStats::resetStats()  	LLViewerStats::instance().mRecording.reset();  } -void LLViewerStats::updateFrameStats(const LLUnit<F64, LLUnits::Seconds> time_diff) +void LLViewerStats::updateFrameStats(const F64Seconds time_diff)  {  	if (getRecording().getLastValue(LLStatViewer::PACKETS_LOST_PERCENT) > 5.0)  	{ @@ -258,15 +258,15 @@ void LLViewerStats::updateFrameStats(const LLUnit<F64, LLUnits::Seconds> time_di  		add(LLStatViewer::FRAMETIME_DOUBLED, time_diff >= 2.0 * mLastTimeDiff ? 1 : 0);  		// old stats that were never really used -		sample(LLStatViewer::FRAMETIME_JITTER, LLUnit<F64, LLUnits::Milliseconds> (mLastTimeDiff - time_diff)); +		sample(LLStatViewer::FRAMETIME_JITTER, F64Milliseconds (mLastTimeDiff - time_diff));  		F32 average_frametime = gRenderStartTime.getElapsedTimeF32() / (F32)gFrameCount; -		sample(LLStatViewer::FRAMETIME_SLEW, LLUnit<F64, LLUnits::Milliseconds> (average_frametime - time_diff)); +		sample(LLStatViewer::FRAMETIME_SLEW, F64Milliseconds (average_frametime - time_diff));  		F32 max_bandwidth = gViewerThrottle.getMaxBandwidth();  		F32 delta_bandwidth = gViewerThrottle.getCurrentBandwidth() - max_bandwidth; -		sample(LLStatViewer::DELTA_BANDWIDTH, LLUnit<F64, LLUnits::Bits>(delta_bandwidth)); -		sample(LLStatViewer::MAX_BANDWIDTH, LLUnit<F64, LLUnits::Bits>(max_bandwidth)); +		sample(LLStatViewer::DELTA_BANDWIDTH, F64Bits(delta_bandwidth)); +		sample(LLStatViewer::MAX_BANDWIDTH, F64Bits(max_bandwidth));  	}  	mLastTimeDiff = time_diff; @@ -299,13 +299,13 @@ F32		gAveLandCompression = 0.f,  		gWorstLandCompression = 0.f,   		gWorstWaterCompression = 0.f; -LLUnit<U32, LLUnits::Bytes>		gTotalWorldData = 0,  -								gTotalObjectData = 0,  -								gTotalTextureData = 0; +U32Bytes				gTotalWorldData,  +								gTotalObjectData,  +								gTotalTextureData;  U32								gSimPingCount = 0; -LLUnit<U32, LLUnits::Bits>		gObjectData = 0; -F32		gAvgSimPing = 0.f; -LLUnit<U32, LLUnits::Bytes>		gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {0}; +U32Bits				gObjectData; +F32Milliseconds		gAvgSimPing(0.f); +U32Bytes			gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {U32Bytes(0)};  extern U32  gVisCompared;  extern U32  gVisTested; @@ -345,8 +345,8 @@ void update_statistics()  	typedef LLInstanceTracker<LLTrace::TraceType<LLTrace::TimeBlockAccumulator>, std::string> trace_type_t; -	LLUnit<F64, LLUnits::Seconds> idle_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Idle")); -	LLUnit<F64, LLUnits::Seconds> network_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Network")); +	F64Seconds idle_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Idle")); +	F64Seconds network_secs = last_frame_recording.getSum(*trace_type_t::getInstance("Network"));  	record(LLStatViewer::FRAME_STACKTIME, last_frame_recording.getSum(*trace_type_t::getInstance("Frame")));  	record(LLStatViewer::UPDATE_STACKTIME, idle_secs - network_secs); @@ -358,13 +358,13 @@ void update_statistics()  	LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost());  	if (cdp)  	{ -		sample(LLStatViewer::SIM_PING, LLUnit<F64, LLUnits::Milliseconds> (cdp->getPingDelay())); -		gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay())) / ((F32)gSimPingCount + 1); +		sample(LLStatViewer::SIM_PING, F64Milliseconds (cdp->getPingDelay())); +		gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay().value())) / ((F32)gSimPingCount + 1);  		gSimPingCount++;  	}  	else  	{ -		sample(LLStatViewer::SIM_PING, LLUnits::Seconds::fromValue(10)); +		sample(LLStatViewer::SIM_PING, U32Seconds(10));  	}  	if (LLViewerStats::instance().getRecording().getSum(LLStatViewer::FPS)) @@ -374,10 +374,10 @@ void update_statistics()  	add(LLStatViewer::FPS, 1);  	F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits()); -	add(LLStatViewer::LAYERS_NETWORK_DATA_RECEIVED, LLUnit<F64, LLUnits::Bits>(layer_bits)); +	add(LLStatViewer::LAYERS_NETWORK_DATA_RECEIVED, F64Bits(layer_bits));  	add(LLStatViewer::OBJECT_NETWORK_DATA_RECEIVED, gObjectData);  	sample(LLStatViewer::PENDING_VFS_OPERATIONS, LLVFile::getVFSThread()->getPending()); -	add(LLStatViewer::ASSET_UDP_DATA_RECEIVED, LLUnit<F64, LLUnits::Bits>(gTransferManager.getTransferBitsIn(LLTCT_ASSET))); +	add(LLStatViewer::ASSET_UDP_DATA_RECEIVED, F64Bits(gTransferManager.getTransferBitsIn(LLTCT_ASSET)));  	gTransferManager.resetTransferBitsIn(LLTCT_ASSET);  	if (LLAppViewer::getTextureFetch()->getNumRequests() == 0) @@ -494,14 +494,14 @@ void send_stats()  	gSimFrames   = (F32) gFrameCount;  	agent["agents_in_view"] = LLVOAvatar::sNumVisibleAvatars; -	agent["ping"] = gAvgSimPing; +	agent["ping"] = gAvgSimPing.value();  	agent["meters_traveled"] = gAgent.getDistanceTraveled();  	agent["regions_visited"] = gAgent.getRegionsVisited();  	agent["mem_use"] = LLMemory::getCurrentRSS() / 1024.0;  	LLSD &system = body["system"]; -	system["ram"] = (S32) gSysMemory.getPhysicalMemoryKB(); +	system["ram"] = (S32) gSysMemory.getPhysicalMemoryKB().value();  	system["os"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple();  	system["cpu"] = gSysCPU.getCPUString();  	unsigned char MACAddress[MAC_ADDRESS_BYTES]; @@ -553,9 +553,9 @@ void send_stats()  	LLSD &download = body["downloads"]; -	download["world_kbytes"] = LLUnit<F64, LLUnits::Kibibytes>(gTotalWorldData).value(); -	download["object_kbytes"] = LLUnit<F64, LLUnits::Kibibytes>(gTotalObjectData).value(); -	download["texture_kbytes"] = LLUnit<F64, LLUnits::Kibibytes>(gTotalTextureData).value(); +	download["world_kbytes"] = F64Kibibytes(gTotalWorldData).value(); +	download["object_kbytes"] = F64Kibibytes(gTotalObjectData).value(); +	download["texture_kbytes"] = F64Kibibytes(gTotalTextureData).value();  	download["mesh_kbytes"] = LLMeshRepository::sBytesReceived/1024.0;  	LLSD &in = body["stats"]["net"]["in"]; diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index b580606326..42c56e8835 100755 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -142,7 +142,7 @@ extern LLTrace::CountStatHandle<>			FPS,  extern LLTrace::CountStatHandle<LLUnit<F64, LLUnits::Kilotriangles> > TRIANGLES_DRAWN; -extern LLTrace::CountStatHandle<LLUnit<F64, LLUnits::Kibibytes> >	ACTIVE_MESSAGE_DATA_RECEIVED, +extern LLTrace::CountStatHandle<F64Kibibytes >	ACTIVE_MESSAGE_DATA_RECEIVED,  																	LAYERS_NETWORK_DATA_RECEIVED,  																	OBJECT_NETWORK_DATA_RECEIVED,  																	ASSET_UDP_DATA_RECEIVED, @@ -150,7 +150,7 @@ extern LLTrace::CountStatHandle<LLUnit<F64, LLUnits::Kibibytes> >	ACTIVE_MESSAGE  																	MESSAGE_SYSTEM_DATA_IN,  																	MESSAGE_SYSTEM_DATA_OUT; -extern LLTrace::CountStatHandle<LLUnit<F64, LLUnits::Seconds> >		SIM_20_FPS_TIME, +extern LLTrace::CountStatHandle<F64Seconds >		SIM_20_FPS_TIME,  																	SIM_PHYSICS_20_FPS_TIME,  																	LOSS_5_PERCENT_TIME; @@ -192,13 +192,13 @@ extern LLTrace::SampleStatHandle<>		FPS_SAMPLE,  extern LLTrace::SampleStatHandle<LLUnit<F32, LLUnits::Percent> > PACKETS_LOST_PERCENT; -extern LLTrace::SampleStatHandle<LLUnit<F64, LLUnits::Megabytes> >	GL_TEX_MEM, +extern LLTrace::SampleStatHandle<F64Megabytes >	GL_TEX_MEM,  																	GL_BOUND_MEM,  																	RAW_MEM,  																	FORMATTED_MEM; -extern LLTrace::SampleStatHandle<LLUnit<F64, LLUnits::Kibibytes> >	DELTA_BANDWIDTH, +extern LLTrace::SampleStatHandle<F64Kibibytes >	DELTA_BANDWIDTH,  																	MAX_BANDWIDTH; -extern SimMeasurement<LLUnit<F64, LLUnits::Milliseconds> >	SIM_FRAME_TIME, +extern SimMeasurement<F64Milliseconds >	SIM_FRAME_TIME,  															SIM_NET_TIME,  															SIM_OTHER_TIME,  															SIM_PHYSICS_TIME, @@ -213,11 +213,11 @@ extern SimMeasurement<LLUnit<F64, LLUnits::Milliseconds> >	SIM_FRAME_TIME,  															SIM_SLEEP_TIME,  															SIM_PUMP_IO_TIME; -extern SimMeasurement<LLUnit<F64, LLUnits::Kilobytes> >	SIM_UNACKED_BYTES; -extern SimMeasurement<LLUnit<F64, LLUnits::Megabytes> >	SIM_PHYSICS_MEM; +extern SimMeasurement<F64Kilobytes >	SIM_UNACKED_BYTES; +extern SimMeasurement<F64Megabytes >	SIM_PHYSICS_MEM; -extern LLTrace::SampleStatHandle<LLUnit<F64, LLUnits::Milliseconds> >	FRAMETIME_JITTER, +extern LLTrace::SampleStatHandle<F64Milliseconds >	FRAMETIME_JITTER,  																		FRAMETIME_SLEW,  																		SIM_PING; @@ -225,7 +225,7 @@ extern LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Meters> > AGENT_POSITION_SN  extern LLTrace::EventStatHandle<>	LOADING_WEARABLES_LONG_DELAY; -extern LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Milliseconds> >	REGION_CROSSING_TIME, +extern LLTrace::EventStatHandle<F64Milliseconds >	REGION_CROSSING_TIME,  														FRAME_STACKTIME,  														UPDATE_STACKTIME,  														NETWORK_STACKTIME, @@ -233,7 +233,7 @@ extern LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Milliseconds> >	REGION_CROS  														REBUILD_STACKTIME,  														RENDER_STACKTIME; -extern LLTrace::EventStatHandle<LLUnit<F64, LLUnits::Seconds> >	AVATAR_EDIT_TIME, +extern LLTrace::EventStatHandle<F64Seconds >	AVATAR_EDIT_TIME,  																TOOLBOX_TIME,  																MOUSELOOK_TIME,  																FPS_10_TIME, @@ -254,7 +254,7 @@ public:  	LLViewerStats();  	~LLViewerStats(); -	void updateFrameStats(const LLUnit<F64, LLUnits::Seconds> time_diff); +	void updateFrameStats(const F64Seconds time_diff);  	void addToMessage(LLSD &body); @@ -370,7 +370,7 @@ public:  private:  	LLTrace::Recording				mRecording; -	LLUnit<F64, LLUnits::Seconds> mLastTimeDiff;  // used for time stat updates +	F64Seconds mLastTimeDiff;  // used for time stat updates  };  static const F32 SEND_STATS_PERIOD = 300.0f; @@ -380,7 +380,7 @@ void update_statistics();  void send_stats();  extern LLFrameTimer gTextureTimer; -extern LLUnit<U32, LLUnits::Bytes>	gTotalTextureData; -extern LLUnit<U32, LLUnits::Bytes>  gTotalObjectData; -extern LLUnit<U32, LLUnits::Bytes>  gTotalTextureBytesPerBoostLevel[] ; +extern U32Bytes	gTotalTextureData; +extern U32Bytes  gTotalObjectData; +extern U32Bytes  gTotalTextureBytesPerBoostLevel[] ;  #endif // LL_LLVIEWERSTATS_H diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index eb8faacac2..4290d338c1 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -63,8 +63,8 @@  ///////////////////////////////////////////////////////////////////////////////  // extern -const LLUnit<S32, LLUnits::Mibibytes> gMinVideoRam = 32; -const LLUnit<S32, LLUnits::Mibibytes> gMaxVideoRam = 512; +const S32Mibibytes gMinVideoRam(32); +const S32Mibibytes gMaxVideoRam(512);  // statics @@ -86,11 +86,11 @@ S32 LLViewerTexture::sAuxCount = 0;  LLFrameTimer LLViewerTexture::sEvaluationTimer;  F32 LLViewerTexture::sDesiredDiscardBias = 0.f;  F32 LLViewerTexture::sDesiredDiscardScale = 1.1f; -LLUnit<S32, LLUnits::Bytes> LLViewerTexture::sBoundTextureMemory = 0; -LLUnit<S32, LLUnits::Bytes> LLViewerTexture::sTotalTextureMemory = 0; -LLUnit<S32, LLUnits::Mibibytes> LLViewerTexture::sMaxBoundTextureMem = 0; -LLUnit<S32, LLUnits::Mibibytes> LLViewerTexture::sMaxTotalTextureMem = 0; -LLUnit<S32, LLUnits::Bytes> LLViewerTexture::sMaxDesiredTextureMem = 0 ; +S32Bytes LLViewerTexture::sBoundTextureMemory; +S32Bytes LLViewerTexture::sTotalTextureMemory; +S32Mibibytes LLViewerTexture::sMaxBoundTextureMem; +S32Mibibytes LLViewerTexture::sMaxTotalTextureMem; +S32Bytes LLViewerTexture::sMaxDesiredTextureMem;  S8  LLViewerTexture::sCameraMovingDiscardBias = 0 ;  F32 LLViewerTexture::sCameraMovingBias = 0.0f ;  S32 LLViewerTexture::sMaxSculptRez = 128 ; //max sculpt image size @@ -530,17 +530,17 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity  		LLViewerMediaTexture::updateClass() ;  	} -	sBoundTextureMemory = LLImageGL::sBoundTextureMemory;//in bytes -	sTotalTextureMemory = LLImageGL::sGlobalTextureMemory;//in bytes -	sMaxBoundTextureMem = gTextureList.getMaxResidentTexMem();//in MB	 -	sMaxTotalTextureMem = gTextureList.getMaxTotalTextureMem() ;//in MB +	sBoundTextureMemory = LLImageGL::sBoundTextureMemory; +	sTotalTextureMemory = LLImageGL::sGlobalTextureMemory; +	sMaxBoundTextureMem = gTextureList.getMaxResidentTexMem(); +	sMaxTotalTextureMem = gTextureList.getMaxTotalTextureMem();  	sMaxDesiredTextureMem = sMaxTotalTextureMem ; //in Bytes, by default and when total used texture memory is small.  	if (sBoundTextureMemory >= sMaxBoundTextureMem ||  		sTotalTextureMemory >= sMaxTotalTextureMem)  	{  		//when texture memory overflows, lower down the threshold to release the textures more aggressively. -		sMaxDesiredTextureMem = llmin(sMaxDesiredTextureMem * 0.75f, LLUnit<S32, LLUnits::Bytes>(gMaxVideoRam)); +		sMaxDesiredTextureMem = llmin(sMaxDesiredTextureMem * 0.75f, S32Bytes(gMaxVideoRam));  		// If we are using more texture memory than we should,  		// scale up the desired discard level diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index b0eae7c071..9a00ccd8c6 100755 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -38,8 +38,8 @@  #include <map>  #include <list> -extern const LLUnit<S32, LLUnits::Mibibytes> gMinVideoRam; -extern const LLUnit<S32, LLUnits::Mibibytes> gMaxVideoRam; +extern const S32Mibibytes gMinVideoRam; +extern const S32Mibibytes gMaxVideoRam;  class LLImageGL ;  class LLImageRaw; @@ -205,11 +205,11 @@ public:  	static LLFrameTimer sEvaluationTimer;  	static F32 sDesiredDiscardBias;  	static F32 sDesiredDiscardScale; -	static LLUnit<S32, LLUnits::Bytes> sBoundTextureMemory; -	static LLUnit<S32, LLUnits::Bytes> sTotalTextureMemory; -	static LLUnit<S32, LLUnits::Mibibytes> sMaxBoundTextureMem; -	static LLUnit<S32, LLUnits::Mibibytes> sMaxTotalTextureMem; -	static LLUnit<S32, LLUnits::Bytes> sMaxDesiredTextureMem ; +	static S32Bytes sBoundTextureMemory; +	static S32Bytes sTotalTextureMemory; +	static S32Mibibytes sMaxBoundTextureMem; +	static S32Mibibytes sMaxTotalTextureMem; +	static S32Bytes sMaxDesiredTextureMem ;  	static S8  sCameraMovingDiscardBias;  	static F32 sCameraMovingBias;  	static S32 sMaxSculptRez ; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 209334fb46..046dfd6eaf 100755 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -90,7 +90,7 @@ void LLViewerTextureList::init()  	mMaxTotalTextureMemInMegaBytes = 0 ;  	// Update how much texture RAM we're allowed to use. -	updateMaxResidentTexMem(0); // 0 = use current +	updateMaxResidentTexMem(S32Mibibytes(0)); // 0 = use current  	doPreloadImages();  } @@ -671,8 +671,8 @@ void LLViewerTextureList::updateImages(F32 max_time)  		sample(NUM_RAW_IMAGES, LLImageRaw::sRawImageCount);  		sample(GL_TEX_MEM, LLImageGL::sGlobalTextureMemory);  		sample(GL_BOUND_MEM, LLImageGL::sBoundTextureMemory); -		sample(RAW_MEM, LLUnit<F64, LLUnits::Bytes>(LLImageRaw::sGlobalRawMemory)); -		sample(FORMATTED_MEM, LLUnit<F64, LLUnits::Bytes>(LLImageFormatted::sGlobalFormattedMemory)); +		sample(RAW_MEM, F64Bytes(LLImageRaw::sGlobalRawMemory)); +		sample(FORMATTED_MEM, F64Bytes(LLImageFormatted::sGlobalFormattedMemory));  	}  	{ @@ -1237,28 +1237,28 @@ const S32 MIN_VIDEO_RAM = 32;  const S32 MAX_VIDEO_RAM = 512; // 512MB max for performance reasons.  // Returns min setting for TextureMemory (in MB) -S32 LLViewerTextureList::getMinVideoRamSetting() +S32Mibibytes LLViewerTextureList::getMinVideoRamSetting()  { -	S32 system_ram = (S32)BYTES_TO_MEGA_BYTES(gSysMemory.getPhysicalMemoryClamped()); +	S32Mibibytes system_ram = gSysMemory.getPhysicalMemoryClamped();  	//min texture mem sets to 64M if total physical mem is more than 1.5GB -	return (system_ram > 1500) ? 64 : gMinVideoRam.value() ; +	return (system_ram > S32Mibibytes(1500)) ? S32Mibibytes(64) : gMinVideoRam ;  }  //static  // Returns max setting for TextureMemory (in MB) -S32 LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended) +S32Mibibytes LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended)  { -	S32 max_texmem; +	S32Mibibytes max_texmem;  	if (gGLManager.mVRAM != 0)  	{  		// Treat any card with < 32 MB (shudder) as having 32 MB  		//  - it's going to be swapping constantly regardless -		S32 max_vram = gGLManager.mVRAM; +		S32Mibibytes max_vram(gGLManager.mVRAM);  		if(gGLManager.mIsATI)  		{  			//shrink the availabe vram for ATI cards because some of them do not handel texture swapping well. -			max_vram = (S32)(max_vram * 0.75f);   +			max_vram = max_vram * 0.75f;   		}  		max_vram = llmax(max_vram, getMinVideoRamSetting()); @@ -1284,26 +1284,26 @@ S32 LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended)  		LL_WARNS() << "VRAM amount not detected, defaulting to " << max_texmem << " MB" << LL_ENDL;  	} -	S32 system_ram = (S32)BYTES_TO_MEGA_BYTES(gSysMemory.getPhysicalMemoryClamped()); // In MB +	S32Mibibytes system_ram = gSysMemory.getPhysicalMemoryClamped(); // In MB  	//LL_INFOS() << "*** DETECTED " << system_ram << " MB of system memory." << LL_ENDL;  	if (get_recommended) -		max_texmem = llmin(max_texmem, (S32)(system_ram/2)); +		max_texmem = llmin(max_texmem, system_ram/2);  	else -		max_texmem = llmin(max_texmem, (S32)(system_ram)); +		max_texmem = llmin(max_texmem, system_ram); -	max_texmem = llclamp(max_texmem, getMinVideoRamSetting(), gMaxVideoRam.value());  +	max_texmem = llclamp(max_texmem, getMinVideoRamSetting(), gMaxVideoRam);   	return max_texmem;  } -const S32 VIDEO_CARD_FRAMEBUFFER_MEM = 12; // MB -const S32 MIN_MEM_FOR_NON_TEXTURE = 512 ; //MB -void LLViewerTextureList::updateMaxResidentTexMem(S32 mem) +const S32Mibibytes VIDEO_CARD_FRAMEBUFFER_MEM(12); +const S32Mibibytes MIN_MEM_FOR_NON_TEXTURE(512); +void LLViewerTextureList::updateMaxResidentTexMem(S32Mibibytes mem)  {  	// Initialize the image pipeline VRAM settings -	S32 cur_mem = gSavedSettings.getS32("TextureMemory"); +	S32Mibibytes cur_mem(gSavedSettings.getS32("TextureMemory"));  	F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple"); -	S32 default_mem = getMaxVideoRamSetting(true); // recommended default +	S32Mibibytes default_mem(getMaxVideoRamSetting(true)); // recommended default  	if (mem == 0)  	{  		mem = cur_mem > 0 ? cur_mem : default_mem; @@ -1314,35 +1314,35 @@ void LLViewerTextureList::updateMaxResidentTexMem(S32 mem)  	}  	// limit the texture memory to a multiple of the default if we've found some cards to behave poorly otherwise -	mem = llmin(mem, (S32) (mem_multiplier * (F32) default_mem)); +	mem = llmin(mem, S32Mibibytes(mem_multiplier * (F32Mibibytes)default_mem));  	mem = llclamp(mem, getMinVideoRamSetting(), getMaxVideoRamSetting());  	if (mem != cur_mem)  	{ -		gSavedSettings.setS32("TextureMemory", mem); +		gSavedSettings.setS32("TextureMemory", mem.value());  		return; //listener will re-enter this function  	}  	// TODO: set available resident texture mem based on use by other subsystems  	// currently max(12MB, VRAM/4) assumed... -	S32 vb_mem = mem; -	S32 fb_mem = llmax(VIDEO_CARD_FRAMEBUFFER_MEM, vb_mem/4); +	S32Mibibytes vb_mem = mem; +	S32Mibibytes fb_mem = llmax(VIDEO_CARD_FRAMEBUFFER_MEM, vb_mem/4);  	mMaxResidentTexMemInMegaBytes = (vb_mem - fb_mem) ; //in MB  	mMaxTotalTextureMemInMegaBytes = mMaxResidentTexMemInMegaBytes * 2;  	if (mMaxResidentTexMemInMegaBytes > 640)  	{ -		mMaxTotalTextureMemInMegaBytes -= (mMaxResidentTexMemInMegaBytes >> 2); +		mMaxTotalTextureMemInMegaBytes -= (mMaxResidentTexMemInMegaBytes / 4);  	}  	//system mem -	S32 system_ram = (S32)BYTES_TO_MEGA_BYTES(gSysMemory.getPhysicalMemoryClamped()); // In MB +	S32Mibibytes system_ram = gSysMemory.getPhysicalMemoryClamped();  	//minimum memory reserved for non-texture use.  	//if system_raw >= 1GB, reserve at least 512MB for non-texture use;  	//otherwise reserve half of the system_ram for non-texture use. -	S32 min_non_texture_mem = llmin(system_ram / 2, MIN_MEM_FOR_NON_TEXTURE) ;  +	S32Mibibytes min_non_texture_mem = llmin(system_ram / 2, MIN_MEM_FOR_NON_TEXTURE) ;   	if (mMaxTotalTextureMemInMegaBytes > system_ram - min_non_texture_mem)  	{ @@ -1379,7 +1379,7 @@ void LLViewerTextureList::receiveImageHeader(LLMessageSystem *msg, void **user_d  	{  		received_size = msg->getReceiveSize() ;		  	} -	add(LLStatViewer::TEXTURE_NETWORK_DATA_RECEIVED, LLUnit<F64, LLUnits::Bytes>(received_size)); +	add(LLStatViewer::TEXTURE_NETWORK_DATA_RECEIVED, F64Bytes(received_size));  	add(LLStatViewer::TEXTURE_PACKETS, 1);  	U8 codec; @@ -1453,7 +1453,7 @@ void LLViewerTextureList::receiveImagePacket(LLMessageSystem *msg, void **user_d  		received_size = msg->getReceiveSize() ;		  	} -	add(LLStatViewer::TEXTURE_NETWORK_DATA_RECEIVED, LLUnit<F64, LLUnits::Bytes>(received_size)); +	add(LLStatViewer::TEXTURE_NETWORK_DATA_RECEIVED, F64Bytes(received_size));  	add(LLStatViewer::TEXTURE_PACKETS, 1);  	//llprintline("Start decode, image header..."); @@ -1520,18 +1520,19 @@ void LLViewerTextureList::processImageNotInDatabase(LLMessageSystem *msg,void **  ///////////////////////////////////////////////////////////////////////////////  //static -const U32 SIXTEEN_MEG = 0x1000000; -S32 LLViewerTextureList::calcMaxTextureRAM() +const LLUnitImplicit<F32, LLUnits::Mibibytes> SIXTEEN_MEG(16); +S32Bytes LLViewerTextureList::calcMaxTextureRAM()  {  	// Decide the maximum amount of RAM we should allow the user to allocate to texture cache  	LLMemoryInfo memory_info; -	U32 available_memory = memory_info.getPhysicalMemoryClamped(); +	LLUnitImplicit<F32, LLUnits::Mibibytes> available_memory = memory_info.getPhysicalMemoryClamped(); -	clamp_rescale((F32)available_memory, -				  (F32)(SIXTEEN_MEG * 16), -				  (F32)U32_MAX, -				  (F32)(SIXTEEN_MEG * 4), -				  (F32)(U32_MAX >> 1)); +	// as originally written, this code was a no-op.  Not sure of the side effect of making it actually work +	/*clamp_rescale(available_memory.value(), +				  (SIXTEEN_MEG * 16), +				  (F32Mibibytes)U32_MAX, +				  (SIXTEEN_MEG * 4), +				  (F32Mibibytes)(U32_MAX >> 1));*/  	return available_memory;  } diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h index 5b6e927e32..9817fea811 100755 --- a/indra/newview/llviewertexturelist.h +++ b/indra/newview/llviewertexturelist.h @@ -71,7 +71,7 @@ public:  	static BOOL createUploadFile(const std::string& filename, const std::string& out_filename, const U8 codec);  	static LLPointer<LLImageJ2C> convertToUploadFile(LLPointer<LLImageRaw> raw_image);  	static void processImageNotInDatabase( LLMessageSystem *msg, void **user_data ); -	static S32 calcMaxTextureRAM(); +	static S32Bytes calcMaxTextureRAM();  	static void receiveImageHeader(LLMessageSystem *msg, void **user_data);  	static void receiveImagePacket(LLMessageSystem *msg, void **user_data); @@ -101,11 +101,11 @@ public:  	void setUpdateStats(BOOL b)			{ mUpdateStats = b; } -	S32	getMaxResidentTexMem() const	{ return mMaxResidentTexMemInMegaBytes; } -	S32 getMaxTotalTextureMem() const   { return mMaxTotalTextureMemInMegaBytes;} +	S32Mibibytes	getMaxResidentTexMem() const	{ return mMaxResidentTexMemInMegaBytes; } +	S32Mibibytes getMaxTotalTextureMem() const   { return mMaxTotalTextureMemInMegaBytes;}  	S32 getNumImages()					{ return mImageList.size(); } -	void updateMaxResidentTexMem(S32 mem); +	void updateMaxResidentTexMem(S32Mibibytes mem);  	void doPreloadImages();  	void doPrefetchImages(); @@ -113,8 +113,8 @@ public:  	void clearFetchingRequests();  	void setDebugFetching(LLViewerFetchedTexture* tex, S32 debug_level); -	static S32 getMinVideoRamSetting(); -	static S32 getMaxVideoRamSetting(bool get_recommended = false); +	static S32Mibibytes getMinVideoRamSetting(); +	static S32Mibibytes getMaxVideoRamSetting(bool get_recommended = false);  private:  	void updateImagesDecodePriorities(); @@ -200,8 +200,8 @@ private:  	BOOL mInitialized ;  	BOOL mUpdateStats; -	S32	mMaxResidentTexMemInMegaBytes; -	S32 mMaxTotalTextureMemInMegaBytes; +	S32Mibibytes	mMaxResidentTexMemInMegaBytes; +	S32Mibibytes mMaxTotalTextureMemInMegaBytes;  	LLFrameTimer mForceDecodeTimer;  private: diff --git a/indra/newview/llviewerthrottle.cpp b/indra/newview/llviewerthrottle.cpp index 916dec86aa..22de7e150b 100755 --- a/indra/newview/llviewerthrottle.cpp +++ b/indra/newview/llviewerthrottle.cpp @@ -48,8 +48,8 @@ const F32 MIN_FRACTIONAL = 0.2f;  const F32 MIN_BANDWIDTH = 50.f;  const F32 MAX_BANDWIDTH = 3000.f;  const F32 STEP_FRACTIONAL = 0.1f; -const LLUnit<F32, LLUnits::Percent> TIGHTEN_THROTTLE_THRESHOLD = 3.0f; // packet loss % per s -const LLUnit<F32, LLUnits::Percent> EASE_THROTTLE_THRESHOLD = 0.5f; // packet loss % per s +const LLUnit<F32, LLUnits::Percent> TIGHTEN_THROTTLE_THRESHOLD(3.0f); // packet loss % per s +const LLUnit<F32, LLUnits::Percent> EASE_THROTTLE_THRESHOLD(0.5f); // packet loss % per s  const F32 DYNAMIC_UPDATE_DURATION = 5.0f; // seconds  LLViewerThrottle gViewerThrottle; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 12d58b7521..1e60b59932 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -738,7 +738,7 @@ public:  			{  				if(gTotalTextureBytesPerBoostLevel[i] > 0)  				{ -					addText(xpos, ypos, llformat("Boost_Level %d:  %.3f MB", i, LLUnit<F32, LLUnits::Mibibytes>(gTotalTextureBytesPerBoostLevel[i]).value())); +					addText(xpos, ypos, llformat("Boost_Level %d:  %.3f MB", i, F32Mibibytes(gTotalTextureBytesPerBoostLevel[i]).value()));  					ypos += y_inc;  				}  			} diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 12b9744b24..db6d2d6fe9 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -899,7 +899,7 @@ void LLVOAvatarSelf::updateRegion(LLViewerRegion *regionp)  		if (mLastRegionHandle != 0)  		{  			++mRegionCrossingCount; -			LLUnit<F64, LLUnits::Seconds> delta = mRegionCrossingTimer.getElapsedTimeF32(); +			F64Seconds delta(mRegionCrossingTimer.getElapsedTimeF32());  			record(LLStatViewer::REGION_CROSSING_TIME, delta);  			// Diagnostics diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 5e8a771929..93351d21f5 100755 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -6547,7 +6547,7 @@ void LLVivoxVoiceClient::expireVoiceFonts()  	// Give a warning notification if any voice fonts are due to expire.  	if (will_expire)  	{ -		LLUnit<S32, LLUnits::Seconds> seconds = gSavedSettings.getS32("VoiceEffectExpiryWarningTime"); +		S32Seconds seconds(gSavedSettings.getS32("VoiceEffectExpiryWarningTime"));  		args["INTERVAL"] = llformat("%d", LLUnit<S32, LLUnits::Days>(seconds).value());  		LLNotificationsUtil::add("VoiceEffectsWillExpire", args); diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 7e4e80240d..9d727dafbe 100755 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -717,7 +717,7 @@ void LLWorld::renderPropertyLines()  void LLWorld::updateNetStats()  { -	LLUnit<F64, LLUnits::Bits> bits = 0.f; +	F64Bits bits;  	U32 packets = 0;  	for (region_list_t::iterator iter = mActiveRegionList.begin(); @@ -735,8 +735,8 @@ void LLWorld::updateNetStats()  	S32 packets_out = gMessageSystem->mPacketsOut - mLastPacketsOut;  	S32 packets_lost = gMessageSystem->mDroppedPackets - mLastPacketsLost; -	LLUnit<F64, LLUnits::Bits> actual_in_bits = gMessageSystem->mPacketRing.getAndResetActualInBits(); -	LLUnit<F64, LLUnits::Bits> actual_out_bits = gMessageSystem->mPacketRing.getAndResetActualOutBits(); +	F64Bits actual_in_bits(gMessageSystem->mPacketRing.getAndResetActualInBits()); +	F64Bits actual_out_bits(gMessageSystem->mPacketRing.getAndResetActualOutBits());  	add(LLStatViewer::MESSAGE_SYSTEM_DATA_IN, actual_in_bits);  	add(LLStatViewer::MESSAGE_SYSTEM_DATA_OUT, actual_out_bits); diff --git a/indra/newview/skins/default/xui/en/floater_stats.xml b/indra/newview/skins/default/xui/en/floater_stats.xml index aaf191a98a..fc2369276c 100755 --- a/indra/newview/skins/default/xui/en/floater_stats.xml +++ b/indra/newview/skins/default/xui/en/floater_stats.xml @@ -52,13 +52,11 @@       <stat_view name="advanced"                   label="Advanced"                   follows="left|top|right" -                 show_bar="true"                   show_label="true"                   setting="OpenDebugStatAdvanced">          <stat_view name="render"                     label="Render"                     follows="left|top|right" -                   show_bar="true"                     show_label="true"                     setting="OpenDebugStatRender">            <stat_bar name="ktrisframe" @@ -84,7 +82,6 @@          <stat_view name="texture"                     label="Texture"                     follows="left|top|right" -                   show_bar="true"                     show_label="true">            <stat_bar name="texture_cache_hits"                      label="Cache Hit Rate" @@ -122,7 +119,6 @@          <stat_view name="network"                     label="Network"                     follows="left|top|right" -                   show_bar="true"                              show_label="true"                     setting="OpenDebugStatNet">            <stat_bar name="packetsinstat" @@ -168,7 +164,6 @@        <stat_view name="sim"                   label="Simulator"                   follows="left|top|right" -                 show_bar="true"                          show_label="true"                   setting="OpenDebugStatSim">          <stat_bar name="simtimedilation" @@ -189,7 +184,6 @@          <stat_view name="physicsdetail"                     label="Physics Details"                     follows="left|top|right" -                   show_bar="true"                              show_label="true">            <stat_bar name="physicspinnedtasks"                      label="Pinned Objects" @@ -237,7 +231,6 @@          <stat_view name="simpathfinding"                     label="Pathfinding"                     follows="left|top|right" -                   show_bar="true"                             show_label="true">            <stat_bar name="simsimaistepmsec"                      label="AI Step Time" @@ -274,7 +267,6 @@          <stat_view name="simperf"                     label="Time"                     follows="left|top|right" -                   show_bar="true"                     show_label="true">            <stat_bar name="simframemsec"                      label="Total Frame Time" @@ -311,7 +303,6 @@            <stat_view name="timedetails"                       label="Time Details"                       follows="left|top|right" -                     show_bar="true"                       show_label="true">              <stat_bar name="simsimphysicsstepmsec"                        label="Physics Step" diff --git a/indra/newview/tests/lltexturestatsuploader_test.cpp b/indra/newview/tests/lltexturestatsuploader_test.cpp index cfb2c267cc..4438523022 100755 --- a/indra/newview/tests/lltexturestatsuploader_test.cpp +++ b/indra/newview/tests/lltexturestatsuploader_test.cpp @@ -111,7 +111,7 @@ namespace tut  	void texturestatsuploader_object_t::test<1>()  	{  		LLTextureStatsUploader tsu; -		llinfos << &tsu << llendl; +		LL_INFOS() << &tsu << LL_ENDL;  		ensure("have we crashed?", true);  	} diff --git a/indra/test/lldatapacker_tut.cpp b/indra/test/lldatapacker_tut.cpp index cf2b7870ef..b403660c13 100755 --- a/indra/test/lldatapacker_tut.cpp +++ b/indra/test/lldatapacker_tut.cpp @@ -349,7 +349,7 @@ namespace tut  		LLFILE* fp = LLFile::fopen(TEST_FILE_NAME, "w+");  		if(!fp)  		{ -			llerrs << "File couldnt be open" <<llendl; +			LL_ERRS() << "File couldnt be open" << LL_ENDL;  			return;  		} @@ -404,7 +404,7 @@ namespace tut  		LLFILE* fp = LLFile::fopen(TEST_FILE_NAME,"w+");  		if(!fp)  		{ -			llerrs << "File couldnt be open" <<llendl; +			LL_ERRS() << "File couldnt be open" << LL_ENDL;  			return;  		} diff --git a/indra/test/llmessagetemplateparser_tut.cpp b/indra/test/llmessagetemplateparser_tut.cpp index da6d229fb5..39f834a9fc 100755 --- a/indra/test/llmessagetemplateparser_tut.cpp +++ b/indra/test/llmessagetemplateparser_tut.cpp @@ -171,7 +171,7 @@ namespace tut  		delete var; -		// *NOTE: the parsers call llerrs on invalid input, so we can't really +		// *NOTE: the parsers call LL_ERRS() on invalid input, so we can't really  		// test that  :-(  	} | 
