Merge remote-tracking branch release/2024.06-atlasaurus into 'develop'

master
Brad Linden 2024-08-09 17:57:23 -07:00
commit a7fde9d79c
591 changed files with 12499 additions and 10377 deletions

View File

@ -1,5 +1,6 @@
# Replace tabs with spaces
1b68f71348ecf3983b76b40d7940da8377f049b7
33418a77b716e122da9778869cdbabe97c83ff37
# Trim trailing whitespace
a0b3021bdcf76859054fda8e30abb3ed47749e83
8444cd9562a6a7b755fcb075864e205122354192

View File

@ -11,8 +11,8 @@ body:
- type: textarea
attributes:
label: Environment
description: About Second Life Text
placeholder: ex. Second Life Test 7.1.3.240191747 (64bit) ...
description: "Please copy the info from the viewer's 'About Second Life' window and paste it here:"
placeholder: 'ex. Second Life Release 7.1.8.9375512768 (64bit) ...'
validations:
required: true

View File

@ -7,14 +7,14 @@ on:
tags: ["Second_Life*"]
jobs:
# The whole point of the setvar job is that we want to set a variable once
# that will be consumed by multiple subsequent jobs. We tried setting it in
# the global env, but a job.env can't directly reference the global env
# context.
setvar:
# The whole point of the setup job is that we want to set variables once
# that will be consumed by multiple subsequent jobs.
setup:
runs-on: ubuntu-latest
outputs:
release_run: ${{ steps.setvar.outputs.release_run }}
configurations: ${{ steps.setvar.outputs.configurations }}
bugsplat_db: ${{ steps.setvar.outputs.bugsplat_db }}
env:
# Build with a tag like "Second_Life#abcdef0" to generate a release page
# (used for builds we are planning to deploy).
@ -22,33 +22,36 @@ jobs:
# important to ensure it's the empty string when false. If you omit || '',
# its value when false is "false", which is interpreted as true.
RELEASE_RUN: ${{ (github.event.inputs.release_run || github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life')) && 'Y' || '' }}
FROM_FORK: ${{ github.event.pull_request.head.repo.fork }}
steps:
- name: Set Variable
- name: Set Variables
id: setvar
shell: bash
run: |
echo "release_run=$RELEASE_RUN" >> "$GITHUB_OUTPUT"
if [[ "$FROM_FORK" == "true" ]]; then
# PR from fork; don't build with Bugsplat, proprietary libs
echo 'configurations=["ReleaseOS"]' >> $GITHUB_OUTPUT
echo "bugsplat_db=" >> $GITHUB_OUTPUT
else
echo 'configurations=["Release"]' >> $GITHUB_OUTPUT
echo "bugsplat_db=SecondLife_Viewer_2018" >> $GITHUB_OUTPUT
fi
build:
needs: setvar
needs: setup
strategy:
matrix:
runner: [windows-large, macos-12-xl]
configuration: [Release]
Linden: [true]
include:
- runner: macos-12-xl
developer_dir: "/Applications/Xcode_14.0.1.app/Contents/Developer"
- runner: windows-large
configuration: ReleaseOS
Linden: false
configuration: ${{ fromJSON(needs.setup.outputs.configurations) }}
runs-on: ${{ matrix.runner }}
outputs:
viewer_channel: ${{ steps.build.outputs.viewer_channel }}
viewer_version: ${{ steps.build.outputs.viewer_version }}
viewer_branch: ${{ steps.which-branch.outputs.branch }}
relnotes: ${{ steps.which-branch.outputs.relnotes }}
imagename: ${{ steps.build.outputs.imagename }}
imagename: ${{ steps.build.outputs.imagename }}
configuration: ${{ matrix.configuration }}
env:
AUTOBUILD_ADDRSIZE: 64
AUTOBUILD_BUILD_ID: ${{ github.run_id }}
@ -61,12 +64,9 @@ jobs:
# autobuild-package.xml.
AUTOBUILD_VCS_INFO: "true"
AUTOBUILD_VSVER: "170"
DEVELOPER_DIR: ${{ matrix.developer_dir }}
DEVELOPER_DIR: "/Applications/Xcode_14.0.1.app/Contents/Developer"
# Ensure that Linden viewer builds engage Bugsplat.
BUGSPLAT_DB: ${{ matrix.Linden && 'SecondLife_Viewer_2018' || '' }}
# Run BUILD steps for Release configuration.
# Run BUILD steps for ReleaseOS configuration only for release runs.
BUILD: ${{ (matrix.Linden || needs.setvar.outputs.release_run) && 'Y' || '' }}
BUGSPLAT_DB: ${{ needs.setup.outputs.bugsplat_db }}
build_coverity: false
build_log_dir: ${{ github.workspace }}/.logs
build_viewer: true
@ -85,19 +85,16 @@ jobs:
variants: ${{ matrix.configuration }}
steps:
- name: Checkout code
if: env.BUILD
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Setup python
if: env.BUILD
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Checkout build variables
if: env.BUILD
uses: actions/checkout@v4
with:
repository: secondlife/build-variables
@ -105,19 +102,16 @@ jobs:
path: .build-variables
- name: Checkout master-message-template
if: env.BUILD
uses: actions/checkout@v4
with:
repository: secondlife/master-message-template
path: .master-message-template
- name: Install autobuild and python dependencies
if: env.BUILD
run: pip3 install autobuild llsd
- name: Cache autobuild packages
id: cache-installables
if: env.BUILD
uses: actions/cache@v4
with:
path: .autobuild-installables
@ -127,19 +121,17 @@ jobs:
${{ runner.os }}-64-
- name: Install windows dependencies
if: env.BUILD && runner.os == 'Windows'
if: runner.os == 'Windows'
run: choco install nsis-unicode
- name: Determine source branch
id: which-branch
if: env.BUILD
uses: secondlife/viewer-build-util/which-branch@v2
with:
token: ${{ github.token }}
- name: Build
id: build
if: env.BUILD
shell: bash
env:
AUTOBUILD_VCS_BRANCH: ${{ steps.which-branch.outputs.branch }}
@ -265,7 +257,7 @@ jobs:
echo "artifact=$RUNNER_OS$cfg_suffix" >> $GITHUB_OUTPUT
- name: Upload executable
if: matrix.Linden && steps.build.outputs.viewer_app
if: matrix.configuration == 'Release' && steps.build.outputs.viewer_app
uses: actions/upload-artifact@v4
with:
name: "${{ steps.build.outputs.artifact }}-app"
@ -275,15 +267,13 @@ jobs:
# The other upload of nontrivial size is the symbol file. Use a distinct
# artifact for that too.
- name: Upload symbol file
if: matrix.Linden
uses: actions/upload-artifact@v4
if: matrix.configuration == 'Release'
with:
name: "${{ steps.build.outputs.artifact }}-symbols"
path: |
${{ steps.build.outputs.symbolfile }}
path: ${{ steps.build.outputs.symbolfile }}
- name: Upload metadata
if: matrix.Linden
uses: actions/upload-artifact@v4
with:
name: "${{ steps.build.outputs.artifact }}-metadata"
@ -294,7 +284,7 @@ jobs:
- name: Upload physics package
uses: actions/upload-artifact@v4
# should only be set for viewer-private
if: matrix.Linden && steps.build.outputs.physicstpv
if: matrix.configuration == 'Release' && steps.build.outputs.physicstpv
with:
name: "${{ steps.build.outputs.artifact }}-physics"
# emitted by build.sh, zero or one lines
@ -402,6 +392,7 @@ jobs:
BUGSPLAT_USER: ${{ secrets.BUGSPLAT_USER }}
BUGSPLAT_PASS: ${{ secrets.BUGSPLAT_PASS }}
needs: build
if: needs.build.outputs.configuration == 'Release'
runs-on: ubuntu-latest
steps:
- name: Download Mac Symbols
@ -422,9 +413,9 @@ jobs:
files: "**/*.xcarchive.zip"
release:
needs: [setvar, build, sign-and-package-windows, sign-and-package-mac]
needs: [setup, build, sign-and-package-windows, sign-and-package-mac]
runs-on: ubuntu-latest
if: needs.setvar.outputs.release_run
if: needs.setup.outputs.release_run
steps:
- uses: actions/download-artifact@v4
with:

View File

@ -26,23 +26,22 @@ on:
jobs:
tag-release:
runs-on: ubuntu-latest
env:
GITHUB_TAG_TOKEN: ${{ secrets.GITHUB_TAG_TOKEN }}
steps:
- name: Setup Env Vars
run: |
CHANNEL="${{ inputs.channel }}"
echo VIEWER_CHANNEL="Second_Life_${CHANNEL:-Develop}" >> ${GITHUB_ENV}
echo NIGHTLY_DATE=$(date --rfc-3339=date) >> ${GITHUB_ENV}
NIGHTLY_DATE=$(date --rfc-3339=date)
echo NIGHTLY_DATE=${NIGHTLY_DATE} >> ${GITHUB_ENV}
echo TAG_ID="$(echo ${{ github.sha }} | cut -c1-8)-${{ inputs.project || '${NIGHTLY_DATE}' }}" >> ${GITHUB_ENV}
- name: Update Tag
uses: actions/github-script@v7.0.1
if: env.GITHUB_TAG_TOKEN
with:
github-token: ${{ env.GITHUB_TAG_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.git.createRef(
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ env.VIEWER_CHANNEL }}#${{ env.NIGHTLY_DATE }}",
ref: "refs/tags/${{ env.VIEWER_CHANNEL }}#${{ env.TAG_ID }}",
sha: context.sha
)
})

View File

@ -46,11 +46,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>dc4a38439f90325b406ec3f7cc4fa66edf0eeec8</string>
<string>058ffb9080ac03abd8ecd1f57fcc1160351c71ed</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.2-e935465/apr_suite-1.7.2-e935465-darwin64-e935465.tar.zst</string>
<string>https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.4-r1/apr_suite-1.7.4-10278668642-darwin64-10278668642.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
@ -60,9 +60,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>84a1a140f20b25d714949185e854d14b</string>
<string>272d97471f6ecf6e1eb4802f353d1f8c6f024eb3</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4811/15302/apr_suite-1.4.5.504800-linux64-504800.tar.bz2</string>
<string>https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.4-r1/apr_suite-1.7.4-10278668642-linux64-10278668642.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
@ -72,11 +74,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>8233de9a11f323a03d569db1043ba5198176457b</string>
<string>587b0b61ecff2ac55cfbcb8e57a7b07c844a0069</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.2-e935465/apr_suite-1.7.2-e935465-windows64-e935465.tar.zst</string>
<string>https://github.com/secondlife/3p-apr_suite/releases/download/v1.7.4-r1/apr_suite-1.7.4-10278668642-windows64-10278668642.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
@ -89,7 +91,7 @@
<key>copyright</key>
<string>Copyright © 2012 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.</string>
<key>version</key>
<string>1.7.2-e935465</string>
<string>1.7.4-10278668642</string>
<key>name</key>
<string>apr_suite</string>
<key>description</key>
@ -104,11 +106,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>d8d9e1e15ec09c81acfa9ffb80c3f20435373543</string>
<string>d600779da508fbb64eb85957f2866fd2b039b674</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-boost/releases/download/v1.84.0-r1/boost-1.84-darwin64-8499892512.tar.zst</string>
<string>https://github.com/secondlife/3p-boost/releases/download/v1.85.0-r1/boost-1.85-darwin64-10124675220.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
@ -118,11 +120,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>a5552fcd343179c4c7d6dd6289675431a8c0fe8d</string>
<string>ce39890fe263358d99c45f1b697107b72e3b6870</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-boost/releases/download/v1.84.0-r1/boost-1.84-linux64-8499892512.tar.zst</string>
<string>https://github.com/secondlife/3p-boost/releases/download/v1.85.0-r1/boost-1.85-linux64-10124675220.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
@ -132,11 +134,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>5af9c69093e171eda552720a7acd570496db17db</string>
<string>2b0b0b0aaf3bdb1d36809db7d08bd60ae7e8fed1</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-boost/releases/download/v1.84.0-r1/boost-1.84-windows64-8499892512.tar.zst</string>
<string>https://github.com/secondlife/3p-boost/releases/download/v1.85.0-r1/boost-1.85-windows64-10124675220.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
@ -149,7 +151,7 @@
<key>copyright</key>
<string>(see individual source files)</string>
<key>version</key>
<string>1.81-09d25a7</string>
<string>1.85</string>
<key>name</key>
<string>boost</string>
<key>description</key>
@ -210,11 +212,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>fd656d2478728c4fc268478ec40d33b0ed1b7d83</string>
<string>a29852f41b77a26a2c10af1d179bf7c4b6a1b12b</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r4/colladadom-2.3.8500178177-darwin64-8500178177.tar.zst</string>
<string>https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r6/colladadom-2.3.10129939866-darwin64-10129939866.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
@ -224,11 +226,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>aebc0ddcae18852e78143fbac793cd4a32f0f251</string>
<string>933c31aa8da53731c75c272b90a64dde08dc1f4d</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r4/colladadom-2.3.8500178177-linux64-8500178177.tar.zst</string>
<string>https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r6/colladadom-2.3.10129939866-linux64-10129939866.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
@ -238,11 +240,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>3b25739b1a923c2edcf19864a1c82aeb5042567b</string>
<string>c01f1692a48d26436297bd5ac4b54fd3c71f7651</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r4/colladadom-2.3.8500178177-windows64-8500178177.tar.zst</string>
<string>https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r6/colladadom-2.3.10129939866-windows64-10129939866.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
@ -255,7 +257,7 @@
<key>copyright</key>
<string>Copyright 2006 Sony Computer Entertainment Inc.</string>
<key>version</key>
<string>2.3.ab0c124</string>
<string>2.3.10129939866</string>
<key>name</key>
<string>colladadom</string>
</map>
@ -437,6 +439,16 @@
</map>
<key>dullahan</key>
<map>
<key>copyright</key>
<string>Copyright (c) 2017, Linden Research, Inc.</string>
<key>description</key>
<string>A headless browser SDK that uses the Chromium Embedded Framework (CEF). It is designed to make it easier to write applications that render modern web content directly to a memory buffer, inject synthesized mouse and keyboard events as well as interact with web based features like JavaScript or cookies.</string>
<key>license</key>
<string>MPL</string>
<key>license_file</key>
<string>LICENSES/LICENSE.txt</string>
<key>name</key>
<string>dullahan</string>
<key>platforms</key>
<map>
<key>darwin64</key>
@ -444,74 +456,64 @@
<key>archive</key>
<map>
<key>hash</key>
<string>e4d568c166049ce61b39d69887b56d2382781a1a</string>
<string>7fde76e3f0e62d0e0593b6157f4d740ecef2429d</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/dullahan/releases/download/v118.0.5993.54/dullahan-1.14.0.202310131309_118.4.1_g3dd6078_chromium-118.0.5993.54-darwin64-6b02a60.tar.zst</string>
<string>https://github.com/secondlife/dullahan/releases/download/v1.14.0-r3/dullahan-1.14.0.202408091638_118.4.1_g3dd6078_chromium-118.0.5993.54-darwin64-10322607516.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
</map>
<key>linux64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>209d031ae67bc66d8e8f8509c71d259014c65ceb</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/dullahan/releases/download/v1.14.0-r3/dullahan-1.14.0.202408091637_118.4.1_g3dd6078_chromium-118.0.5993.54-linux64-10322607516.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
</map>
<key>windows64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>a00eae7f5dc430ae48389ab723ced39739b0a144</string>
<string>4124c79d8b0e319877ffa4c12581d5c1318b4d93</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/dullahan/releases/download/v118.0.5993.54/dullahan-1.14.0.202310131404_118.4.1_g3dd6078_chromium-118.0.5993.54-windows64-6b02a60.tar.zst</string>
<string>https://github.com/secondlife/dullahan/releases/download/v1.14.0-r3/dullahan-1.14.0.202408091639_118.4.1_g3dd6078_chromium-118.0.5993.54-windows64-10322607516.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>license</key>
<string>MPL</string>
<key>license_file</key>
<string>LICENSES/LICENSE.txt</string>
<key>copyright</key>
<string>Copyright (c) 2017, Linden Research, Inc.</string>
<key>version</key>
<string>1.14.0.202310131404_118.4.1_g3dd6078_chromium-118.0.5993.54</string>
<key>name</key>
<string>dullahan</string>
<key>description</key>
<string>A headless browser SDK that uses the Chromium Embedded Framework (CEF). It is designed to make it easier to write applications that render modern web content directly to a memory buffer, inject synthesized mouse and keyboard events as well as interact with web based features like JavaScript or cookies.</string>
<string>1.14.0.202408091639_118.4.1_g3dd6078_chromium-118.0.5993.54</string>
</map>
<key>emoji_shortcodes</key>
<map>
<key>platforms</key>
<map>
<key>darwin64</key>
<key>common</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>52c41a4547d2d9aceb4a9a1e9e1680c71e5ffa79</string>
<string>9c58108270fbad15a321f75501cdfb9c6b78a6f2</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-emoji-shortcodes/releases/download/v6.1.0.5413f58/emoji_shortcodes-6.1.0.5413f58-darwin64-5413f58.tar.zst</string>
<string>https://github.com/secondlife/3p-emoji-shortcodes/releases/download/v15.3.2-r1/emoji_shortcodes-15.3.2.10207138275-common-10207138275.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
</map>
<key>windows64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>3137e06d376767a631bc9626832d558c4d5e5aa9</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-emoji-shortcodes/releases/download/v6.1.0.5413f58/emoji_shortcodes-6.1.0.5413f58-windows64-5413f58.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
<string>common</string>
</map>
</map>
<key>license</key>
@ -521,7 +523,7 @@
<key>copyright</key>
<string>Copyright 2017-2019 Miles Johnson.</string>
<key>version</key>
<string>6.1.0.5413f58</string>
<string>15.3.2.10207138275</string>
<key>name</key>
<string>emoji_shortcodes</string>
<key>canonical_repo</key>
@ -538,11 +540,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>b85526ca80b6a7e73c7870285cf68d568f742095</string>
<string>bd61ec7787ea96d11f735afa5a6296ed175472b6</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-expat/releases/download/v2.1.1.1f36d02/expat-2.1.1.1f36d02-darwin64-1f36d02.tar.zst</string>
<string>https://github.com/secondlife/3p-expat/releases/download/v2.6.2-r4/expat-2.6.2-r4-darwin64-10278332617.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
@ -552,11 +554,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>4cd82e2dec06ddff19e9b3dc0254f2593ec80452</string>
<string>acf891bda4125a92f6347e69f0e7867f32cebd20</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-expat/releases/download/v2.1.1.1f36d02/expat-2.1.1.1f36d02-linux64-1f36d02.tar.zst</string>
<string>https://github.com/secondlife/3p-expat/releases/download/v2.6.2-r4/expat-2.6.2-r4-linux64-10278332617.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
@ -566,11 +568,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>47c01a89bc32c5740efe51be43e459ffd9b7cd34</string>
<string>1b9c198626fca0f30fb2770856e65767a9951683</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-expat/releases/download/v2.1.1.1f36d02/expat-2.1.1.1f36d02-windows64-1f36d02.tar.zst</string>
<string>https://github.com/secondlife/3p-expat/releases/download/v2.6.2-r4/expat-2.6.2-r4-windows64-10278332617.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
@ -581,9 +583,9 @@
<key>license_file</key>
<string>LICENSES/expat.txt</string>
<key>copyright</key>
<string>Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd and Clark Cooper - Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers.</string>
<string>Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper - Copyright (c) 2001-2022 Expat maintainers.</string>
<key>version</key>
<string>2.1.1.1f36d02</string>
<string>2.6.2-r4</string>
<key>name</key>
<string>expat</string>
<key>description</key>
@ -959,63 +961,65 @@
<key>name</key>
<string>jpegencoderbasic</string>
</map>
<key>jpeglib</key>
<key>libjpeg-turbo</key>
<map>
<key>platforms</key>
<map>
<key>darwin64</key>
<key>windows64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>776d114aa1e3455bb13deaacd756deb07b53ecbe</string>
<string>36144272e381952a7c11f1d593c2916c5c7387d0</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-jpeglib/releases/download/v8c.7846234/jpeglib-8c.7846234-darwin64-7846234.tar.zst</string>
<string>https://github.com/secondlife/3p-libjpeg-turbo/releases/download/v3.0.3-r1/libjpeg_turbo-3.0.3-windows64-10204037839.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
<string>windows64</string>
</map>
<key>linux64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>b4b2278bd2fcae85619e2145a243cca388d760d7</string>
<string>f853a7d4fe842e7a661dd71a56a51f65b2ec25c7</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-jpeglib/releases/download/v8c.7846234/jpeglib-8c.7846234-linux64-7846234.tar.zst</string>
<string>https://github.com/secondlife/3p-libjpeg-turbo/releases/download/v3.0.3-r1/libjpeg_turbo-3.0.3-linux64-10204037839.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
</map>
<key>windows64</key>
<key>darwin64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>d50fcac69eeb9404638da07db96ee3e1191ecf93</string>
<string>6fcbc2c3c91b5e9bfbbc57ddf27d2f3698fe7d99</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-jpeglib/releases/download/v8c.7846234/jpeglib-8c.7846234-windows64-7846234.tar.zst</string>
<string>https://github.com/secondlife/3p-libjpeg-turbo/releases/download/v3.0.3-r1/libjpeg_turbo-3.0.3-darwin64-10204037839.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
<string>darwin64</string>
</map>
</map>
<key>license</key>
<string>jpeglib</string>
<string>libjpeg-turbo</string>
<key>license_file</key>
<string>LICENSES/jpeglib.txt</string>
<string>LICENSES/libjpeg-turbo.txt</string>
<key>copyright</key>
<string>Copyright (C) 1991-2011, Thomas G. Lane, Guido Vollbeding.</string>
<string>Copyright (C)2009-2024 D. R. Commander. All Rights Reserved. Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.</string>
<key>version</key>
<string>8c.7846234</string>
<string>3.0.3</string>
<key>name</key>
<string>jpeglib</string>
<string>libjpeg-turbo</string>
<key>canonical_repo</key>
<string>https://github.com/secondlife/3p-libjpeg-turbo</string>
<key>description</key>
<string>JPEG encoding, decoding library</string>
</map>
@ -1110,11 +1114,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>d5757ab84d934fa358f299ab91e2e297beaa3dac</string>
<string>e71ae7a645603fe967a69aa5beb5b3009185e177</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-libhunspell/releases/download/v1.3.2.650fb94/libhunspell-1.3.2.650fb94-darwin64-650fb94.tar.zst</string>
<string>https://github.com/secondlife/3p-libhunspell/releases/download/v1.7.2-r1/libhunspell-1.7.2.10207243663-darwin64-10207243663.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
@ -1124,11 +1128,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>6413d3bd4cd50c2a6b7f949eb4bd6f0c94feb984</string>
<string>275ffb7f60064d8008aed8406f80f34229f651fc</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-libhunspell/releases/download/v1.3.2.650fb94/libhunspell-1.3.2.650fb94-linux64-650fb94.tar.zst</string>
<string>https://github.com/secondlife/3p-libhunspell/releases/download/v1.7.2-r1/libhunspell-1.7.2.10207243663-linux64-10207243663.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
@ -1138,11 +1142,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>c1be4a79b20435030b2e0e01b582c61b462c8376</string>
<string>89ff24e93eaeca7949ccdb5cc368f938f5b1f307</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-libhunspell/releases/download/v1.3.2.650fb94/libhunspell-1.3.2.650fb94-windows64-650fb94.tar.zst</string>
<string>https://github.com/secondlife/3p-libhunspell/releases/download/v1.7.2-r1/libhunspell-1.7.2.10207243663-windows64-10207243663.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
@ -1153,9 +1157,9 @@
<key>license_file</key>
<string>LICENSES/hunspell.txt</string>
<key>copyright</key>
<string>See hunspell.txt</string>
<string>LGPL 2.1</string>
<key>version</key>
<string>1.3.2.650fb94</string>
<string>1.7.2.10207243663</string>
<key>name</key>
<string>libhunspell</string>
<key>description</key>
@ -1387,6 +1391,15 @@
</map>
<key>llca</key>
<map>
<key>copyright</key>
<string>Copyright (c) 2016, Linden Research, Inc.; data provided by the Mozilla NSS Project.
</string>
<key>license</key>
<string>mit</string>
<key>license_file</key>
<string>LICENSES/ca-license.txt</string>
<key>name</key>
<string>llca</string>
<key>platforms</key>
<map>
<key>common</key>
@ -1394,27 +1407,18 @@
<key>archive</key>
<map>
<key>hash</key>
<string>a9503e1b4e1d9790cf29d18a3d9ab39e6a515679</string>
<string>6d6771706a5b70caa24893ff62afc925f8d035f6</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/llca/releases/download/v202402012004.0-0f5d9c3/llca-202402012004.0-common-0f5d9c3.tar.zst</string>
<string>https://github.com/secondlife/llca/releases/download/v202407221723.0-a0fd5b9/llca-202407221423.0-common-10042698865.tar.zst</string>
</map>
<key>name</key>
<string>common</string>
</map>
</map>
<key>license</key>
<string>mit</string>
<key>license_file</key>
<string>LICENSES/ca-license.txt</string>
<key>copyright</key>
<string>Copyright (c) 2016, Linden Research, Inc.; data provided by the Mozilla NSS Project.
</string>
<key>version</key>
<string>202402012004.0</string>
<key>name</key>
<string>llca</string>
<string>202407221423.0</string>
</map>
<key>llphysicsextensions_source</key>
<map>
@ -1435,11 +1439,11 @@
<key>creds</key>
<string>github</string>
<key>hash</key>
<string>755a3de464149ae88b048f976828a8c0c46e3bdb</string>
<string>9e59c93c7110e87b4ff3db330f11a23c50e5000f</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/172966323</string>
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/178910560</string>
</map>
<key>name</key>
<string>darwin64</string>
@ -1451,11 +1455,11 @@
<key>creds</key>
<string>github</string>
<key>hash</key>
<string>813e7b5e294d7958e3d69e2252752ff346953b0c</string>
<string>7ed994db5bafa9a7ad09a1b53da850a84715c65e</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/172966322</string>
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/178910561</string>
</map>
<key>name</key>
<string>linux64</string>
@ -1467,18 +1471,18 @@
<key>creds</key>
<string>github</string>
<key>hash</key>
<string>67f647538b1b49d0152fd9d03cfb9bdf978e33d1</string>
<string>66824c02e0e5eabbfbe37bfb173360195f89697c</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/172966328</string>
<string>https://api.github.com/repos/secondlife/llphysicsextensions_source/releases/assets/178910562</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>version</key>
<string>1.0.b8b1f73</string>
<string>1.0.66e6919</string>
</map>
<key>llphysicsextensions_stub</key>
<map>
@ -1619,11 +1623,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>3bf88febd23656327a4ee2a3ebe99cae4b15573e</string>
<string>3d173e176e9777f1b10f54fe0bd1c735a65b56e5</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-meshoptimizer/releases/download/v160-032f20a/meshoptimizer-160-darwin64-032f20a.tar.zst</string>
<string>https://github.com/secondlife/3p-meshoptimizer/releases/download/v210-r1/meshoptimizer-210-darwin64-9846246058.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
@ -1633,15 +1637,29 @@
<key>archive</key>
<map>
<key>hash</key>
<string>13c0a33d9c49cc07b354527c7ef992d33f854c59</string>
<string>6777467d1d06064351c27f70d556fdcba8420c52</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-meshoptimizer/releases/download/v160-032f20a/meshoptimizer-160-windows64-032f20a.tar.zst</string>
<string>https://github.com/secondlife/3p-meshoptimizer/releases/download/v210-r1/meshoptimizer-210-windows64-9846246058.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
<key>linux64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>17eb4a03f94d363e9ad8b096ac590e0649cf91fa</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-meshoptimizer/releases/download/v210-r1/meshoptimizer-210-linux64-9846246058.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
</map>
</map>
<key>license</key>
<string>meshoptimizer</string>
@ -1650,7 +1668,7 @@
<key>copyright</key>
<string>Copyright (c) 2016-2021 Arseny Kapoulkine</string>
<key>version</key>
<string>160</string>
<string>210</string>
<key>name</key>
<string>meshoptimizer</string>
<key>canonical_repo</key>
@ -1942,11 +1960,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key>
<map>
<key>hash</key>
<string>ad0dd0f608b868cc44c225ee48e114239fca2807</string>
<string>1e694e5562b8d844bc44d5f7ae4dce243ee70d23</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.3-1.3.6.e4101b6/ogg_vorbis-1.3.3-1.3.6.e4101b6-darwin64-e4101b6.tar.zst</string>
<string>https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.5-1.3.7/ogg_vorbis-1.3.5-1.3.7.10218872737-darwin64-10218872737.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
@ -1956,9 +1974,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key>
<map>
<key>hash</key>
<string>45ebd074053dc9cae8c5c74b52085d4b</string>
<string>ce0c6adb6d684eb2f4b2ad8838c67186c59e151a</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/465/990/ogg_vorbis-1.2.2-1.3.2.500397-linux64-500397.tar.bz2</string>
<string>https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.5-1.3.7/ogg_vorbis-1.3.5-1.3.7.10218872737-linux64-10218872737.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
@ -1968,11 +1988,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key>
<map>
<key>hash</key>
<string>2e73a0a5659c9a09eba2f94619aa5c23c7cc3937</string>
<string>9434b592c5d748c5deb64ad548fd1484638e3172</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.3-1.3.6.e4101b6/ogg_vorbis-1.3.3-1.3.6.e4101b6-windows64-e4101b6.tar.zst</string>
<string>https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.5-1.3.7/ogg_vorbis-1.3.5-1.3.7.10218872737-windows64-10218872737.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
@ -1985,7 +2005,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>copyright</key>
<string>Copyright (c) 2002, Xiph.org Foundation</string>
<key>version</key>
<string>1.3.3-1.3.6.e4101b6</string>
<string>1.3.5-1.3.7.10218872737</string>
<key>name</key>
<string>ogg_vorbis</string>
<key>description</key>
@ -2186,64 +2206,6 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>description</key>
<string>Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) Library</string>
</map>
<key>pcre</key>
<map>
<key>platforms</key>
<map>
<key>darwin64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>b372d37596474043a62568e569b0ce155192f484</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-pcre/releases/download/v8.35.979fd86/pcre-8.35.979fd86-darwin64-979fd86.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
</map>
<key>linux64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>0f058ca2176e7d02d51e54c66a96f336</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/908/2010/pcre-8.35.500898-linux64-500898.tar.bz2</string>
</map>
<key>name</key>
<string>linux64</string>
</map>
<key>windows64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>166564afb60a7536a038fae80e2fc9a41d6dbccb</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-pcre/releases/download/v8.35.979fd86/pcre-8.35.979fd86-windows64-979fd86.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>license</key>
<string>bsd</string>
<key>license_file</key>
<string>LICENSES/pcre-license.txt</string>
<key>copyright</key>
<string>Copyright (c) 1997-2014 University of Cambridge; Copyright(c) 2009-2014 Zoltan Herczeg; Copyright (c) 2007-2012, Google Inc.</string>
<key>version</key>
<string>8.35.979fd86</string>
<key>name</key>
<string>pcre</string>
<key>description</key>
<string>PCRE Perl-compatible regular expression library</string>
</map>
<key>slvoice</key>
<map>
<key>platforms</key>
@ -2405,11 +2367,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key>
<map>
<key>hash</key>
<string>49650353442698c3e05102676fe427d0ebe02f0b</string>
<string>a901a14066daf8c8796c8d2914917129427fd80b</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-tracy/releases/download/v0.8.1-eecbf72/tracy-v0.8.1-eecbf72-darwin64-eecbf72.tar.zst</string>
<string>https://github.com/secondlife/3p-tracy/releases/download/v0.10.0%2Br1/tracy-v0.10.0.9845715133-darwin64-9845715133.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
@ -2419,15 +2381,29 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key>
<map>
<key>hash</key>
<string>2b80e7407e4f3e82eff3879add0e9ad63e7fcace</string>
<string>ca5fc66e3431278f20286261ffe85192bbd9a2ca</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-tracy/releases/download/v0.8.1-eecbf72/tracy-v0.8.1-eecbf72-windows64-eecbf72.tar.zst</string>
<string>https://github.com/secondlife/3p-tracy/releases/download/v0.10.0%2Br1/tracy-v0.10.0.9845715133-windows64-9845715133.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
<key>linux64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>e6f53d513c238ad599b75a8b5f94b8b0d1315438</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-tracy/releases/download/v0.10.0%2Br1/tracy-v0.10.0.9845715133-linux64-9845715133.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
</map>
</map>
<key>license</key>
<string>bsd</string>
@ -2436,7 +2412,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>copyright</key>
<string>Copyright (c) 2017-2022, Bartosz Taudul (wolf@nereid.pl)</string>
<key>version</key>
<string>v0.8.1-eecbf72</string>
<string>v0.10.0.9845715133</string>
<key>name</key>
<string>tracy</string>
<key>canonical_repo</key>
@ -2480,93 +2456,23 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>description</key>
<string>TUT is a small and portable unit test framework for C++.</string>
</map>
<key>uriparser</key>
<map>
<key>platforms</key>
<map>
<key>darwin64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>4b6ee5113b1368ec9ff5b59e195adde370b9f585</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-uriparser/releases/download/v0.9.4-8fff38a/uriparser-0.9.4-darwin64-8fff38a.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
</map>
<key>linux64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>44dc74ec73e37c56bef6317d12a29d0435cb4bbb</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-uriparser/releases/download/v0.9.4-8fff38a/uriparser-0.9.4-linux64-8fff38a.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
</map>
<key>windows64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>e8b20edfc624f1d09bc83480932a9c844d47fc13</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-uriparser/releases/download/v0.9.4-8fff38a/uriparser-0.9.4-windows64-8fff38a.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>license</key>
<string>New BSD license</string>
<key>license_file</key>
<string>LICENSES/uriparser.txt</string>
<key>copyright</key>
<string>Copyright (C) 2007, Weijia Song &lt;songweijia@gmail.com&gt;, Sebastian Pipping &lt;webmaster@hartwork.org&gt;</string>
<key>version</key>
<string>0.9.4</string>
<key>name</key>
<string>uriparser</string>
<key>description</key>
<string>uriparser is a strictly RFC 3986 compliant URI parsing and handling library written in C. uriparser is cross-platform, fast, supports Unicode and is licensed under the New BSD license.</string>
</map>
<key>viewer-fonts</key>
<map>
<key>platforms</key>
<map>
<key>darwin64</key>
<key>common</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>6041bbd4001e3951f96ac3456c7906da</string>
<string>e88a7c97a6843d43e0093388f211299ec2892790</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/113314/980656/viewer_fonts-1.579464-darwin64-579464.tar.bz2</string>
<string>https://github.com/secondlife/3p-viewer-fonts/releases/download/v1.1.0-r1/viewer_fonts-1.0.0.10204976553-common-10204976553.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
</map>
<key>windows64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>1745ba6eec0108250446fe01d4aa065c</string>
<key>url</key>
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/113307/980631/viewer_fonts-1.579464-windows64-579464.tar.bz2</string>
</map>
<key>name</key>
<string>windows64</string>
<string>common</string>
</map>
</map>
<key>license</key>
@ -2576,7 +2482,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>copyright</key>
<string>Copyright 2016-2022 Brad Erickson CC-BY-4.0/MIT, Copyright 2016-2022 Twitter, Inc. CC-BY-4.0, Copyright 2013 Joe Loughry and Terence Eden MIT</string>
<key>version</key>
<string>1.579464</string>
<string>1.0.0.10204976553</string>
<key>name</key>
<string>viewer-fonts</string>
<key>description</key>
@ -2648,50 +2554,14 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
</map>
<key>vlc-bin</key>
<map>
<key>platforms</key>
<map>
<key>darwin64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>a26b47ab01a7e2c0add4c236886162c1135b3b79</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-vlc-bin/releases/download/v3.0.16.c219a5d/vlc_bin-3.0.16.c219a5d-darwin64-c219a5d.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
</map>
<key>windows64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>d56002da7435bab166c88d59eeaf69fd87cd897d</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-vlc-bin/releases/download/v3.0.16.c219a5d/vlc_bin-3.0.16.c219a5d-windows64-c219a5d.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>copyright</key>
<string>Copyright (C) 1998-2016 VLC authors and VideoLAN</string>
<key>license</key>
<string>GPL2</string>
<key>license_file</key>
<string>LICENSES/vlc.txt</string>
<key>copyright</key>
<string>Copyright (C) 1998-2016 VLC authors and VideoLAN</string>
<key>version</key>
<string>3.0.16.c219a5d</string>
<key>name</key>
<string>vlc-bin</string>
</map>
<key>xmlrpc-epi</key>
<map>
<key>platforms</key>
<map>
<key>darwin64</key>
@ -2699,56 +2569,32 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key>
<map>
<key>hash</key>
<string>aa12611374876196b3ebb6bda8d419a697217b8b</string>
<string>f13c82042ef8311e57dd75a3b2bda02d70f711b5</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-xmlrpc-epi/releases/download/v0.54.1.8a05acf/xmlrpc_epi-0.54.1.8a05acf-darwin64-8a05acf.tar.zst</string>
<string>https://github.com/secondlife/3p-vlc-bin/releases/download/v3.0.21.e60ee26/vlc_bin-3.0.21.10218721728-darwin64-10218721728.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
</map>
<key>linux64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>ad0c8b41ee4b4de216382bec46ee1c25962a3f12</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-xmlrpc-epi/releases/download/v0.54.1.8a05acf/xmlrpc_epi-0.54.1.8a05acf-linux64-8a05acf.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
</map>
<key>windows64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>e53fd38c14b8c47c7c84dead8a1b211bb8be170c</string>
<string>bd995441c1a229ed1432ddd837d7d1663b8c5548</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-xmlrpc-epi/releases/download/v0.54.1.8a05acf/xmlrpc_epi-0.54.1.8a05acf-windows64-8a05acf.tar.zst</string>
<string>https://github.com/secondlife/3p-vlc-bin/releases/download/v3.0.21.e60ee26/vlc_bin-3.0.21.10218721728-windows64-10218721728.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>license</key>
<string>xmlrpc-epi</string>
<key>license_file</key>
<string>LICENSES/xmlrpc-epi.txt</string>
<key>copyright</key>
<string>Copyright: (C) 2000 Epinions, Inc.</string>
<key>version</key>
<string>0.54.1.8a05acf</string>
<key>name</key>
<string>xmlrpc-epi</string>
<key>description</key>
<string>XMLRPC Library</string>
<string>3.0.21.10218721728</string>
</map>
<key>vulkan_gltf</key>
<map>
@ -2859,11 +2705,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key>
<map>
<key>hash</key>
<string>1a73c476b371b62066d1c3eced249660e9467e53</string>
<string>fc9362865e33391d55c64d6101726da0a25d924e</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-xxhash/releases/download/v0.8.1-69ff69a/xxhash-0.8.1-69ff69a-common-69ff69a.tar.zst</string>
<string>https://github.com/secondlife/3p-xxhash/releases/download/v0.8.2-r1/xxhash-0.8.2-10285735820-common-10285735820.tar.zst</string>
</map>
<key>name</key>
<string>common</string>
@ -2876,7 +2722,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>copyright</key>
<string>Copyright (c) 2012-2021 Yann Collet</string>
<key>version</key>
<string>0.8.1-69ff69a</string>
<string>0.8.2-10285735820</string>
<key>name</key>
<string>xxhash</string>
<key>description</key>

View File

@ -146,12 +146,21 @@ pre_build()
&& [ -r "$master_message_template_checkout/message_template.msg" ] \
&& template_verifier_master_url="-DTEMPLATE_VERIFIER_MASTER_URL=file://$master_message_template_checkout/message_template.msg"
RELEASE_CRASH_REPORTING=ON
HAVOK=ON
RELEASE_CRASH_REPORTING=OFF
HAVOK=OFF
SIGNING=()
if [[ "$arch" == "Darwin" && "$variant" == "Release" ]]
then SIGNING=("-DENABLE_SIGNING:BOOL=YES" \
"-DSIGNING_IDENTITY:STRING=Developer ID Application: Linden Research, Inc.")
if [[ "$variant" != *OS ]]
then
# Proprietary builds
RELEASE_CRASH_REPORTING=ON
HAVOK=ON
if [[ "$arch" == "Darwin" ]]
then
SIGNING=("-DENABLE_SIGNING:BOOL=YES" \
"-DSIGNING_IDENTITY:STRING=Developer ID Application: Linden Research, Inc.")
fi
fi
if [ "${RELEASE_CRASH_REPORTING:-}" != "OFF" ]

View File

@ -1436,6 +1436,30 @@ Sovereign Engineer
SL-18534
SL-19690
SL-19336
secondlife/viewer/pull/1283
secondlife/viewer/pull/1287
secondlife/viewer/pull/1906
secondlife/viewer/pull/1930
secondlife/viewer/pull/1941
secondlife/viewer/pull/1946
secondlife/viewer/pull/1948
secondlife/viewer/pull/1950
secondlife/viewer/pull/1951
secondlife/viewer/pull/2066
secondlife/viewer/pull/2077
secondlife/viewer/pull/2078
secondlife/viewer/pull/2080
secondlife/viewer/pull/2085
secondlife/viewer/pull/2098
secondlife/viewer/pull/2099
secondlife/viewer/pull/2105
secondlife/viewer/pull/2115
secondlife/viewer/pull/2116
secondlife/viewer/pull/2124
secondlife/viewer/pull/2125
secondlife/viewer/pull/2135
secondlife/viewer/pull/2136
secondlife/viewer/pull/2149
SpacedOut Frye
VWR-34
VWR-45

View File

@ -0,0 +1,12 @@
# PBR Materials
## KHR Texture Transforms
Texture repeats for PBR materials on prims are based on the [KHR\_texture\_transform](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_texture_transform) spec, and thus should be expected to behave according to the spec. We currently suport offset, rotation, and scale from the spec. texCoord is not currently supported.
PBR materials should have approximately correct lighting based on the normal texture:
- With default texture transforms, assuming the prim or model has correct normals and tangents
- With a texture transform applied, especially rotation or negative scale
- With a texture animation applied via `llSetTextureAnim`, especially a rotation animation
- Note: Texture animations are not guaranteed to loop when a PBR texture transform is applied

View File

@ -39,7 +39,7 @@ PBR terrain does not support materials with alpha blend or double-sided. In addi
## PBR Terrain Texture Transforms
Like PBR materials on prims, PBR terrain repeats are based on the [KHR\_texture\_transform](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_texture_transform) spec, and thus should be expected to behave the same way.
Like PBR materials on prims, PBR terrain repeats are based on the [KHR\_texture\_transform](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_texture_transform) spec, and thus should be expected to behave the same way. We currently suport offset, rotation, and scale from the spec. texCoord is not currently supported.
The southwest corner of a region, at z=0, is the UV origin for all texture coordinates of the whole region. Unless an offset is also applied, scale and rotation of the terrain texture transforms are relative to that point.
@ -50,3 +50,14 @@ If triplanar mapping is enabled, and an avatar faces an axially-aligned wall, th
Textures of materials should not appear mirrored.
When triplanar mapping is enabled, rotations on the axially aligned walls should apply in the same direction as they would on flat ground.
## PBR Terrain Normal Textures
This section assumes terrain normal maps are enabled at the current graphics setting.
PBR terrain should have approximately correct lighting based on the normal texture:
- When on flat ground
- On cliffs, when triplanar mapping is enabled. Lighting will be somewhat less accurate when the cliff face is not axially aligned.
- If no Terrain Texture Transform is applied.
- If a Terrain Texture Transform is applied, especially for rotation or negative scale.

View File

@ -44,6 +44,8 @@ The PBR terrain texture transform flag should be set automatically when logging
When the PBR terrain texture transform feature is enabled, the UI of the Terrain tab should be overhauled. Availability of features depends on the type of terrain.
**Known issue:** The Region/Estate floater may have to be closed/reopened a second time in order for the UI overhaul to take effect, after teleporting between regions that do and do not have the feature flag set.
When "PBR Metallic Roughness" is checked:
- There should be a way for the user to change the texture transforms for the terrain in the current region
@ -87,6 +89,12 @@ If saving the terrain fails for any reason, the terrain should not be updated.
Unlike a viewer without PBR terrain support, the new viewer will no longer treat textures with alpha channels as invalid.
### Saving PBR Terrain Texture Transforms
If "PBR Metallic Roughness" checkbox is checked, a user with saving composition permissions should also be allowed to edit and save PBR texture transforms.
One texture transform may be set for each material swatch. Setting texture transforms for each individual texture on the material is not currently supported.
## Graphics Features
Texture terrain with transparency is not permitted to be applied in the viewer.

View File

@ -32,6 +32,10 @@ add_compile_definitions( ADDRESS_SIZE=${ADDRESS_SIZE})
# -- which we do. Without one or the other, we get a ton of Boost warnings.
add_compile_definitions(BOOST_BIND_GLOBAL_PLACEHOLDERS)
# Force enable SSE2 instructions in GLM per the manual
# https://github.com/g-truc/glm/blob/master/manual.md#section2_10
add_compile_definitions(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES=1 GLM_FORCE_SSE2=1)
# Configure crash reporting
set(RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in release builds")
set(NON_RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in developer builds")
@ -104,11 +108,6 @@ if (WINDOWS)
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
endif()
# workaround for github runner image breakage:
# https://github.com/actions/runner-images/issues/10004#issuecomment-2153445161
# can be removed after the above issue is resolved and deployed across GHA
add_compile_definitions(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)
# Allow use of sprintf etc
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif (WINDOWS)

View File

@ -18,6 +18,7 @@ if (WINDOWS)
${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apr-1.lib
${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}aprutil-1.lib
)
target_compile_definitions( ll::apr INTERFACE APR_DECLARE_STATIC=1 APU_DECLARE_STATIC=1 API_DECLARE_STATIC=1)
elseif (DARWIN)
if (LLCOMMON_LINK_SHARED)
set(APR_selector "0.dylib")
@ -28,16 +29,15 @@ elseif (DARWIN)
endif (LLCOMMON_LINK_SHARED)
target_link_libraries( ll::apr INTERFACE
libapr-1.${APR_selector}
libaprutil-1.${APRUTIL_selector}
${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.${APR_selector}
${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.${APR_selector}
iconv
)
else (WINDOWS)
else()
target_link_libraries( ll::apr INTERFACE
apr-1
aprutil-1
uuid
${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.a
${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.a
rt
)
endif (WINDOWS)
endif ()
target_include_directories( ll::apr SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/apr-1 )

View File

@ -1,4 +1,5 @@
# -*- cmake -*-
include(Linking)
include(Prebuilt)
include_guard()
@ -9,8 +10,22 @@ use_prebuilt_binary(ogg_vorbis)
target_include_directories( ll::vorbis SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include )
if (WINDOWS)
target_link_libraries(ll::vorbis INTERFACE ogg_static vorbis_static vorbisenc_static vorbisfile_static )
target_link_libraries(ll::vorbis INTERFACE
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libogg.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libogg.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisenc.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbisenc.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisfile.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbisfile.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbis.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbis.lib
)
else (WINDOWS)
target_link_libraries(ll::vorbis INTERFACE ogg vorbis vorbisenc vorbisfile )
target_link_libraries(ll::vorbis INTERFACE
${ARCH_PREBUILT_DIRS_RELEASE}/libogg.a
${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisenc.a
${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisfile.a
${ARCH_PREBUILT_DIRS_RELEASE}/libvorbis.a
)
endif (WINDOWS)

View File

@ -24,7 +24,8 @@ if (WINDOWS)
libboost_program_options-mt${addrsfx}
libboost_regex-mt${addrsfx}
libboost_system-mt${addrsfx}
libboost_thread-mt${addrsfx})
libboost_thread-mt${addrsfx}
libboost_url-mt${addrsfx})
elseif (LINUX)
target_link_libraries( ll::boost INTERFACE
boost_context-mt${addrsfx}
@ -34,7 +35,8 @@ elseif (LINUX)
boost_regex-mt${addrsfx}
boost_signals-mt${addrsfx}
boost_system-mt${addrsfx}
boost_thread-mt${addrsfx})
boost_thread-mt${addrsfx}
boost_url-mt${addrsfx})
elseif (DARWIN)
target_link_libraries( ll::boost INTERFACE
boost_context-mt${addrsfx}
@ -43,7 +45,8 @@ elseif (DARWIN)
boost_program_options-mt${addrsfx}
boost_regex-mt${addrsfx}
boost_system-mt${addrsfx}
boost_thread-mt${addrsfx})
boost_thread-mt${addrsfx}
boost_url-mt${addrsfx})
endif (WINDOWS)
if (LINUX)

View File

@ -57,13 +57,11 @@ set(cmake_SOURCE_FILES
Tut.cmake
UI.cmake
UnixInstall.cmake
URIPARSER.cmake
Variables.cmake
ViewerMiscLibs.cmake
VisualLeakDetector.cmake
LibVLCPlugin.cmake
WebRTC.cmake
XmlRpcEpi.cmake
xxHash.cmake
ZLIBNG.cmake
)

View File

@ -54,13 +54,14 @@ if(WINDOWS)
set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
set(release_files
openjp2.dll
libapr-1.dll
libaprutil-1.dll
nghttp2.dll
libhunspell.dll
uriparser.dll
)
if(LLCOMMON_LINK_SHARED)
set(release_files ${release_files} libapr-1.dll)
set(release_files ${release_files} libaprutil-1.dll)
endif()
# OpenSSL
if(ADDRESS_SIZE EQUAL 64)
set(release_files ${release_files} libcrypto-1_1-x64.dll)
@ -137,9 +138,14 @@ if(WINDOWS)
# Check each of them.
foreach(release_msvc_file
msvcp${MSVC_VER}.dll
msvcp${MSVC_VER}_1.dll
msvcp${MSVC_VER}_2.dll
msvcp${MSVC_VER}_atomic_wait.dll
msvcp${MSVC_VER}_codecvt_ids.dll
msvcr${MSVC_VER}.dll
vcruntime${MSVC_VER}.dll
vcruntime${MSVC_VER}_1.dll
vcruntime${MSVC_VER}_threads.dll
)
if(redist_path AND EXISTS "${redist_path}/${release_msvc_file}")
MESSAGE(STATUS "Copying redist file from ${redist_path}/${release_msvc_file}")
@ -176,20 +182,20 @@ elseif(DARWIN)
)
set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
set(release_files
libapr-1.0.dylib
libapr-1.dylib
libaprutil-1.0.dylib
libaprutil-1.dylib
${EXPAT_COPY}
libhunspell-1.3.0.dylib
libndofdev.dylib
libnghttp2.dylib
libnghttp2.14.dylib
liburiparser.dylib
liburiparser.1.dylib
liburiparser.1.0.27.dylib
)
if(LLCOMMON_LINK_SHARED)
set(release_files ${release_files}
libapr-1.0.dylib
libapr-1.dylib
libaprutil-1.0.dylib
libaprutil-1.dylib
)
endif()
if (TARGET ll::openal)
list(APPEND release_files libalut.dylib libopenal.dylib)
endif ()
@ -225,12 +231,9 @@ elseif(LINUX)
if( USE_AUTOBUILD_3P )
list( APPEND release_files
libapr-1.so.0
libaprutil-1.so.0
libatk-1.0.so
libfreetype.so.6.6.2
libfreetype.so.6
libhunspell-1.3.so.0.0.0
libopenjp2.so
libuuid.so.16
libuuid.so.16.0.22
@ -239,6 +242,13 @@ elseif(LINUX)
libgmodule-2.0.so
libgobject-2.0.so
)
if(LLCOMMON_LINK_SHARED)
set(release_files ${release_files}
libapr-1.so.0
libaprutil-1.so.0
)
endif()
endif()
else(WINDOWS)

View File

@ -7,14 +7,13 @@ add_library( ll::expat INTERFACE IMPORTED )
use_system_binary(expat)
use_prebuilt_binary(expat)
if (WINDOWS)
target_link_libraries( ll::expat INTERFACE libexpatMT )
set(EXPAT_COPY libexpatMT.dll)
else (WINDOWS)
target_link_libraries( ll::expat INTERFACE expat )
if (DARWIN)
set(EXPAT_COPY libexpat.1.dylib libexpat.dylib)
else ()
set(EXPAT_COPY libexpat.so.1 libexpat.so)
endif ()
endif (WINDOWS)
target_compile_definitions( ll::expat INTERFACE XML_STATIC=1)
target_link_libraries( ll::expat INTERFACE
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libexpatd.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libexpat.lib)
else ()
target_link_libraries( ll::expat INTERFACE
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libexpat.a
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libexpat.a)
endif ()
target_include_directories( ll::expat SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include )

View File

@ -1,4 +1,5 @@
# -*- cmake -*-
include(Linking)
include(Prebuilt)
include_guard()
@ -8,10 +9,16 @@ add_library( ll::hunspell INTERFACE IMPORTED )
use_system_binary(hunspell)
use_prebuilt_binary(libhunspell)
if (WINDOWS)
target_link_libraries( ll::hunspell INTERFACE libhunspell)
target_compile_definitions( ll::hunspell INTERFACE HUNSPELL_STATIC=1)
target_link_libraries( ll::hunspell INTERFACE
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libhunspell.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libhunspell.lib
)
elseif(DARWIN)
target_link_libraries( ll::hunspell INTERFACE hunspell-1.3)
target_link_libraries( ll::hunspell INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libhunspell-1.7.a
)
elseif(LINUX)
target_link_libraries( ll::hunspell INTERFACE hunspell-1.3)
target_link_libraries( ll::hunspell INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libhunspell-1.7.a
)
endif()
target_include_directories( ll::hunspell SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/hunspell)

View File

@ -7,12 +7,14 @@ include_guard()
add_library( ll::libjpeg INTERFACE IMPORTED )
use_system_binary(libjpeg)
use_prebuilt_binary(jpeglib)
use_prebuilt_binary(libjpeg-turbo)
if (LINUX)
target_link_libraries( ll::libjpeg INTERFACE jpeg)
target_link_libraries( ll::libjpeg INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libjpeg.a)
elseif (DARWIN)
target_link_libraries( ll::libjpeg INTERFACE jpeg)
target_link_libraries( ll::libjpeg INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libjpeg.a)
elseif (WINDOWS)
target_link_libraries( ll::libjpeg INTERFACE jpeglib)
target_link_libraries( ll::libjpeg INTERFACE
debug ${ARCH_PREBUILT_DIRS_DEBUG}/jpeg.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/jpeg.lib)
endif (LINUX)
target_include_directories( ll::libjpeg SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include)

View File

@ -6,5 +6,3 @@ include(EXPAT)
include(Tracy)
include(xxHash)
include(ZLIBNG)
include(XmlRpcEpi)

View File

@ -6,7 +6,6 @@ include(Boost)
include_guard()
add_library( ll::pcre INTERFACE IMPORTED )
add_library( ll::minizip-ng INTERFACE IMPORTED )
add_library( ll::libxml INTERFACE IMPORTED )
add_library( ll::colladadom INTERFACE IMPORTED )
@ -22,11 +21,8 @@ use_system_binary( colladadom )
use_prebuilt_binary(colladadom)
use_prebuilt_binary(minizip-ng) # needed for colladadom
use_prebuilt_binary(pcre)
use_prebuilt_binary(libxml2)
target_link_libraries( ll::pcre INTERFACE pcrecpp pcre )
if (WINDOWS)
target_link_libraries( ll::minizip-ng INTERFACE libminizip )
else()

View File

@ -1,19 +0,0 @@
# -*- cmake -*-
include_guard()
include(Prebuilt)
add_library( ll::uriparser INTERFACE IMPORTED )
use_system_binary( uriparser )
use_prebuilt_binary(uriparser)
if (WINDOWS)
target_link_libraries( ll::uriparser INTERFACE uriparser)
elseif (LINUX)
target_link_libraries( ll::uriparser INTERFACE uriparser)
elseif (DARWIN)
target_link_libraries( ll::uriparser INTERFACE liburiparser.dylib)
endif (WINDOWS)
target_include_directories( ll::uriparser SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/uriparser)

View File

@ -1,11 +0,0 @@
# -*- cmake -*-
include(Prebuilt)
include_guard()
add_library( ll::xmlrpc-epi INTERFACE IMPORTED )
use_system_binary( xmlrpc-epi )
use_prebuilt_binary(xmlrpc-epi)
target_link_libraries(ll::xmlrpc-epi INTERFACE xmlrpc-epi )
target_include_directories( ll::xmlrpc-epi SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include)

View File

@ -557,7 +557,7 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
}
if (mLastWeight != mLastWeight)
{
mLastWeight = mCurWeight+.001;
mLastWeight = mCurWeight+.001f;
}
// perform differential update of morph

View File

@ -106,7 +106,7 @@ void LLTexLayerSetBuffer::pushProjection() const
gGL.matrixMode(LLRender::MM_PROJECTION);
gGL.pushMatrix();
gGL.loadIdentity();
gGL.ortho(0.0f, getCompositeWidth(), 0.0f, getCompositeHeight(), -1.0f, 1.0f);
gGL.ortho(0.0f, (F32)getCompositeWidth(), 0.0f, (F32)getCompositeHeight(), -1.0f, 1.0f);
gGL.matrixMode(LLRender::MM_MODELVIEW);
gGL.pushMatrix();

View File

@ -790,9 +790,12 @@ bool LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid)
if (gAssetStorage->hasLocalAsset(uuid, LLAssetType::AT_SOUND))
{
// Just put it on the decode queue.
// Just put it on the decode queue it if it's not already in the queue
LL_DEBUGS("AudioEngine") << "addDecodeRequest for " << uuid << " has local asset file already" << LL_ENDL;
mImpl->mDecodeQueue.push_back(uuid);
if (std::find(mImpl->mDecodeQueue.begin(), mImpl->mDecodeQueue.end(), uuid) == mImpl->mDecodeQueue.end())
{
mImpl->mDecodeQueue.emplace_back(uuid);
}
return true;
}

View File

@ -1827,7 +1827,17 @@ bool LLAudioData::load()
{
// Hrm. Right now, let's unset the buffer, since it's empty.
gAudiop->cleanupBuffer(mBufferp);
mBufferp = NULL;
mBufferp = nullptr;
if (!gDirUtilp->fileExists(wav_path))
{
mHasLocalData = false;
mHasDecodedData = false;
mHasCompletedDecode = false;
mHasDecodeFailed = false;
mHasWAVLoadFailed = false;
gAudiop->preloadSound(mID);
}
return false;
}

View File

@ -38,7 +38,7 @@
LLStringTable LLCharacter::sVisualParamNames(1024);
std::vector< LLCharacter* > LLCharacter::sInstances;
std::list< LLCharacter* > LLCharacter::sInstances;
bool LLCharacter::sAllowInstancesChange = true ;
//-----------------------------------------------------------------------------
@ -53,7 +53,6 @@ LLCharacter::LLCharacter()
mSkeletonSerialNum( 0 )
{
llassert_always(sAllowInstancesChange) ;
sInstances.push_back(this);
mMotionController.setCharacter( this );
mPauseRequest = new LLPauseRequestHandle();
@ -66,28 +65,12 @@ LLCharacter::LLCharacter()
//-----------------------------------------------------------------------------
LLCharacter::~LLCharacter()
{
for (LLVisualParam *param = getFirstVisualParam();
param;
param = getNextVisualParam())
for (const auto& it : mVisualParamIndexMap)
{
delete param;
delete it.second;
}
size_t i ;
size_t size = sInstances.size() ;
for(i = 0 ; i < size ; i++)
{
if(sInstances[i] == this)
{
break ;
}
}
llassert_always(i < size) ;
llassert_always(sAllowInstancesChange) ;
sInstances[i] = sInstances[size - 1] ;
sInstances.pop_back() ;
}

View File

@ -245,6 +245,24 @@ public:
S32 getVisualParamCount() const { return (S32)mVisualParamIndexMap.size(); }
LLVisualParam* getVisualParam(const char *name);
void animateTweakableVisualParams(F32 delta)
{
for (auto& it : mVisualParamIndexMap)
{
if (it.second->isTweakable())
{
it.second->animate(delta);
}
}
}
void applyAllVisualParams(ESex avatar_sex)
{
for (auto& it : mVisualParamIndexMap)
{
it.second->apply(avatar_sex);
}
}
ESex getSex() const { return mSex; }
void setSex( ESex sex ) { mSex = sex; }
@ -255,7 +273,7 @@ public:
U32 getSkeletonSerialNum() const { return mSkeletonSerialNum; }
void setSkeletonSerialNum( U32 num ) { mSkeletonSerialNum = num; }
static std::vector< LLCharacter* > sInstances;
static std::list< LLCharacter* > sInstances;
static bool sAllowInstancesChange ; //debug use
virtual void setHoverOffset(const LLVector3& hover_offset, bool send_update=true) { mHoverOffset = hover_offset; }

View File

@ -2227,7 +2227,12 @@ bool LLKeyframeMotion::dumpToFile(const std::string& name)
}
S32 file_size = getFileSize();
U8* buffer = new U8[file_size];
U8* buffer = new(std::nothrow) U8[file_size];
if (!buffer)
{
LLError::LLUserWarningMsg::showOutOfMemory();
LL_ERRS() << "Bad memory allocation for buffer, file: " << name << " " << file_size << LL_ENDL;
}
LL_DEBUGS("BVH") << "Dumping " << outfilename << LL_ENDL;
LLDataPackerBinaryBuffer dp(buffer, file_size);
@ -2407,13 +2412,10 @@ void LLKeyframeMotion::onLoadComplete(const LLUUID& asset_uuid,
{
LLUUID* id = (LLUUID*)user_data;
std::vector<LLCharacter* >::iterator char_iter = LLCharacter::sInstances.begin();
while(char_iter != LLCharacter::sInstances.end() &&
(*char_iter)->getID() != *id)
{
++char_iter;
}
auto char_iter = std::find_if(LLCharacter::sInstances.begin(), LLCharacter::sInstances.end(), [&](LLCharacter* c)
{
return c->getID() == *id;
});
delete id;
@ -2438,7 +2440,12 @@ void LLKeyframeMotion::onLoadComplete(const LLUUID& asset_uuid,
LLFileSystem file(asset_uuid, type, LLFileSystem::READ);
S32 size = file.getSize();
U8* buffer = new U8[size];
U8* buffer = new(std::nothrow) U8[size];
if (!buffer)
{
LLError::LLUserWarningMsg::showOutOfMemory();
LL_ERRS() << "Bad memory allocation for buffer of size: " << size << LL_ENDL;
}
file.read((U8*)buffer, size); /*Flawfinder: ignore*/
LL_DEBUGS("Animation") << "Loading keyframe data for: " << motionp->getName() << ":" << motionp->getID() << " (" << size << " bytes)" << LL_ENDL;

View File

@ -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, U32Milliseconds(100));
mRoll = LLSmoothInterpolation::lerp(mRoll, target_roll, F32Milliseconds(100.f));
LLQuaternion roll(mRoll, LLVector3(0.f, 0.f, 1.f));
mPelvisState->setRotation(roll);

View File

@ -10,7 +10,6 @@ include(Boost)
include(LLSharedLibs)
include(Copy3rdPartyLibs)
include(ZLIBNG)
include(URIPARSER)
include(Tracy)
@ -278,7 +277,6 @@ target_link_libraries(
ll::expat
ll::zlib-ng
ll::boost
ll::uriparser
ll::oslibraries
ll::tracy
)

View File

@ -90,7 +90,7 @@ bool LLApp::sDisableCrashlogger = false;
// Local flag for whether or not to do logging in signal handlers.
//static
bool LLApp::sLogInSignal = false;
bool LLApp::sLogInSignal = true;
// static
// Keeps track of application status
@ -373,6 +373,9 @@ static std::map<LLApp::EAppStatus, const char*> statusDesc
// static
void LLApp::setStatus(EAppStatus status)
{
auto status_it = statusDesc.find(status);
std::string status_text = status_it != statusDesc.end() ? std::string(status_it->second) : std::to_string(status);
LL_INFOS() << "status: " << status_text << LL_ENDL;
// notify everyone waiting on sStatus any time its value changes
sStatus.set_all(status);
@ -381,18 +384,7 @@ void LLApp::setStatus(EAppStatus status)
if (! LLEventPumps::wasDeleted())
{
// notify interested parties of status change
LLSD statsd;
auto found = statusDesc.find(status);
if (found != statusDesc.end())
{
statsd = found->second;
}
else
{
// unknown status? at least report value
statsd = LLSD::Integer(status);
}
LLEventPumps::instance().obtain("LLApp").post(llsd::map("status", statsd));
LLEventPumps::instance().obtain("LLApp").post(llsd::map("status", status_text));
}
}
@ -487,6 +479,33 @@ int LLApp::getPid()
#endif
}
// static
void LLApp::notifyOutOfDiskSpace()
{
static const U32Seconds min_interval = U32Seconds(60);
static U32Seconds min_time_to_send = U32Seconds(0);
U32Seconds now = LLTimer::getTotalTime();
if (now < min_time_to_send)
return;
min_time_to_send = now + min_interval;
if (LLApp* app = instance())
{
app->sendOutOfDiskSpaceNotification();
}
else
{
LL_WARNS() << "No app instance" << LL_ENDL;
}
}
// virtual
void LLApp::sendOutOfDiskSpaceNotification()
{
LL_WARNS() << "Should never be called" << LL_ENDL; // Should be overridden
}
#ifndef LL_WINDOWS
void setup_signals()
{
@ -654,6 +673,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
{
LL_WARNS() << "Signal handler - Handling fatal signal!" << LL_ENDL;
}
if (LLApp::isError())
{
// Received second fatal signal while handling first, just die right now
@ -691,11 +711,11 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
clear_signals();
raise(signum);
return;
} else {
if (LLApp::sLogInSignal)
{
LL_INFOS() << "Signal handler - Unhandled signal " << signum << ", ignoring!" << LL_ENDL;
}
}
if (LLApp::sLogInSignal)
{
LL_INFOS() << "Signal handler - Unhandled signal " << signum << ", ignoring!" << LL_ENDL;
}
}
}

View File

@ -202,6 +202,8 @@ public:
static bool isExiting(); // Either quitting or error (app is exiting, cleanly or not)
static int getPid();
static void notifyOutOfDiskSpace();
//
// Sleep for specified time while still running
//
@ -301,6 +303,8 @@ protected:
*/
void stepFrame();
virtual void sendOutOfDiskSpaceNotification();
private:
// Contains the filename of the minidump file after a crash.
char mMinidumpPath[MAX_MINDUMP_PATH_LENGTH];

View File

@ -28,6 +28,7 @@
#include "linden_common.h"
#include "llapr.h"
#include "llapp.h"
#include "llmutex.h"
#include "apr_dso.h"
@ -606,7 +607,11 @@ S32 LLAPRFile::writeEx(const std::string& filename, const void *buf, S32 offset,
apr_status_t s = apr_file_write(file_handle, buf, &bytes_written);
if (s != APR_SUCCESS)
{
LL_WARNS("APR") << " Attempting to write filename: " << filename << LL_ENDL;
LL_WARNS("APR") << "Attempting to write filename: " << filename << LL_ENDL;
if (APR_STATUS_IS_ENOSPC(s))
{
LLApp::notifyOutOfDiskSpace();
}
ll_apr_warn_status(s);
bytes_written = 0;
}

View File

@ -31,8 +31,9 @@
#include "llexception.h"
#include <boost/fiber/fss.hpp>
#include <boost/fiber/future/promise.hpp>
#include <boost/fiber/future/future.hpp>
#include <boost/fiber/future/promise.hpp>
#include <boost/fiber/recursive_mutex.hpp>
#include "mutex.h"
#include "llsingleton.h"
#include "llinstancetracker.h"
@ -307,6 +308,12 @@ public:
// use mutex, lock, condition_variable suitable for coroutines
using Mutex = boost::fibers::mutex;
using RMutex = boost::fibers::recursive_mutex;
// With C++17, LockType is deprecated: at this point we can directly
// declare 'std::unique_lock lk(some_mutex)' without explicitly stating
// the mutex type. Sadly, making LockType an alias template for
// std::unique_lock doesn't work the same way: Class Template Argument
// Deduction only works for class templates, not alias templates.
using LockType = std::unique_lock<Mutex>;
using cv_status = boost::fibers::cv_status;
using ConditionVariable = boost::fibers::condition_variable;

View File

@ -41,20 +41,11 @@
#include "llstring.h"
#include "llfasttimer.h"
static const F64 DATE_EPOCH = 0.0;
static const F64 LL_APR_USEC_PER_SEC = 1000000.0;
// should be APR_USEC_PER_SEC, but that relies on INT64_C which
// isn't defined in glib under our build set up for some reason
LLDate::LLDate() : mSecondsSinceEpoch(DATE_EPOCH)
{}
LLDate::LLDate(const LLDate& date) :
mSecondsSinceEpoch(date.mSecondsSinceEpoch)
{}
LLDate::LLDate(F64SecondsImplicit seconds_since_epoch) :
mSecondsSinceEpoch(seconds_since_epoch.value())
{}

View File

@ -43,16 +43,13 @@
*/
class LL_COMMON_API LLDate
{
static constexpr F64 DATE_EPOCH = 0.0;
public:
/**
* @brief Construct a date equal to epoch.
*/
LLDate();
/**
* @brief Construct a date equal to the source date.
*/
LLDate(const LLDate& date);
constexpr LLDate() : mSecondsSinceEpoch(DATE_EPOCH)
{}
/**
* @brief Construct a date from a seconds since epoch value.

View File

@ -55,7 +55,6 @@
#include "llsingleton.h"
#include "llstl.h"
#include "lltimer.h"
#include <boost/fiber/recursive_mutex.hpp>
// On Mac, got:
// #error "Boost.Stacktrace requires `_Unwind_Backtrace` function. Define
@ -168,7 +167,7 @@ namespace {
virtual void recordMessage(LLError::ELevel level,
const std::string& message) override
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING
LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING;
if (LLError::getAlwaysFlush())
{
mFile << message << std::endl;
@ -235,7 +234,7 @@ namespace {
virtual void recordMessage(LLError::ELevel level,
const std::string& message) override
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING
LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING;
// The default colors for error, warn and debug are now a bit more pastel
// and easier to read on the default (black) terminal background but you
// now have the option to set the color of each via an environment variables:
@ -275,7 +274,7 @@ namespace {
LL_FORCE_INLINE void writeANSI(const std::string& ansi_code, const std::string& message)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING
LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING;
static std::string s_ansi_bold = createBoldANSI(); // bold text
static std::string s_ansi_reset = createResetANSI(); // reset
// ANSI color code escape sequence, message, and reset in one fprintf call
@ -312,7 +311,7 @@ namespace {
virtual void recordMessage(LLError::ELevel level,
const std::string& message) override
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING
LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING;
mBuffer->addLine(message);
}
@ -339,7 +338,7 @@ namespace {
virtual void recordMessage(LLError::ELevel level,
const std::string& message) override
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING
LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING;
debugger_print(message);
}
};
@ -507,7 +506,7 @@ namespace
LLError::TimeFunction mTimeFunction;
Recorders mRecorders;
boost::fibers::recursive_mutex mRecorderMutex;
LLCoros::RMutex mRecorderMutex;
int mShouldLogCallCounter;
@ -1216,7 +1215,7 @@ namespace
void writeToRecorders(const LLError::CallSite& site, const std::string& message)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING
LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING;
LLError::ELevel level = site.mLevel;
SettingsConfigPtr s = Globals::getInstance()->getSettingsConfig();
@ -1347,7 +1346,7 @@ namespace LLError
bool Log::shouldLog(CallSite& site)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING
LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING;
LLMutexTrylock lock(getMutex<LOG_MUTEX>(), 5);
if (!lock.isLocked())
{
@ -1392,7 +1391,7 @@ namespace LLError
void Log::flush(const std::ostringstream& out, const CallSite& site)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING
LL_PROFILE_ZONE_SCOPED_CATEGORY_LOGGING;
LLMutexTrylock lock(getMutex<LOG_MUTEX>(),5);
if (!lock.isLocked())
{

View File

@ -190,7 +190,7 @@ namespace LLError
{}
void recordMessage(LLError::ELevel level, const std::string& message) override
{
LL_PROFILE_ZONE_SCOPED
LL_PROFILE_ZONE_SCOPED;
mCallable(level, message);
}
private:

View File

@ -429,7 +429,7 @@ public:
// path, then stores it to mTarget.
virtual bool post(const LLSD& event)
{
LL_PROFILE_ZONE_SCOPED
LL_PROFILE_ZONE_SCOPED;
// Extract the element specified by 'mPath' from 'event'. To perform a
// generic type-appropriate store through mTarget, construct an

View File

@ -248,6 +248,24 @@ int LLFile::close(LLFILE * file)
return ret_value;
}
std::string LLFile::getContents(const std::string& filename)
{
LLFILE* fp = fopen(filename, "rb"); /* Flawfinder: ignore */
if (fp)
{
fseek(fp, 0, SEEK_END);
U32 length = ftell(fp);
fseek(fp, 0, SEEK_SET);
std::vector<char> buffer(length);
size_t nread = fread(buffer.data(), 1, length, fp);
fclose(fp);
return std::string(buffer.data(), nread);
}
return LLStringUtil::null;
}
int LLFile::remove(const std::string& filename, int supress_error)
{

View File

@ -67,6 +67,8 @@ public:
static int close(LLFILE * file);
static std::string getContents(const std::string& filename);
// perms is a permissions mask like 0777 or 0700. In most cases it will
// be overridden by the user's umask. It is ignored on Windows.
// mkdir() considers "directory already exists" to be SUCCESS.

View File

@ -39,6 +39,7 @@
#elif LL_LINUX
# include <unistd.h>
# include <sys/resource.h>
# include <sys/sysinfo.h>
#endif
#include "llmemory.h"
@ -50,13 +51,28 @@
//----------------------------------------------------------------------------
//static
// most important memory metric for texture streaming
// On Windows, this should agree with resource monitor -> performance -> memory -> available
// On OS X, this should be activity monitor -> memory -> (physical memory - memory used)
// NOTE: this number MAY be less than the actual available memory on systems with more than MaxHeapSize64 GB of physical memory (default 16GB)
// In that case, should report min(available, sMaxHeapSizeInKB-sAllocateMemInKB)
U32Kilobytes LLMemory::sAvailPhysicalMemInKB(U32_MAX);
// Installed physical memory
U32Kilobytes LLMemory::sMaxPhysicalMemInKB(0);
// Maximimum heap size according to the user's settings (default 16GB)
U32Kilobytes LLMemory::sMaxHeapSizeInKB(U32_MAX);
// Current memory usage
U32Kilobytes LLMemory::sAllocatedMemInKB(0);
U32Kilobytes LLMemory::sAllocatedPageSizeInKB(0);
static LLTrace::SampleStatHandle<F64Megabytes> sAllocatedMem("allocated_mem", "active memory in use by application");
static LLTrace::SampleStatHandle<F64Megabytes> sVirtualMem("virtual_mem", "virtual memory assigned to application");
U32Kilobytes LLMemory::sAllocatedMemInKB(0);
U32Kilobytes LLMemory::sAllocatedPageSizeInKB(0);
U32Kilobytes LLMemory::sMaxHeapSizeInKB(U32_MAX);
void ll_assert_aligned_func(uintptr_t ptr,U32 alignment)
{
@ -84,7 +100,14 @@ void LLMemory::initMaxHeapSizeGB(F32Gigabytes max_heap_size)
//static
void LLMemory::updateMemoryInfo()
{
LL_PROFILE_ZONE_SCOPED
LL_PROFILE_ZONE_SCOPED;
sMaxPhysicalMemInKB = gSysMemory.getPhysicalMemoryKB();
U32Kilobytes avail_mem;
LLMemoryInfo::getAvailableMemoryKB(avail_mem);
sAvailPhysicalMemInKB = avail_mem;
#if LL_WINDOWS
PROCESS_MEMORY_COUNTERS counters;
@ -95,23 +118,9 @@ void LLMemory::updateMemoryInfo()
}
sAllocatedMemInKB = U32Kilobytes::convert(U64Bytes(counters.WorkingSetSize));
sample(sAllocatedMem, sAllocatedMemInKB);
sAllocatedPageSizeInKB = U32Kilobytes::convert(U64Bytes(counters.PagefileUsage));
sample(sVirtualMem, sAllocatedPageSizeInKB);
U32Kilobytes avail_phys, avail_virtual;
LLMemoryInfo::getAvailableMemoryKB(avail_phys, avail_virtual) ;
sMaxPhysicalMemInKB = llmin(avail_phys + sAllocatedMemInKB, sMaxHeapSizeInKB);
if(sMaxPhysicalMemInKB > sAllocatedMemInKB)
{
sAvailPhysicalMemInKB = sMaxPhysicalMemInKB - sAllocatedMemInKB ;
}
else
{
sAvailPhysicalMemInKB = U32Kilobytes(0);
}
#elif defined(LL_DARWIN)
task_vm_info info;
mach_msg_type_number_t infoCount = TASK_VM_INFO_COUNT;
@ -136,31 +145,19 @@ void LLMemory::updateMemoryInfo()
{
LL_WARNS() << "task_info failed" << LL_ENDL;
}
// Total installed and available physical memory are properties of the host, not just our process.
vm_statistics64_data_t vmstat;
mach_msg_type_number_t count = HOST_VM_INFO64_COUNT;
mach_port_t host = mach_host_self();
vm_size_t page_size;
host_page_size(host, &page_size);
kern_return_t result = host_statistics64(host, HOST_VM_INFO64, reinterpret_cast<host_info_t>(&vmstat), &count);
if (result == KERN_SUCCESS) {
// This is what Chrome reports as 'the "Physical Memory Free" value reported by the Memory Monitor in Instruments.'
// Note though that inactive pages are not included here and not yet free, but could become so under memory pressure.
sAvailPhysicalMemInKB = U32Bytes(vmstat.free_count * page_size);
sMaxPhysicalMemInKB = LLMemoryInfo::getHardwareMemSize();
}
else
{
LL_WARNS() << "task_info failed" << LL_ENDL;
}
#elif defined(LL_LINUX)
// Use sysinfo() to get the total physical memory.
struct sysinfo info;
sysinfo(&info);
sAllocatedMemInKB = U32Kilobytes::convert(U64Bytes(LLMemory::getCurrentRSS())); // represents the RAM allocated by this process only (in line with the windows implementation)
#else
//not valid for other systems for now.
LL_WARNS() << "LLMemory::updateMemoryInfo() not implemented for this platform." << LL_ENDL;
sAllocatedMemInKB = U64Bytes(LLMemory::getCurrentRSS());
sMaxPhysicalMemInKB = U64Bytes(U32_MAX);
sAvailPhysicalMemInKB = U64Bytes(U32_MAX);
#endif
sample(sAllocatedMem, sAllocatedMemInKB);
sAvailPhysicalMemInKB = llmin(sAvailPhysicalMemInKB, sMaxHeapSizeInKB - sAllocatedMemInKB);
return ;
}
@ -192,16 +189,16 @@ void* LLMemory::tryToAlloc(void* address, U32 size)
//static
void LLMemory::logMemoryInfo(bool update)
{
LL_PROFILE_ZONE_SCOPED
LL_PROFILE_ZONE_SCOPED;
if(update)
{
updateMemoryInfo() ;
}
LL_INFOS() << "Current allocated physical memory(KB): " << sAllocatedMemInKB << LL_ENDL ;
LL_INFOS() << "Current allocated page size (KB): " << sAllocatedPageSizeInKB << LL_ENDL ;
LL_INFOS() << "Current available physical memory(KB): " << sAvailPhysicalMemInKB << LL_ENDL ;
LL_INFOS() << "Current max usable memory(KB): " << sMaxPhysicalMemInKB << LL_ENDL ;
LL_INFOS() << llformat("Current allocated physical memory: %.2f MB", sAllocatedMemInKB / 1024.0) << LL_ENDL;
LL_INFOS() << llformat("Current allocated page size: %.2f MB", sAllocatedPageSizeInKB / 1024.0) << LL_ENDL;
LL_INFOS() << llformat("Current available physical memory: %.2f MB", sAvailPhysicalMemInKB / 1024.0) << LL_ENDL;
LL_INFOS() << llformat("Current max usable memory: %.2f MB", sMaxPhysicalMemInKB / 1024.0) << LL_ENDL;
}
//static

View File

@ -100,7 +100,7 @@ void LLMutex::unlock()
bool LLMutex::isLocked()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
if (!mMutex.try_lock())
{
return true;
@ -124,7 +124,7 @@ LLThread::id_t LLMutex::lockingThread() const
bool LLMutex::trylock()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
if (isSelfLocked())
{ //redundant lock
mCount++;
@ -161,7 +161,7 @@ LLSharedMutex::LLSharedMutex()
bool LLSharedMutex::isLocked() const
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
std::lock_guard<std::mutex> lock(mLockMutex);
return !mLockingThreads.empty();
@ -169,7 +169,7 @@ bool LLSharedMutex::isLocked() const
bool LLSharedMutex::isThreadLocked() const
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
LLThread::id_t current_thread = LLThread::currentID();
std::lock_guard<std::mutex> lock(mLockMutex);
@ -179,7 +179,7 @@ bool LLSharedMutex::isThreadLocked() const
void LLSharedMutex::lockShared()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
LLThread::id_t current_thread = LLThread::currentID();
mLockMutex.lock();
@ -204,7 +204,7 @@ void LLSharedMutex::lockShared()
void LLSharedMutex::lockExclusive()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
LLThread::id_t current_thread = LLThread::currentID();
mLockMutex.lock();
@ -237,7 +237,7 @@ void LLSharedMutex::lockExclusive()
bool LLSharedMutex::trylockShared()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
LLThread::id_t current_thread = LLThread::currentID();
std::lock_guard<std::mutex> lock(mLockMutex);
@ -260,7 +260,7 @@ bool LLSharedMutex::trylockShared()
bool LLSharedMutex::trylockExclusive()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
LLThread::id_t current_thread = LLThread::currentID();
std::lock_guard<std::mutex> lock(mLockMutex);
@ -282,7 +282,7 @@ bool LLSharedMutex::trylockExclusive()
void LLSharedMutex::unlockShared()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
LLThread::id_t current_thread = LLThread::currentID();
std::lock_guard<std::mutex> lock(mLockMutex);
@ -303,7 +303,7 @@ void LLSharedMutex::unlockShared()
void LLSharedMutex::unlockExclusive()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
LLThread::id_t current_thread = LLThread::currentID();
std::lock_guard<std::mutex> lock(mLockMutex);
@ -338,20 +338,20 @@ LLCondition::~LLCondition()
void LLCondition::wait()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
std::unique_lock< std::mutex > lock(mMutex);
mCond.wait(lock);
}
void LLCondition::signal()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
mCond.notify_one();
}
void LLCondition::broadcast()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
mCond.notify_all();
}
@ -364,7 +364,7 @@ LLMutexTrylock::LLMutexTrylock(LLMutex* mutex)
: mMutex(mutex),
mLocked(false)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
if (mMutex)
mLocked = mMutex->trylock();
}
@ -373,7 +373,7 @@ LLMutexTrylock::LLMutexTrylock(LLMutex* mutex, U32 aTries, U32 delay_ms)
: mMutex(mutex),
mLocked(false)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
if (!mMutex)
return;
@ -388,7 +388,7 @@ LLMutexTrylock::LLMutexTrylock(LLMutex* mutex, U32 aTries, U32 delay_ms)
LLMutexTrylock::~LLMutexTrylock()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
if (mMutex && mLocked)
mMutex->unlock();
}
@ -400,7 +400,7 @@ LLMutexTrylock::~LLMutexTrylock()
//
LLScopedLock::LLScopedLock(std::mutex* mutex) : mMutex(mutex)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
if(mutex)
{
mutex->lock();
@ -419,7 +419,7 @@ LLScopedLock::~LLScopedLock()
void LLScopedLock::unlock()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
if(mLocked)
{
mMutex->unlock();

View File

@ -46,8 +46,11 @@
template <class Type> class LLPointer
{
public:
template<typename Subclass>
friend class LLPointer;
LLPointer() :
mPointer(NULL)
mPointer(nullptr)
{
}
@ -63,6 +66,12 @@ public:
ref();
}
LLPointer(LLPointer<Type>&& ptr) noexcept
{
mPointer = ptr.mPointer;
ptr.mPointer = nullptr;
}
// Support conversion up the type hierarchy. See Item 45 in Effective C++, 3rd Ed.
template<typename Subclass>
LLPointer(const LLPointer<Subclass>& ptr) :
@ -71,6 +80,13 @@ public:
ref();
}
template<typename Subclass>
LLPointer(LLPointer<Subclass>&& ptr) noexcept :
mPointer(ptr.get())
{
ptr.mPointer = nullptr;
}
~LLPointer()
{
unref();
@ -82,11 +98,11 @@ public:
const Type& operator*() const { return *mPointer; }
Type& operator*() { return *mPointer; }
operator BOOL() const { return (mPointer != NULL); }
operator bool() const { return (mPointer != NULL); }
bool operator!() const { return (mPointer == NULL); }
bool isNull() const { return (mPointer == NULL); }
bool notNull() const { return (mPointer != NULL); }
operator BOOL() const { return (mPointer != nullptr); }
operator bool() const { return (mPointer != nullptr); }
bool operator!() const { return (mPointer == nullptr); }
bool isNull() const { return (mPointer == nullptr); }
bool notNull() const { return (mPointer != nullptr); }
operator Type*() const { return mPointer; }
bool operator !=(Type* ptr) const { return (mPointer != ptr); }
@ -107,6 +123,17 @@ public:
return *this;
}
LLPointer<Type>& operator =(LLPointer<Type>&& ptr)
{
if (mPointer != ptr.mPointer)
{
unref();
mPointer = ptr.mPointer;
ptr.mPointer = nullptr;
}
return *this;
}
// support assignment up the type hierarchy. See Item 45 in Effective C++, 3rd Ed.
template<typename Subclass>
LLPointer<Type>& operator =(const LLPointer<Subclass>& ptr)
@ -115,6 +142,18 @@ public:
return *this;
}
template<typename Subclass>
LLPointer<Type>& operator =(LLPointer<Subclass>&& ptr)
{
if (mPointer != ptr.mPointer)
{
unref();
mPointer = ptr.mPointer;
ptr.mPointer = nullptr;
}
return *this;
}
// Just exchange the pointers, which will not change the reference counts.
static void swap(LLPointer<Type>& a, LLPointer<Type>& b)
{
@ -141,9 +180,9 @@ protected:
if (mPointer)
{
Type *temp = mPointer;
mPointer = NULL;
mPointer = nullptr;
temp->unref();
if (mPointer != NULL)
if (mPointer != nullptr)
{
LL_WARNS() << "Unreference did assignment to non-NULL because of destructor" << LL_ENDL;
unref();
@ -168,9 +207,11 @@ protected:
template <class Type> class LLConstPointer
{
template<typename Subclass>
friend class LLConstPointer;
public:
LLConstPointer() :
mPointer(NULL)
mPointer(nullptr)
{
}
@ -186,6 +227,12 @@ public:
ref();
}
LLConstPointer(LLConstPointer<Type>&& ptr) noexcept
{
mPointer = ptr.mPointer;
ptr.mPointer = nullptr;
}
// support conversion up the type hierarchy. See Item 45 in Effective C++, 3rd Ed.
template<typename Subclass>
LLConstPointer(const LLConstPointer<Subclass>& ptr) :
@ -194,6 +241,13 @@ public:
ref();
}
template<typename Subclass>
LLConstPointer(LLConstPointer<Subclass>&& ptr) noexcept :
mPointer(ptr.get())
{
ptr.mPointer = nullptr;
}
~LLConstPointer()
{
unref();
@ -203,11 +257,11 @@ public:
const Type* operator->() const { return mPointer; }
const Type& operator*() const { return *mPointer; }
operator BOOL() const { return (mPointer != NULL); }
operator bool() const { return (mPointer != NULL); }
bool operator!() const { return (mPointer == NULL); }
bool isNull() const { return (mPointer == NULL); }
bool notNull() const { return (mPointer != NULL); }
operator BOOL() const { return (mPointer != nullptr); }
operator bool() const { return (mPointer != nullptr); }
bool operator!() const { return (mPointer == nullptr); }
bool isNull() const { return (mPointer == nullptr); }
bool notNull() const { return (mPointer != nullptr); }
operator const Type*() const { return mPointer; }
bool operator !=(const Type* ptr) const { return (mPointer != ptr); }
@ -239,6 +293,17 @@ public:
return *this;
}
LLConstPointer<Type>& operator =(LLConstPointer<Type>&& ptr)
{
if (mPointer != ptr.mPointer)
{
unref();
mPointer = ptr.mPointer;
ptr.mPointer = nullptr;
}
return *this;
}
// support assignment up the type hierarchy. See Item 45 in Effective C++, 3rd Ed.
template<typename Subclass>
LLConstPointer<Type>& operator =(const LLConstPointer<Subclass>& ptr)
@ -252,6 +317,18 @@ public:
return *this;
}
template<typename Subclass>
LLConstPointer<Type>& operator =(LLConstPointer<Subclass>&& ptr)
{
if (mPointer != ptr.mPointer)
{
unref();
mPointer = ptr.mPointer;
ptr.mPointer = nullptr;
}
return *this;
}
// Just exchange the pointers, which will not change the reference counts.
static void swap(LLConstPointer<Type>& a, LLConstPointer<Type>& b)
{
@ -278,9 +355,9 @@ protected:
if (mPointer)
{
const Type *temp = mPointer;
mPointer = NULL;
mPointer = nullptr;
temp->unref();
if (mPointer != NULL)
if (mPointer != nullptr)
{
LL_WARNS() << "Unreference did assignment to non-NULL because of destructor" << LL_ENDL;
unref();
@ -313,7 +390,7 @@ public:
: LLPointer<Type>(ptr),
mStayUnique(false)
{
if (ptr.mForceUnique)
if (ptr.mStayUnique)
{
makeUnique();
}

View File

@ -74,9 +74,6 @@
#ifndef LL_MSVC
#define LL_MSVC 1
#endif
#if _MSC_VER < 1400
#define LL_MSVC7 //Visual C++ 2003 or earlier
#endif
#endif
// Deal with minor differences on Unixy OSes.
@ -130,8 +127,6 @@
#endif
// level 4 warnings that we need to disable:
#pragma warning (disable : 4244) // possible loss of data on conversions
#pragma warning (disable : 4396) // the inline specifier cannot be used when a friend declaration refers to a specialization of a function template
#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
#endif // LL_MSVC

View File

@ -84,7 +84,7 @@ extern thread_local bool gProfilerEnabled;
// #define TRACY_NO_BROADCAST 1
// #define TRACY_ONLY_LOCALHOST 1
#define TRACY_ONLY_IPV4 1
#include "Tracy.hpp"
#include "tracy/Tracy.hpp"
// Enable OpenGL profiling
#define LL_PROFILER_ENABLE_TRACY_OPENGL 0

View File

@ -483,7 +483,7 @@ void LLQueuedThread::processRequest(LLQueuedThread::QueuedRequest* req)
if (sleep_time.count() > 0)
{
ms_sleep(sleep_time.count());
ms_sleep((U32)sleep_time.count());
}
}
processRequest(req);

View File

@ -85,7 +85,7 @@ inline F32 ll_internal_random<F32>()
// Per Monty, it's important to clamp using the correct fmodf() rather
// than expanding to F64 for fmod() and then truncating back to F32. Prior
// to this change, we were getting sporadic ll_frand() == 1.0 results.
F32 rv{ narrow<F32>(gRandomGenerator()) };
F32 rv{ narrow<F64>(gRandomGenerator()) };
if(!((rv >= 0.0f) && (rv < 1.0f))) return fmodf(rv, 1.0f);
return rv;
}

View File

@ -30,6 +30,7 @@
#include "linden_common.h"
#include "llsd.h"
#include "llbase64.h"
#include "llerror.h"
#include "../llmath/llmath.h"
#include "llformat.h"
@ -105,6 +106,9 @@ public:
static void reset(Impl*& var, Impl* impl);
///< safely set var to refer to the new impl (possibly shared)
static void move(Impl*& var, Impl*& impl);
///< safely move impl from one object to another
static Impl& safe( Impl*);
static const Impl& safe(const Impl*);
///< since a NULL Impl* is used for undefined, this ensures there is
@ -122,11 +126,17 @@ public:
virtual void assign(Impl*& var, LLSD::Boolean);
virtual void assign(Impl*& var, LLSD::Integer);
virtual void assign(Impl*& var, LLSD::Real);
virtual void assign(Impl*& var, const char*);
virtual void assign(Impl*& var, const LLSD::String&);
virtual void assign(Impl*& var, const LLSD::UUID&);
virtual void assign(Impl*& var, const LLSD::Date&);
virtual void assign(Impl*& var, const LLSD::URI&);
virtual void assign(Impl*& var, const LLSD::Binary&);
virtual void assign(Impl*& var, LLSD::String&&);
virtual void assign(Impl*& var, LLSD::UUID&&);
virtual void assign(Impl*& var, LLSD::Date&&);
virtual void assign(Impl*& var, LLSD::URI&&);
virtual void assign(Impl*& var, LLSD::Binary&&);
///< If the receiver is the right type and unshared, these are simple
// data assignments, othewise the default implementation handless
// constructing the proper Impl subclass
@ -142,11 +152,13 @@ public:
virtual const String& asStringRef() const { static const std::string empty; return empty; }
virtual bool has(const String&) const { return false; }
virtual LLSD get(const String&) const { return LLSD(); }
virtual String asXMLRPCValue() const { return "<nil/>"; }
virtual bool has(std::string_view) const { return false; }
virtual LLSD get(std::string_view) const { return LLSD(); }
virtual LLSD getKeys() const { return LLSD::emptyArray(); }
virtual void erase(const String&) { }
virtual const LLSD& ref(const String&) const{ return undef(); }
virtual const LLSD& ref(std::string_view) const{ return undef(); }
virtual size_t size() const { return 0; }
virtual LLSD get(size_t) const { return LLSD(); }
@ -182,7 +194,7 @@ namespace LLSDUnnamedNamespace
namespace
#endif
{
template<LLSD::Type T, class Data, class DataRef = Data>
template<LLSD::Type T, class Data, class DataRef = Data, class DataMove = Data>
class ImplBase : public LLSD::Impl
///< This class handles most of the work for a subclass of Impl
// for a given simple data type. Subclasses of this provide the
@ -195,6 +207,7 @@ namespace
public:
ImplBase(DataRef value) : mValue(value) { }
ImplBase(DataMove value) : mValue(std::move(value)) { }
virtual LLSD::Type type() const { return T; }
@ -209,11 +222,21 @@ namespace
mValue = value;
}
}
virtual void assign(LLSD::Impl*& var, DataMove value) {
if (shared())
{
Impl::assign(var, std::move(value));
}
else
{
mValue = std::move(value);
}
}
};
class ImplBoolean
: public ImplBase<LLSD::TypeBoolean, LLSD::Boolean>
class ImplBoolean final
: public ImplBase<LLSD::TypeBoolean, LLSD::Boolean, LLSD::Boolean, LLSD::Boolean&&>
{
public:
ImplBoolean(LLSD::Boolean v) : Base(v) { }
@ -222,6 +245,8 @@ namespace
virtual LLSD::Integer asInteger() const { return mValue ? 1 : 0; }
virtual LLSD::Real asReal() const { return mValue ? 1 : 0; }
virtual LLSD::String asString() const;
virtual LLSD::String asXMLRPCValue() const { return mValue ? "<boolean>1</boolean>" : "<boolean>0</boolean>"; }
};
LLSD::String ImplBoolean::asString() const
@ -233,8 +258,8 @@ namespace
{ return mValue ? "true" : ""; }
class ImplInteger
: public ImplBase<LLSD::TypeInteger, LLSD::Integer>
class ImplInteger final
: public ImplBase<LLSD::TypeInteger, LLSD::Integer, LLSD::Integer, LLSD::Integer&&>
{
public:
ImplInteger(LLSD::Integer v) : Base(v) { }
@ -243,14 +268,16 @@ namespace
virtual LLSD::Integer asInteger() const { return mValue; }
virtual LLSD::Real asReal() const { return mValue; }
virtual LLSD::String asString() const;
virtual LLSD::String asXMLRPCValue() const { return "<int>" + std::to_string(mValue) + "</int>"; }
};
LLSD::String ImplInteger::asString() const
{ return llformat("%d", mValue); }
class ImplReal
: public ImplBase<LLSD::TypeReal, LLSD::Real>
class ImplReal final
: public ImplBase<LLSD::TypeReal, LLSD::Real, LLSD::Real, LLSD::Real&&>
{
public:
ImplReal(LLSD::Real v) : Base(v) { }
@ -259,6 +286,8 @@ namespace
virtual LLSD::Integer asInteger() const;
virtual LLSD::Real asReal() const { return mValue; }
virtual LLSD::String asString() const;
virtual LLSD::String asXMLRPCValue() const { return "<double>" + std::to_string(mValue) + "</double>"; }
};
LLSD::Boolean ImplReal::asBoolean() const
@ -271,11 +300,12 @@ namespace
{ return llformat("%lg", mValue); }
class ImplString
: public ImplBase<LLSD::TypeString, LLSD::String, const LLSD::String&>
class ImplString final
: public ImplBase<LLSD::TypeString, LLSD::String, const LLSD::String&, LLSD::String&&>
{
public:
ImplString(const LLSD::String& v) : Base(v) { }
ImplString(LLSD::String&& v) : Base(std::move(v)) {}
virtual LLSD::Boolean asBoolean() const { return !mValue.empty(); }
virtual LLSD::Integer asInteger() const;
@ -286,9 +316,24 @@ namespace
virtual LLSD::URI asURI() const { return LLURI(mValue); }
virtual size_t size() const { return mValue.size(); }
virtual const LLSD::String& asStringRef() const { return mValue; }
virtual LLSD::String asXMLRPCValue() const { return "<string>" + LLStringFn::xml_encode(mValue) + "</string>"; }
using LLSD::Impl::assign; // Unhiding base class virtuals...
virtual void assign(LLSD::Impl*& var, const char* value)
{
if (shared())
{
Impl::assign(var, value);
}
else
{
mValue = value;
}
}
};
LLSD::Integer ImplString::asInteger() const
LLSD::Integer ImplString::asInteger() const
{
// This must treat "1.23" not as an error, but as a number, which is
// then truncated down to an integer. Hence, this code doesn't call
@ -298,7 +343,7 @@ namespace
return (int)asReal();
}
LLSD::Real ImplString::asReal() const
LLSD::Real ImplString::asReal() const
{
F64 v = 0.0;
std::istringstream i_stream(mValue);
@ -315,25 +360,32 @@ namespace
}
class ImplUUID
: public ImplBase<LLSD::TypeUUID, LLSD::UUID, const LLSD::UUID&>
class ImplUUID final
: public ImplBase<LLSD::TypeUUID, LLSD::UUID, const LLSD::UUID&, LLSD::UUID&&>
{
public:
ImplUUID(const LLSD::UUID& v) : Base(v) { }
ImplUUID(LLSD::UUID&& v) : Base(std::move(v)) { }
virtual LLSD::String asString() const{ return mValue.asString(); }
virtual LLSD::UUID asUUID() const { return mValue; }
virtual LLSD::String asXMLRPCValue() const { return "<string>" + mValue.asString() + "</string>"; }
};
class ImplDate
: public ImplBase<LLSD::TypeDate, LLSD::Date, const LLSD::Date&>
class ImplDate final
: public ImplBase<LLSD::TypeDate, LLSD::Date, const LLSD::Date&, LLSD::Date&&>
{
public:
ImplDate(const LLSD::Date& v)
: ImplBase<LLSD::TypeDate, LLSD::Date, const LLSD::Date&>(v)
: ImplBase(v)
{ }
ImplDate(LLSD::Date&& v)
: ImplBase(std::move(v))
{ }
virtual LLSD::Integer asInteger() const
{
return (LLSD::Integer)(mValue.secondsSinceEpoch());
@ -344,34 +396,42 @@ namespace
}
virtual LLSD::String asString() const{ return mValue.asString(); }
virtual LLSD::Date asDate() const { return mValue; }
virtual LLSD::String asXMLRPCValue() const { return "<dateTime.iso8601>" + mValue.toHTTPDateString("%FT%T") + "</dateTime.iso8601>"; }
};
class ImplURI
: public ImplBase<LLSD::TypeURI, LLSD::URI, const LLSD::URI&>
class ImplURI final
: public ImplBase<LLSD::TypeURI, LLSD::URI, const LLSD::URI&, LLSD::URI&&>
{
public:
ImplURI(const LLSD::URI& v) : Base(v) { }
ImplURI(LLSD::URI&& v) : Base(std::move(v)) { }
virtual LLSD::String asString() const{ return mValue.asString(); }
virtual LLSD::URI asURI() const { return mValue; }
virtual LLSD::String asXMLRPCValue() const { return "<string>" + LLStringFn::xml_encode(mValue.asString()) + "</string>"; }
};
class ImplBinary
: public ImplBase<LLSD::TypeBinary, LLSD::Binary, const LLSD::Binary&>
class ImplBinary final
: public ImplBase<LLSD::TypeBinary, LLSD::Binary, const LLSD::Binary&, LLSD::Binary&&>
{
public:
ImplBinary(const LLSD::Binary& v) : Base(v) { }
ImplBinary(LLSD::Binary&& v) : Base(std::move(v)) { }
virtual const LLSD::Binary& asBinary() const{ return mValue; }
virtual LLSD::String asXMLRPCValue() const { return "<base64>" + LLBase64::encode(mValue.data(), mValue.size()) + "</base64>"; }
};
class ImplMap : public LLSD::Impl
class ImplMap final : public LLSD::Impl
{
private:
typedef std::map<LLSD::String, LLSD> DataMap;
typedef std::map<LLSD::String, LLSD, std::less<>> DataMap;
DataMap mData;
@ -387,17 +447,30 @@ namespace
virtual LLSD::Boolean asBoolean() const { return !mData.empty(); }
virtual bool has(const LLSD::String&) const;
virtual LLSD::String asXMLRPCValue() const
{
std::ostringstream os;
os << "<struct>";
for (const auto& it : mData)
{
os << "<member><name>" << LLStringFn::xml_encode(it.first) << "</name>"
<< it.second.asXMLRPCValue() << "</member>";
}
os << "</struct>";
return os.str();
}
virtual bool has(std::string_view) const;
using LLSD::Impl::get; // Unhiding get(size_t)
using LLSD::Impl::erase; // Unhiding erase(size_t)
using LLSD::Impl::ref; // Unhiding ref(size_t)
virtual LLSD get(const LLSD::String&) const;
virtual LLSD get(std::string_view) const;
virtual LLSD getKeys() const;
void insert(const LLSD::String& k, const LLSD& v);
void insert(std::string_view k, const LLSD& v);
virtual void erase(const LLSD::String&);
LLSD& ref(const LLSD::String&);
virtual const LLSD& ref(const LLSD::String&) const;
LLSD& ref(std::string_view);
virtual const LLSD& ref(std::string_view) const;
virtual size_t size() const { return mData.size(); }
@ -425,14 +498,14 @@ namespace
}
}
bool ImplMap::has(const LLSD::String& k) const
bool ImplMap::has(const std::string_view k) const
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD;
DataMap::const_iterator i = mData.find(k);
return i != mData.end();
}
LLSD ImplMap::get(const LLSD::String& k) const
LLSD ImplMap::get(const std::string_view k) const
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD;
DataMap::const_iterator i = mData.find(k);
@ -452,10 +525,10 @@ namespace
return keys;
}
void ImplMap::insert(const LLSD::String& k, const LLSD& v)
void ImplMap::insert(std::string_view k, const LLSD& v)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD;
mData.insert(DataMap::value_type(k, v));
mData.emplace(k, v);
}
void ImplMap::erase(const LLSD::String& k)
@ -464,15 +537,21 @@ namespace
mData.erase(k);
}
LLSD& ImplMap::ref(const LLSD::String& k)
LLSD& ImplMap::ref(std::string_view k)
{
return mData[k];
DataMap::iterator i = mData.lower_bound(k);
if (i == mData.end() || mData.key_comp()(k, i->first))
{
return mData.emplace_hint(i, std::make_pair(k, LLSD()))->second;
}
return i->second;
}
const LLSD& ImplMap::ref(const LLSD::String& k) const
const LLSD& ImplMap::ref(std::string_view k) const
{
DataMap::const_iterator i = mData.lower_bound(k);
if (i == mData.end() || mData.key_comp()(k, i->first))
if (i == mData.end() || mData.key_comp()(k, i->first))
{
return undef();
}
@ -500,7 +579,7 @@ namespace
{
//std::cout << " " << (*iter).first << ": " << (*iter).second << std::endl;
Impl::calcStats((*iter).second, type_counts, share_counts);
iter++;
++iter;
}
// Add in the values for this map
@ -511,7 +590,7 @@ namespace
class ImplArray : public LLSD::Impl
{
private:
typedef std::vector<LLSD> DataVector;
typedef std::vector<LLSD> DataVector;
DataVector mData;
@ -527,6 +606,18 @@ namespace
virtual LLSD::Boolean asBoolean() const { return !mData.empty(); }
virtual LLSD::String asXMLRPCValue() const
{
std::ostringstream os;
os << "<array><data>";
for (const auto& it : mData)
{
os << it.asXMLRPCValue();
}
os << "</data></array>";
return os.str();
}
using LLSD::Impl::get; // Unhiding get(LLSD::String)
using LLSD::Impl::erase; // Unhiding erase(LLSD::String)
using LLSD::Impl::ref; // Unhiding ref(LLSD::String)
@ -647,7 +738,7 @@ namespace
while (iter != endArray())
{ // Add values for all items held in the array
Impl::calcStats((*iter), type_counts, share_counts);
iter++;
++iter;
}
// Add in the values for this array
@ -685,6 +776,16 @@ void LLSD::Impl::reset(Impl*& var, Impl* impl)
var = impl;
}
void LLSD::Impl::move(Impl*& var, Impl*& impl)
{
if (var && var->mUseCount != STATIC_USAGE_COUNT && --var->mUseCount == 0)
{
delete var; // destroy var if usage falls to 0 and not static
}
var = impl; // Steal impl to var without incrementing use since this is a move
impl = nullptr; // null out old-impl pointer
}
LLSD::Impl& LLSD::Impl::safe(Impl* impl)
{
static Impl theUndefined(STATIC_USAGE_COUNT);
@ -738,6 +839,11 @@ void LLSD::Impl::assign(Impl*& var, LLSD::Real v)
reset(var, new ImplReal(v));
}
void LLSD::Impl::assign(Impl*& var, const char* v)
{
reset(var, new ImplString(v));
}
void LLSD::Impl::assign(Impl*& var, const LLSD::String& v)
{
reset(var, new ImplString(v));
@ -763,6 +869,31 @@ void LLSD::Impl::assign(Impl*& var, const LLSD::Binary& v)
reset(var, new ImplBinary(v));
}
void LLSD::Impl::assign(Impl*& var, LLSD::String&& v)
{
reset(var, new ImplString(std::move(v)));
}
void LLSD::Impl::assign(Impl*& var, LLSD::UUID&& v)
{
reset(var, new ImplUUID(std::move(v)));
}
void LLSD::Impl::assign(Impl*& var, LLSD::Date&& v)
{
reset(var, new ImplDate(std::move(v)));
}
void LLSD::Impl::assign(Impl*& var, LLSD::URI&& v)
{
reset(var, new ImplURI(std::move(v)));
}
void LLSD::Impl::assign(Impl*& var, LLSD::Binary&& v)
{
reset(var, new ImplBinary(std::move(v)));
}
const LLSD& LLSD::Impl::undef()
{
@ -835,6 +966,9 @@ LLSD::~LLSD() { FREE_LLSD_OBJECT; Impl::reset(impl, 0)
LLSD::LLSD(const LLSD& other) : impl(0) { ALLOC_LLSD_OBJECT; assign(other); }
void LLSD::assign(const LLSD& other) { Impl::assign(impl, other.impl); }
LLSD::LLSD(LLSD&& other) noexcept : impl(nullptr) { ALLOC_LLSD_OBJECT; Impl::move(impl, other.impl); }
void LLSD::assign(LLSD&& other) { Impl::move(impl, other.impl); }
LLSD& LLSD::operator=(LLSD&& other) noexcept { Impl::move(impl, other.impl); return *this; }
void LLSD::clear() { Impl::assignUndefined(impl); }
@ -849,6 +983,11 @@ LLSD::LLSD(const String& v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); }
LLSD::LLSD(const Date& v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); }
LLSD::LLSD(const URI& v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); }
LLSD::LLSD(const Binary& v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); }
LLSD::LLSD(UUID&& v) : impl(0) { ALLOC_LLSD_OBJECT; assign(std::move(v)); }
LLSD::LLSD(String&& v) : impl(0) { ALLOC_LLSD_OBJECT; assign(std::move(v)); }
LLSD::LLSD(Date&& v) : impl(0) { ALLOC_LLSD_OBJECT; assign(std::move(v)); }
LLSD::LLSD(URI&& v) : impl(0) { ALLOC_LLSD_OBJECT; assign(std::move(v)); }
LLSD::LLSD(Binary&& v) : impl(0) { ALLOC_LLSD_OBJECT; assign(std::move(v)); }
// Scalar Assignment
void LLSD::assign(Boolean v) { safe(impl).assign(impl, v); }
@ -859,6 +998,11 @@ void LLSD::assign(const UUID& v) { safe(impl).assign(impl, v); }
void LLSD::assign(const Date& v) { safe(impl).assign(impl, v); }
void LLSD::assign(const URI& v) { safe(impl).assign(impl, v); }
void LLSD::assign(const Binary& v) { safe(impl).assign(impl, v); }
void LLSD::assign(String&& v) { safe(impl).assign(impl, std::move(v)); }
void LLSD::assign(UUID&& v) { safe(impl).assign(impl, std::move(v)); }
void LLSD::assign(Date&& v) { safe(impl).assign(impl, std::move(v)); }
void LLSD::assign(URI&& v) { safe(impl).assign(impl, std::move(v)); }
void LLSD::assign(Binary&& v) { safe(impl).assign(impl, std::move(v)); }
// Scalar Accessors
LLSD::Boolean LLSD::asBoolean() const { return safe(impl).asBoolean(); }
@ -872,11 +1016,13 @@ const LLSD::Binary& LLSD::asBinary() const { return safe(impl).asBinary(); }
const LLSD::String& LLSD::asStringRef() const { return safe(impl).asStringRef(); }
LLSD::String LLSD::asXMLRPCValue() const { return "<value>" + safe(impl).asXMLRPCValue() + "</value>"; }
// const char * helpers
LLSD::LLSD(const char* v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); }
void LLSD::assign(const char* v)
{
if(v) assign(std::string(v));
if(v) safe(impl).assign(impl, v);
else assign(std::string());
}
@ -888,24 +1034,24 @@ LLSD LLSD::emptyMap()
return v;
}
bool LLSD::has(const String& k) const { return safe(impl).has(k); }
LLSD LLSD::get(const String& k) const { return safe(impl).get(k); }
bool LLSD::has(const std::string_view k) const { return safe(impl).has(k); }
LLSD LLSD::get(const std::string_view k) const { return safe(impl).get(k); }
LLSD LLSD::getKeys() const { return safe(impl).getKeys(); }
void LLSD::insert(const String& k, const LLSD& v) { makeMap(impl).insert(k, v); }
void LLSD::insert(std::string_view k, const LLSD& v) { makeMap(impl).insert(k, v); }
LLSD& LLSD::with(const String& k, const LLSD& v)
LLSD& LLSD::with(std::string_view k, const LLSD& v)
{
makeMap(impl).insert(k, v);
return *this;
}
void LLSD::erase(const String& k) { makeMap(impl).erase(k); }
LLSD& LLSD::operator[](const String& k)
LLSD& LLSD::operator[](const std::string_view k)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD;
return makeMap(impl).ref(k);
}
const LLSD& LLSD::operator[](const String& k) const
const LLSD& LLSD::operator[](const std::string_view k) const
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD;
return safe(impl).ref(k);

View File

@ -161,6 +161,13 @@ public:
//@}
/** @name Movable */
//@{
LLSD(LLSD&& other) noexcept;
void assign(LLSD&& other);
LLSD& operator=(LLSD&& other) noexcept;
//@}
void clear(); ///< resets to Undefined
@ -188,6 +195,11 @@ public:
LLSD(const Date&);
LLSD(const URI&);
LLSD(const Binary&);
LLSD(String&&);
LLSD(UUID&&);
LLSD(Date&&);
LLSD(URI&&);
LLSD(Binary&&);
//@}
/** @name Convenience Constructors */
@ -215,6 +227,11 @@ public:
void assign(const Date&);
void assign(const URI&);
void assign(const Binary&);
void assign(String&&);
void assign(UUID&&);
void assign(Date&&);
void assign(URI&&);
void assign(Binary&&);
LLSD& operator=(Boolean v) { assign(v); return *this; }
LLSD& operator=(Integer v) { assign(v); return *this; }
@ -224,6 +241,11 @@ public:
LLSD& operator=(const Date& v) { assign(v); return *this; }
LLSD& operator=(const URI& v) { assign(v); return *this; }
LLSD& operator=(const Binary& v) { assign(v); return *this; }
LLSD& operator=(String&& v) { assign(std::move(v)); return *this; }
LLSD& operator=(UUID&& v) { assign(std::move(v)); return *this; }
LLSD& operator=(Date&& v) { assign(std::move(v)); return *this; }
LLSD& operator=(URI&& v) { assign(std::move(v)); return *this; }
LLSD& operator=(Binary&& v) { assign(std::move(v)); return *this; }
//@}
/**
@ -259,10 +281,14 @@ public:
UUID asUUID() const;
Date asDate() const;
URI asURI() const;
const Binary& asBinary() const;
const Binary& asBinary() const;
// asStringRef on any non-string type will return a ref to an empty string.
const String& asStringRef() const;
const String& asStringRef() const;
// Return "<value><((type))>((scalar value or recursive calls))</((type))></value>"
// See http://xmlrpc.com/spec.md
String asXMLRPCValue() const;
operator Boolean() const { return asBoolean(); }
operator Integer() const { return asInteger(); }
@ -275,7 +301,7 @@ public:
// This is needed because most platforms do not automatically
// convert the boolean negation as a bool in an if statement.
bool operator!() const {return !asBoolean();}
bool operator!() const { return !asBoolean(); }
//@}
/** @name Character Pointer Helpers
@ -292,24 +318,22 @@ public:
//@{
static LLSD emptyMap();
bool has(const String&) const;
LLSD get(const String&) const;
bool has(const std::string_view) const;
LLSD get(const std::string_view) const;
LLSD getKeys() const; // Return an LLSD array with keys as strings
void insert(const String&, const LLSD&);
void insert(std::string_view, const LLSD&);
void erase(const String&);
LLSD& with(const String&, const LLSD&);
LLSD& with(std::string_view, const LLSD&);
LLSD& operator[](const String&);
LLSD& operator[](const std::string_view);
LLSD& operator[](const char* c)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD;
return (*this)[String(c)];
return c ? (*this)[std::string_view(c)] : *this;
}
const LLSD& operator[](const String&) const;
const LLSD& operator[](const std::string_view) const;
const LLSD& operator[](const char* c) const
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD;
return (*this)[String(c)];
return c ? (*this)[std::string_view(c)] : *this;
}
//@}

View File

@ -149,7 +149,7 @@ bool LLParamSDParser::readF32(Parser& parser, void* val_ptr)
{
LLParamSDParser& self = static_cast<LLParamSDParser&>(parser);
*((F32*)val_ptr) = self.mCurReadSD->asReal();
*((F32*)val_ptr) = (F32)self.mCurReadSD->asReal();
return true;
}

View File

@ -231,7 +231,7 @@ bool LLSDSerialize::deserialize(LLSD& sd, std::istream& str, llssize max_bytes)
}
// Since we've already read 'inbuf' bytes into 'hdr_buf', prepend that
// data to whatever remains in 'str'.
LLMemoryStreamBuf already(reinterpret_cast<const U8*>(hdr_buf), inbuf);
LLMemoryStreamBuf already(reinterpret_cast<const U8*>(hdr_buf), (S32)inbuf);
cat_streambuf prebuff(&already, str.rdbuf());
std::istream prepend(&prebuff);
#if 1
@ -475,7 +475,7 @@ LLSDNotationParser::~LLSDNotationParser()
// virtual
S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data, S32 max_depth) const
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD;
// map: { string:object, string:object }
// array: [ object, object, object ]
// undef: !
@ -566,7 +566,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data, S32 max_depth) c
data,
NOTATION_FALSE_SERIAL,
false);
if(PARSE_FAILURE == cnt) parse_count = cnt;
if(PARSE_FAILURE == cnt) parse_count = (S32)cnt;
else account(cnt);
}
else
@ -592,7 +592,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data, S32 max_depth) c
if(isalpha(c))
{
auto cnt = deserialize_boolean(istr,data,NOTATION_TRUE_SERIAL,true);
if(PARSE_FAILURE == cnt) parse_count = cnt;
if(PARSE_FAILURE == cnt) parse_count = (S32)cnt;
else account(cnt);
}
else
@ -735,7 +735,7 @@ S32 LLSDNotationParser::doParse(std::istream& istr, LLSD& data, S32 max_depth) c
S32 LLSDNotationParser::parseMap(std::istream& istr, LLSD& map, S32 max_depth) const
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD;
// map: { string:object, string:object }
map = LLSD::emptyMap();
S32 parse_count = 0;
@ -796,7 +796,7 @@ S32 LLSDNotationParser::parseMap(std::istream& istr, LLSD& map, S32 max_depth) c
S32 LLSDNotationParser::parseArray(std::istream& istr, LLSD& array, S32 max_depth) const
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD;
// array: [ object, object, object ]
array = LLSD::emptyArray();
S32 parse_count = 0;
@ -836,7 +836,7 @@ S32 LLSDNotationParser::parseArray(std::istream& istr, LLSD& array, S32 max_dept
bool LLSDNotationParser::parseString(std::istream& istr, LLSD& data) const
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD;
std::string value;
auto count = deserialize_string(istr, value, mMaxBytesLeft);
if(PARSE_FAILURE == count) return false;
@ -847,7 +847,7 @@ bool LLSDNotationParser::parseString(std::istream& istr, LLSD& data) const
bool LLSDNotationParser::parseBinary(std::istream& istr, LLSD& data) const
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD;
// binary: b##"ff3120ab1"
// or: b(len)"..."
@ -950,7 +950,7 @@ LLSDBinaryParser::~LLSDBinaryParser()
// virtual
S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data, S32 max_depth) const
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD;
/**
* Undefined: '!'<br>
* Boolean: '1' for true '0' for false<br>

View File

@ -554,7 +554,7 @@ void LLSDXMLParser::Impl::parsePart(const char* buf, llssize len)
if ( buf != NULL
&& len > 0 )
{
XML_Status status = XML_Parse(mParser, buf, len, false);
XML_Status status = XML_Parse(mParser, buf, (int)len, 0);
if (status == XML_STATUS_ERROR)
{
LL_INFOS() << "Unexpected XML parsing error at start" << LL_ENDL;
@ -930,7 +930,7 @@ void LLSDXMLParser::parsePart(const char *buf, llssize len)
// virtual
S32 LLSDXMLParser::doParse(std::istream& input, LLSD& data, S32 max_depth) const
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD;
#ifdef XML_PARSER_PERFORMANCE_TESTS
XML_Timer timer( &parseTime );

View File

@ -51,7 +51,7 @@
// U32
LLSD ll_sd_from_U32(const U32 val)
{
std::vector<U8> v;
LLSD::Binary v;
U32 net_order = htonl(val);
v.resize(4);
@ -63,7 +63,7 @@ LLSD ll_sd_from_U32(const U32 val)
U32 ll_U32_from_sd(const LLSD& sd)
{
U32 ret;
std::vector<U8> v = sd.asBinary();
const LLSD::Binary& v = sd.asBinary();
if (v.size() < 4)
{
return 0;
@ -76,7 +76,7 @@ U32 ll_U32_from_sd(const LLSD& sd)
//U64
LLSD ll_sd_from_U64(const U64 val)
{
std::vector<U8> v;
LLSD::Binary v;
U32 high, low;
high = (U32)(val >> 32);
@ -94,7 +94,7 @@ LLSD ll_sd_from_U64(const U64 val)
U64 ll_U64_from_sd(const LLSD& sd)
{
U32 high, low;
std::vector<U8> v = sd.asBinary();
const LLSD::Binary& v = sd.asBinary();
if (v.size() < 8)
{
@ -112,7 +112,7 @@ U64 ll_U64_from_sd(const LLSD& sd)
// IP Address (stored in net order in a U32, so don't need swizzling)
LLSD ll_sd_from_ipaddr(const U32 val)
{
std::vector<U8> v;
LLSD::Binary v;
v.resize(4);
memcpy(&(v[0]), &val, 4); /* Flawfinder: ignore */
@ -123,7 +123,7 @@ LLSD ll_sd_from_ipaddr(const U32 val)
U32 ll_ipaddr_from_sd(const LLSD& sd)
{
U32 ret;
std::vector<U8> v = sd.asBinary();
const LLSD::Binary& v = sd.asBinary();
if (v.size() < 4)
{
return 0;
@ -135,17 +135,17 @@ U32 ll_ipaddr_from_sd(const LLSD& sd)
// Converts an LLSD binary to an LLSD string
LLSD ll_string_from_binary(const LLSD& sd)
{
std::vector<U8> value = sd.asBinary();
const LLSD::Binary& value = sd.asBinary();
std::string str;
str.resize(value.size());
memcpy(&str[0], &value[0], value.size());
memcpy(&str[0], value.data(), value.size());
return str;
}
// Converts an LLSD string to an LLSD binary
LLSD ll_binary_from_string(const LLSD& sd)
{
std::vector<U8> binary_value;
LLSD::Binary binary_value;
std::string string_value = sd.asString();
for (const U8 c : string_value)
@ -214,7 +214,7 @@ bool compare_llsd_with_template(
const LLSD& template_llsd,
LLSD& resultant_llsd)
{
LL_PROFILE_ZONE_SCOPED
LL_PROFILE_ZONE_SCOPED;
if (
llsd_to_test.isUndefined() &&
@ -337,7 +337,7 @@ bool filter_llsd_with_template(
const LLSD & template_llsd,
LLSD & resultant_llsd)
{
LL_PROFILE_ZONE_SCOPED
LL_PROFILE_ZONE_SCOPED;
if (llsd_to_test.isUndefined() && template_llsd.isDefined())
{
@ -533,7 +533,7 @@ class TypeLookup
public:
TypeLookup()
{
LL_PROFILE_ZONE_SCOPED
LL_PROFILE_ZONE_SCOPED;
for (const Data *di(boost::begin(typedata)), *dend(boost::end(typedata)); di != dend; ++di)
{
@ -543,7 +543,7 @@ public:
std::string lookup(LLSD::Type type) const
{
LL_PROFILE_ZONE_SCOPED
LL_PROFILE_ZONE_SCOPED;
MapType::const_iterator found = mMap.find(type);
if (found != mMap.end())
@ -595,7 +595,7 @@ static std::string match_types(LLSD::Type expect, // prototype.type()
LLSD::Type actual, // type we're checking
const std::string& pfx) // as for llsd_matches
{
LL_PROFILE_ZONE_SCOPED
LL_PROFILE_ZONE_SCOPED;
// Trivial case: if the actual type is exactly what we expect, we're good.
if (actual == expect)
@ -634,7 +634,7 @@ static std::string match_types(LLSD::Type expect, // prototype.type()
// see docstring in .h file
std::string llsd_matches(const LLSD& prototype, const LLSD& data, const std::string& pfx)
{
LL_PROFILE_ZONE_SCOPED
LL_PROFILE_ZONE_SCOPED;
// An undefined prototype means that any data is valid.
// An undefined slot in an array or map prototype means that any data
@ -768,7 +768,7 @@ std::string llsd_matches(const LLSD& prototype, const LLSD& data, const std::str
bool llsd_equals(const LLSD& lhs, const LLSD& rhs, int bits)
{
LL_PROFILE_ZONE_SCOPED
LL_PROFILE_ZONE_SCOPED;
// We're comparing strict equality of LLSD representation rather than
// performing any conversions. So if the types aren't equal, the LLSD
@ -878,7 +878,7 @@ namespace llsd
LLSD& drill_ref(LLSD& blob, const LLSD& rawPath)
{
LL_PROFILE_ZONE_SCOPED
LL_PROFILE_ZONE_SCOPED;
// Treat rawPath uniformly as an array. If it's not already an array,
// store it as the only entry in one. (But let's say Undefined means an
@ -905,7 +905,7 @@ LLSD& drill_ref(LLSD& blob, const LLSD& rawPath)
// path entry that's bad.
for (LLSD::Integer i = 0; i < path.size(); ++i)
{
LL_PROFILE_ZONE_NUM( i )
LL_PROFILE_ZONE_NUM(i);
const LLSD& key{path[i]};
if (key.isString())
@ -935,7 +935,7 @@ LLSD& drill_ref(LLSD& blob, const LLSD& rawPath)
LLSD drill(const LLSD& blob, const LLSD& path)
{
LL_PROFILE_ZONE_SCOPED
LL_PROFILE_ZONE_SCOPED;
// drill_ref() does exactly what we want. Temporarily cast away
// const-ness and use that.
@ -949,7 +949,7 @@ LLSD drill(const LLSD& blob, const LLSD& path)
// filter may be include to exclude/include keys in a map.
LLSD llsd_clone(LLSD value, LLSD filter)
{
LL_PROFILE_ZONE_SCOPED
LL_PROFILE_ZONE_SCOPED;
LLSD clone;
bool has_filter(filter.isMap());
@ -990,8 +990,7 @@ LLSD llsd_clone(LLSD value, LLSD filter)
case LLSD::TypeBinary:
{
LLSD::Binary bin(value.asBinary().begin(), value.asBinary().end());
clone = LLSD::Binary(bin);
clone = LLSD::Binary(value.asBinary().begin(), value.asBinary().end());
break;
}
default:

View File

@ -37,7 +37,8 @@
#include "llmainthreadtask.h"
#ifdef LL_WINDOWS
#pragma warning( disable : 4506 ) // no definition for inline function
#pragma warning(push)
#pragma warning(disable : 4506) // no definition for inline function
#endif
class LLSingletonBase: private boost::noncopyable
@ -861,4 +862,8 @@ private:
template <class T>
T* LLSimpleton<T>::sInstance{ nullptr };
#ifdef LL_WINDOWS
#pragma warning(pop)
#endif
#endif

View File

@ -226,11 +226,11 @@ void delete_and_clear_array(T*& ptr)
// foo[2] = "hello";
// const char* bar = get_ptr_in_map(foo, 2); // bar -> "hello"
// const char* baz = get_ptr_in_map(foo, 3); // baz == NULL
template <typename K, typename T>
inline T* get_ptr_in_map(const std::map<K,T*>& inmap, const K& key)
template <typename T>
inline typename T::mapped_type get_ptr_in_map(const T& inmap, typename T::key_type const& key)
{
// Typedef here avoids warnings because of new c++ naming rules.
typedef typename std::map<K,T*>::const_iterator map_iter;
typedef typename T::const_iterator map_iter;
map_iter iter = inmap.find(key);
if(iter == inmap.end())
{

View File

@ -250,7 +250,7 @@ LLWString utf16str_to_wstring(const U16* utf16str, size_t len)
while (i < len)
{
llwchar cur_char;
i += utf16chars_to_wchar(chars16+i, &cur_char);
i += (S32)utf16chars_to_wchar(chars16+i, &cur_char);
wout += cur_char;
}
return wout;
@ -1208,6 +1208,75 @@ namespace LLStringFn
return output;
}
using literals_t = std::map<char, std::string>;
static const literals_t xml_elem_literals =
{
{ '<', "&lt;" },
{ '>', "&gt;" },
{ '&', "&amp;" }
};
static const literals_t xml_attr_literals =
{
{ '"', "&quot;" },
{ '\'', "&apos;" }
};
static void literals_encode(std::string& text, const literals_t& literals)
{
for (const std::pair<char, std::string> it : literals)
{
std::string::size_type pos = 0;
while ((pos = text.find(it.first, pos)) != std::string::npos)
{
text.replace(pos, 1, it.second);
pos += it.second.size();
}
}
}
static void literals_decode(std::string& text, const literals_t& literals)
{
for (const std::pair<char, std::string> it : literals)
{
std::string::size_type pos = 0;
while ((pos = text.find(it.second, pos)) != std::string::npos)
{
text[pos++] = it.first;
text.erase(pos, it.second.size() - 1);
}
}
}
/**
* @brief Replace all characters that are not allowed in XML 1.0
* with corresponding literals: [ < > & ] => [ &lt; &gt; &amp; ]
*/
std::string xml_encode(const std::string& input, bool for_attribute)
{
std::string result(input);
literals_encode(result, xml_elem_literals);
if (for_attribute)
{
literals_encode(result, xml_attr_literals);
}
return result;
}
/**
* @brief Replace some of XML literals that are defined in XML 1.0
* with corresponding characters: [ &lt; &gt; &amp; ] => [ < > & ]
*/
std::string xml_decode(const std::string& input, bool for_attribute)
{
std::string result(input);
literals_decode(result, xml_elem_literals);
if (for_attribute)
{
literals_decode(result, xml_attr_literals);
}
return result;
}
/**
* @brief Replace all control characters (c < 0x20) with replacement in
* string.

View File

@ -889,6 +889,20 @@ namespace LLStringFn
LL_COMMON_API std::string strip_invalid_xml(const std::string& input);
/**
* @brief Replace all characters that are not allowed in XML 1.0
* with corresponding literals: [ < > & ] => [ &lt; &gt; &amp; ]
*/
LL_COMMON_API std::string xml_encode(const std::string& input, bool for_attribute = false);
/**
* @brief Replace some of XML literals that are defined in XML 1.0
* with corresponding characters: [ &lt; &gt; &amp; ] => [ < > & ]
*/
LL_COMMON_API std::string xml_decode(const std::string& input, bool for_attribute = false);
/**
* @brief Replace all control characters (0 <= c < 0x20) with replacement in
* string. This is safe for utf-8

View File

@ -74,6 +74,8 @@ using namespace llsd;
# include <mach/mach_host.h>
# include <mach/task.h>
# include <mach/task_info.h>
# include <sys/types.h>
# include <mach/mach_init.h>
#elif LL_LINUX
# include <errno.h>
# include <sys/utsname.h>
@ -85,6 +87,7 @@ const char MEMINFO_FILE[] = "/proc/meminfo";
#endif
LLCPUInfo gSysCPU;
LLMemoryInfo gSysMemory;
// Don't log memory info any more often than this. It also serves as our
// framerate sample size.
@ -797,33 +800,32 @@ U32Kilobytes LLMemoryInfo::getPhysicalMemoryKB() const
}
//static
void LLMemoryInfo::getAvailableMemoryKB(U32Kilobytes& avail_physical_mem_kb, U32Kilobytes& avail_virtual_mem_kb)
void LLMemoryInfo::getAvailableMemoryKB(U32Kilobytes& avail_mem_kb)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_MEMORY;
#if LL_WINDOWS
// Sigh, this shouldn't be a static method, then we wouldn't have to
// reload this data separately from refresh()
LLSD statsMap(loadStatsMap());
avail_physical_mem_kb = (U32Kilobytes)statsMap["Avail Physical KB"].asInteger();
avail_virtual_mem_kb = (U32Kilobytes)statsMap["Avail Virtual KB"].asInteger();
avail_mem_kb = (U32Kilobytes)statsMap["Avail Physical KB"].asInteger();
#elif LL_DARWIN
// mStatsMap is derived from vm_stat, look for (e.g.) "kb free":
// $ vm_stat
// Mach Virtual Memory Statistics: (page size of 4096 bytes)
// Pages free: 462078.
// Pages active: 142010.
// Pages inactive: 220007.
// Pages wired down: 159552.
// "Translation faults": 220825184.
// Pages copy-on-write: 2104153.
// Pages zero filled: 167034876.
// Pages reactivated: 65153.
// Pageins: 2097212.
// Pageouts: 41759.
// Object cache: 841598 hits of 7629869 lookups (11% hit rate)
avail_physical_mem_kb = (U32Kilobytes)-1 ;
avail_virtual_mem_kb = (U32Kilobytes)-1 ;
// use host_statistics64 to get memory info
vm_statistics64_data_t vmstat;
mach_msg_type_number_t count = HOST_VM_INFO64_COUNT;
mach_port_t host = mach_host_self();
vm_size_t page_size;
host_page_size(host, &page_size);
kern_return_t result = host_statistics64(host, HOST_VM_INFO64, reinterpret_cast<host_info_t>(&vmstat), &count);
if (result == KERN_SUCCESS)
{
avail_mem_kb = U64Bytes((vmstat.free_count + vmstat.inactive_count) * page_size);
}
else
{
avail_mem_kb = (U32Kilobytes)-1;
}
#elif LL_LINUX
// mStatsMap is derived from MEMINFO_FILE:
@ -874,15 +876,14 @@ void LLMemoryInfo::getAvailableMemoryKB(U32Kilobytes& avail_physical_mem_kb, U32
// DirectMap4k: 434168 kB
// DirectMap2M: 477184 kB
// (could also run 'free', but easier to read a file than run a program)
avail_physical_mem_kb = (U32Kilobytes)-1 ;
avail_virtual_mem_kb = (U32Kilobytes)-1 ;
LLSD statsMap(loadStatsMap());
avail_mem_kb = (U32Kilobytes)statsMap["MemFree"].asInteger();
#else
//do not know how to collect available memory info for other systems.
//leave it blank here for now.
avail_physical_mem_kb = (U32Kilobytes)-1 ;
avail_virtual_mem_kb = (U32Kilobytes)-1 ;
avail_mem_kb = (U32Kilobytes)-1 ;
#endif
}
@ -928,7 +929,7 @@ LLSD LLMemoryInfo::getStatsMap() const
LLMemoryInfo& LLMemoryInfo::refresh()
{
LL_PROFILE_ZONE_SCOPED
LL_PROFILE_ZONE_SCOPED;
mStatsMap = loadStatsMap();
LL_DEBUGS("LLMemoryInfo") << "Populated mStatsMap:\n";
@ -977,7 +978,7 @@ LLSD LLMemoryInfo::loadStatsMap()
// specifically accepts PROCESS_MEMORY_COUNTERS*, and since this is a
// classic-C API, PROCESS_MEMORY_COUNTERS_EX isn't a subclass. Cast the
// pointer.
GetProcessMemoryInfo(GetCurrentProcess(), PPROCESS_MEMORY_COUNTERS(&pmem), sizeof(pmem));
GetProcessMemoryInfo(GetCurrentProcess(), (PROCESS_MEMORY_COUNTERS*) &pmem, sizeof(pmem));
stats.add("Page Fault Count", pmem.PageFaultCount);
stats.add("PeakWorkingSetSize KB", pmem.PeakWorkingSetSize/div);

View File

@ -134,8 +134,8 @@ public:
static U32Kilobytes getHardwareMemSize(); // Because some Mac linkers won't let us reference extern gSysMemory from a different lib.
#endif
//get the available memory infomation in KiloBytes.
static void getAvailableMemoryKB(U32Kilobytes& avail_physical_mem_kb, U32Kilobytes& avail_virtual_mem_kb);
//get the available memory in KiloBytes.
static void getAvailableMemoryKB(U32Kilobytes& avail_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.
@ -169,6 +169,7 @@ bool LL_COMMON_API gunzip_file(const std::string& srcfile, const std::string& ds
// gzip srcfile into dstfile. Returns false on error.
bool LL_COMMON_API gzip_file(const std::string& srcfile, const std::string& dstfile);
extern LL_COMMON_API LLMemoryInfo gSysMemory;
extern LL_COMMON_API LLCPUInfo gSysCPU;
#endif // LL_LLSYS_H

View File

@ -269,6 +269,7 @@ void LLThread::shutdown()
mStatus = STOPPED;
return;
}
delete mThreadp;
mThreadp = NULL;
}
@ -299,6 +300,7 @@ void LLThread::start()
{
mThreadp = new std::thread(std::bind(&LLThread::threadRun, this));
mNativeHandle = mThreadp->native_handle();
mThreadp->detach();
}
catch (std::system_error& ex)
{
@ -344,7 +346,7 @@ bool LLThread::runCondition(void)
// Stop thread execution if requested until unpaused.
void LLThread::checkPause()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
mDataLock->lock();
// This is in a while loop because the pthread API allows for spurious wakeups.
@ -376,20 +378,20 @@ void LLThread::setQuitting()
// static
LLThread::id_t LLThread::currentID()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
return std::this_thread::get_id();
}
// static
void LLThread::yield()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
std::this_thread::yield();
}
void LLThread::wake()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
mDataLock->lock();
if(!shouldSleep())
{
@ -400,7 +402,7 @@ void LLThread::wake()
void LLThread::wakeLocked()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
if(!shouldSleep())
{
mRunCondition->signal();
@ -409,13 +411,13 @@ void LLThread::wakeLocked()
void LLThread::lockData()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
mDataLock->lock();
}
void LLThread::unlockData()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD
LL_PROFILE_ZONE_SCOPED_CATEGORY_THREAD;
mDataLock->unlock();
}

View File

@ -91,7 +91,7 @@ U32 micro_sleep(U64 us, U32 max_yields)
U32 micro_sleep(U64 us, U32 max_yields)
{
LL_PROFILE_ZONE_SCOPED
LL_PROFILE_ZONE_SCOPED;
#if 0
LARGE_INTEGER ft;
ft.QuadPart = -static_cast<S64>(us * 10); // '-' using relative time
@ -101,7 +101,7 @@ U32 micro_sleep(U64 us, U32 max_yields)
WaitForSingleObject(timer, INFINITE);
CloseHandle(timer);
#else
Sleep(us / 1000);
Sleep((DWORD)(us / 1000));
#endif
return 0;
@ -109,7 +109,7 @@ U32 micro_sleep(U64 us, U32 max_yields)
void ms_sleep(U32 ms)
{
LL_PROFILE_ZONE_SCOPED
LL_PROFILE_ZONE_SCOPED;
micro_sleep(ms * 1000, 0);
}

View File

@ -100,7 +100,7 @@ bool AccumulatorBufferGroup::isCurrent() const
return mCounts.isCurrent();
}
void AccumulatorBufferGroup::append( const AccumulatorBufferGroup& other )
void AccumulatorBufferGroup::append(const AccumulatorBufferGroup& other)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_STATS;
mCounts.addSamples(other.mCounts, SEQUENTIAL);
@ -109,7 +109,7 @@ void AccumulatorBufferGroup::append( const AccumulatorBufferGroup& other )
mStackTimers.addSamples(other.mStackTimers, SEQUENTIAL);
}
void AccumulatorBufferGroup::merge( const AccumulatorBufferGroup& other)
void AccumulatorBufferGroup::merge(const AccumulatorBufferGroup& other)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_STATS;
mCounts.addSamples(other.mCounts, NON_SEQUENTIAL);
@ -140,7 +140,7 @@ void AccumulatorBufferGroup::sync()
F64 SampleAccumulator::mergeSumsOfSquares(const SampleAccumulator& a, const SampleAccumulator& b)
{
const F64 epsilon = 0.0000001;
constexpr F64 epsilon = 0.0000001;
if (a.getSamplingTime() > epsilon && b.getSamplingTime() > epsilon)
{
@ -170,7 +170,7 @@ F64 SampleAccumulator::mergeSumsOfSquares(const SampleAccumulator& a, const Samp
return a.getSumOfSquares();
}
void SampleAccumulator::addSamples( const SampleAccumulator& other, EBufferAppendType append_type )
void SampleAccumulator::addSamples(const SampleAccumulator& other, EBufferAppendType append_type)
{
if (append_type == NON_SEQUENTIAL)
{
@ -205,7 +205,7 @@ void SampleAccumulator::addSamples( const SampleAccumulator& other, EBufferAppen
}
}
void SampleAccumulator::reset( const SampleAccumulator* other )
void SampleAccumulator::reset(const SampleAccumulator* other)
{
mLastValue = other ? other->mLastValue : NaN;
mHasValue = other ? other->mHasValue : false;
@ -243,7 +243,7 @@ F64 EventAccumulator::mergeSumsOfSquares(const EventAccumulator& a, const EventA
return a.mSumOfSquares;
}
void EventAccumulator::addSamples( const EventAccumulator& other, EBufferAppendType append_type )
void EventAccumulator::addSamples(const EventAccumulator& other, EBufferAppendType append_type)
{
if (other.mNumSamples)
{
@ -269,12 +269,12 @@ void EventAccumulator::addSamples( const EventAccumulator& other, EBufferAppendT
}
}
void EventAccumulator::reset( const EventAccumulator* other )
void EventAccumulator::reset(const EventAccumulator* other)
{
mNumSamples = 0;
mSum = 0;
mMin = F32(NaN);
mMax = F32(NaN);
mMin = NaN;
mMax = NaN;
mMean = NaN;
mSumOfSquares = 0;
mLastValue = other ? other->mLastValue : NaN;

View File

@ -39,7 +39,7 @@
namespace LLTrace
{
const F64 NaN = std::numeric_limits<double>::quiet_NaN();
constexpr F64 NaN = std::numeric_limits<double>::quiet_NaN();
enum EBufferAppendType
{
@ -251,8 +251,8 @@ namespace LLTrace
EventAccumulator()
: mSum(0),
mMin(F32(NaN)),
mMax(F32(NaN)),
mMin(NaN),
mMax(NaN),
mMean(NaN),
mSumOfSquares(0),
mNumSamples(0),
@ -288,11 +288,11 @@ namespace LLTrace
void sync(F64SecondsImplicit) {}
F64 getSum() const { return mSum; }
F32 getMin() const { return mMin; }
F32 getMax() const { return mMax; }
F64 getMin() const { return mMin; }
F64 getMax() const { return mMax; }
F64 getLastValue() const { return mLastValue; }
F64 getMean() const { return mMean; }
F64 getStandardDeviation() const { return sqrtf(mSumOfSquares / mNumSamples); }
F64 getStandardDeviation() const { return sqrt(mSumOfSquares / mNumSamples); }
F64 getSumOfSquares() const { return mSumOfSquares; }
S32 getSampleCount() const { return mNumSamples; }
bool hasValue() const { return mNumSamples > 0; }
@ -307,7 +307,7 @@ namespace LLTrace
F64 mMean,
mSumOfSquares;
F32 mMin,
F64 mMin,
mMax;
S32 mNumSamples;
@ -322,8 +322,8 @@ namespace LLTrace
SampleAccumulator()
: mSum(0),
mMin(F32(NaN)),
mMax(F32(NaN)),
mMin(NaN),
mMax(NaN),
mMean(NaN),
mSumOfSquares(0),
mLastSampleTimeStamp(0),
@ -378,11 +378,11 @@ namespace LLTrace
}
F64 getSum() const { return mSum; }
F32 getMin() const { return mMin; }
F32 getMax() const { return mMax; }
F64 getMin() const { return mMin; }
F64 getMax() const { return mMax; }
F64 getLastValue() const { return mLastValue; }
F64 getMean() const { return mMean; }
F64 getStandardDeviation() const { return sqrtf(mSumOfSquares / mTotalSamplingTime); }
F64 getStandardDeviation() const { return sqrt(mSumOfSquares / mTotalSamplingTime); }
F64 getSumOfSquares() const { return mSumOfSquares; }
F64SecondsImplicit getSamplingTime() const { return mTotalSamplingTime; }
S32 getSampleCount() const { return mNumSamples; }
@ -402,7 +402,7 @@ namespace LLTrace
mLastSampleTimeStamp,
mTotalSamplingTime;
F32 mMin,
F64 mMin,
mMax;
S32 mNumSamples;

View File

@ -229,7 +229,7 @@ F32 Recording::getPerSec(const StatType<TimeBlockAccumulator::CallCountFacet>& s
update();
const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()];
const TimeBlockAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mStackTimers[stat.getIndex()] : NULL;
return (F32)(accumulator.mCalls + (active_accumulator ? active_accumulator->mCalls : 0)) / mElapsedSeconds.value();
return (F32)(accumulator.mCalls + (active_accumulator ? active_accumulator->mCalls : 0)) / (F32)mElapsedSeconds.value();
}
bool Recording::hasValue(const StatType<CountAccumulator>& stat)
@ -296,11 +296,11 @@ F64 Recording::getMean( const StatType<SampleAccumulator>& stat )
const SampleAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mSamples[stat.getIndex()] : NULL;
if (active_accumulator && active_accumulator->hasValue())
{
F32 t = 0.0f;
F64 t = 0.0;
S32 div = accumulator.getSampleCount() + active_accumulator->getSampleCount();
if (div > 0)
{
t = active_accumulator->getSampleCount() / div;
t = (F64)active_accumulator->getSampleCount() / (F64)div;
}
return lerp(accumulator.getMean(), active_accumulator->getMean(), t);
}
@ -319,7 +319,7 @@ F64 Recording::getStandardDeviation( const StatType<SampleAccumulator>& stat )
if (active_accumulator && active_accumulator->hasValue())
{
F64 sum_of_squares = SampleAccumulator::mergeSumsOfSquares(accumulator, *active_accumulator);
return sqrtf(sum_of_squares / (accumulator.getSamplingTime() + active_accumulator->getSamplingTime()));
return sqrt(sum_of_squares / (F64)(accumulator.getSamplingTime() + active_accumulator->getSamplingTime()));
}
else
{
@ -382,11 +382,11 @@ F64 Recording::getMean( const StatType<EventAccumulator>& stat )
const EventAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mEvents[stat.getIndex()] : NULL;
if (active_accumulator && active_accumulator->hasValue())
{
F32 t = 0.0f;
F64 t = 0.0;
S32 div = accumulator.getSampleCount() + active_accumulator->getSampleCount();
if (div > 0)
{
t = active_accumulator->getSampleCount() / div;
t = (F64)active_accumulator->getSampleCount() / (F64)div;
}
return lerp(accumulator.getMean(), active_accumulator->getMean(), t);
}
@ -405,7 +405,7 @@ F64 Recording::getStandardDeviation( const StatType<EventAccumulator>& stat )
if (active_accumulator && active_accumulator->hasValue())
{
F64 sum_of_squares = EventAccumulator::mergeSumsOfSquares(accumulator, *active_accumulator);
return sqrtf(sum_of_squares / (accumulator.getSampleCount() + active_accumulator->getSampleCount()));
return sqrt(sum_of_squares / (F64)(accumulator.getSampleCount() + active_accumulator->getSampleCount()));
}
else
{

View File

@ -35,6 +35,11 @@
#include "llpointer.h"
#include <limits>
#ifdef LL_WINDOWS
#pragma warning(push)
#pragma warning(disable : 4244) // possible loss of data on conversions
#endif
class LLStopWatchControlsMixinCommon
{
public:
@ -714,4 +719,8 @@ namespace LLTrace
};
}
#ifdef LL_WINDOWS
#pragma warning(pop)
#endif
#endif // LL_LLTRACERECORDING_H

View File

@ -31,6 +31,11 @@
#include "llpreprocessor.h"
#include "llerror.h"
#ifdef LL_WINDOWS
#pragma warning(push)
#pragma warning(disable : 4244) // possible loss of data on conversions
#endif
//lightweight replacement of type traits for simple type equality check
template<typename S, typename T>
struct LLIsSameType
@ -846,4 +851,8 @@ LL_FORCE_INLINE S2 ll_convert_units(LLUnit<S1, base_unit_name> in, LLUnit<S2, un
typedef LLUnit<U64, ns::unit_name> U64##unit_name; \
typedef LLUnitImplicit<U64, ns::unit_name> U64##unit_name##Implicit
#ifdef LL_WINDOWS
#pragma warning(pop)
#endif
#endif //LL_UNITTYPE_H

View File

@ -29,12 +29,7 @@
#include "linden_common.h"
#include "lluriparser.h"
#if LL_DARWIN
#include <signal.h>
#include <setjmp.h>
#endif
LLUriParser::LLUriParser(const std::string& u) : mTmpScheme(false), mNormalizedTmp(false), mRes(0)
LLUriParser::LLUriParser(const std::string& u) : mTmpScheme(false), mNormalizedTmp(false), mRes(false)
{
if (u.find("://") == std::string::npos)
{
@ -42,36 +37,52 @@ LLUriParser::LLUriParser(const std::string& u) : mTmpScheme(false), mNormalizedT
mTmpScheme = true;
}
mNormalizedUri += u.c_str();
mNormalizedUri.append(u);
mRes = parse();
}
LLUriParser::~LLUriParser()
{
uriFreeUriMembersA(&mUri);
}
S32 LLUriParser::parse()
bool LLUriParser::parse()
{
mRes = uriParseSingleUriA(&mUri, mNormalizedUri.c_str(), NULL);
try
{
auto res = boost::urls::parse_uri(mNormalizedUri);
if (res)
{
mUri = *res;
mRes = true;
}
else
{
mRes = false;
}
}
catch (const std::length_error&)
{
LL_WARNS() << "Failed to parse uri due to exceeding uri_view max_size" << LL_ENDL;
mRes = false;
}
return mRes;
}
const char * LLUriParser::scheme() const
const std::string& LLUriParser::scheme() const
{
return mScheme.c_str();
return mScheme;
}
void LLUriParser::sheme(const std::string& s)
void LLUriParser::scheme(const std::string& s)
{
mTmpScheme = !s.size();
mScheme = s;
}
const char * LLUriParser::port() const
const std::string& LLUriParser::port() const
{
return mPort.c_str();
return mPort;
}
void LLUriParser::port(const std::string& s)
@ -79,9 +90,9 @@ void LLUriParser::port(const std::string& s)
mPort = s;
}
const char * LLUriParser::host() const
const std::string& LLUriParser::host() const
{
return mHost.c_str();
return mHost;
}
void LLUriParser::host(const std::string& s)
@ -89,9 +100,9 @@ void LLUriParser::host(const std::string& s)
mHost = s;
}
const char * LLUriParser::path() const
const std::string& LLUriParser::path() const
{
return mPath.c_str();
return mPath;
}
void LLUriParser::path(const std::string& s)
@ -99,9 +110,9 @@ void LLUriParser::path(const std::string& s)
mPath = s;
}
const char * LLUriParser::query() const
const std::string& LLUriParser::query() const
{
return mQuery.c_str();
return mQuery;
}
void LLUriParser::query(const std::string& s)
@ -109,9 +120,9 @@ void LLUriParser::query(const std::string& s)
mQuery = s;
}
const char * LLUriParser::fragment() const
const std::string& LLUriParser::fragment() const
{
return mFragment.c_str();
return mFragment;
}
void LLUriParser::fragment(const std::string& s)
@ -119,19 +130,6 @@ void LLUriParser::fragment(const std::string& s)
mFragment = s;
}
void LLUriParser::textRangeToString(UriTextRangeA& textRange, std::string& str)
{
if (textRange.first != NULL && textRange.afterLast != NULL && textRange.first < textRange.afterLast)
{
const ptrdiff_t len = textRange.afterLast - textRange.first;
str.assign(textRange.first, static_cast<std::string::size_type>(len));
}
else
{
str = LLStringUtil::null;
}
}
void LLUriParser::extractParts()
{
if (mTmpScheme || mNormalizedTmp)
@ -140,96 +138,24 @@ void LLUriParser::extractParts()
}
else
{
textRangeToString(mUri.scheme, mScheme);
mScheme = mUri.scheme();
}
textRangeToString(mUri.hostText, mHost);
textRangeToString(mUri.portText, mPort);
textRangeToString(mUri.query, mQuery);
textRangeToString(mUri.fragment, mFragment);
UriPathSegmentA * pathHead = mUri.pathHead;
while (pathHead)
{
std::string partOfPath;
textRangeToString(pathHead->text, partOfPath);
mPath += '/';
mPath += partOfPath;
pathHead = pathHead->next;
}
mHost = mUri.host();
mPort = mUri.port();
mQuery = mUri.query();
mFragment = mUri.fragment();
mPath = mUri.path();
}
#if LL_DARWIN
typedef void(*sighandler_t)(int);
jmp_buf return_to_normalize;
static int sLastSignal = 0;
void uri_signal_handler(int signal)
{
sLastSignal = signal;
// Apparently signal handler throwing an exception doesn't work.
// This is ugly and unsafe due to not unwinding content of uriparser library,
// but unless we have a way to catch this as NSexception, jump appears to be the only option.
longjmp(return_to_normalize, 1 /*setjmp will return this value*/);
}
#endif
S32 LLUriParser::normalize()
bool LLUriParser::normalize()
{
mNormalizedTmp = mTmpScheme;
if (!mRes)
if (mRes)
{
#if LL_DARWIN
sighandler_t last_sigill_handler, last_sigbus_handler;
last_sigill_handler = signal(SIGILL, &uri_signal_handler); // illegal instruction
last_sigbus_handler = signal(SIGBUS, &uri_signal_handler);
if (setjmp(return_to_normalize))
{
// Issue: external library crashed via signal
// If you encountered this, please try to figure out what's wrong:
// 1. Verify that library's input is 'sane'
// 2. Check if we have an NSexception to work with (unlikely)
// 3. See if passing same string causes exception to repeat
//
// Crash happens at uriNormalizeSyntaxExA
// Warning!!! This does not properly unwind stack,
// if this can be handled by NSexception, it needs to be remade
llassert(0);
LL_WARNS() << "Uriparser crashed with " << sLastSignal << " , while processing: " << mNormalizedUri << LL_ENDL;
signal(SIGILL, last_sigill_handler);
signal(SIGBUS, last_sigbus_handler);
return 1;
}
#endif
mRes = uriNormalizeSyntaxExA(&mUri, URI_NORMALIZE_SCHEME | URI_NORMALIZE_HOST);
#if LL_DARWIN
signal(SIGILL, last_sigill_handler);
signal(SIGBUS, last_sigbus_handler);
#endif
if (!mRes)
{
S32 chars_required;
mRes = uriToStringCharsRequiredA(&mUri, &chars_required);
if (!mRes)
{
chars_required++;
std::vector<char> label_buf(chars_required);
mRes = uriToStringA(&label_buf[0], &mUri, chars_required, NULL);
if (!mRes)
{
mNormalizedUri = &label_buf[mTmpScheme ? 7 : 0];
mTmpScheme = false;
}
}
}
mUri.normalize_scheme().normalize_authority();
mNormalizedUri = mUri.buffer().substr(mTmpScheme ? 7 : 0);
mTmpScheme = false;
}
if(mTmpScheme && mNormalizedUri.size() > 7)
@ -302,7 +228,7 @@ bool LLUriParser::test() const
return uri == mNormalizedUri;
}
const char * LLUriParser::normalizedUri() const
const std::string& LLUriParser::normalizedUri() const
{
return mNormalizedUri.c_str();
return mNormalizedUri;
}

View File

@ -30,7 +30,7 @@
#define LL_LLURIPARSER_H
#include <string>
#include "uriparser/Uri.h"
#include "boost/url.hpp"
class LL_COMMON_API LLUriParser
{
@ -38,36 +38,35 @@ public:
LLUriParser(const std::string& u);
~LLUriParser();
const char * scheme() const;
void sheme (const std::string& s);
const std::string& scheme() const;
void scheme (const std::string& s);
const char * port() const;
const std::string& port() const;
void port (const std::string& s);
const char * host() const;
const std::string& host() const;
void host (const std::string& s);
const char * path() const;
const std::string& path() const;
void path (const std::string& s);
const char * query() const;
const std::string& query() const;
void query (const std::string& s);
const char * fragment() const;
const std::string& fragment() const;
void fragment (const std::string& s);
const char * normalizedUri() const;
const std::string& normalizedUri() const;
void extractParts();
void glue(std::string& uri) const;
void glueFirst(std::string& uri, bool use_scheme = true) const;
void glueSecond(std::string& uri) const;
bool test() const;
S32 normalize();
bool normalize();
private:
S32 parse();
void textRangeToString(UriTextRangeA& textRange, std::string& str);
bool parse();
std::string mScheme;
std::string mHost;
std::string mPort;
@ -76,9 +75,9 @@ private:
std::string mFragment;
std::string mNormalizedUri;
UriUriA mUri;
boost::url mUri;
S32 mRes;
bool mRes;
bool mTmpScheme;
bool mNormalizedTmp;
};

View File

@ -81,13 +81,13 @@ class TestEventThrottle: public LLEventThrottleBase
public:
TestEventThrottle(F32 interval):
LLEventThrottleBase(interval),
mAlarmRemaining(-1),
mTimerRemaining(-1)
mAlarmRemaining(-1.f),
mTimerRemaining(-1.f)
{}
TestEventThrottle(LLEventPump& source, F32 interval):
LLEventThrottleBase(source, interval),
mAlarmRemaining(-1),
mTimerRemaining(-1)
mAlarmRemaining(-1.f),
mTimerRemaining(-1.f)
{}
/*----- implementation of LLEventThrottleBase timing functionality -----*/
@ -100,12 +100,12 @@ public:
virtual bool alarmRunning() const /*override*/
{
// decrementing to exactly 0 should mean the alarm fires
return mAlarmRemaining > 0;
return mAlarmRemaining > 0.f;
}
virtual void alarmCancel() /*override*/
{
mAlarmRemaining = -1;
mAlarmRemaining = -1.f;
}
virtual void timerSet(F32 interval) /*override*/
@ -116,7 +116,7 @@ public:
virtual F32 timerGetRemaining() const /*override*/
{
// LLTimer.getRemainingTimeF32() never returns negative; 0.0 means expired
return (mTimerRemaining > 0.0)? mTimerRemaining : 0.0;
return (mTimerRemaining > 0.0f)? mTimerRemaining : 0.0f;
}
/*------------------- methods for manipulating time --------------------*/

View File

@ -1809,7 +1809,7 @@ namespace tut
std::string q("\"");
std::string qPYTHON(q + PYTHON + q);
std::string qscript(q + scriptfile.getName() + q);
int rc = _spawnl(_P_WAIT, PYTHON.c_str(), qPYTHON.c_str(), qscript.c_str(),
int rc = (int)_spawnl(_P_WAIT, PYTHON.c_str(), qPYTHON.c_str(), qscript.c_str(),
std::forward<ARGS>(args)..., NULL);
if (rc == -1)
{

View File

@ -32,6 +32,10 @@
#include "lltracerecording.h"
#include "../test/lltut.h"
#ifdef LL_WINDOWS
#pragma warning(disable : 4244) // possible loss of data on conversions
#endif
namespace LLUnits
{
// using powers of 2 to allow strict floating point equality

View File

@ -262,7 +262,7 @@ namespace tut
F32 float_val = quatloos_implicit;
ensure("implicit units convert implicitly to regular values", float_val == 16);
S32 int_val = quatloos_implicit;
S32 int_val = (S32)quatloos_implicit;
ensure("implicit units convert implicitly to regular values", int_val == 16);
// conversion of implicits

View File

@ -155,10 +155,7 @@ if (DARWIN)
# for portability. This operation is Darwin-specific. We can count on the
# 'cp' command.
set(copy_dylibs
libapr-1.0.dylib
libaprutil-1.0.dylib
libnghttp2*.dylib
liburiparser*.dylib
${EXPAT_COPY}
)

View File

@ -106,17 +106,17 @@ namespace LLCore
// Maxium number of policy classes that can be defined.
// *TODO: Currently limited to the default class + 1, extend.
// (TSN: should this be more dynamically sized. Is there a reason to hard limit the number of policies?)
const int HTTP_POLICY_CLASS_LIMIT = 32;
constexpr int HTTP_POLICY_CLASS_LIMIT = 32;
// Debug/informational tracing. Used both
// as a global option and in per-request traces.
const int HTTP_TRACE_OFF = 0;
const int HTTP_TRACE_LOW = 1;
const int HTTP_TRACE_CURL_HEADERS = 2;
const int HTTP_TRACE_CURL_BODIES = 3;
constexpr int HTTP_TRACE_OFF = 0;
constexpr int HTTP_TRACE_LOW = 1;
constexpr int HTTP_TRACE_CURL_HEADERS = 2;
constexpr int HTTP_TRACE_CURL_BODIES = 3;
const int HTTP_TRACE_MIN = HTTP_TRACE_OFF;
const int HTTP_TRACE_MAX = HTTP_TRACE_CURL_BODIES;
constexpr int HTTP_TRACE_MIN = HTTP_TRACE_OFF;
constexpr int HTTP_TRACE_MAX = HTTP_TRACE_CURL_BODIES;
// Request retry limits
//
@ -127,41 +127,41 @@ const int HTTP_TRACE_MAX = HTTP_TRACE_CURL_BODIES;
// We want to span a few windows to allow transport to slow
// after onset of the throttles and then recover without a final
// failure. Other systems may need other constants.
const int HTTP_RETRY_COUNT_DEFAULT = 5;
const int HTTP_RETRY_COUNT_MIN = 0;
const int HTTP_RETRY_COUNT_MAX = 100;
const HttpTime HTTP_RETRY_BACKOFF_MIN_DEFAULT = 1E6L; // 1 sec
const HttpTime HTTP_RETRY_BACKOFF_MAX_DEFAULT = 5E6L; // 5 sec
const HttpTime HTTP_RETRY_BACKOFF_MAX = 20E6L; // 20 sec
constexpr int HTTP_RETRY_COUNT_DEFAULT = 5;
constexpr int HTTP_RETRY_COUNT_MIN = 0;
constexpr int HTTP_RETRY_COUNT_MAX = 100;
constexpr HttpTime HTTP_RETRY_BACKOFF_MIN_DEFAULT = 1000000UL; // 1 sec
constexpr HttpTime HTTP_RETRY_BACKOFF_MAX_DEFAULT = 50000006UL; // 5 sec
constexpr HttpTime HTTP_RETRY_BACKOFF_MAX = 20000000UL; // 20 sec
const int HTTP_REDIRECTS_DEFAULT = 10;
constexpr int HTTP_REDIRECTS_DEFAULT = 10;
// Timeout value used for both connect and protocol exchange.
// Retries and time-on-queue are not included and aren't
// accounted for.
const long HTTP_REQUEST_TIMEOUT_DEFAULT = 30L;
const long HTTP_REQUEST_XFER_TIMEOUT_DEFAULT = 0L;
const long HTTP_REQUEST_TIMEOUT_MIN = 0L;
const long HTTP_REQUEST_TIMEOUT_MAX = 3600L;
constexpr long HTTP_REQUEST_TIMEOUT_DEFAULT = 30L;
constexpr long HTTP_REQUEST_XFER_TIMEOUT_DEFAULT = 0L;
constexpr long HTTP_REQUEST_TIMEOUT_MIN = 0L;
constexpr long HTTP_REQUEST_TIMEOUT_MAX = 3600L;
// Limits on connection counts
const int HTTP_CONNECTION_LIMIT_DEFAULT = 8;
const int HTTP_CONNECTION_LIMIT_MIN = 1;
const int HTTP_CONNECTION_LIMIT_MAX = 256;
constexpr int HTTP_CONNECTION_LIMIT_DEFAULT = 8;
constexpr int HTTP_CONNECTION_LIMIT_MIN = 1;
constexpr int HTTP_CONNECTION_LIMIT_MAX = 256;
// Pipelining limits
const long HTTP_PIPELINING_DEFAULT = 0L;
const long HTTP_PIPELINING_MAX = 20L;
constexpr long HTTP_PIPELINING_DEFAULT = 0L;
constexpr long HTTP_PIPELINING_MAX = 20L;
// Miscellaneous defaults
const bool HTTP_USE_RETRY_AFTER_DEFAULT = true;
const long HTTP_THROTTLE_RATE_DEFAULT = 0L;
constexpr bool HTTP_USE_RETRY_AFTER_DEFAULT = true;
constexpr long HTTP_THROTTLE_RATE_DEFAULT = 0L;
// Tuning parameters
// Time worker thread sleeps after a pass through the
// request, ready and active queues.
const int HTTP_SERVICE_LOOP_SLEEP_NORMAL_MS = 2;
constexpr int HTTP_SERVICE_LOOP_SLEEP_NORMAL_MS = 2;
// Block allocation size (a tuning parameter) is found
// in bufferarray.h.

View File

@ -47,12 +47,12 @@ namespace LLCore
void recordDataDown(size_t bytes)
{
mDataDown.push(bytes);
mDataDown.push((F32)bytes);
}
void recordDataUp(size_t bytes)
{
mDataUp.push(bytes);
mDataUp.push((F32)bytes);
}
void recordHTTPRequest() { ++mRequests; }

View File

@ -45,11 +45,10 @@
bool LLCrashLock::isProcessAlive(U32 pid, const std::string& pname)
{
std::wstring wpname;
wpname = std::wstring(pname.begin(), pname.end());
std::wstring wpname = ll_convert_string_to_wide(pname);
HANDLE snapshot;
PROCESSENTRY32 pe32;
PROCESSENTRY32 pe32{};
bool matched = false;
@ -65,7 +64,7 @@ bool LLCrashLock::isProcessAlive(U32 pid, const std::string& pname)
{
do {
std::wstring wexecname = pe32.szExeFile;
std::string execname = std::string(wexecname.begin(), wexecname.end());
std::string execname = ll_convert_wide_to_string(wexecname);
if (!wpname.compare(pe32.szExeFile))
{
if (pid == (U32)pe32.th32ProcessID)

View File

@ -201,15 +201,15 @@ U32 LLDir::deleteDirAndContents(const std::string& dir_name)
boost::filesystem::path dir_path(dir_name);
#endif
if (boost::filesystem::exists (dir_path))
if (boost::filesystem::exists(dir_path))
{
if (!boost::filesystem::is_empty (dir_path))
if (!boost::filesystem::is_empty(dir_path))
{ // Directory has content
num_deleted = boost::filesystem::remove_all (dir_path);
num_deleted = (U32)boost::filesystem::remove_all(dir_path);
}
else
{ // Directory is empty
boost::filesystem::remove (dir_path);
boost::filesystem::remove(dir_path);
}
}
}

View File

@ -325,8 +325,8 @@ const std::string LLDiskCache::getCacheInfo()
{
std::ostringstream cache_info;
F32 max_in_mb = (F32)mMaxSizeBytes / (1024.0 * 1024.0);
F32 percent_used = ((F32)dirFileSize(mCacheDir) / (F32)mMaxSizeBytes) * 100.0;
F32 max_in_mb = (F32)mMaxSizeBytes / (1024.0f * 1024.0f);
F32 percent_used = ((F32)dirFileSize(mCacheDir) / (F32)mMaxSizeBytes) * 100.0f;
cache_info << std::fixed;
cache_info << std::setprecision(1);

View File

@ -79,6 +79,7 @@ LLFileSystem::~LLFileSystem()
// static
bool LLFileSystem::getExists(const LLUUID& file_id, const LLAssetType::EType file_type)
{
LL_PROFILE_ZONE_SCOPED;
std::string id_str;
file_id.toString(id_str);
const std::string extra_info = "";
@ -147,7 +148,7 @@ S32 LLFileSystem::getFileSize(const LLUUID& file_id, const LLAssetType::EType fi
if (file.is_open())
{
file.seekg(0, std::ios::end);
file_size = file.tellg();
file_size = (S32)file.tellg();
}
return file_size;
@ -175,7 +176,7 @@ bool LLFileSystem::read(U8* buffer, S32 bytes)
}
else
{
mBytesRead = file.gcount();
mBytesRead = (S32)file.gcount();
}
file.close();
@ -216,7 +217,7 @@ bool LLFileSystem::write(const U8* buffer, S32 bytes)
{
ofs.write((const char*)buffer, bytes);
mPosition = ofs.tellp(); // <FS:Ansariel> Fix asset caching
mPosition = (S32)ofs.tellp(); // <FS:Ansariel> Fix asset caching
success = true;
}

View File

@ -32,37 +32,37 @@
#include "llpointer.h"
#include "lltrace.h"
const S32 MIN_IMAGE_MIP = 2; // 4x4, only used for expand/contract power of 2
const S32 MAX_IMAGE_MIP = 12; // 4096x4096
constexpr S32 MIN_IMAGE_MIP = 2; // 4x4, only used for expand/contract power of 2
constexpr S32 MAX_IMAGE_MIP = 12; // 4096x4096
// *TODO : Use MAX_IMAGE_MIP as max discard level and modify j2c management so that the number
// of levels is read from the header's file, not inferred from its size.
const S32 MAX_DISCARD_LEVEL = 5;
constexpr S32 MAX_DISCARD_LEVEL = 5;
// JPEG2000 size constraints
// Those are declared here as they are germane to other image constraints used in the viewer
// and declared right here. Some come from the JPEG2000 spec, some conventions specific to SL.
const S32 MAX_DECOMPOSITION_LEVELS = 32; // Number of decomposition levels cannot exceed 32 according to jpeg2000 spec
const S32 MIN_DECOMPOSITION_LEVELS = 5; // the SL viewer will *crash* trying to decode images with fewer than 5 decomposition levels (unless image is small that is)
const S32 MAX_PRECINCT_SIZE = 4096; // No reason to be bigger than MAX_IMAGE_SIZE
const S32 MIN_PRECINCT_SIZE = 4; // Can't be smaller than MIN_BLOCK_SIZE
const S32 MAX_BLOCK_SIZE = 64; // Max total block size is 4096, hence 64x64 when using square blocks
const S32 MIN_BLOCK_SIZE = 4; // Min block dim is 4 according to jpeg2000 spec
const S32 MIN_LAYER_SIZE = 2000; // Size of the first quality layer (after header). Must be > to FIRST_PACKET_SIZE!!
const S32 MAX_NB_LAYERS = 64; // Max number of layers we'll entertain in SL (practical limit)
constexpr S32 MAX_DECOMPOSITION_LEVELS = 32; // Number of decomposition levels cannot exceed 32 according to jpeg2000 spec
constexpr S32 MIN_DECOMPOSITION_LEVELS = 5; // the SL viewer will *crash* trying to decode images with fewer than 5 decomposition levels (unless image is small that is)
constexpr S32 MAX_PRECINCT_SIZE = 4096; // No reason to be bigger than MAX_IMAGE_SIZE
constexpr S32 MIN_PRECINCT_SIZE = 4; // Can't be smaller than MIN_BLOCK_SIZE
constexpr S32 MAX_BLOCK_SIZE = 64; // Max total block size is 4096, hence 64x64 when using square blocks
constexpr S32 MIN_BLOCK_SIZE = 4; // Min block dim is 4 according to jpeg2000 spec
constexpr S32 MIN_LAYER_SIZE = 2000; // Size of the first quality layer (after header). Must be > to FIRST_PACKET_SIZE!!
constexpr S32 MAX_NB_LAYERS = 64; // Max number of layers we'll entertain in SL (practical limit)
const S32 MIN_IMAGE_SIZE = (1<<MIN_IMAGE_MIP); // 4, only used for expand/contract power of 2
const S32 MAX_IMAGE_SIZE = (1<<MAX_IMAGE_MIP); // 4096
const S32 MIN_IMAGE_AREA = MIN_IMAGE_SIZE * MIN_IMAGE_SIZE;
const S32 MAX_IMAGE_AREA = MAX_IMAGE_SIZE * MAX_IMAGE_SIZE;
const S32 MAX_IMAGE_COMPONENTS = 8;
const S32 MAX_IMAGE_DATA_SIZE = MAX_IMAGE_AREA * MAX_IMAGE_COMPONENTS; //4096 * 4096 * 8 = 128 MB
constexpr S32 MIN_IMAGE_SIZE = (1<<MIN_IMAGE_MIP); // 4, only used for expand/contract power of 2
constexpr S32 MAX_IMAGE_SIZE = (1<<MAX_IMAGE_MIP); // 4096
constexpr S32 MIN_IMAGE_AREA = MIN_IMAGE_SIZE * MIN_IMAGE_SIZE;
constexpr S32 MAX_IMAGE_AREA = MAX_IMAGE_SIZE * MAX_IMAGE_SIZE;
constexpr S32 MAX_IMAGE_COMPONENTS = 8;
constexpr S32 MAX_IMAGE_DATA_SIZE = MAX_IMAGE_AREA * MAX_IMAGE_COMPONENTS; //4096 * 4096 * 8 = 128 MB
// Note! These CANNOT be changed without modifying simulator code
// *TODO: change both to 1024 when SIM texture fetching is deprecated
const S32 FIRST_PACKET_SIZE = 600;
const S32 MAX_IMG_PACKET_SIZE = 1000;
const S32 HTTP_PACKET_SIZE = 1496;
constexpr S32 FIRST_PACKET_SIZE = 600;
constexpr S32 MAX_IMG_PACKET_SIZE = 1000;
constexpr S32 HTTP_PACKET_SIZE = 1496;
// Base classes for images.
// There are two major parts for the image:

View File

@ -253,7 +253,7 @@ void LLImageFilter::executeFilter(LLPointer<LLImageRaw> raw_image)
bool abs_value = (mFilterData[i][index++].asReal() > 0.0);
for (S32 k = 0; k < NUM_VALUES_IN_MAT3; k++)
for (S32 j = 0; j < NUM_VALUES_IN_MAT3; j++)
kernel.mMatrix[k][j] = mFilterData[i][index++].asReal();
kernel.mMatrix[k][j] = (F32)mFilterData[i][index++].asReal();
convolve(kernel,normalize,abs_value);
}
else if (filter_name == "colortransform")
@ -262,7 +262,7 @@ void LLImageFilter::executeFilter(LLPointer<LLImageRaw> raw_image)
S32 index = 1;
for (S32 k = 0; k < NUM_VALUES_IN_MAT3; k++)
for (S32 j = 0; j < NUM_VALUES_IN_MAT3; j++)
transform.mMatrix[k][j] = mFilterData[i][index++].asReal();
transform.mMatrix[k][j] = (F32)mFilterData[i][index++].asReal();
transform.transpose();
colorTransform(transform);
}
@ -279,32 +279,32 @@ void LLImageFilter::executeFilter(LLPointer<LLImageRaw> raw_image)
void LLImageFilter::blendStencil(F32 alpha, U8* pixel, U8 red, U8 green, U8 blue)
{
F32 inv_alpha = 1.0 - alpha;
F32 inv_alpha = 1.0f - alpha;
switch (mStencilBlendMode)
{
case STENCIL_BLEND_MODE_BLEND:
// Classic blend of incoming color with the background image
pixel[VRED] = inv_alpha * pixel[VRED] + alpha * red;
pixel[VGREEN] = inv_alpha * pixel[VGREEN] + alpha * green;
pixel[VBLUE] = inv_alpha * pixel[VBLUE] + alpha * blue;
pixel[VRED] = (U8)(inv_alpha * pixel[VRED] + alpha * red);
pixel[VGREEN] = (U8)(inv_alpha * pixel[VGREEN] + alpha * green);
pixel[VBLUE] = (U8)(inv_alpha * pixel[VBLUE] + alpha * blue);
break;
case STENCIL_BLEND_MODE_ADD:
// Add incoming color to the background image
pixel[VRED] = llclampb(pixel[VRED] + alpha * red);
pixel[VGREEN] = llclampb(pixel[VGREEN] + alpha * green);
pixel[VBLUE] = llclampb(pixel[VBLUE] + alpha * blue);
pixel[VRED] = (U8)llclampb(pixel[VRED] + alpha * red);
pixel[VGREEN] = (U8)llclampb(pixel[VGREEN] + alpha * green);
pixel[VBLUE] = (U8)llclampb(pixel[VBLUE] + alpha * blue);
break;
case STENCIL_BLEND_MODE_ABACK:
// Add back background image to the incoming color
pixel[VRED] = llclampb(inv_alpha * pixel[VRED] + red);
pixel[VGREEN] = llclampb(inv_alpha * pixel[VGREEN] + green);
pixel[VBLUE] = llclampb(inv_alpha * pixel[VBLUE] + blue);
pixel[VRED] = (U8)llclampb(inv_alpha * pixel[VRED] + red);
pixel[VGREEN] = (U8)llclampb(inv_alpha * pixel[VGREEN] + green);
pixel[VBLUE] = (U8)llclampb(inv_alpha * pixel[VBLUE] + blue);
break;
case STENCIL_BLEND_MODE_FADE:
// Fade incoming color to black
pixel[VRED] = alpha * red;
pixel[VGREEN] = alpha * green;
pixel[VBLUE] = alpha * blue;
pixel[VRED] = (U8)(alpha * red);
pixel[VGREEN] = (U8)(alpha * green);
pixel[VBLUE] = (U8)(alpha * blue);
break;
}
}
@ -348,7 +348,7 @@ void LLImageFilter::colorTransform(const LLMatrix3 &transform)
dst.clamp(0.0f,255.0f);
// Blend result
blendStencil(getStencilAlpha(i,j), dst_data, dst.mV[VRED], dst.mV[VGREEN], dst.mV[VBLUE]);
blendStencil(getStencilAlpha(i,j), dst_data, (U8)dst.mV[VRED], (U8)dst.mV[VGREEN], (U8)dst.mV[VBLUE]);
dst_data += components;
}
}
@ -463,7 +463,7 @@ void LLImageFilter::convolve(const LLMatrix3 &kernel, bool normalize, bool abs_v
dst.clamp(0.0f,255.0f);
// Blend result
blendStencil(getStencilAlpha(i,j), dst_data, dst.mV[VRED], dst.mV[VGREEN], dst.mV[VBLUE]);
blendStencil(getStencilAlpha(i,j), dst_data, (U8)dst.mV[VRED], (U8)dst.mV[VGREEN], (U8)dst.mV[VBLUE]);
// Next pixel
dst_data += components;
@ -499,7 +499,7 @@ void LLImageFilter::filterScreen(EScreenMode mode, const F32 wave_length, const
S32 width = mImage->getWidth();
S32 height = mImage->getHeight();
F32 wave_length_pixels = wave_length * (F32)(height) / 2.0;
F32 wave_length_pixels = wave_length * (F32)(height) / 2.0f;
F32 sin = sinf(angle*DEG_TO_RAD);
F32 cos = cosf(angle*DEG_TO_RAD);
@ -507,7 +507,7 @@ void LLImageFilter::filterScreen(EScreenMode mode, const F32 wave_length, const
U8 gamma[256];
for (S32 i = 0; i < 256; i++)
{
F32 gamma_i = llclampf((float)(powf((float)(i)/255.0,1.0/4.0)));
F32 gamma_i = llclampf((float)(powf((float)(i)/255.0f,1.0f/4.0f)));
gamma[i] = (U8)(255.0 * gamma_i);
}
@ -525,11 +525,11 @@ void LLImageFilter::filterScreen(EScreenMode mode, const F32 wave_length, const
case SCREEN_MODE_2DSINE:
di = cos*i + sin*j;
dj = -sin*i + cos*j;
value = (sinf(2*F_PI*di/wave_length_pixels)*sinf(2*F_PI*dj/wave_length_pixels)+1.0)*255.0/2.0;
value = (sinf(2*F_PI*di/wave_length_pixels)*sinf(2*F_PI*dj/wave_length_pixels)+1.0f)*255.0f/2.0f;
break;
case SCREEN_MODE_LINE:
dj = sin*i - cos*j;
value = (sinf(2*F_PI*dj/wave_length_pixels)+1.0)*255.0/2.0;
value = (sinf(2*F_PI*dj/wave_length_pixels)+1.0f)*255.0f/2.0f;
break;
}
U8 dst_value = (dst_data[VRED] >= (U8)(value) ? gamma[dst_data[VRED] - (U8)(value)] : 0);
@ -556,16 +556,16 @@ void LLImageFilter::setStencil(EStencilShape shape, EStencilBlendMode mode, F32
mStencilCenterX = (S32)(mImage->getWidth() + params[0] * (F32)(mImage->getHeight()))/2;
mStencilCenterY = (S32)(mImage->getHeight() + params[1] * (F32)(mImage->getHeight()))/2;
mStencilWidth = (S32)(params[2] * (F32)(mImage->getHeight()))/2;
mStencilGamma = (params[3] <= 0.0 ? 1.0 : params[3]);
mStencilGamma = (params[3] <= 0.0f ? 1.0f : params[3]);
mStencilWavelength = (params[0] <= 0.0 ? 10.0 : params[0] * (F32)(mImage->getHeight()) / 2.0);
mStencilWavelength = (params[0] <= 0.0f ? 10.0f : params[0] * (F32)(mImage->getHeight()) / 2.0f);
mStencilSine = sinf(params[1]*DEG_TO_RAD);
mStencilCosine = cosf(params[1]*DEG_TO_RAD);
mStencilStartX = ((F32)(mImage->getWidth()) + params[0] * (F32)(mImage->getHeight()))/2.0;
mStencilStartY = ((F32)(mImage->getHeight()) + params[1] * (F32)(mImage->getHeight()))/2.0;
F32 end_x = ((F32)(mImage->getWidth()) + params[2] * (F32)(mImage->getHeight()))/2.0;
F32 end_y = ((F32)(mImage->getHeight()) + params[3] * (F32)(mImage->getHeight()))/2.0;
mStencilStartX = ((F32)(mImage->getWidth()) + params[0] * (F32)(mImage->getHeight()))/2.0f;
mStencilStartY = ((F32)(mImage->getHeight()) + params[1] * (F32)(mImage->getHeight()))/2.0f;
F32 end_x = ((F32)(mImage->getWidth()) + params[2] * (F32)(mImage->getHeight()))/2.0f;
F32 end_y = ((F32)(mImage->getHeight()) + params[3] * (F32)(mImage->getHeight()))/2.0f;
mStencilGradX = end_x - mStencilStartX;
mStencilGradY = end_y - mStencilStartY;
mStencilGradN = mStencilGradX*mStencilGradX + mStencilGradY*mStencilGradY;
@ -578,14 +578,14 @@ F32 LLImageFilter::getStencilAlpha(S32 i, S32 j)
{
// alpha is a modified gaussian value, with a center and fading in a circular pattern toward the edges
// The gamma parameter controls the intensity of the drop down from alpha 1.0 (center) to 0.0
F32 d_center_square = (i - mStencilCenterX)*(i - mStencilCenterX) + (j - mStencilCenterY)*(j - mStencilCenterY);
F32 d_center_square = (F32)((i - mStencilCenterX)*(i - mStencilCenterX) + (j - mStencilCenterY)*(j - mStencilCenterY));
alpha = powf(F_E, -(powf((d_center_square/(mStencilWidth*mStencilWidth)),mStencilGamma)/2.0f));
}
else if (mStencilShape == STENCIL_SHAPE_SCAN_LINES)
{
// alpha varies according to a squared sine function.
F32 d = mStencilSine*i - mStencilCosine*j;
alpha = (sinf(2*F_PI*d/mStencilWavelength) > 0.0 ? 1.0 : 0.0);
alpha = (sinf(2*F_PI*d/mStencilWavelength) > 0.0f ? 1.0f : 0.0f);
}
else if (mStencilShape == STENCIL_SHAPE_GRADIENT)
{
@ -756,11 +756,11 @@ void LLImageFilter::filterGamma(F32 gamma, const LLColor3& alpha)
for (S32 i = 0; i < 256; i++)
{
F32 gamma_i = llclampf((float)(powf((float)(i)/255.0,1.0/gamma)));
F32 gamma_i = llclampf((float)(powf((float)(i)/255.0f,1.0f/gamma)));
// Blend in with alpha values
gamma_red_lut[i] = (U8)((1.0 - alpha.mV[0]) * (float)(i) + alpha.mV[0] * 255.0 * gamma_i);
gamma_green_lut[i] = (U8)((1.0 - alpha.mV[1]) * (float)(i) + alpha.mV[1] * 255.0 * gamma_i);
gamma_blue_lut[i] = (U8)((1.0 - alpha.mV[2]) * (float)(i) + alpha.mV[2] * 255.0 * gamma_i);
gamma_red_lut[i] = (U8)((1.0f - alpha.mV[0]) * (float)(i) + alpha.mV[0] * 255.0f * gamma_i);
gamma_green_lut[i] = (U8)((1.0f - alpha.mV[1]) * (float)(i) + alpha.mV[1] * 255.0f * gamma_i);
gamma_blue_lut[i] = (U8)((1.0f - alpha.mV[2]) * (float)(i) + alpha.mV[2] * 255.0f * gamma_i);
}
colorCorrect(gamma_red_lut,gamma_green_lut,gamma_blue_lut);
@ -808,23 +808,23 @@ void LLImageFilter::filterLinearize(F32 tail, const LLColor3& alpha)
{
U8 value_i = (i < min_v ? 0 : 255);
// Blend in with alpha values
linear_red_lut[i] = (U8)((1.0 - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
linear_green_lut[i] = (U8)((1.0 - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
linear_blue_lut[i] = (U8)((1.0 - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
linear_red_lut[i] = (U8)((1.0f - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
linear_green_lut[i] = (U8)((1.0f - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
linear_blue_lut[i] = (U8)((1.0f - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
}
}
else
{
// Linearize between min and max
F32 slope = 255.0 / (F32)(max_v - min_v);
F32 slope = 255.0f / (F32)(max_v - min_v);
F32 translate = -min_v * slope;
for (S32 i = 0; i < 256; i++)
{
U8 value_i = (U8)(llclampb((S32)(slope*i + translate)));
// Blend in with alpha values
linear_red_lut[i] = (U8)((1.0 - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
linear_green_lut[i] = (U8)((1.0 - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
linear_blue_lut[i] = (U8)((1.0 - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
linear_red_lut[i] = (U8)((1.0f - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
linear_green_lut[i] = (U8)((1.0f - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
linear_blue_lut[i] = (U8)((1.0f - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
}
}
@ -863,9 +863,9 @@ void LLImageFilter::filterEqualize(S32 nb_classes, const LLColor3& alpha)
for (S32 i = 0; i < 256; i++)
{
// Blend in current_value with alpha values
equalize_red_lut[i] = (U8)((1.0 - alpha.mV[0]) * (float)(i) + alpha.mV[0] * current_value);
equalize_green_lut[i] = (U8)((1.0 - alpha.mV[1]) * (float)(i) + alpha.mV[1] * current_value);
equalize_blue_lut[i] = (U8)((1.0 - alpha.mV[2]) * (float)(i) + alpha.mV[2] * current_value);
equalize_red_lut[i] = (U8)((1.0f - alpha.mV[0]) * (float)(i) + alpha.mV[0] * current_value);
equalize_green_lut[i] = (U8)((1.0f - alpha.mV[1]) * (float)(i) + alpha.mV[1] * current_value);
equalize_blue_lut[i] = (U8)((1.0f - alpha.mV[2]) * (float)(i) + alpha.mV[2] * current_value);
if (cumulated_histo[i] >= current_count)
{
current_count += delta_count;
@ -884,15 +884,15 @@ void LLImageFilter::filterColorize(const LLColor3& color, const LLColor3& alpha)
U8 green_lut[256];
U8 blue_lut[256];
F32 red_composite = 255.0 * alpha.mV[0] * color.mV[0];
F32 green_composite = 255.0 * alpha.mV[1] * color.mV[1];
F32 blue_composite = 255.0 * alpha.mV[2] * color.mV[2];
F32 red_composite = 255.0f * alpha.mV[0] * color.mV[0];
F32 green_composite = 255.0f * alpha.mV[1] * color.mV[1];
F32 blue_composite = 255.0f * alpha.mV[2] * color.mV[2];
for (S32 i = 0; i < 256; i++)
{
red_lut[i] = (U8)(llclampb((S32)((1.0 - alpha.mV[0]) * (F32)(i) + red_composite)));
green_lut[i] = (U8)(llclampb((S32)((1.0 - alpha.mV[1]) * (F32)(i) + green_composite)));
blue_lut[i] = (U8)(llclampb((S32)((1.0 - alpha.mV[2]) * (F32)(i) + blue_composite)));
red_lut[i] = (U8)(llclampb((S32)((1.0f - alpha.mV[0]) * (F32)(i) + red_composite)));
green_lut[i] = (U8)(llclampb((S32)((1.0f - alpha.mV[1]) * (F32)(i) + green_composite)));
blue_lut[i] = (U8)(llclampb((S32)((1.0f - alpha.mV[2]) * (F32)(i) + blue_composite)));
}
colorCorrect(red_lut,green_lut,blue_lut);
@ -904,15 +904,15 @@ void LLImageFilter::filterContrast(F32 slope, const LLColor3& alpha)
U8 contrast_green_lut[256];
U8 contrast_blue_lut[256];
F32 translate = 128.0 * (1.0 - slope);
F32 translate = 128.0f * (1.0f - slope);
for (S32 i = 0; i < 256; i++)
{
U8 value_i = (U8)(llclampb((S32)(slope*i + translate)));
// Blend in with alpha values
contrast_red_lut[i] = (U8)((1.0 - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
contrast_green_lut[i] = (U8)((1.0 - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
contrast_blue_lut[i] = (U8)((1.0 - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
contrast_red_lut[i] = (U8)((1.0f - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
contrast_green_lut[i] = (U8)((1.0f - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
contrast_blue_lut[i] = (U8)((1.0f - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
}
colorCorrect(contrast_red_lut,contrast_green_lut,contrast_blue_lut);
@ -924,15 +924,15 @@ void LLImageFilter::filterBrightness(F32 add, const LLColor3& alpha)
U8 brightness_green_lut[256];
U8 brightness_blue_lut[256];
S32 add_value = (S32)(add * 255.0);
S32 add_value = (S32)(add * 255.0f);
for (S32 i = 0; i < 256; i++)
{
U8 value_i = (U8)(llclampb(i + add_value));
// Blend in with alpha values
brightness_red_lut[i] = (U8)((1.0 - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
brightness_green_lut[i] = (U8)((1.0 - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
brightness_blue_lut[i] = (U8)((1.0 - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
brightness_red_lut[i] = (U8)((1.0f - alpha.mV[0]) * (float)(i) + alpha.mV[0] * value_i);
brightness_green_lut[i] = (U8)((1.0f - alpha.mV[1]) * (float)(i) + alpha.mV[1] * value_i);
brightness_blue_lut[i] = (U8)((1.0f - alpha.mV[2]) * (float)(i) + alpha.mV[2] * value_i);
}
colorCorrect(brightness_red_lut,brightness_green_lut,brightness_blue_lut);

View File

@ -275,30 +275,24 @@ S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 r
// For details about the equation used here, see https://wiki.lindenlab.com/wiki/THX1138_KDU_Improvements#Byte_Range_Study
// Estimate the number of layers. This is consistent with what's done for j2c encoding in LLImageJ2CKDU::encodeImpl().
constexpr S32 precision = 8; // assumed bitrate per component channel, might change in future for HDR support
constexpr S32 max_components = 4; // assumed the file has four components; three color and alpha
S32 nb_layers = 1;
S32 surface = w*h;
const S32 surface = w*h;
S32 s = 64*64;
S32 totalbytes = (S32)(s * max_components * precision * rate); // first level computed before loop
while (surface > s)
{
if (nb_layers <= (5 - discard_level))
totalbytes += (S32)(s * max_components * precision * rate);
nb_layers++;
s *= 4;
}
F32 layer_factor = 3.0f * (7 - llclamp(nb_layers,1,6));
// Compute w/pow(2,discard_level) and h/pow(2,discard_level)
w >>= discard_level;
h >>= discard_level;
w = llmax(w, 1);
h = llmax(h, 1);
totalbytes /= 8; // to bytes
totalbytes += calcHeaderSizeJ2C(); // header
// Temporary: compute both new and old range and pick one according to the settings TextureNewByteRange
// *TODO: Take the old code out once we have enough tests done
S32 bytes;
S32 new_bytes = (S32) (sqrt((F32)(w*h))*(F32)(comp)*rate*1000.f/layer_factor);
S32 old_bytes = (S32)((F32)(w*h*comp)*rate);
bytes = (LLImage::useNewByteRange() && (new_bytes < old_bytes) ? new_bytes : old_bytes);
bytes = llmax(bytes, calcHeaderSizeJ2C());
return bytes;
return totalbytes;
}
S32 LLImageJ2C::calcHeaderSize()

View File

@ -431,23 +431,20 @@ public:
opj_set_default_encoder_parameters(&parameters);
parameters.cod_format = OPJ_CODEC_J2K;
parameters.cp_disto_alloc = 1;
parameters.max_cs_size = (1 << 15);
if (reversible)
{
parameters.max_cs_size = 0; // do not limit size for reversible compression
parameters.irreversible = 0; // should be the default, but, just in case
parameters.tcp_numlayers = 1;
parameters.tcp_rates[0] = 1.0f;
/* documentation seems to be wrong, should be 0.0f for lossless, not 1.0f
see https://github.com/uclouvain/openjpeg/blob/39e8c50a2f9bdcf36810ee3d41bcbf1cc78968ae/src/lib/openjp2/j2k.c#L7755
*/
parameters.tcp_rates[0] = 0.0f;
}
else
{
parameters.tcp_numlayers = 5;
parameters.tcp_rates[0] = 1920.0f;
parameters.tcp_rates[1] = 960.0f;
parameters.tcp_rates[2] = 480.0f;
parameters.tcp_rates[3] = 120.0f;
parameters.tcp_rates[4] = 30.0f;
parameters.irreversible = 1;
parameters.tcp_mct = 1;
}
if (comment_text)
@ -501,6 +498,50 @@ public:
parameters.prog_order = OPJ_RLCP;
parameters.cp_disto_alloc = 1;
// if not lossless compression, computes tcp_numlayers and max_cs_size depending on the image dimensions
if( parameters.irreversible ) {
// computes a number of layers
U32 surface = rawImageIn.getWidth() * rawImageIn.getHeight();
U32 nb_layers = 1;
U32 s = 64*64;
while (surface > s)
{
nb_layers++;
s *= 4;
}
nb_layers = llclamp(nb_layers, 1, 6);
parameters.tcp_numlayers = nb_layers;
parameters.tcp_rates[nb_layers - 1] = (U32)(1.f / DEFAULT_COMPRESSION_RATE); // 1:8 by default
// for each subsequent layer, computes its rate and adds surface * numcomps * 1/rate to the max_cs_size
U32 max_cs_size = (U32)(surface * image->numcomps * DEFAULT_COMPRESSION_RATE);
U32 multiplier;
for (int i = nb_layers - 2; i >= 0; i--)
{
if( i == nb_layers - 2 )
{
multiplier = 15;
}
else if( i == nb_layers - 3 )
{
multiplier = 4;
}
else
{
multiplier = 2;
}
parameters.tcp_rates[i] = parameters.tcp_rates[i + 1] * multiplier;
max_cs_size += (U32)(surface * image->numcomps * (1 / parameters.tcp_rates[i]));
}
//ensure that we have at least a minimal size
max_cs_size = llmax(max_cs_size, (U32)FIRST_PACKET_SIZE);
parameters.max_cs_size = max_cs_size;
}
if (!opj_setup_encoder(encoder, &parameters, image))
{
return false;
@ -557,7 +598,7 @@ public:
{
// "append" (set) the data we "streamed" (memcopied) for writing to the formatted image
// with side-effect of setting the actually encoded size to same
compressedImageOut.allocateData(offset);
compressedImageOut.allocateData((S32)offset);
memcpy(compressedImageOut.getData(), buffer, offset);
compressedImageOut.updateData(); // update width, height etc from header
}

View File

@ -1268,7 +1268,7 @@ void LLParcel::setExperienceKeyType( const LLUUID& experience_key, U32 type )
U32 LLParcel::countExperienceKeyType( U32 type )
{
return std::count_if(
return (U32)std::count_if(
boost::begin(mExperienceKeys | boost::adaptors::map_values),
boost::end(mExperienceKeys | boost::adaptors::map_values),
[type](U32 key){ return (key == type); });

View File

@ -278,11 +278,11 @@ LLSD LLSettingsBase::interpolateSDValue(const std::string& key_name, const LLSD
{
case LLSD::TypeInteger:
// lerp between the two values rounding the result to the nearest integer.
new_value = LLSD::Integer(llroundf(lerp(value.asReal(), other_value.asReal(), mix)));
new_value = LLSD::Integer(llroundf(lerp((F32)value.asReal(), (F32)other_value.asReal(), (F32)mix)));
break;
case LLSD::TypeReal:
// lerp between the two values.
new_value = LLSD::Real(lerp(value.asReal(), other_value.asReal(), mix));
new_value = LLSD::Real(lerp((F32)value.asReal(), (F32)other_value.asReal(), (F32)mix));
break;
case LLSD::TypeMap:
// deep copy.
@ -297,7 +297,7 @@ LLSD LLSettingsBase::interpolateSDValue(const std::string& key_name, const LLSD
{
LLQuaternion a(value);
LLQuaternion b(other_value);
LLQuaternion q = slerp(mix, a, b);
LLQuaternion q = slerp((F32)mix, a, b);
new_array = q.getValue();
}
else
@ -308,7 +308,7 @@ LLSD LLSettingsBase::interpolateSDValue(const std::string& key_name, const LLSD
for (size_t i = 0; i < len; ++i)
{
new_array[i] = lerp(value[i].asReal(), other_value[i].asReal(), mix);
new_array[i] = lerp((F32)value[i].asReal(), (F32)other_value[i].asReal(), (F32)mix);
}
}
@ -693,7 +693,7 @@ void LLSettingsBlender::update(const LLSettingsBase::BlendFactor& blendf)
F64 LLSettingsBlender::setBlendFactor(const LLSettingsBase::BlendFactor& blendf_in)
{
LLSettingsBase::TrackPosition blendf = blendf_in;
LLSettingsBase::TrackPosition blendf = (F32)blendf_in;
llassert(!isnan(blendf));
if (blendf >= 1.0)
{
@ -744,7 +744,7 @@ bool LLSettingsBlenderTimeDelta::applyTimeDelta(const LLSettingsBase::Seconds& t
return false;
}
LLSettingsBase::BlendFactor blendf = calculateBlend(mTimeSpent, mBlendSpan);
LLSettingsBase::BlendFactor blendf = calculateBlend((F32)mTimeSpent.value(), mBlendSpan);
if (fabs(mLastBlendF - blendf) < mBlendFMinDelta)
{

View File

@ -475,7 +475,7 @@ public:
LLSettingsBlenderTimeDelta(const LLSettingsBase::ptr_t &target,
const LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, const LLSettingsBase::Seconds& blend_span) :
LLSettingsBlender(target, initsetting, endsetting),
mBlendSpan(blend_span),
mBlendSpan((F32)blend_span.value()),
mLastUpdate(0.0f),
mTimeSpent(0.0f),
mBlendFMinDelta(MIN_BLEND_DELTA),

View File

@ -499,7 +499,7 @@ namespace
continue;
}
LLSettingsBase::TrackPosition frame = elem[LLSettingsDay::SETTING_KEYKFRAME].asReal();
LLSettingsBase::TrackPosition frame = (F32)elem[LLSettingsDay::SETTING_KEYKFRAME].asReal();
if ((frame < 0.0) || (frame > 1.0))
{
frame = llclamp(frame, 0.0f, 1.0f);

View File

@ -480,19 +480,19 @@ void LLSettingsSky::blend(const LLSettingsBase::ptr_t &end, F64 blendf)
// If there is no cloud texture in destination, reduce coverage to imitate disappearance
// See LLDrawPoolWLSky::renderSkyClouds... we don't blend present texture with null
// Note: Probably can be done by shader
cloud_shadow = lerp(mSettings[SETTING_CLOUD_SHADOW].asReal(), (F64)0.f, blendf);
cloud_shadow = lerp((F32)mSettings[SETTING_CLOUD_SHADOW].asReal(), 0.f, (F32)blendf);
cloud_noise_id_next = cloud_noise_id;
}
else if (cloud_noise_id.isNull() && !cloud_noise_id_next.isNull())
{
// Source has no cloud texture, reduce initial coverage to imitate appearance
// use same texture as destination
cloud_shadow = lerp((F64)0.f, other->mSettings[SETTING_CLOUD_SHADOW].asReal(), blendf);
cloud_shadow = lerp(0.f, (F32)other->mSettings[SETTING_CLOUD_SHADOW].asReal(), (F32)blendf);
setCloudNoiseTextureId(cloud_noise_id_next);
}
else
{
cloud_shadow = lerp(mSettings[SETTING_CLOUD_SHADOW].asReal(), other->mSettings[SETTING_CLOUD_SHADOW].asReal(), blendf);
cloud_shadow = lerp((F32)mSettings[SETTING_CLOUD_SHADOW].asReal(), (F32)other->mSettings[SETTING_CLOUD_SHADOW].asReal(), (F32)blendf);
}
LLSD blenddata = interpolateSDMap(mSettings, other->mSettings, other->getParameterMap(), blendf);
@ -923,8 +923,8 @@ LLSD LLSettingsSky::translateLegacySettings(const LLSD& legacy)
if (legacy.has(SETTING_LEGACY_EAST_ANGLE) && legacy.has(SETTING_LEGACY_SUN_ANGLE))
{
// get counter-clockwise radian angle from clockwise legacy WL east angle...
F32 azimuth = -legacy[SETTING_LEGACY_EAST_ANGLE].asReal();
F32 altitude = legacy[SETTING_LEGACY_SUN_ANGLE].asReal();
F32 azimuth = -(F32)legacy[SETTING_LEGACY_EAST_ANGLE].asReal();
F32 altitude = (F32)legacy[SETTING_LEGACY_SUN_ANGLE].asReal();
LLQuaternion sunquat = convert_azimuth_and_altitude_to_quat(azimuth, altitude);
// original WL moon dir was diametrically opposed to the sun dir
@ -958,7 +958,7 @@ void LLSettingsSky::updateSettings()
F32 LLSettingsSky::getSunMoonGlowFactor() const
{
return getIsSunUp() ? 1.0f :
getIsMoonUp() ? getMoonBrightness() * 0.25 : 0.0f;
getIsMoonUp() ? getMoonBrightness() * 0.25f : 0.0f;
}
bool LLSettingsSky::getIsSunUp() const
@ -1043,11 +1043,11 @@ F32 LLSettingsSky::getFloat(const std::string& key, F32 default_value) const
LL_PROFILE_ZONE_SCOPED_CATEGORY_ENVIRONMENT;
if (mSettings.has(SETTING_LEGACY_HAZE) && mSettings[SETTING_LEGACY_HAZE].has(key))
{
return mSettings[SETTING_LEGACY_HAZE][key].asReal();
return (F32)mSettings[SETTING_LEGACY_HAZE][key].asReal();
}
if (mSettings.has(key))
{
return mSettings[key].asReal();
return (F32)mSettings[key].asReal();
}
return default_value;
}
@ -1307,7 +1307,7 @@ void LLSettingsSky::clampColor(LLColor3& color, F32 gamma, F32 scale) const
color *= scale/max_color;
}
LLColor3 linear(color);
linear *= 1.0 / scale;
linear *= 1.0f / scale;
linear = smear(1.0f) - linear;
linear = componentPow(linear, gamma);
linear *= scale;
@ -1353,7 +1353,7 @@ void LLSettingsSky::calculateLightSettings() const
F32 haze_horizon = getHazeHorizon();
sunlight *= 1.0 - cloud_shadow;
sunlight *= 1.0f - cloud_shadow;
sunlight += tmpAmbient;
mHazeColor = getBlueHorizon() * getBlueDensity() * sunlight;
@ -1415,22 +1415,22 @@ LLUUID LLSettingsSky::GetDefaultHaloTextureId()
F32 LLSettingsSky::getPlanetRadius() const
{
return mSettings[SETTING_PLANET_RADIUS].asReal();
return (F32)mSettings[SETTING_PLANET_RADIUS].asReal();
}
F32 LLSettingsSky::getSkyMoistureLevel() const
{
return mSettings[SETTING_SKY_MOISTURE_LEVEL].asReal();
return (F32)mSettings[SETTING_SKY_MOISTURE_LEVEL].asReal();
}
F32 LLSettingsSky::getSkyDropletRadius() const
{
return mSettings[SETTING_SKY_DROPLET_RADIUS].asReal();
return (F32)mSettings[SETTING_SKY_DROPLET_RADIUS].asReal();
}
F32 LLSettingsSky::getSkyIceLevel() const
{
return mSettings[SETTING_SKY_ICE_LEVEL].asReal();
return (F32)mSettings[SETTING_SKY_ICE_LEVEL].asReal();
}
F32 LLSettingsSky::getReflectionProbeAmbiance(bool auto_adjust) const
@ -1440,27 +1440,27 @@ F32 LLSettingsSky::getReflectionProbeAmbiance(bool auto_adjust) const
return sAutoAdjustProbeAmbiance;
}
return mSettings[SETTING_REFLECTION_PROBE_AMBIANCE].asReal();
return (F32)mSettings[SETTING_REFLECTION_PROBE_AMBIANCE].asReal();
}
F32 LLSettingsSky::getSkyBottomRadius() const
{
return mSettings[SETTING_SKY_BOTTOM_RADIUS].asReal();
return (F32)mSettings[SETTING_SKY_BOTTOM_RADIUS].asReal();
}
F32 LLSettingsSky::getSkyTopRadius() const
{
return mSettings[SETTING_SKY_TOP_RADIUS].asReal();
return (F32)mSettings[SETTING_SKY_TOP_RADIUS].asReal();
}
F32 LLSettingsSky::getSunArcRadians() const
{
return mSettings[SETTING_SUN_ARC_RADIANS].asReal();
return (F32)mSettings[SETTING_SUN_ARC_RADIANS].asReal();
}
F32 LLSettingsSky::getMieAnisotropy() const
{
return getMieConfig()[SETTING_MIE_ANISOTROPY_FACTOR].asReal();
return (F32)getMieConfig()[SETTING_MIE_ANISOTROPY_FACTOR].asReal();
}
LLSD LLSettingsSky::getRayleighConfig() const
@ -1569,7 +1569,7 @@ void LLSettingsSky::setCloudPosDensity2(const LLColor3 &val)
F32 LLSettingsSky::getCloudScale() const
{
return mSettings[SETTING_CLOUD_SCALE].asReal();
return (F32)mSettings[SETTING_CLOUD_SCALE].asReal();
}
void LLSettingsSky::setCloudScale(F32 val)
@ -1601,7 +1601,7 @@ void LLSettingsSky::setCloudScrollRateY(F32 val)
F32 LLSettingsSky::getCloudShadow() const
{
return mSettings[SETTING_CLOUD_SHADOW].asReal();
return (F32)mSettings[SETTING_CLOUD_SHADOW].asReal();
}
void LLSettingsSky::setCloudShadow(F32 val)
@ -1611,7 +1611,7 @@ void LLSettingsSky::setCloudShadow(F32 val)
F32 LLSettingsSky::getCloudVariance() const
{
return mSettings[SETTING_CLOUD_VARIANCE].asReal();
return (F32)mSettings[SETTING_CLOUD_VARIANCE].asReal();
}
void LLSettingsSky::setCloudVariance(F32 val)
@ -1621,7 +1621,7 @@ void LLSettingsSky::setCloudVariance(F32 val)
F32 LLSettingsSky::getDomeOffset() const
{
//return mSettings[SETTING_DOME_OFFSET].asReal();
//return (F32)mSettings[SETTING_DOME_OFFSET].asReal();
return DOME_OFFSET;
}
@ -1633,7 +1633,7 @@ F32 LLSettingsSky::getDomeRadius() const
F32 LLSettingsSky::getGamma() const
{
return mSettings[SETTING_GAMMA].asReal();
return (F32)mSettings[SETTING_GAMMA].asReal();
}
void LLSettingsSky::setGamma(F32 val)
@ -1654,7 +1654,7 @@ void LLSettingsSky::setGlow(const LLColor3 &val)
F32 LLSettingsSky::getMaxY() const
{
return mSettings[SETTING_MAX_Y].asReal();
return (F32)mSettings[SETTING_MAX_Y].asReal();
}
void LLSettingsSky::setMaxY(F32 val)
@ -1674,7 +1674,7 @@ void LLSettingsSky::setMoonRotation(const LLQuaternion &val)
F32 LLSettingsSky::getMoonScale() const
{
return mSettings[SETTING_MOON_SCALE].asReal();
return (F32)mSettings[SETTING_MOON_SCALE].asReal();
}
void LLSettingsSky::setMoonScale(F32 val)
@ -1692,9 +1692,9 @@ void LLSettingsSky::setMoonTextureId(LLUUID id)
setValue(SETTING_MOON_TEXTUREID, id);
}
F32 LLSettingsSky::getMoonBrightness() const
F32 LLSettingsSky::getMoonBrightness() const
{
return mSettings[SETTING_MOON_BRIGHTNESS].asReal();
return (F32)mSettings[SETTING_MOON_BRIGHTNESS].asReal();
}
void LLSettingsSky::setMoonBrightness(F32 brightness_factor)
@ -1704,7 +1704,7 @@ void LLSettingsSky::setMoonBrightness(F32 brightness_factor)
F32 LLSettingsSky::getStarBrightness() const
{
return mSettings[SETTING_STAR_BRIGHTNESS].asReal();
return (F32)mSettings[SETTING_STAR_BRIGHTNESS].asReal();
}
void LLSettingsSky::setStarBrightness(F32 val)
@ -1749,7 +1749,7 @@ void LLSettingsSky::setSunRotation(const LLQuaternion &val)
F32 LLSettingsSky::getSunScale() const
{
return mSettings[SETTING_SUN_SCALE].asReal();
return (F32)mSettings[SETTING_SUN_SCALE].asReal();
}
void LLSettingsSky::setSunScale(F32 val)

View File

@ -72,7 +72,7 @@ public:
//---------------------------------------------------------------------
F32 getBlurMultiplier() const
{
return mSettings[SETTING_BLUR_MULTIPLIER].asReal();
return (F32)mSettings[SETTING_BLUR_MULTIPLIER].asReal();
}
void setBlurMultiplier(F32 val)
@ -92,7 +92,7 @@ public:
F32 getWaterFogDensity() const
{
return mSettings[SETTING_FOG_DENSITY].asReal();
return (F32)mSettings[SETTING_FOG_DENSITY].asReal();
}
F32 getModifiedWaterFogDensity(bool underwater) const;
@ -104,7 +104,7 @@ public:
F32 getFogMod() const
{
return mSettings[SETTING_FOG_MOD].asReal();
return (F32)mSettings[SETTING_FOG_MOD].asReal();
}
void setFogMod(F32 val)
@ -114,7 +114,7 @@ public:
F32 getFresnelOffset() const
{
return mSettings[SETTING_FRESNEL_OFFSET].asReal();
return (F32)mSettings[SETTING_FRESNEL_OFFSET].asReal();
}
void setFresnelOffset(F32 val)
@ -124,7 +124,7 @@ public:
F32 getFresnelScale() const
{
return mSettings[SETTING_FRESNEL_SCALE].asReal();
return (F32)mSettings[SETTING_FRESNEL_SCALE].asReal();
}
void setFresnelScale(F32 val)
@ -164,7 +164,7 @@ public:
F32 getScaleAbove() const
{
return mSettings[SETTING_SCALE_ABOVE].asReal();
return (F32)mSettings[SETTING_SCALE_ABOVE].asReal();
}
void setScaleAbove(F32 val)
@ -174,7 +174,7 @@ public:
F32 getScaleBelow() const
{
return mSettings[SETTING_SCALE_BELOW].asReal();
return (F32)mSettings[SETTING_SCALE_BELOW].asReal();
}
void setScaleBelow(F32 val)

View File

@ -61,7 +61,7 @@ LLPointer<LLInventoryItem> create_random_inventory_item()
S32 price = rand();
LLSaleInfo sale_info(LLSaleInfo::FS_COPY, price);
U32 flags = rand();
S32 creation = time(NULL);
S32 creation = (S32)time(NULL);
LLPointer<LLInventoryItem> item = new LLInventoryItem(
item_id,
@ -195,7 +195,7 @@ namespace tut
src->setSaleInfo(new_sale_info);
U32 new_flags = rand();
S32 new_creation = time(NULL);
S32 new_creation = (S32)time(NULL);
LLPermissions new_perm;
@ -266,7 +266,7 @@ namespace tut
src->setSaleInfo(new_sale_info);
U32 new_flags = rand();
S32 new_creation = time(NULL);
S32 new_creation = (S32)time(NULL);
LLPermissions new_perm;

View File

@ -175,7 +175,7 @@ private:
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 (F32)llfloor(a); }
F32 _ceil(const F32& a) const { return llceil(a); }
F32 _ceil(const F32& a) const { return (F32)llceil(a); }
F32 _atan2(const F32& a,const F32& b) const { return atan2(a,b); }
LLCalc::calc_map_t* mConstants;

View File

@ -186,10 +186,10 @@ inline LLSD LLQuaternion::getValue() const
inline void LLQuaternion::setValue(const LLSD& sd)
{
mQ[0] = sd[0].asReal();
mQ[1] = sd[1].asReal();
mQ[2] = sd[2].asReal();
mQ[3] = sd[3].asReal();
mQ[0] = (F32)sd[0].asReal();
mQ[1] = (F32)sd[1].asReal();
mQ[2] = (F32)sd[2].asReal();
mQ[3] = (F32)sd[3].asReal();
}
// checker

View File

@ -734,7 +734,7 @@ S32 LLProfile::getNumPoints(const LLProfileParams& params, bool path_open,F32 de
bool LLProfile::generate(const LLProfileParams& params, bool path_open,F32 detail, S32 split,
bool is_sculpted, S32 sculpt_size)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME;
if ((!mDirty) && (!is_sculpted))
{
@ -1216,7 +1216,7 @@ S32 LLPath::getNumNGonPoints(const LLPathParams& params, S32 sides, F32 startOff
void LLPath::genNGon(const LLPathParams& params, S32 sides, F32 startOff, F32 end_scale, F32 twist_scale)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME;
// Generates a circular path, starting at (1, 0, 0), counterclockwise along the xz plane.
constexpr F32 tableScale[] = { 1, 1, 1, 0.5f, 0.707107f, 0.53f, 0.525f, 0.5f };
@ -1452,7 +1452,7 @@ S32 LLPath::getNumPoints(const LLPathParams& params, F32 detail)
bool LLPath::generate(const LLPathParams& params, F32 detail, S32 split,
bool is_sculpted, S32 sculpt_size)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME;
if ((!mDirty) && (!is_sculpted))
{
@ -2029,7 +2029,7 @@ LLVolume::~LLVolume()
bool LLVolume::generate()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME;
LL_CHECK_MEMORY
llassert_always(mProfilep);
@ -2289,7 +2289,7 @@ bool LLVolumeFace::VertexData::compareNormal(const LLVolumeFace::VertexData& rhs
bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME;
//input stream is now pointing at a zlib compressed block of LLSD
//decompress block
@ -2345,11 +2345,11 @@ bool LLVolume::unpackVolumeFacesInternal(const LLSD& mdl)
continue;
}
LLSD::Binary pos = mdl[i]["Position"];
LLSD::Binary norm = mdl[i]["Normal"];
LLSD::Binary tangent = mdl[i]["Tangent"];
LLSD::Binary tc = mdl[i]["TexCoord0"];
LLSD::Binary idx = mdl[i]["TriangleList"];
const LLSD::Binary& pos = mdl[i]["Position"].asBinary();
const LLSD::Binary& norm = mdl[i]["Normal"].asBinary();
const LLSD::Binary& tangent = mdl[i]["Tangent"].asBinary();
const LLSD::Binary& tc = mdl[i]["TexCoord0"].asBinary();
const LLSD::Binary& idx = mdl[i]["TriangleList"].asBinary();
//copy out indices
auto num_indices = idx.size() / 2;
@ -2538,7 +2538,7 @@ bool LLVolume::unpackVolumeFacesInternal(const LLSD& mdl)
continue;
}
LLSD::Binary weights = mdl[i]["Weights"];
const LLSD::Binary& weights = mdl[i]["Weights"].asBinary();
U32 idx = 0;
@ -2776,7 +2776,7 @@ S32 LLVolume::getNumFaces() const
void LLVolume::createVolumeFaces()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME;
if (mGenerateSingleFace)
{
@ -3741,7 +3741,7 @@ void LLVolume::generateSilhouetteVertices(std::vector<LLVector3> &vertices,
const LLMatrix3& norm_mat_in,
S32 face_mask)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME;
LLMatrix4a mat;
mat.loadu(mat_in);
@ -4870,7 +4870,7 @@ void LLVolumeFace::freeData()
bool LLVolumeFace::create(LLVolume* volume, bool partial_build)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME;
//tree for this face is no longer valid
destroyOctree();
@ -5462,7 +5462,11 @@ bool LLVolumeFace::cacheOptimize(bool gen_tangents)
U32 stream_count = data.w.empty() ? 4 : 5;
S32 vert_count = static_cast<S32>(meshopt_generateVertexRemapMulti(&remap[0], nullptr, data.p.size(), data.p.size(), mos, stream_count));
S32 vert_count = 0;
if (!data.p.empty())
{
vert_count = static_cast<S32>(meshopt_generateVertexRemapMulti(&remap[0], nullptr, data.p.size(), data.p.size(), mos, stream_count));
}
if (vert_count < 65535 && vert_count != 0)
{
@ -5545,7 +5549,7 @@ bool LLVolumeFace::cacheOptimize(bool gen_tangents)
void LLVolumeFace::createOctree(F32 scaler, const LLVector4a& center, const LLVector4a& size)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME;
if (getOctree())
{
@ -6556,7 +6560,7 @@ void LLVolumeFace::fillFromLegacyData(std::vector<LLVolumeFace::VertexData>& v,
bool LLVolumeFace::createSide(LLVolume* volume, bool partial_build)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME;
LL_CHECK_MEMORY
bool flat = mTypeMask & FLAT_MASK;
@ -7090,7 +7094,7 @@ bool LLVolumeFace::createSide(LLVolume* volume, bool partial_build)
void LLCalculateTangentArray(U32 vertexCount, const LLVector4a *vertex, const LLVector4a *normal,
const LLVector2 *texcoord, U32 triangleCount, const U16* index_array, LLVector4a *tangent)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME;
//LLVector4a *tan1 = new LLVector4a[vertexCount * 2];
LLVector4a* tan1 = (LLVector4a*) ll_aligned_malloc_16(vertexCount*2*sizeof(LLVector4a));

View File

@ -143,7 +143,7 @@ public:
virtual void visit(const LLOctreeNode<LLVolumeTriangle, LLVolumeTriangle*>* branch)
{ //this is a depth first traversal, so it's safe to assum all children have complete
//bounding data
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME
LL_PROFILE_ZONE_SCOPED_CATEGORY_VOLUME;
LLVolumeOctreeListener* node = (LLVolumeOctreeListener*)branch->getListener(0);

View File

@ -209,10 +209,6 @@ inline LLColor3::LLColor3(const F32 *vec)
mV[VBLUE] = vec[VBLUE];
}
#if LL_WINDOWS
# pragma warning( disable : 4996 ) // strncpy teh sux0r
#endif
inline LLColor3::LLColor3(const char* color_string) // takes a string of format "RRGGBB" where RR is hex 00..FF
{
if (strlen(color_string) < 6) /* Flawfinder: ignore */
@ -517,9 +513,9 @@ inline const LLVector3 linearColor3v(const T& a) {
template<typename T>
const LLColor3& LLColor3::set(const std::vector<T>& v)
{
for (S32 i = 0; i < llmin((S32)v.size(), 3); ++i)
for (size_t i = 0; i < llmin(v.size(), 3); ++i)
{
mV[i] = v[i];
mV[i] = (F32)v[i];
}
return *this;
@ -530,9 +526,9 @@ const LLColor3& LLColor3::set(const std::vector<T>& v)
template<typename T>
void LLColor3::write(std::vector<T>& v) const
{
for (int i = 0; i < llmin((S32)v.size(), 3); ++i)
for (size_t i = 0; i < llmin(v.size(), 3); ++i)
{
v[i] = mV[i];
v[i] = (T)mV[i];
}
}

View File

@ -702,9 +702,9 @@ inline const LLColor4 linearColor4(const LLColor4 &a)
template<typename T>
const LLColor4& LLColor4::set(const std::vector<T>& v)
{
for (S32 i = 0; i < llmin((S32)v.size(), 4); ++i)
for (size_t i = 0; i < llmin(v.size(), 4); ++i)
{
mV[i] = v[i];
mV[i] = (F32)v[i];
}
return *this;
@ -713,9 +713,9 @@ const LLColor4& LLColor4::set(const std::vector<T>& v)
template<typename T>
void LLColor4::write(std::vector<T>& v) const
{
for (int i = 0; i < llmin((S32)v.size(), 4); ++i)
for (size_t i = 0; i < llmin(v.size(), 4); ++i)
{
v[i] = mV[i];
v[i] = (T)mV[i];
}
}

View File

@ -67,10 +67,10 @@ class LLVector4
void setValue(const LLSD& sd)
{
mV[0] = sd[0].asReal();
mV[1] = sd[1].asReal();
mV[2] = sd[2].asReal();
mV[3] = sd[3].asReal();
mV[0] = (F32)sd[0].asReal();
mV[1] = (F32)sd[1].asReal();
mV[2] = (F32)sd[2].asReal();
mV[3] = (F32)sd[3].asReal();
}

Some files were not shown because too many files have changed in this diff Show More