Commit Graph

95 Commits (7c42711ca3a4e67b95473aa5129dce5ff19bea15)

Author SHA1 Message Date
Ansariel b42f9d836b Re-enable a lot of compiler warnings for MSVC and address the C4267 "possible loss of precision" warnings 2024-06-01 15:49:26 +02:00
Ansariel e2e37cced8 Fix line endlings 2024-05-22 22:40:26 +03:00
Ansariel 1b67dd855c Merge remote-tracking branch 'origin/main' into DRTVWR-600-maint-A
# Conflicts:
#	autobuild.xml
#	indra/cmake/CMakeLists.txt
#	indra/cmake/GoogleMock.cmake
#	indra/llaudio/llaudioengine_fmodstudio.cpp
#	indra/llaudio/llaudioengine_fmodstudio.h
#	indra/llaudio/lllistener_fmodstudio.cpp
#	indra/llaudio/lllistener_fmodstudio.h
#	indra/llaudio/llstreamingaudio_fmodstudio.cpp
#	indra/llaudio/llstreamingaudio_fmodstudio.h
#	indra/llcharacter/llmultigesture.cpp
#	indra/llcharacter/llmultigesture.h
#	indra/llimage/llimage.cpp
#	indra/llimage/llimagepng.cpp
#	indra/llimage/llimageworker.cpp
#	indra/llimage/tests/llimageworker_test.cpp
#	indra/llmessage/tests/llmockhttpclient.h
#	indra/llprimitive/llgltfmaterial.h
#	indra/llrender/llfontfreetype.cpp
#	indra/llui/llcombobox.cpp
#	indra/llui/llfolderview.cpp
#	indra/llui/llfolderviewmodel.h
#	indra/llui/lllineeditor.cpp
#	indra/llui/lllineeditor.h
#	indra/llui/lltextbase.cpp
#	indra/llui/lltextbase.h
#	indra/llui/lltexteditor.cpp
#	indra/llui/lltextvalidate.cpp
#	indra/llui/lltextvalidate.h
#	indra/llui/lluictrl.h
#	indra/llui/llview.cpp
#	indra/llwindow/llwindowmacosx.cpp
#	indra/newview/app_settings/settings.xml
#	indra/newview/llappearancemgr.cpp
#	indra/newview/llappearancemgr.h
#	indra/newview/llavatarpropertiesprocessor.cpp
#	indra/newview/llavatarpropertiesprocessor.h
#	indra/newview/llbreadcrumbview.cpp
#	indra/newview/llbreadcrumbview.h
#	indra/newview/llbreastmotion.cpp
#	indra/newview/llbreastmotion.h
#	indra/newview/llconversationmodel.h
#	indra/newview/lldensityctrl.cpp
#	indra/newview/lldensityctrl.h
#	indra/newview/llface.inl
#	indra/newview/llfloatereditsky.cpp
#	indra/newview/llfloatereditwater.cpp
#	indra/newview/llfloateremojipicker.h
#	indra/newview/llfloaterimsessiontab.cpp
#	indra/newview/llfloaterprofiletexture.cpp
#	indra/newview/llfloaterprofiletexture.h
#	indra/newview/llgesturemgr.cpp
#	indra/newview/llgesturemgr.h
#	indra/newview/llimpanel.cpp
#	indra/newview/llimpanel.h
#	indra/newview/llinventorybridge.cpp
#	indra/newview/llinventorybridge.h
#	indra/newview/llinventoryclipboard.cpp
#	indra/newview/llinventoryclipboard.h
#	indra/newview/llinventoryfunctions.cpp
#	indra/newview/llinventoryfunctions.h
#	indra/newview/llinventorygallery.cpp
#	indra/newview/lllistbrowser.cpp
#	indra/newview/lllistbrowser.h
#	indra/newview/llpanelobjectinventory.cpp
#	indra/newview/llpanelprofile.cpp
#	indra/newview/llpanelprofile.h
#	indra/newview/llpreviewgesture.cpp
#	indra/newview/llsavedsettingsglue.cpp
#	indra/newview/llsavedsettingsglue.h
#	indra/newview/lltooldraganddrop.cpp
#	indra/newview/llurllineeditorctrl.cpp
#	indra/newview/llvectorperfoptions.cpp
#	indra/newview/llvectorperfoptions.h
#	indra/newview/llviewerparceloverlay.cpp
#	indra/newview/llviewertexlayer.cpp
#	indra/newview/llviewertexturelist.cpp
#	indra/newview/macmain.h
#	indra/test/test.cpp
2024-05-22 19:04:52 +02:00
Alexander Gavriliuk f9473e8afc secondlife/viewer#1333 BOOL to bool conversion leftovers: ternaries 2024-05-07 10:18:51 +02:00
Andrey Lihatskiy 1b68f71348 #824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed 2024-04-29 07:56:09 +03:00
Alexander Gavriliuk a2552a5556 Build fix for Visual Studio patch 2024-02-08 23:44:34 +03:00
Brad Kittenbrink (Brad Linden) b9b38db567 Fix for SL-19968 objects missing timing bug due to stall during login
ensure inventory skeleton loading doesn't block the message system from processing packets.
2023-11-03 09:49:48 -07:00
Andrey Lihatskiy 3b13c0ca15 DRTVWR-582 xcode-14.3 merge follow up 2023-05-26 21:01:15 +03:00
Andrey Lihatskiy b9cd6e2e84 Merge branch 'xcode-14.3' into DRTVWR-582-maint-U
# Conflicts:
#	indra/llcommon/llsdserialize.h
2023-05-26 06:15:49 +03:00
simon 55460b4958 SL-19711 - viewer can't parse environments. Fixed max parsing bug
(cherry picked from commit eb0516b9940f200b32349d611f38f1ccee48005d)
2023-05-24 00:25:57 +01:00
Nat Goodspeed 626bbe5032 SL-18837: Fix call to strip_deprecated_header().
Pass llssize instead of S32.
2023-05-22 19:14:48 -04:00
Nat Goodspeed 84278d0d2c SL-18837: Merge branch 'xcode-14.1' of secondlife/viewer into xcode-14.3 2023-05-19 17:21:51 -04:00
Nat Goodspeed 22a07b1121 SL-18330: fix strip_deprecated_header(cur_size) param to llssize. 2023-05-03 12:48:22 -04:00
Andrey Lihatskiy f1095d7831 Merge branch 'main' into marchcat/main-contrib-merge
# Conflicts:
#	indra/cmake/CMakeLists.txt
#	indra/llcommon/llsdserialize.cpp
#	indra/llcommon/llsdserialize.h
#	indra/llcommon/tests/llleap_test.cpp
#	indra/newview/llfilepicker.h
#	indra/newview/llfilepicker_mac.h
#	indra/newview/llfilepicker_mac.mm
#	indra/newview/skins/default/xui/en/strings.xml
2023-04-07 00:20:59 +03:00
Nat Goodspeed 6cb6385bc7 SL-18330: Tweaks for Visual Studio builds 2023-03-01 16:37:55 -05:00
Nat Goodspeed c18f0a61ab SL-18330: Fix a narrowing conversion in LLSDSerialize::deserialize(). 2023-03-01 14:35:04 -05:00
Nat Goodspeed 292bb3991b SL-18330: Fix per PR review comments. 2023-02-15 17:29:48 -05:00
Nat Goodspeed aec39a0f9f SL-18330: Merge branch 'contribute' into sl-18330-merge 2023-02-15 15:11:35 -05:00
Callum Prentice 422cd237df Fix up a couple of tiny merge conflicts after a merge with main 2023-02-13 14:12:59 -08:00
Nat Goodspeed 590e158cf3 SL-18330: Adapt LLSDSerialize and tests to llssize max_bytes params. 2022-12-06 16:30:35 -05:00
Nat Goodspeed db1d757aeb DRTVWR-575: Update a few more int lengths in llsdserialize.{h,cpp}. 2022-12-06 14:40:11 -05:00
Nat Goodspeed 73aced620f DRTVWR-575: Use llssize (signed size_t) for max_bytes parameters.
Since LLSDSerialize::SIZE_UNLIMITED is negative, passing that through unsigned
size_t parameters could result in peculiar behavior.
2022-12-06 13:59:06 -05:00
Nat Goodspeed 2f557cd7fa SL-18330: Fix new C++ <-> Python LLSD compatibility tests.
When sending multiple LEAP packets in the same file (for testing convenience),
use a length prefix instead of delimiting with '\n'. Now that we allow a
serialization format that includes an LLSD format header (e.g.
"<?llsd/binary?>"), '\n' is part of the packet content. But in fact, testing
binary LLSD means we can't pick any delimiter guaranteed not to appear in the
packet content.

Using a length prefix also lets us pass a specific max_bytes to the subject
C++ LLSD parser.

Make llleap_test.cpp use new freestanding Python llsd package when available.
Update Python-side LEAP protocol code to work directly with encoded bytes
stream, avoiding bytes<->str encoding and decoding, which breaks binary LLSD.

Make LLSDSerialize::deserialize() recognize LLSD format header case-
insensitively. Python emits and checks for "llsd/binary", while LLSDSerialize
emits and checks for "LLSD/Binary". Once any of the headers is recognized,
pass corrected max_bytes to the specific parser.

Make deserialize() more careful about the no-header case: preserve '\n' in
content. Introduce debugging code (disabled) because it's a little tricky to
recreate.

Revert LLLeap child process stdout parser from LLSDSerialize::deserialize() to
the specific LLSDNotationParser(), as at present: the generic parser fails one
of LLLeap's integration tests for reasons that remain mysterious.
2022-12-02 15:17:56 -05:00
Nat Goodspeed 42e0787446 SL-18330: LLSDSerialize::deserialize() w/o hdr uses XML or notation
Absent a header from LLSDSerialize::serialize(), make deserialize()
distinguish between XML or notation by recognizing an initial '<'.
2022-11-23 17:15:15 -05:00
Nat Goodspeed abe62c23d7 SL-18330: Make LLSDSerialize::deserialize() default to notation.
LLSDSerialize::serialize() emits a header string, e.g. "<? llsd/notation ?>"
for notation format. Until now, LLSDSerialize::deserialize() has required that
header to properly decode the input stream.

But none of LLSDBinaryFormatter, LLSDXMLFormatter or LLSDNotationFormatter
emit that header themselves. Nor do any of the Python llsd.format_binary(),
format_xml() or format_notation() functions. Until now, you could not use
LLSD::deserialize() to parse an arbitrary-format LLSD stream serialized by
anything but LLSDSerialize::serialize().

Change LLSDSerialize::deserialize() so that if no header is recognized,
instead of failing, it attempts to parse as notation. Add tests to exercise
this case.

The tricky part about this processing is that deserialize() necessarily reads
some number of bytes from the input stream first, to try to recognize the
header. If it fails to do so, it must prepend the bytes it has already read to
the rest of the input stream since they're probably the beginning of the
serialized data.

To support this use case, introduce cat_streambuf, a std::streambuf subclass
that (virtually) concatenates other std::streambuf instances. When read by a
std::istream, the sequence of underlying std::streambufs appears to the
consumer as a single continuous stream.
2022-11-22 16:21:44 -05:00
Nat Goodspeed 4349cb6165 DRTVWR-575: Address review comments on Xcode 14.1 type tweaks.
Introduce LLSD template constructors and assignment operators to disambiguate
construction or assignment from any integer type to Integer, likewise any
floating point type to Real. Use new narrow() function to validate
conversions.

For LLSD method parameters converted from LLSD::Integer to size_t, where the
method previously checked for a negative argument, make it now check for
size_t converted from negative: in other words, more than S32_MAX. The risk of
having a parameter forced from negative to unsigned exceeds the risk of a
valid length or index over that max.

In lltracerecording.cpp's PeriodicRecording, now that mCurPeriod and
mNumRecordedPeriods are size_t instead of S32, defend against subtracting 1
from 0.

Use narrow() to validate newly-introduced narrowing conversions.

Make llclamp() return the type of the raw input value, even if the types of
the boundary values differ.

std::ostream::tellp() no longer returns a value we can directly report as a
number. Cast to U64.
2022-11-12 18:59:21 -10:00
Nat Goodspeed 9522a0b7c1 DRTVWR-575: Fix llcommon assumptions that size_t fits in 4 bytes.
It's a little distressing how often we have historically coded S32 or U32 to
pass a length or index.

There are more such assumptions in other viewer subdirectories, but this is a
start.
2022-11-03 14:58:32 -04:00
Rye Mutt 1b31ab5c52 Introduce a U8* based interface to unzip_llsd and unpackVolumeFaces 2022-09-27 17:59:21 -04:00
Andrey Kleshchev 5af8f15a05 SL-14541 Replace zlib with zlib-ng 2021-09-08 23:18:07 +03:00
Nat Goodspeed a83da3a452 DRTVWR-476: Make LLSDFormatter::OPTIONS_PRETTY_BINARY uppercase
for compatibility with Python llbase.llsd.parse().

The Python parse() currently requires uppercase hex digits for b16"hex"
coding; lowercase hex digits cause it to raise LLSDParseError.
2020-05-14 08:54:15 -04:00
Nat Goodspeed 066fb5dafc DRTVWR-476: Default LLSDNotationFormatter now OPTIONS_PRETTY_BINARY.
LLSDNotationFormatter (also LLSDNotationStreamer that uses it, plus
operator<<(std::ostream&, const LLSD&) that uses LLSDNotationStreamer) is most
useful for displaying LLSD to a human, e.g. for logging. Having the default
dump raw binary bytes into the log file is not only suboptimal, it can
truncate the output if one of those bytes is '\0'. (This is a problem with the
logging subsystem, but that's a story for another day.)

Use OPTIONS_PRETTY_BINARY wherever there is a default LLSDFormatter
::EFormatterOptions argument.

Also, allow setting LLSDFormatter subclass boolalpha(), realFormat() and
format(options) using optional constructor arguments. Naturally, each subclass
that supports this must accept and forward these constructor arguments to its
LLSDFormatter base class constructor.

Fix a couple bugs in LLSDNotationFormatter::format_impl() for an LLSD::Binary
value with OPTIONS_PRETTY_BINARY:
- The code unconditionally emitted a b(len) type prefix followed by either raw
  binary or hex, depending on the option flag. OPTIONS_PRETTY_BINARY caused it
  to emit "0x" before the hex representation of the data. This is wrong in
  that it can't be read back by either the C++ or the Python LLSD parser.
  Correct OPTIONS_PRETTY_BINARY formatting consists of b16"hex digits" rather
  than b(len)"raw bytes".
- Although the code did set hex mode, it didn't set either the field width or
  the fill character, so that a byte value less than 16 would emit a single
  digit rather than two.

Instead of having one LLSDFormatter::format() method with an optional options
argument, declare two overloads. The format() overload without options passes
the mOptions data member to the overload accepting options.

Refactor the LLSDFormatter family, hoisting the recursive format_impl() method
(accepting level) to a pure virtual method at LLSDFormatter base-class level.
Most subclasses therefore need not override either base-class format() method,
only format_impl(). In fact the short format() overload isn't even virtual.

Consistently use LLSDFormatter::EFormatterOptions enum as the options
parameter wherever such options are accepted.
2020-05-13 16:37:12 -04:00
Andrey Lihatskiy c757c29c95 Merge branch 'master' into DRTVWR-500
# Conflicts:
#	indra/newview/pipeline.cpp
2020-04-20 21:23:34 +03:00
andreykproductengine 1b4d5492c6 SL-11727 Fix build warnings 2019-10-23 16:37:15 +03:00
Rider Linden 3888de9439 Merge 2018-05-22 13:16:37 -07:00
Rider Linden 7b56db31f9 Merge 2018-03-07 11:27:43 -08:00
Rider Linden b766466b30 Added settings inventory object with subtype 2018-02-26 09:27:14 -08:00
andreykproductengine e32b4f481a MAINT-8308 Additional logging for mesh processing 2018-02-19 21:01:34 +02:00
andreykproductengine f22c1bcf20 MAINT-8022 Handling memory errors in unzip_llsdNavMesh 2018-02-19 21:30:48 +02:00
andreykproductengine 64b9b4c771 MAINT-2338 Implemented binary parser depth control 2018-02-01 16:35:02 +02:00
andreykproductengine c56298d4ba MAINT-8022 Make unzip silent yet include failure reason into output 2018-01-03 16:30:57 +02:00
andreykproductengine a35008993e MAINT-8022 String crashes in unzip_llsd 2018-01-02 20:31:23 +02:00
andreykproductengine dcfccc6f43 MAINT-8022 Crashes in unzip_llsd #2 2017-11-28 15:55:40 +02:00
andreykproductengine 6d7c19623d MAINT-8022 Crashes in unzip_llsd 2017-11-27 19:04:41 +02:00
AndreyL ProductEngine 7cc9455fe1 MAINT-6697 Correct pointer freeing 2017-06-07 23:05:37 +03:00
AndreyL ProductEngine d9fe21f17f MAINT-6697 More nullchecks for zip/unzip functions 2017-06-07 19:30:32 +03:00
AndreyL ProductEngine f2780a93c0 MAINT-6697 Added a nullcheck to unzip_llsd() 2017-06-07 03:16:56 +03:00
andreykproductengine 26e73e2f58 MAINT-6825 Fixing bad_alloc crash 2016-10-28 17:29:30 +03:00
Oz Linden c8726aba30 remove execute permission from many files that should not have it 2015-11-10 09:48:56 -05:00
Oz Linden e15002a11c merge changes for 3.7.9-release 2014-06-16 11:42:37 -04:00
Brad Payne (Vir Linden) 7b9708a2e3 sunshine-external merge WIP 2014-05-13 10:02:26 -04:00