From 60d3dd98a44230c21803c1606552ee098ed9fa7c Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 21 Feb 2024 21:05:14 +0100 Subject: Convert remaining BOOL to bool --- indra/test/llbuffer_tut.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/test/llbuffer_tut.cpp') diff --git a/indra/test/llbuffer_tut.cpp b/indra/test/llbuffer_tut.cpp index 9b8aae6a73..52dc909a2c 100644 --- a/indra/test/llbuffer_tut.cpp +++ b/indra/test/llbuffer_tut.cpp @@ -62,7 +62,7 @@ namespace tut ensure("LLSegment get functions failed", (0 == segment.getChannel() && NULL == segment.data() && 0 == segment.size())); segment.setChannel(50); ensure_equals("LLSegment setChannel() function failed", segment.getChannel(), 50); - ensure("LLSegment isOnChannel() function failed", (TRUE == segment.isOnChannel(50))); + ensure("LLSegment isOnChannel() function failed", (true == segment.isOnChannel(50))); } template<> template<> @@ -74,7 +74,7 @@ namespace tut LLSegment segment(channel, (U8*)str, len); ensure("LLSegment get functions failed", (30 == segment.getChannel() && len == segment.size() && (U8*)str == segment.data())); ensure_memory_matches("LLSegment::data() failed", segment.data(), segment.size(), (U8*)str, len); - ensure("LLSegment isOnChannel() function failed", (TRUE == segment.isOnChannel(channel))); + ensure("LLSegment isOnChannel() function failed", (true == segment.isOnChannel(channel))); } template<> template<> @@ -91,27 +91,27 @@ namespace tut S32 requestSize; requestSize = 16384-1; - ensure("1. LLHeapBuffer createSegment failed", (TRUE == buf.createSegment(channel, requestSize, segment)) && segment.size() == requestSize); + ensure("1. LLHeapBuffer createSegment failed", (true == buf.createSegment(channel, requestSize, segment)) && segment.size() == requestSize); // second request for remainign 1 byte requestSize = 1; - ensure("2. LLHeapBuffer createSegment failed", (TRUE == buf.createSegment(channel, requestSize, segment)) && segment.size() == requestSize); + ensure("2. LLHeapBuffer createSegment failed", (true == buf.createSegment(channel, requestSize, segment)) && segment.size() == requestSize); // it should fail now. requestSize = 1; - ensure("3. LLHeapBuffer createSegment failed", (FALSE == buf.createSegment(channel, requestSize, segment))); + ensure("3. LLHeapBuffer createSegment failed", (false == buf.createSegment(channel, requestSize, segment))); LLHeapBuffer buf1(bigSize); // requst for more than default size but less than total sizeit should fail now. requestSize = 16384 + 1; - ensure("4. LLHeapBuffer createSegment failed", (TRUE == buf1.createSegment(channel, requestSize, segment)) && segment.size() == requestSize); + ensure("4. LLHeapBuffer createSegment failed", (true == buf1.createSegment(channel, requestSize, segment)) && segment.size() == requestSize); LLHeapBuffer buf2((U8*) str, smallSize); requestSize = smallSize; - ensure("5. LLHeapBuffer createSegment failed", (TRUE == buf2.createSegment(channel, requestSize, segment)) && segment.size() == requestSize && memcmp(segment.data(), (U8*) str, requestSize) == 0); + ensure("5. LLHeapBuffer createSegment failed", (true == buf2.createSegment(channel, requestSize, segment)) && segment.size() == requestSize && memcmp(segment.data(), (U8*) str, requestSize) == 0); requestSize = smallSize+1; - ensure("6. LLHeapBuffer createSegment failed", (FALSE == buf2.createSegment(channel, requestSize, segment))); + ensure("6. LLHeapBuffer createSegment failed", (false == buf2.createSegment(channel, requestSize, segment))); } //makeChannelConsumer() -- cgit v1.2.3 From e2e37cced861b98de8c1a7c9c0d3a50d2d90e433 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 22 May 2024 21:25:21 +0200 Subject: Fix line endlings --- indra/test/llbuffer_tut.cpp | 542 ++++++++++++++++++++++---------------------- 1 file changed, 271 insertions(+), 271 deletions(-) (limited to 'indra/test/llbuffer_tut.cpp') diff --git a/indra/test/llbuffer_tut.cpp b/indra/test/llbuffer_tut.cpp index 0100a3e225..07cb4d5aed 100644 --- a/indra/test/llbuffer_tut.cpp +++ b/indra/test/llbuffer_tut.cpp @@ -1,271 +1,271 @@ -/** - * @file llbuffer_tut.cpp - * @author Adroit - * @date 2007-03 - * @brief llbuffer test cases. - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include - -#include "linden_common.h" -#include "lltut.h" -#include "llbuffer.h" -#include "llerror.h" - - -namespace tut -{ - struct buffer - { - }; - - typedef test_group buffer_t; - typedef buffer_t::object buffer_object_t; - tut::buffer_t tut_buffer("buffer"); - - template<> template<> - void buffer_object_t::test<1>() - { - LLChannelDescriptors channelDescriptors; - ensure("in() and out() functions Failed", (0 == channelDescriptors.in() && 1 == channelDescriptors.out())); - - S32 val = 50; - LLChannelDescriptors channelDescriptors1(val); - ensure("LLChannelDescriptors in() and out() functions Failed", (50 == channelDescriptors1.in() && 51 == channelDescriptors1.out())); - } - - template<> template<> - void buffer_object_t::test<2>() - { - LLSegment segment; - ensure("LLSegment get functions failed", (0 == segment.getChannel() && NULL == segment.data() && 0 == segment.size())); - segment.setChannel(50); - ensure_equals("LLSegment setChannel() function failed", segment.getChannel(), 50); - ensure("LLSegment isOnChannel() function failed", (true == segment.isOnChannel(50))); - } - - template<> template<> - void buffer_object_t::test<3>() - { - S32 channel = 30; - const char str[] = "SecondLife"; - S32 len = sizeof(str); - LLSegment segment(channel, (U8*)str, len); - ensure("LLSegment get functions failed", (30 == segment.getChannel() && len == segment.size() && (U8*)str == segment.data())); - ensure_memory_matches("LLSegment::data() failed", segment.data(), segment.size(), (U8*)str, len); - ensure("LLSegment isOnChannel() function failed", (true == segment.isOnChannel(channel))); - } - - template<> template<> - void buffer_object_t::test<4>() - { - S32 channel = 50; - S32 bigSize = 16384*2; - char str[] = "SecondLife"; - S32 smallSize = sizeof(str); - - LLSegment segment; - LLHeapBuffer buf; // use default size of DEFAULT_HEAP_BUFFER_SIZE = 16384 - - S32 requestSize; - - requestSize = 16384-1; - ensure("1. LLHeapBuffer createSegment failed", (true == buf.createSegment(channel, requestSize, segment)) && segment.size() == requestSize); - // second request for remainign 1 byte - - requestSize = 1; - ensure("2. LLHeapBuffer createSegment failed", (true == buf.createSegment(channel, requestSize, segment)) && segment.size() == requestSize); - - // it should fail now. - requestSize = 1; - ensure("3. LLHeapBuffer createSegment failed", (false == buf.createSegment(channel, requestSize, segment))); - - LLHeapBuffer buf1(bigSize); - - // requst for more than default size but less than total sizeit should fail now. - requestSize = 16384 + 1; - ensure("4. LLHeapBuffer createSegment failed", (true == buf1.createSegment(channel, requestSize, segment)) && segment.size() == requestSize); - - LLHeapBuffer buf2((U8*) str, smallSize); - requestSize = smallSize; - ensure("5. LLHeapBuffer createSegment failed", (true == buf2.createSegment(channel, requestSize, segment)) && segment.size() == requestSize && memcmp(segment.data(), (U8*) str, requestSize) == 0); - requestSize = smallSize+1; - ensure("6. LLHeapBuffer createSegment failed", (false == buf2.createSegment(channel, requestSize, segment))); - } - - //makeChannelConsumer() - template<> template<> - void buffer_object_t::test<5>() - { - LLChannelDescriptors inchannelDescriptors(20); - LLChannelDescriptors outchannelDescriptors = LLBufferArray::makeChannelConsumer(inchannelDescriptors); - ensure("LLBufferArray::makeChannelConsumer() function Failed", (21 == outchannelDescriptors.in())); - } - - template<> template<> - void buffer_object_t::test<6>() - { - LLBufferArray bufferArray; - const char array[] = "SecondLife"; - S32 len = strlen(array); - LLChannelDescriptors channelDescriptors = bufferArray.nextChannel(); - bufferArray.append(channelDescriptors.in(), (U8*)array, len); - S32 count = bufferArray.countAfter(channelDescriptors.in(), NULL); - ensure_equals("Appended size is:", count, len); - } - - //append() and prepend() - template<> template<> - void buffer_object_t::test<7>() - { - LLBufferArray bufferArray; - const char array[] = "SecondLife"; - S32 len = strlen(array); - const char array1[] = "LindenLabs"; - S32 len1 = strlen(array1); - - std::string str(array1); - str.append(array); - - LLChannelDescriptors channelDescriptors = bufferArray.nextChannel(); - bufferArray.append(channelDescriptors.in(), (U8*)array, len); - bufferArray.prepend(channelDescriptors.in(), (U8*)array1, len1); - char buf[100]; - S32 len2 = 20; - bufferArray.readAfter(channelDescriptors.in(), NULL, (U8*)buf, len2); - ensure_equals("readAfter length failed", len2, 20); - - buf[len2] = '\0'; - ensure_equals("readAfter/prepend/append failed", buf, str); - } - - //append() - template<> template<> - void buffer_object_t::test<8>() - { - LLBufferArray bufferArray; - const char array[] = "SecondLife"; - S32 len = strlen(array); - const char array1[] = "LindenLabs"; - S32 len1 = strlen(array1); - - std::string str(array); - str.append(array1); - - LLChannelDescriptors channelDescriptors = bufferArray.nextChannel(); - bufferArray.append(channelDescriptors.in(), (U8*)array, len); - bufferArray.append(channelDescriptors.in(), (U8*)array1, len1); - char buf[100]; - S32 len2 = 20; - bufferArray.readAfter(channelDescriptors.in(), NULL, (U8*)buf, len2); - ensure_equals("readAfter length failed", len2, 20); - - buf[len2] = '\0'; - ensure_equals("readAfter/append/append failed", buf, str); - } - - template<> template<> - void buffer_object_t::test<9>() - { - LLBufferArray bufferArray; - const char array[] = "SecondLife"; - S32 len = strlen(array) + 1; - std::string str(array); - LLChannelDescriptors channelDescriptors = bufferArray.nextChannel(); - bufferArray.append(channelDescriptors.in(), (U8*)array, len); - LLBufferArray bufferArray1; - ensure("Contents are not copied and the source buffer is not empty", (1 == bufferArray1.takeContents(bufferArray))); - - char buf[100]; - S32 len2 = len; - bufferArray1.readAfter(channelDescriptors.in(), NULL, (U8*)buf, len2); - ensure_equals("takeContents failed to copy", buf, str); - } - - //seek() - template<> template<> - void buffer_object_t::test<10>() - { - const char array[] = "SecondLife is a Virtual World"; - S32 len = strlen(array); - LLBufferArray bufferArray; - bufferArray.append(0, (U8*)array, len); - - char buf[255]; - S32 len1 = 16; - U8* last = bufferArray.readAfter(0, 0, (U8*)buf, len1); - buf[len1] = '\0'; - last = bufferArray.seek(0, last, -2); - - len1 = 15; - last = bufferArray.readAfter(0, last, (U8*)buf, len1); - buf[len1] = '\0'; - std::string str(buf); - ensure_equals("Seek does'nt worked", str, std::string("a Virtual World")); - } - - template<> template<> - void buffer_object_t::test<11>() - { - const char array[] = "SecondLife is a Virtual World"; - S32 len = strlen(array); - LLBufferArray bufferArray; - bufferArray.append(0, (U8*)array, len); - - char buf[255]; - S32 len1 = 10; - U8* last = bufferArray.readAfter(0, 0, (U8*)buf, len1); - bufferArray.splitAfter(last); - LLBufferArray::segment_iterator_t iterator = bufferArray.beginSegment(); - ++iterator; - std::string str(((char*)(*iterator).data()), (*iterator).size()); - ensure_equals("Strings are not equal;splitAfter() operation failed", str, std::string(" is a Virtual World")); - } - - //makeSegment()->eraseSegment() - template<> template<> - void buffer_object_t::test<12>() - { - LLBufferArray bufferArray; - LLChannelDescriptors channelDescriptors; - LLBufferArray::segment_iterator_t it; - S32 length = 1000; - it = bufferArray.makeSegment(channelDescriptors.out(), length); - ensure("makeSegment() function failed", (it != bufferArray.endSegment())); - ensure("eraseSegment() function failed", bufferArray.eraseSegment(it)); - ensure("eraseSegment() begin/end should now be same", bufferArray.beginSegment() == bufferArray.endSegment()); - } - - // constructSegmentAfter() - template<> template<> - void buffer_object_t::test<13>() - { - LLBufferArray bufferArray; - LLBufferArray::segment_iterator_t it; - LLSegment segment; - LLBufferArray::segment_iterator_t end = bufferArray.endSegment(); - it = bufferArray.constructSegmentAfter(NULL, segment); - ensure("constructSegmentAfter() function failed", (it == end)); - } -} +/** + * @file llbuffer_tut.cpp + * @author Adroit + * @date 2007-03 + * @brief llbuffer test cases. + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include + +#include "linden_common.h" +#include "lltut.h" +#include "llbuffer.h" +#include "llerror.h" + + +namespace tut +{ + struct buffer + { + }; + + typedef test_group buffer_t; + typedef buffer_t::object buffer_object_t; + tut::buffer_t tut_buffer("buffer"); + + template<> template<> + void buffer_object_t::test<1>() + { + LLChannelDescriptors channelDescriptors; + ensure("in() and out() functions Failed", (0 == channelDescriptors.in() && 1 == channelDescriptors.out())); + + S32 val = 50; + LLChannelDescriptors channelDescriptors1(val); + ensure("LLChannelDescriptors in() and out() functions Failed", (50 == channelDescriptors1.in() && 51 == channelDescriptors1.out())); + } + + template<> template<> + void buffer_object_t::test<2>() + { + LLSegment segment; + ensure("LLSegment get functions failed", (0 == segment.getChannel() && NULL == segment.data() && 0 == segment.size())); + segment.setChannel(50); + ensure_equals("LLSegment setChannel() function failed", segment.getChannel(), 50); + ensure("LLSegment isOnChannel() function failed", (true == segment.isOnChannel(50))); + } + + template<> template<> + void buffer_object_t::test<3>() + { + S32 channel = 30; + const char str[] = "SecondLife"; + S32 len = sizeof(str); + LLSegment segment(channel, (U8*)str, len); + ensure("LLSegment get functions failed", (30 == segment.getChannel() && len == segment.size() && (U8*)str == segment.data())); + ensure_memory_matches("LLSegment::data() failed", segment.data(), segment.size(), (U8*)str, len); + ensure("LLSegment isOnChannel() function failed", (true == segment.isOnChannel(channel))); + } + + template<> template<> + void buffer_object_t::test<4>() + { + S32 channel = 50; + S32 bigSize = 16384*2; + char str[] = "SecondLife"; + S32 smallSize = sizeof(str); + + LLSegment segment; + LLHeapBuffer buf; // use default size of DEFAULT_HEAP_BUFFER_SIZE = 16384 + + S32 requestSize; + + requestSize = 16384-1; + ensure("1. LLHeapBuffer createSegment failed", (true == buf.createSegment(channel, requestSize, segment)) && segment.size() == requestSize); + // second request for remainign 1 byte + + requestSize = 1; + ensure("2. LLHeapBuffer createSegment failed", (true == buf.createSegment(channel, requestSize, segment)) && segment.size() == requestSize); + + // it should fail now. + requestSize = 1; + ensure("3. LLHeapBuffer createSegment failed", (false == buf.createSegment(channel, requestSize, segment))); + + LLHeapBuffer buf1(bigSize); + + // requst for more than default size but less than total sizeit should fail now. + requestSize = 16384 + 1; + ensure("4. LLHeapBuffer createSegment failed", (true == buf1.createSegment(channel, requestSize, segment)) && segment.size() == requestSize); + + LLHeapBuffer buf2((U8*) str, smallSize); + requestSize = smallSize; + ensure("5. LLHeapBuffer createSegment failed", (true == buf2.createSegment(channel, requestSize, segment)) && segment.size() == requestSize && memcmp(segment.data(), (U8*) str, requestSize) == 0); + requestSize = smallSize+1; + ensure("6. LLHeapBuffer createSegment failed", (false == buf2.createSegment(channel, requestSize, segment))); + } + + //makeChannelConsumer() + template<> template<> + void buffer_object_t::test<5>() + { + LLChannelDescriptors inchannelDescriptors(20); + LLChannelDescriptors outchannelDescriptors = LLBufferArray::makeChannelConsumer(inchannelDescriptors); + ensure("LLBufferArray::makeChannelConsumer() function Failed", (21 == outchannelDescriptors.in())); + } + + template<> template<> + void buffer_object_t::test<6>() + { + LLBufferArray bufferArray; + const char array[] = "SecondLife"; + S32 len = strlen(array); + LLChannelDescriptors channelDescriptors = bufferArray.nextChannel(); + bufferArray.append(channelDescriptors.in(), (U8*)array, len); + S32 count = bufferArray.countAfter(channelDescriptors.in(), NULL); + ensure_equals("Appended size is:", count, len); + } + + //append() and prepend() + template<> template<> + void buffer_object_t::test<7>() + { + LLBufferArray bufferArray; + const char array[] = "SecondLife"; + S32 len = strlen(array); + const char array1[] = "LindenLabs"; + S32 len1 = strlen(array1); + + std::string str(array1); + str.append(array); + + LLChannelDescriptors channelDescriptors = bufferArray.nextChannel(); + bufferArray.append(channelDescriptors.in(), (U8*)array, len); + bufferArray.prepend(channelDescriptors.in(), (U8*)array1, len1); + char buf[100]; + S32 len2 = 20; + bufferArray.readAfter(channelDescriptors.in(), NULL, (U8*)buf, len2); + ensure_equals("readAfter length failed", len2, 20); + + buf[len2] = '\0'; + ensure_equals("readAfter/prepend/append failed", buf, str); + } + + //append() + template<> template<> + void buffer_object_t::test<8>() + { + LLBufferArray bufferArray; + const char array[] = "SecondLife"; + S32 len = strlen(array); + const char array1[] = "LindenLabs"; + S32 len1 = strlen(array1); + + std::string str(array); + str.append(array1); + + LLChannelDescriptors channelDescriptors = bufferArray.nextChannel(); + bufferArray.append(channelDescriptors.in(), (U8*)array, len); + bufferArray.append(channelDescriptors.in(), (U8*)array1, len1); + char buf[100]; + S32 len2 = 20; + bufferArray.readAfter(channelDescriptors.in(), NULL, (U8*)buf, len2); + ensure_equals("readAfter length failed", len2, 20); + + buf[len2] = '\0'; + ensure_equals("readAfter/append/append failed", buf, str); + } + + template<> template<> + void buffer_object_t::test<9>() + { + LLBufferArray bufferArray; + const char array[] = "SecondLife"; + S32 len = strlen(array) + 1; + std::string str(array); + LLChannelDescriptors channelDescriptors = bufferArray.nextChannel(); + bufferArray.append(channelDescriptors.in(), (U8*)array, len); + LLBufferArray bufferArray1; + ensure("Contents are not copied and the source buffer is not empty", (1 == bufferArray1.takeContents(bufferArray))); + + char buf[100]; + S32 len2 = len; + bufferArray1.readAfter(channelDescriptors.in(), NULL, (U8*)buf, len2); + ensure_equals("takeContents failed to copy", buf, str); + } + + //seek() + template<> template<> + void buffer_object_t::test<10>() + { + const char array[] = "SecondLife is a Virtual World"; + S32 len = strlen(array); + LLBufferArray bufferArray; + bufferArray.append(0, (U8*)array, len); + + char buf[255]; + S32 len1 = 16; + U8* last = bufferArray.readAfter(0, 0, (U8*)buf, len1); + buf[len1] = '\0'; + last = bufferArray.seek(0, last, -2); + + len1 = 15; + last = bufferArray.readAfter(0, last, (U8*)buf, len1); + buf[len1] = '\0'; + std::string str(buf); + ensure_equals("Seek does'nt worked", str, std::string("a Virtual World")); + } + + template<> template<> + void buffer_object_t::test<11>() + { + const char array[] = "SecondLife is a Virtual World"; + S32 len = strlen(array); + LLBufferArray bufferArray; + bufferArray.append(0, (U8*)array, len); + + char buf[255]; + S32 len1 = 10; + U8* last = bufferArray.readAfter(0, 0, (U8*)buf, len1); + bufferArray.splitAfter(last); + LLBufferArray::segment_iterator_t iterator = bufferArray.beginSegment(); + ++iterator; + std::string str(((char*)(*iterator).data()), (*iterator).size()); + ensure_equals("Strings are not equal;splitAfter() operation failed", str, std::string(" is a Virtual World")); + } + + //makeSegment()->eraseSegment() + template<> template<> + void buffer_object_t::test<12>() + { + LLBufferArray bufferArray; + LLChannelDescriptors channelDescriptors; + LLBufferArray::segment_iterator_t it; + S32 length = 1000; + it = bufferArray.makeSegment(channelDescriptors.out(), length); + ensure("makeSegment() function failed", (it != bufferArray.endSegment())); + ensure("eraseSegment() function failed", bufferArray.eraseSegment(it)); + ensure("eraseSegment() begin/end should now be same", bufferArray.beginSegment() == bufferArray.endSegment()); + } + + // constructSegmentAfter() + template<> template<> + void buffer_object_t::test<13>() + { + LLBufferArray bufferArray; + LLBufferArray::segment_iterator_t it; + LLSegment segment; + LLBufferArray::segment_iterator_t end = bufferArray.endSegment(); + it = bufferArray.constructSegmentAfter(NULL, segment); + ensure("constructSegmentAfter() function failed", (it == end)); + } +} -- cgit v1.2.3 From b42f9d836b4c0f7fbd4bdae1734021e2a09fdbe8 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sat, 1 Jun 2024 15:49:26 +0200 Subject: Re-enable a lot of compiler warnings for MSVC and address the C4267 "possible loss of precision" warnings --- indra/test/llbuffer_tut.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'indra/test/llbuffer_tut.cpp') diff --git a/indra/test/llbuffer_tut.cpp b/indra/test/llbuffer_tut.cpp index 07cb4d5aed..330a4f288f 100644 --- a/indra/test/llbuffer_tut.cpp +++ b/indra/test/llbuffer_tut.cpp @@ -128,7 +128,7 @@ namespace tut { LLBufferArray bufferArray; const char array[] = "SecondLife"; - S32 len = strlen(array); + S32 len = static_cast(strlen(array)); LLChannelDescriptors channelDescriptors = bufferArray.nextChannel(); bufferArray.append(channelDescriptors.in(), (U8*)array, len); S32 count = bufferArray.countAfter(channelDescriptors.in(), NULL); @@ -141,9 +141,9 @@ namespace tut { LLBufferArray bufferArray; const char array[] = "SecondLife"; - S32 len = strlen(array); + S32 len = static_cast(strlen(array)); const char array1[] = "LindenLabs"; - S32 len1 = strlen(array1); + S32 len1 = static_cast(strlen(array1)); std::string str(array1); str.append(array); @@ -166,9 +166,9 @@ namespace tut { LLBufferArray bufferArray; const char array[] = "SecondLife"; - S32 len = strlen(array); + S32 len = static_cast(strlen(array)); const char array1[] = "LindenLabs"; - S32 len1 = strlen(array1); + S32 len1 = static_cast(strlen(array1)); std::string str(array); str.append(array1); @@ -190,7 +190,7 @@ namespace tut { LLBufferArray bufferArray; const char array[] = "SecondLife"; - S32 len = strlen(array) + 1; + S32 len = static_cast(strlen(array)) + 1; std::string str(array); LLChannelDescriptors channelDescriptors = bufferArray.nextChannel(); bufferArray.append(channelDescriptors.in(), (U8*)array, len); @@ -208,7 +208,7 @@ namespace tut void buffer_object_t::test<10>() { const char array[] = "SecondLife is a Virtual World"; - S32 len = strlen(array); + S32 len = static_cast(strlen(array)); LLBufferArray bufferArray; bufferArray.append(0, (U8*)array, len); @@ -229,7 +229,7 @@ namespace tut void buffer_object_t::test<11>() { const char array[] = "SecondLife is a Virtual World"; - S32 len = strlen(array); + S32 len = static_cast(strlen(array)); LLBufferArray bufferArray; bufferArray.append(0, (U8*)array, len); -- cgit v1.2.3