converted a bunch of narrowing implicit conversions to explicit

master
Richard Linden 2012-02-01 13:03:46 -08:00
parent b396089906
commit 5a14a67e06
32 changed files with 96 additions and 107 deletions

View File

@ -215,7 +215,7 @@ BOOL LLVorbisDecodeState::initDecode()
return(FALSE);
}
S32 sample_count = ov_pcm_total(&mVF, -1);
S32 sample_count = (S32)ov_pcm_total(&mVF, -1);
size_t size_guess = (size_t)sample_count;
vorbis_info* vi = ov_info(&mVF, -1);
size_guess *= (vi? vi->channels : 1);

View File

@ -52,24 +52,12 @@
#include <ctime>
#include <iosfwd>
// Work around Microsoft compiler warnings in STL headers
#ifdef LL_WINDOWS
#pragma warning (disable : 4702) // unreachable code
#pragma warning (disable : 4244) // conversion from time_t to S32
#endif // LL_WINDOWS
// *TODO: Eliminate these, most library .cpp files don't need them.
// Add them to llviewerprecompiledheaders.h if necessary.
#include <list>
#include <map>
#include <vector>
#include <string>
#ifdef LL_WINDOWS
// Reenable warnings we disabled above
#pragma warning (3 : 4702) // unreachable code, we like level 3, not 4
// moved msvc warnings to llpreprocessor.h *TODO - delete this comment after merge conflicts are unlikely -brad
#endif // LL_WINDOWS
//#include <list>
//#include <map>
//#include <vector>
//#include <string>
// Linden only libs in alpha-order other than stdtypes.h
// *NOTE: Please keep includes here to a minimum, see above.

View File

@ -430,13 +430,13 @@ LLBoundListener LLEventPump::listen_impl(const std::string& name, const LLEventL
{
// The new node isn't last. Place it between the previous node and
// the successor.
newNode = (myprev + mydmi->second)/2.0;
newNode = (myprev + mydmi->second)/2.f;
}
else
{
// The new node is last. Bump myprev up to the next integer, add
// 1.0 and use that.
newNode = std::ceil(myprev) + 1.0;
newNode = std::ceil(myprev) + 1.f;
}
// Now that newNode has a value that places it appropriately in mSignal,
// connect it.

View File

@ -175,7 +175,7 @@ void LLMD5::update(std::istream& stream){
while (stream.good()){
stream.read( (char*)buffer, BLOCK_LEN); /* Flawfinder: ignore */ // note that return value of read is unusable.
len=stream.gcount();
len=(int)stream.gcount();
update(buffer, len);
}

View File

@ -132,7 +132,7 @@
#pragma warning( 3 : 4265 ) // "class has virtual functions, but destructor is not virtual"
#pragma warning( 3 : 4266 ) // 'function' : no override available for virtual member function from base 'type'; function is hidden
#pragma warning (disable : 4180) // qualifier applied to function type has no meaning; ignored
#pragma warning( disable : 4284 ) // silly MS warning deep inside their <map> include file
//#pragma warning( disable : 4284 ) // silly MS warning deep inside their <map> include file
#pragma warning( disable : 4503 ) // 'decorated name length exceeded, name was truncated'. Does not seem to affect compilation.
#pragma warning( disable : 4800 ) // 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
#pragma warning( disable : 4996 ) // warning: deprecated
@ -152,6 +152,7 @@
#pragma warning (disable : 4251) // member needs to have dll-interface to be used by clients of class
#pragma warning (disable : 4275) // non dll-interface class used as base for dll-interface class
#pragma warning (disable : 4018) // '<' : signed/unsigned mismatch
#endif // LL_MSVC
#if LL_WINDOWS

View File

@ -110,7 +110,7 @@ bool LLSDSerialize::deserialize(LLSD& sd, std::istream& str, S32 max_bytes)
if (!strncasecmp(LEGACY_NON_HEADER, hdr_buf, strlen(LEGACY_NON_HEADER))) /* Flawfinder: ignore */
{
legacy_no_header = true;
inbuf = str.gcount();
inbuf = (int)str.gcount();
}
else
{
@ -343,7 +343,7 @@ std::istream& LLSDParser::get(
char delim) const
{
istr.get(s, n, delim);
if(mCheckLimits) mMaxBytesLeft -= istr.gcount();
if(mCheckLimits) mMaxBytesLeft -= (int)istr.gcount();
return istr;
}
@ -353,7 +353,7 @@ std::istream& LLSDParser::get(
char delim) const
{
istr.get(sb, delim);
if(mCheckLimits) mMaxBytesLeft -= istr.gcount();
if(mCheckLimits) mMaxBytesLeft -= (int)istr.gcount();
return istr;
}
@ -377,7 +377,7 @@ std::istream& LLSDParser::read(
std::streamsize n) const
{
istr.read(s, n);
if(mCheckLimits) mMaxBytesLeft -= istr.gcount();
if(mCheckLimits) mMaxBytesLeft -= (int)istr.gcount();
return istr;
}
@ -789,7 +789,7 @@ bool LLSDNotationParser::parseBinary(std::istream& istr, LLSD& data) const
if(len)
{
value.resize(len);
account(fullread(istr, (char *)&value[0], len));
account((int)fullread(istr, (char *)&value[0], len));
}
c = get(istr); // strip off the trailing double-quote
data = value;
@ -1069,7 +1069,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const
if(size > 0)
{
value.resize(size);
account(fullread(istr, (char*)&value[0], size));
account((int)fullread(istr, (char*)&value[0], size));
}
data = value;
}
@ -1200,7 +1200,7 @@ bool LLSDBinaryParser::parseString(
if(size)
{
buf.resize(size);
account(fullread(istr, &buf[0], size));
account((int)fullread(istr, &buf[0], size));
value.assign(buf.begin(), buf.end());
}
return true;
@ -1642,7 +1642,7 @@ int deserialize_string_raw(
const S32 BUF_LEN = 20;
char buf[BUF_LEN]; /* Flawfinder: ignore */
istr.get(buf, BUF_LEN - 1, ')');
count += istr.gcount();
count += (int)istr.gcount();
int c = istr.get();
c = istr.get();
count += 2;
@ -1657,7 +1657,7 @@ int deserialize_string_raw(
if(len)
{
buf.resize(len);
count += fullread(istr, (char *)&buf[0], len);
count += (int)fullread(istr, (char *)&buf[0], len);
value.assign(buf.begin(), buf.end());
}
c = istr.get();

View File

@ -464,7 +464,7 @@ S32 LLSDXMLParser::Impl::parseLines(std::istream& input, LLSD& data)
}
}
status = XML_ParseBuffer(mParser, num_read, false);
status = XML_ParseBuffer(mParser, (int)num_read, false);
if (status == XML_STATUS_ERROR)
{
break;

View File

@ -308,7 +308,7 @@ class LLSDParam<T> \
{ \
public: \
LLSDParam(const LLSD& value): \
_value(value.AS()) \
_value((T)value.AS()) \
{} \
\
operator T() const { return _value; } \

View File

@ -593,7 +593,7 @@ void LLStatTime::stop()
{
if ( LLStatAccum::SCALE_PER_FRAME == scale )
{
return mTotalTimeInFrame;
return (F32)mTotalTimeInFrame;
}
else
{

View File

@ -83,7 +83,7 @@ U32 micro_sleep(U64 us, U32 max_yields)
{
// max_yields is unused; just fiddle with it to avoid warnings.
max_yields = 0;
ms_sleep(us / 1000);
ms_sleep((U32)(us / 1000));
return 0;
}
#elif LL_LINUX || LL_SOLARIS || LL_DARWIN

View File

@ -250,7 +250,7 @@ void LLCrashLogger::gatherFiles()
if(minidump_stream.is_open())
{
minidump_stream.seekg(0, std::ios::end);
size_t length = minidump_stream.tellg();
size_t length = (size_t)minidump_stream.tellg();
minidump_stream.seekg(0, std::ios::beg);
LLSD::Binary data;

View File

@ -501,10 +501,10 @@ void LLImageCompressionTester::outputTestRecord(LLSD *sd)
F32 decompressionRate = 0.0f;
F32 compressionRate = 0.0f;
F32 totalkBInDecompression = (F32)(mTotalBytesInDecompression) / 1000.0;
F32 totalkBOutDecompression = (F32)(mTotalBytesOutDecompression) / 1000.0;
F32 totalkBInCompression = (F32)(mTotalBytesInCompression) / 1000.0;
F32 totalkBOutCompression = (F32)(mTotalBytesOutCompression) / 1000.0;
F32 totalkBInDecompression = (F32)(mTotalBytesInDecompression) / 1000.f;
F32 totalkBOutDecompression = (F32)(mTotalBytesOutDecompression) / 1000.f;
F32 totalkBInCompression = (F32)(mTotalBytesInCompression) / 1000.f;
F32 totalkBOutCompression = (F32)(mTotalBytesOutCompression) / 1000.f;
if (!is_approx_zero(mTotalTimeDecompression))
{

View File

@ -405,7 +405,7 @@ U32 LLInventoryItem::getCRC32() const
//lldebugs << "7 crc: " << std::hex << crc << std::dec << llendl;
crc += mSaleInfo.getCRC32();
//lldebugs << "8 crc: " << std::hex << crc << std::dec << llendl;
crc += mCreationDate;
crc += (U32)mCreationDate;
//lldebugs << "9 crc: " << std::hex << crc << std::dec << llendl;
return crc;
}
@ -521,7 +521,7 @@ void LLInventoryItem::packMessage(LLMessageSystem* msg) const
mSaleInfo.packMessage(msg);
msg->addStringFast(_PREHASH_Name, mName);
msg->addStringFast(_PREHASH_Description, mDescription);
msg->addS32Fast(_PREHASH_CreationDate, mCreationDate);
msg->addS32Fast(_PREHASH_CreationDate, (S32)mCreationDate);
U32 crc = getCRC32();
msg->addU32Fast(_PREHASH_CRC, crc);
}

View File

@ -174,7 +174,7 @@ private:
F32 _log(const F32& a) const { return log(a); }
F32 _exp(const F32& a) const { return exp(a); }
F32 _fabs(const F32& a) const { return fabs(a); }
F32 _floor(const F32& a) const { return llfloor(a); }
F32 _floor(const F32& a) const { return (F3)llfloor(a); }
F32 _ceil(const F32& a) const { return llceil(a); }
F32 _atan2(const F32& a,const F32& b) const { return atan2(a,b); }

View File

@ -2903,7 +2903,7 @@ F32 LLVolume::sculptGetSurfaceArea()
// compute the area of the quad by taking the length of the cross product of the two triangles
LLVector3 cross1 = (p1 - p2) % (p1 - p3);
LLVector3 cross2 = (p4 - p2) % (p4 - p3);
area += (cross1.magVec() + cross2.magVec()) / 2.0;
area += (cross1.magVec() + cross2.magVec()) / 2.f;
}
}
@ -5887,7 +5887,7 @@ F32 find_vertex_score(LLVCacheVertexData& data)
}
//bonus points for having low valence
F32 valence_boost = powf(data.mActiveTriangles, -FindVertexScore_ValenceBoostPower);
F32 valence_boost = powf((F32)data.mActiveTriangles, -FindVertexScore_ValenceBoostPower);
score += FindVertexScore_ValenceBoostScale * valence_boost;
return score;

View File

@ -858,25 +858,25 @@ LLSD LLMatrix4::getValue() const
void LLMatrix4::setValue(const LLSD& data)
{
mMatrix[0][0] = data[0].asReal();
mMatrix[0][1] = data[1].asReal();
mMatrix[0][2] = data[2].asReal();
mMatrix[0][3] = data[3].asReal();
mMatrix[0][0] = (F32)data[0].asReal();
mMatrix[0][1] = (F32)data[1].asReal();
mMatrix[0][2] = (F32)data[2].asReal();
mMatrix[0][3] = (F32)data[3].asReal();
mMatrix[1][0] = data[4].asReal();
mMatrix[1][1] = data[5].asReal();
mMatrix[1][2] = data[6].asReal();
mMatrix[1][3] = data[7].asReal();
mMatrix[1][0] = (F32)data[4].asReal();
mMatrix[1][1] = (F32)data[5].asReal();
mMatrix[1][2] = (F32)data[6].asReal();
mMatrix[1][3] = (F32)data[7].asReal();
mMatrix[2][0] = data[8].asReal();
mMatrix[2][1] = data[9].asReal();
mMatrix[2][2] = data[10].asReal();
mMatrix[2][3] = data[11].asReal();
mMatrix[2][0] = (F32)data[8].asReal();
mMatrix[2][1] = (F32)data[9].asReal();
mMatrix[2][2] = (F32)data[10].asReal();
mMatrix[2][3] = (F32)data[11].asReal();
mMatrix[3][0] = data[12].asReal();
mMatrix[3][1] = data[13].asReal();
mMatrix[3][2] = data[14].asReal();
mMatrix[3][3] = data[15].asReal();
mMatrix[3][0] = (F32)data[12].asReal();
mMatrix[3][1] = (F32)data[13].asReal();
mMatrix[3][2] = (F32)data[14].asReal();
mMatrix[3][3] = (F32)data[15].asReal();
}

View File

@ -273,7 +273,7 @@ streampos LLBufferStreamBuf::seekoff(
// NULL is fine
break;
}
address = mBuffer->seek(mChannels.in(), base_addr, off);
address = (S32)mBuffer->seek(mChannels.in(), base_addr, off);
if(address)
{
LLBufferArray::segment_iterator_t iter;
@ -304,7 +304,7 @@ streampos LLBufferStreamBuf::seekoff(
// NULL is fine
break;
}
address = mBuffer->seek(mChannels.out(), base_addr, off);
address = (S32)mBuffer->seek(mChannels.out(), base_addr, off);
if(address)
{
LLBufferArray::segment_iterator_t iter;

View File

@ -428,9 +428,9 @@ size_t curlReadCallback(char* data, size_t size, size_t nmemb, void* user_data)
LLCurl::Easy* easy = (LLCurl::Easy*)user_data;
S32 n = size * nmemb;
S32 startpos = easy->getInput().tellg();
S32 startpos = (S32)easy->getInput().tellg();
easy->getInput().seekg(0, std::ios::end);
S32 endpos = easy->getInput().tellg();
S32 endpos = (S32)easy->getInput().tellg();
easy->getInput().seekg(startpos, std::ios::beg);
S32 maxn = endpos - startpos;
n = llmin(n, maxn);

View File

@ -158,7 +158,7 @@ namespace
if(fstream.is_open())
{
fstream.seekg(0, std::ios::end);
U32 fileSize = fstream.tellg();
U32 fileSize = (U32)fstream.tellg();
fstream.seekg(0, std::ios::beg);
std::vector<char> fileBuffer(fileSize);
fstream.read(&fileBuffer[0], fileSize);

View File

@ -388,7 +388,7 @@ bool LLMimeParser::Impl::parseHeaders(
// not to read past limit when we get() the newline.
S32 max_get = llmin((S32)LINE_BUFFER_LENGTH, limit - mScanCount - 1);
istr.getline(mBuffer, max_get, '\r');
mScanCount += istr.gcount();
mScanCount += (S32)istr.gcount();
int c = istr.get();
if(EOF == c)
{
@ -496,7 +496,7 @@ void LLMimeParser::Impl::scanPastSeparator(
// past limit when we get() the newline.
S32 max_get = llmin((S32)LINE_BUFFER_LENGTH, limit - mScanCount - 1);
istr.getline(mBuffer, max_get, '\r');
mScanCount += istr.gcount();
mScanCount += (S32)istr.gcount();
if(istr.gcount() >= LINE_BUFFER_LENGTH - 1)
{
// that's way too long to be a separator, so ignore it.

View File

@ -88,7 +88,7 @@ bool LLSDMessage::httpListener(const LLSD& request)
request,
url, "POST", reply, error),
LLSD(), // headers
timeout);
(F32)timeout);
return false;
}

View File

@ -317,7 +317,7 @@ void LLSDMessageBuilder::copyFromMessageData(const LLMsgData& data)
// S64 not supported in LLSD so we just truncate it
case MVT_S64:
addS32(varname, *(S64*)mvci.getData());
addS32(varname, (S32)*(S64*)mvci.getData());
break;
case MVT_F32:

View File

@ -3147,7 +3147,7 @@ bool LLMessageSystem::generateDigestForWindowAndUUIDs(char* digest, const S32 wi
LL_ERRS("Messaging") << "Trying to generate complex digest on a machine without a shared secret!" << llendl;
}
U32 now = time(NULL);
U32 now = (U32)time(NULL);
now /= window;
@ -3167,7 +3167,7 @@ bool LLMessageSystem::isMatchingDigestForWindowAndUUIDs(const char* digest, cons
}
char our_digest[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */
U32 now = time(NULL);
U32 now = (U32)time(NULL);
now /= window;
@ -3213,7 +3213,7 @@ bool LLMessageSystem::generateDigestForWindow(char* digest, const S32 window) co
LL_ERRS("Messaging") << "Trying to generate simple digest on a machine without a shared secret!" << llendl;
}
U32 now = time(NULL);
U32 now = (U32)time(NULL);
now /= window;

View File

@ -115,23 +115,23 @@ static LLFastTimer::DeclareTimer FTM_RENDER_FONTS("Fonts");
S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, const LLRect& rect, const LLColor4 &color, HAlign halign, VAlign valign, U8 style,
ShadowType shadow, S32 max_chars, F32* right_x, BOOL use_ellipses) const
{
F32 x = rect.mLeft;
F32 x = (F32)rect.mLeft;
F32 y = 0.f;
switch(valign)
{
case TOP:
y = rect.mTop;
y = (F32)rect.mTop;
break;
case VCENTER:
y = rect.getCenterY();
y = (F32)rect.getCenterY();
break;
case BASELINE:
case BOTTOM:
y = rect.mBottom;
y = (F32)rect.mBottom;
break;
default:
y = rect.mBottom;
y = (F32)rect.mBottom;
break;
}
return render(wstr, begin_offset, x, y, color, halign, valign, style, shadow, max_chars, rect.getWidth(), right_x, use_ellipses);
@ -251,7 +251,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
cur_render_y = cur_y;
cur_render_x = cur_x;
F32 start_x = llround(cur_x);
F32 start_x = (F32)llround(cur_x);
const LLFontBitmapCache* font_bitmap_cache = mFontFreetype->getFontBitmapCache();
@ -335,10 +335,10 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
(fgi->mXBitmapOffset + fgi->mWidth) * inv_width,
(fgi->mYBitmapOffset - PAD_UVY) * inv_height);
// snap glyph origin to whole screen pixel
LLRectf screen_rect(llround(cur_render_x + (F32)fgi->mXBearing),
llround(cur_render_y + (F32)fgi->mYBearing),
llround(cur_render_x + (F32)fgi->mXBearing) + (F32)fgi->mWidth,
llround(cur_render_y + (F32)fgi->mYBearing) - (F32)fgi->mHeight);
LLRectf screen_rect((F32)llround(cur_render_x + (F32)fgi->mXBearing),
(F32)llround(cur_render_y + (F32)fgi->mYBearing),
(F32)llround(cur_render_x + (F32)fgi->mXBearing) + (F32)fgi->mWidth,
(F32)llround(cur_render_y + (F32)fgi->mYBearing) - (F32)fgi->mHeight);
if (glyph_count >= GLYPH_BATCH_SIZE)
{
@ -636,7 +636,7 @@ S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_ch
}
// Round after kerning.
cur_x = llround(cur_x);
cur_x = (F32)llround(cur_x);
drawn_x = cur_x;
}
@ -707,7 +707,7 @@ S32 LLFontGL::firstDrawableChar(const llwchar* wchars, F32 max_pixels, S32 text_
}
// Round after kerning.
total_width = llround(total_width);
total_width = (F32)llround(total_width);
}
if (drawable_chars == 0)
@ -790,7 +790,7 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, S32 begin_offset, F32 t
// Round after kerning.
cur_x = llround(cur_x);
cur_x = (F32)llround(cur_x);
}
return llmin(max_chars, pos - begin_offset);

View File

@ -244,7 +244,7 @@ void LLDragHandleTop::reshapeTitleBox()
const LLFontGL* font = LLFontGL::getFontSansSerif();
S32 title_width = getRect().getWidth();
title_width -= LEFT_PAD + 2 * BORDER_PAD + getButtonsRect().getWidth();
S32 title_height = font->getLineHeight();
S32 title_height = llround(font->getLineHeight());
LLRect title_rect;
title_rect.setLeftTopAndSize(
LEFT_PAD,

View File

@ -45,7 +45,7 @@ void LLLFSThread::initClass(bool local_is_threaded)
//static
S32 LLLFSThread::updateClass(U32 ms_elapsed)
{
sLocal->update(ms_elapsed);
sLocal->update((F32)ms_elapsed);
return sLocal->getPending();
}

View File

@ -46,7 +46,7 @@ void LLVFSThread::initClass(bool local_is_threaded)
//static
S32 LLVFSThread::updateClass(U32 ms_elapsed)
{
sLocal->update(ms_elapsed);
sLocal->update((F32)ms_elapsed);
return sLocal->getPending();
}

View File

@ -801,7 +801,7 @@ bool LLXMLNode::parseStream(
while(str.good())
{
str.read((char*)buffer, BUFSIZE);
int count = str.gcount();
int count = (int)str.gcount();
if (XML_Parse(my_parser, (const char *)buffer, count, !str.good()) != XML_STATUS_OK)
{

View File

@ -705,7 +705,7 @@ private:
// look up "Display Name" in meta data
OSType meta_data_key = kQTMetaDataCommonKeyDisplayName;
QTMetaDataItem item = kQTMetaDataItemUninitialized;
result = QTMetaDataGetNextItem( media_data_ref, kQTMetaDataStorageFormatWildcard,
result = (OSErr)QTMetaDataGetNextItem( media_data_ref, kQTMetaDataStorageFormatWildcard,
0, kQTMetaDataKeyFormatCommon,
(const UInt8 *)&meta_data_key,
sizeof( meta_data_key ), &item );
@ -714,14 +714,14 @@ private:
// find the size of the title
ByteCount size;
result = QTMetaDataGetItemValue( media_data_ref, item, NULL, 0, &size );
result = (OSErr)QTMetaDataGetItemValue( media_data_ref, item, NULL, 0, &size );
if ( noErr != result || size <= 0 /*|| size > 1024 FIXME: arbitrary limit */ )
return false;
// allocate some space and grab it
UInt8* item_data = new UInt8[ size + 1 ];
memset( item_data, 0, ( size + 1 ) * sizeof( UInt8 ) );
result = QTMetaDataGetItemValue( media_data_ref, item, item_data, size, NULL );
result = (OSErr)QTMetaDataGetItemValue( media_data_ref, item, item_data, size, NULL );
if ( noErr != result )
{
delete [] item_data;

View File

@ -991,7 +991,7 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
{
if(message_name == "set_volume")
{
F32 volume = message_in.getValueReal("volume");
F32 volume = (F32)message_in.getValueReal("volume");
setVolume(volume);
}
}
@ -1057,9 +1057,9 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
S32 height = message_in.getValueS32("height");
S32 texture_width = message_in.getValueS32("texture_width");
S32 texture_height = message_in.getValueS32("texture_height");
mBackgroundR = message_in.getValueReal("background_r");
mBackgroundG = message_in.getValueReal("background_g");
mBackgroundB = message_in.getValueReal("background_b");
mBackgroundR = (F32)message_in.getValueReal("background_r");
mBackgroundG = (F32)message_in.getValueReal("background_g");
mBackgroundB = (F32)message_in.getValueReal("background_b");
// mBackgroundA = message_in.setValueReal("background_a"); // Ignore any alpha
if(!name.empty())
@ -1245,9 +1245,9 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
if(message_name == "js_agent_location")
{
#if LLQTWEBKIT_API_VERSION >= 9
F32 x = message_in.getValueReal("x");
F32 y = message_in.getValueReal("y");
F32 z = message_in.getValueReal("z");
F32 x = (F32)message_in.getValueReal("x");
F32 y = (F32)message_in.getValueReal("y");
F32 z = (F32)message_in.getValueReal("z");
LLQtWebKit::getInstance()->setAgentLocation( x, y, z );
LLQtWebKit::getInstance()->emitLocation();
#endif
@ -1256,9 +1256,9 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
if(message_name == "js_agent_global_location")
{
#if LLQTWEBKIT_API_VERSION >= 9
F32 x = message_in.getValueReal("x");
F32 y = message_in.getValueReal("y");
F32 z = message_in.getValueReal("z");
F32 x = (F32)message_in.getValueReal("x");
F32 y = (F32)message_in.getValueReal("y");
F32 z = (F32)message_in.getValueReal("z");
LLQtWebKit::getInstance()->setAgentGlobalLocation( x, y, z );
LLQtWebKit::getInstance()->emitLocation();
#endif
@ -1267,7 +1267,7 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
if(message_name == "js_agent_orientation")
{
#if LLQTWEBKIT_API_VERSION >= 9
F32 angle = message_in.getValueReal("angle");
F32 angle = (F32)message_in.getValueReal("angle");
LLQtWebKit::getInstance()->setAgentOrientation( angle );
LLQtWebKit::getInstance()->emitLocation();
#endif
@ -1323,7 +1323,7 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
else if(message_name == "set_page_zoom_factor")
{
#if LLQTWEBKIT_API_VERSION >= 15
F32 factor = message_in.getValueReal("factor");
F32 factor = (F32)message_in.getValueReal("factor");
LLQtWebKit::getInstance()->setPageZoomFactor(factor);
#else
llwarns << "Ignoring setPageZoomFactor message (llqtwebkit version is too old)." << llendl;

View File

@ -100,9 +100,9 @@ namespace tut
{
S32 level = mMap->scaleToLevel(0.0);
ensure("scaleToLevel() test 1 failed", level == LLWorldMipmap::MAP_LEVELS);
level = mMap->scaleToLevel(LLWorldMipmap::MAP_TILE_SIZE);
level = mMap->scaleToLevel((F32)LLWorldMipmap::MAP_TILE_SIZE);
ensure("scaleToLevel() test 2 failed", level == 1);
level = mMap->scaleToLevel(10 * LLWorldMipmap::MAP_TILE_SIZE);
level = mMap->scaleToLevel(10.f * LLWorldMipmap::MAP_TILE_SIZE);
ensure("scaleToLevel() test 3 failed", level == 1);
}
// Test 2 : globalToMipmap()

View File

@ -447,7 +447,7 @@ void LLUpdaterServiceImpl::restartTimer(unsigned int seconds)
LL_INFOS("UpdaterService") << "will check for update again in " <<
seconds << " seconds" << LL_ENDL;
mTimer.start();
mTimer.setTimerExpirySec(seconds);
mTimer.setTimerExpirySec((F32)seconds);
LLEventPumps::instance().obtain("mainloop").listen(
sListenerName, boost::bind(&LLUpdaterServiceImpl::onMainLoop, this, _1));
}