merge with viewer tools update

master
Brad Payne (Vir Linden) 2015-04-24 10:08:13 -04:00
commit 76fb5f1542
391 changed files with 3686 additions and 5037 deletions

View File

@ -17,6 +17,7 @@ build-linux-*
build-darwin-*
build-vc80/
build-vc100/
build-vc120/
indra/build-vc[0-9]*
indra/CMakeFiles
indra/lib/mono/1.0/*.dll

View File

@ -500,3 +500,4 @@ d3d0101e980ec95043e0af9b7903045d3bc447e4 3.7.24-release
9978a8c3a2ffce4a5e1c186256581c2ac139c9dc 3.7.25-release
000e9dda4162cbf0a83ba88558b19473654a09a9 3.7.26-release
afd8d4756e8eda3c8f760625d1c17a2ad40ad6c8 3.7.27-release
566874eb5ab26c003ef7fb0e22ce40c5fa0013f4 3.7.28-release

View File

@ -11,9 +11,14 @@ Linux.symbolfiles = "newview/secondlife-symbols-linux.tar.bz2"
# Use Public Upload Locations
public_build = true
build_docs = true
# skip windows debug build until we can get a fix in.
# disable all Debug builds (RelWithDebInfo is sufficient)
build_CYGWIN_Debug = false
build_Linux_Debug = false
build_Darwin_Debug = false
build_Debug = false
# Update Public Inworld Build Status Indicators (setting should mirror "public_build")
email_status_this_is_os = true
@ -47,13 +52,24 @@ Linux.cxx_version = /usr/bin/g++-4.6
################################################################
viewer_channel = "Second Life Test"
# Setup default packaging parameters.
################################################################
# Special packaging parameters.
# These parameters can be used to create additional packages
# which identify themselves in a distinct way with either
# a sourceid (sent to web services) or a channel name (sent to login)
# the default sourceid should always be a null string:
sourceid = ""
additional_packages = "Amazon Desura"
Amazon_sourceid = "1207v_Amazon"
Amazon_viewer_channel_suffix = "Amazon"
Desura_sourceid = "1208_desura"
Desura_viewer_channel_suffix = "Desura"
# the additional_packages variable is a blank separated list of package prefixes:
additional_packages = ""
# to set the special values for a package, create variables using each prefix:
# additional_packages = "Foo Bar"
# Foo_sourceid = "bingo"
# Foo_viewer_channel_suffix = "Foo"
# Bar_sourceid = "bongo"
# Bar_viewer_channel_suffix = "Bar"
# the viewer_channel_suffix is prefixed by a blank and then appended to the viewer_channel
# for the package in a setting that overrides the compiled-in value
################################################################
# Notifications - to configure email notices, add a setting like this:
# <username>_<reponame>.email = <email-address>

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,7 @@
#!/bin/sh
# This is a the master build script - it is intended to be run by parabuild
# This is a the master build script - it is intended to be run by the Linden
# Lab build farm
# It is called by a wrapper script in the shared repository which sets up
# the environment from the various BuildParams files and does all the build
# result post-processing.
@ -12,8 +13,6 @@
# * The special style in which python is invoked is intentional to permit
# use of a native python install on windows - which requires paths in DOS form
# * This script relies heavily on parameters defined in BuildParams
# * The basic convention is that the build name can be mapped onto a mercurial URL,
# which is also used as the "branch" name.
check_for()
{
@ -33,7 +32,7 @@ build_dir_Linux()
build_dir_CYGWIN()
{
echo build-vc100
echo build-vc120
}
viewer_channel_suffix()
@ -102,7 +101,7 @@ pre_build()
check_for "Confirm dictionaries are installed before 'autobuild configure'" ${build_dir}/packages/dictionaries
"$AUTOBUILD" configure -c $variant -- \
"$autobuild" configure -c $variant -- \
-DPACKAGE:BOOL=ON \
-DRELEASE_CRASH_REPORTING:BOOL=ON \
-DVIEWER_CHANNEL:STRING="\"$viewer_channel\"" \
@ -120,14 +119,20 @@ package_llphysicsextensions_tpv()
if [ "$variant" = "Release" ]
then
llpetpvcfg=$build_dir/packages/llphysicsextensions/autobuild-tpv.xml
"$AUTOBUILD" build --verbose --config-file $llpetpvcfg -c Tpv
"$autobuild" build --verbose --config-file $llpetpvcfg -c Tpv
# capture the package file name for use in upload later...
PKGTMP=`mktemp -t pgktpv.XXXXXX`
trap "rm $PKGTMP* 2>/dev/null" 0
"$AUTOBUILD" package --verbose --config-file $llpetpvcfg > $PKGTMP
"$autobuild" package --verbose --config-file $llpetpvcfg --results-file "$(native_path $PKGTMP)"
tpv_status=$?
sed -n -e 's/^wrote *//p' $PKGTMP > $build_dir/llphysicsextensions_package
if [ -r "${PKGTMP}" ]
then
cat "${PKGTMP}" >> "$build_log"
eval $(cat "${PKGTMP}") # sets autobuild_package_{name,filename,md5}
autobuild_package_filename="$(shell_path "${autobuild_package_filename}")"
echo "${autobuild_package_filename}" > $build_dir/llphysicsextensions_package
fi
else
echo "Do not provide llphysicsextensions_tpv for $variant"
llphysicsextensions_package=""
@ -143,7 +148,7 @@ build()
then
begin_section "Viewer$variant"
"$AUTOBUILD" build --no-configure -c $variant
"$autobuild" build --no-configure -c $variant
build_ok=$?
end_section "Viewer$variant"
@ -172,11 +177,22 @@ build()
# This is called from the branch independent script upon completion of all platform builds.
build_docs()
{
begin_section Docs
# Stub code to generate docs
echo Hello world > documentation.txt
upload_item docs documentation.txt text/plain
end_section Docs
begin_section "Building Documentation"
begin_section "Autobuild metadata"
if [ -r "$build_dir/autobuild-package.xml" ]
then
upload_item docs "$build_dir/autobuild-package.xml" text/xml
else
record_event "no metadata at '$build_dir/autobuild-package.xml'"
fi
end_section "Autobuild metadata"
if [ "$arch" != "Linux" ]
then
record_dependencies_graph # defined in build.sh
else
echo "TBD - skipping linux graph (probable python version dependency)" 1>&2
fi
end_section "Building Documentation"
}
@ -200,33 +216,23 @@ fi
# Check to see if we're skipping the platform
eval '$build_'"$arch" || pass
if [ -z "$AUTOBUILD" ]
# ensure AUTOBUILD is in native path form for child processes
AUTOBUILD="$(native_path "$AUTOBUILD")"
# set "$autobuild" to cygwin path form for use locally in this script
autobuild="$(shell_path "$AUTOBUILD")"
if [ ! -x "$autobuild" ]
then
export autobuild_dir="$here/../../../autobuild/bin/"
if [ -d "$autobuild_dir" ]
then
export AUTOBUILD="$autobuild_dir"autobuild
if [ -x "$AUTOBUILD" ]
then
# *HACK - bash doesn't know how to pass real pathnames to native windows python
case "$arch" in
CYGWIN) AUTOBUILD=$(cygpath -u $AUTOBUILD.cmd) ;;
esac
else
record_failure "Not executable: $AUTOBUILD"
exit 1
fi
else
record_failure "Not found: $autobuild_dir"
exit 1
fi
record_failure "AUTOBUILD not executable: '$autobuild'"
exit 1
fi
# load autbuild provided shell functions and variables
eval "$("$AUTOBUILD" source_environment)"
# load autobuild provided shell functions and variables
eval "$("$autobuild" source_environment)"
# dump environment variables for debugging
begin_section "Environment"
env|sort
end_section "Environment"
# Now run the build
succeeded=true
@ -276,6 +282,8 @@ do
end_section "Do$variant"
done
build_docs
# If we are building variants in parallel, wait, then collect results.
# This requires that the build dirs are variant specific
if $build_link_parallel && [ x"$build_processes" != x ]
@ -375,7 +383,6 @@ then
fi
fi
# check status and upload results to S3
if $succeeded
then

View File

@ -313,7 +313,9 @@ Ciaran Laval
Cinder Roxley
BUG-2326
BUG-3863
BUG-8786
OPEN-185
OPEN-282
STORM-1703
STORM-1948
STORM-1831
@ -325,6 +327,7 @@ Cinder Roxley
STORM-2036
STORM-2037
STORM-2053
STORM-2113
Clara Young
Coaldust Numbers
VWR-1095
@ -1229,8 +1232,10 @@ Sovereign Engineer
MAINT-2334
OPEN-189
STORM-1972
STORM-2113
OPEN-195
OPEN-217
OPEN-295
SpacedOut Frye
VWR-34
VWR-45
@ -1272,6 +1277,7 @@ TankMaster Finesmith
OPEN-140
OPEN-142
OPEN-154
OPEN-295
STORM-1100
STORM-1258
STORM-1602

View File

@ -20,12 +20,6 @@ if (NOT CMAKE_BUILD_TYPE)
"Build type. One of: Debug Release RelWithDebInfo" FORCE)
endif (NOT CMAKE_BUILD_TYPE)
# For the library installation process;
# see cmake/Prebuild.cmake for the counterpart code.
if ("${CMAKE_SOURCE_DIR}/../autobuild.xml" IS_NEWER_THAN "${CMAKE_BINARY_DIR}/temp/sentinel_installed")
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/temp)
file(WRITE ${CMAKE_BINARY_DIR}/temp/sentinel_installed "0")
endif ("${CMAKE_SOURCE_DIR}/../autobuild.xml" IS_NEWER_THAN "${CMAKE_BINARY_DIR}/temp/sentinel_installed")
add_subdirectory(cmake)
add_subdirectory(${LIBS_OPEN_PREFIX}llaudio)
@ -60,6 +54,7 @@ add_subdirectory(${LIBS_OPEN_PREFIX}viewer_components)
# Legacy C++ tests. Build always, run if LL_TESTS is true.
add_subdirectory(${VIEWER_PREFIX}test)
if (ENABLE_MEDIA_PLUGINS)
# viewer media plugins
add_subdirectory(${LIBS_OPEN_PREFIX}media_plugins)
@ -68,6 +63,7 @@ add_subdirectory(${LIBS_OPEN_PREFIX}media_plugins)
add_subdirectory(${VIEWER_PREFIX}test_apps/llplugintest)
add_subdirectory(${VIEWER_PREFIX}test_apps/llfbconnecttest)
endif (LL_TESTS AND NOT LINUX)
endif (ENABLE_MEDIA_PLUGINS)
if (LINUX)
add_subdirectory(${VIEWER_PREFIX}linux_crash_logger)

View File

@ -49,12 +49,13 @@ if (WINDOWS)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MDd /MP -D_SCL_SECURE_NO_WARNINGS=1"
CACHE STRING "C++ compiler debug options" FORCE)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /MP /Ob0 -D_SECURE_STL=0"
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /Zo /MD /MP /Ob0 -D_SECURE_STL=0"
CACHE STRING "C++ compiler release-with-debug options" FORCE)
set(CMAKE_CXX_FLAGS_RELEASE
"${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MD /MP /Ob2 -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0"
"${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /Zo /MD /MP /Ob2 -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0"
CACHE STRING "C++ compiler release options" FORCE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
# zlib has assembly-language object files incompatible with SAFESEH
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE /SAFESEH:NO /NODEFAULTLIB:LIBCMT")
set(CMAKE_CXX_STANDARD_LIBRARIES "")
set(CMAKE_C_STANDARD_LIBRARIES "")
@ -190,22 +191,28 @@ if (DARWIN)
add_definitions(-DLL_DARWIN=1)
set(CMAKE_CXX_LINK_FLAGS "-Wl,-no_compact_unwind -Wl,-headerpad_max_install_names,-search_paths_first")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}")
set(DARWIN_extra_cstar_flags "-mlong-branch -g")
set(DARWIN_extra_cstar_flags "-g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DARWIN_extra_cstar_flags}")
# NOTE: it's critical that the optimization flag is put in front.
# NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered.
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
if (XCODE_VERSION GREATER 4.2)
set(ENABLE_SIGNING TRUE)
set(SIGNING_IDENTITY "Developer ID Application: Linden Research, Inc.")
endif (XCODE_VERSION GREATER 4.2)
set(ENABLE_SIGNING TRUE)
set(SIGNING_IDENTITY "Developer ID Application: Linden Research, Inc.")
endif (DARWIN)
if (LINUX OR DARWIN)
set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs")
if (CMAKE_CXX_COMPILER MATCHES ".*clang")
set(CMAKE_COMPILER_IS_CLANGXX 1)
endif (CMAKE_CXX_COMPILER MATCHES ".*clang")
if (CMAKE_COMPILER_IS_GNUCXX)
set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs")
elseif (CMAKE_COMPILER_IS_CLANGXX)
set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs")
endif()
if (NOT GCC_DISABLE_FATAL_WARNINGS)
set(GCC_WARNINGS "${GCC_WARNINGS} -Werror")

View File

@ -8,7 +8,7 @@ if (USESYSTEMLIBS)
pkg_check_modules(VORBISENC REQUIRED vorbisenc)
pkg_check_modules(VORBISFILE REQUIRED vorbisfile)
else (USESYSTEMLIBS)
use_prebuilt_binary(ogg-vorbis)
use_prebuilt_binary(ogg_vorbis)
set(VORBIS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
set(VORBISENC_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})
set(VORBISFILE_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})

View File

@ -1,5 +1,5 @@
# -*- cmake -*-
include(Prebuilt)
set(DB_FIND_QUIETLY ON)
set(DB_FIND_REQUIRED ON)

View File

@ -0,0 +1,10 @@
# -*- cmake -*-
# Construct the version and copyright information based on package data.
include(Python)
add_custom_command(OUTPUT packages-info.txt
COMMENT Generating packages-info.txt for the about box
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/../autobuild.xml
DEPENDS ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py > packages-info.txt
)

View File

@ -23,7 +23,7 @@ set(cmake_SOURCE_FILES
DirectX.cmake
DragDrop.cmake
EXPAT.cmake
ExamplePlugin.cmake
## ExamplePlugin.cmake
FindAPR.cmake
FindAutobuild.cmake
FindBerkeleyDB.cmake
@ -45,9 +45,9 @@ set(cmake_SOURCE_FILES
GLEXT.cmake
GLH.cmake
GLOD.cmake
GStreamer010Plugin.cmake
## GStreamer010Plugin.cmake
GetPrerequisites_2_8.cmake
Glui.cmake
## Glui.cmake
Glut.cmake
GoogleBreakpad.cmake
GoogleMock.cmake
@ -82,18 +82,18 @@ set(cmake_SOURCE_FILES
LLXML.cmake
LScript.cmake
Linking.cmake
MediaPluginBase.cmake
## MediaPluginBase.cmake
NDOF.cmake
OPENAL.cmake
OpenGL.cmake
OpenJPEG.cmake
OpenSSL.cmake
PNG.cmake
PluginAPI.cmake
## PluginAPI.cmake
Prebuilt.cmake
PulseAudio.cmake
Python.cmake
QuickTimePlugin.cmake
## QuickTimePlugin.cmake
TemplateCheck.cmake
Tut.cmake
UI.cmake
@ -102,7 +102,7 @@ set(cmake_SOURCE_FILES
Variables.cmake
ViewerMiscLibs.cmake
VisualLeakDetector.cmake
WebKitLibPlugin.cmake
## WebKitLibPlugin.cmake
XmlRpcEpi.cmake
ZLIB.cmake
)

View File

@ -66,126 +66,80 @@ if(WINDOWS)
set(release_files ${release_files} fmodex.dll)
endif (FMODEX)
#*******************************
# Copy MS C runtime dlls, required for packaging.
# *TODO - Adapt this to support VC9
if (MSVC80)
FIND_PATH(debug_msvc8_redist_path msvcr80d.dll
#*******************************
# Copy MS C runtime dlls, required for packaging.
# *TODO - Adapt this to support VC9
if (MSVC80)
set(MSVC_VER 80)
set(MSVC_VERDOT 8.0)
elseif (MSVC_VERSION EQUAL 1600) # VisualStudio 2010
set(MSVC_VER 100)
set(MSVC_VERDOT 10.0)
elseif (MSVC_VERSION EQUAL 1800) # VisualStudio 2013, which is (sigh) VS 12
set(MSVC_VER 120)
set(MSVC_VERDOT 12.0)
else (MSVC80)
MESSAGE(WARNING "New MSVC_VERSION ${MSVC_VERSION} of MSVC: adapt Copy3rdPartyLibs.cmake")
endif (MSVC80)
FIND_PATH(debug_msvc_redist_path msvcr${MSVC_VER}d.dll
PATHS
${MSVC_DEBUG_REDIST_PATH}
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC80.DebugCRT
NO_DEFAULT_PATH
NO_DEFAULT_PATH
)
if(EXISTS ${debug_msvc8_redist_path})
set(debug_msvc8_files
msvcr80d.dll
msvcp80d.dll
Microsoft.VC80.DebugCRT.manifest
)
copy_if_different(
${debug_msvc8_redist_path}
"${SHARED_LIB_STAGING_DIR_DEBUG}"
out_targets
${debug_msvc8_files}
)
set(third_party_targets ${third_party_targets} ${out_targets})
endif (EXISTS ${debug_msvc8_redist_path})
FIND_PATH(release_msvc8_redist_path msvcr80.dll
PATHS
${MSVC_REDIST_PATH}
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC80.CRT
NO_DEFAULT_PATH
NO_DEFAULT_PATH
)
if(EXISTS ${release_msvc8_redist_path})
set(release_msvc8_files
msvcr80.dll
msvcp80.dll
Microsoft.VC80.CRT.manifest
)
copy_if_different(
${release_msvc8_redist_path}
"${SHARED_LIB_STAGING_DIR_RELEASE}"
out_targets
${release_msvc8_files}
)
set(third_party_targets ${third_party_targets} ${out_targets})
copy_if_different(
${release_msvc8_redist_path}
"${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
out_targets
${release_msvc8_files}
)
set(third_party_targets ${third_party_targets} ${out_targets})
endif (EXISTS ${release_msvc8_redist_path})
elseif (MSVC_VERSION EQUAL 1600) # VisualStudio 2010
FIND_PATH(debug_msvc10_redist_path msvcr100d.dll
PATHS
${MSVC_DEBUG_REDIST_PATH}
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC100.DebugCRT
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${MSVC_VERDOT}\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC${MSVC_VER}.DebugCRT
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/System32
NO_DEFAULT_PATH
)
if(EXISTS ${debug_msvc10_redist_path})
set(debug_msvc10_files
msvcr100d.dll
msvcp100d.dll
if(EXISTS ${debug_msvc_redist_path})
set(debug_msvc_files
msvcr${MSVC_VER}d.dll
msvcp${MSVC_VER}d.dll
)
copy_if_different(
${debug_msvc10_redist_path}
${debug_msvc_redist_path}
"${SHARED_LIB_STAGING_DIR_DEBUG}"
out_targets
${debug_msvc10_files}
${debug_msvc_files}
)
set(third_party_targets ${third_party_targets} ${out_targets})
endif ()
FIND_PATH(release_msvc10_redist_path msvcr100.dll
FIND_PATH(release_msvc_redist_path msvcr${MSVC_VER}.dll
PATHS
${MSVC_REDIST_PATH}
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC100.CRT
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${MSVC_VERDOT}\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC${MSVC_VER}.CRT
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/SysWOW64
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Windows;Directory]/System32
NO_DEFAULT_PATH
)
if(EXISTS ${release_msvc10_redist_path})
set(release_msvc10_files
msvcr100.dll
msvcp100.dll
if(EXISTS ${release_msvc_redist_path})
set(release_msvc_files
msvcr${MSVC_VER}.dll
msvcp${MSVC_VER}.dll
)
copy_if_different(
${release_msvc10_redist_path}
${release_msvc_redist_path}
"${SHARED_LIB_STAGING_DIR_RELEASE}"
out_targets
${release_msvc10_files}
${release_msvc_files}
)
set(third_party_targets ${third_party_targets} ${out_targets})
copy_if_different(
${release_msvc10_redist_path}
${release_msvc_redist_path}
"${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
out_targets
${release_msvc10_files}
${release_msvc_files}
)
set(third_party_targets ${third_party_targets} ${out_targets})
endif ()
endif (MSVC80)
elseif(DARWIN)
set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug/Resources")

View File

@ -7,7 +7,7 @@ if (USESYSTEMLIBS)
pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1)
elseif (LINUX)
use_prebuilt_binary(dbusglib)
use_prebuilt_binary(dbus_glib)
set(DBUSGLIB_FOUND ON FORCE BOOL)
set(DBUSGLIB_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/include/dbus

View File

@ -4,14 +4,18 @@
#
# Output variables:
#
# AUTOBUILD_EXECUTABLE - path to autobuild or pautobuild executable
# AUTOBUILD_EXECUTABLE - path to autobuild executable
# *TODO - if cmake was executed by autobuild, autobuild will have set the AUTOBUILD env var
# update this to check for that case
IF (NOT AUTOBUILD_EXECUTABLE)
# If cmake was executed by autobuild, autobuild will have set the AUTOBUILD env var
IF (DEFINED ENV{AUTOBUILD})
SET(AUTOBUILD_EXECUTABLE $ENV{AUTOBUILD})
ELSE (DEFINED ENV{AUTOBUILD})
IF(WIN32)
SET(AUTOBUILD_EXE_NAMES autobuild.cmd autobuild.exe)
SET(AUTOBUILD_EXE_NAMES autobuild.exe autobuild.cmd)
ELSE(WIN32)
SET(AUTOBUILD_EXE_NAMES autobuild)
ENDIF(WIN32)
@ -21,21 +25,19 @@ IF (NOT AUTOBUILD_EXECUTABLE)
AUTOBUILD_EXECUTABLE
NAMES ${AUTOBUILD_EXE_NAMES}
PATHS
ENV PATH
${CMAKE_SOURCE_DIR}/..
${CMAKE_SOURCE_DIR}/../..
${CMAKE_SOURCE_DIR}/../../..
ENV PATH
${CMAKE_SOURCE_DIR}/..
${CMAKE_SOURCE_DIR}/../..
${CMAKE_SOURCE_DIR}/../../..
PATH_SUFFIXES "/autobuild/bin/"
)
ENDIF (DEFINED ENV{AUTOBUILD})
IF (AUTOBUILD_EXECUTABLE)
GET_FILENAME_COMPONENT(_autobuild_name ${AUTOBUILD_EXECUTABLE} NAME_WE)
MESSAGE(STATUS "Using autobuild at: ${AUTOBUILD_EXECUTABLE}")
ELSE (AUTOBUILD_EXECUTABLE)
IF (AUTOBUILD_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find autobuild executable")
ENDIF (AUTOBUILD_FIND_REQUIRED)
ENDIF (AUTOBUILD_EXECUTABLE)
IF (NOT AUTOBUILD_EXECUTABLE)
IF (AUTOBUILD_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find autobuild executable")
ENDIF (AUTOBUILD_FIND_REQUIRED)
ENDIF (NOT AUTOBUILD_EXECUTABLE)
MARK_AS_ADVANCED(AUTOBUILD_EXECUTABLE)
MARK_AS_ADVANCED(AUTOBUILD_EXECUTABLE)
ENDIF (NOT AUTOBUILD_EXECUTABLE)

View File

@ -2,7 +2,9 @@
include(Prebuilt)
if (NOT USESYSTEMLIBS)
use_prebuilt_binary(glext)
use_prebuilt_binary(glh_linear)
if (WINDOWS OR LINUX)
use_prebuilt_binary(glext)
endif (WINDOWS OR LINUX)
use_prebuilt_binary(glh-linear)
set(GLEXT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
endif (NOT USESYSTEMLIBS)

View File

@ -7,5 +7,5 @@ set(GLH_FIND_QUIETLY TRUE)
if (USESYSTEMLIBS)
include(FindGLH)
else (USESYSTEMLIBS)
use_prebuilt_binary(glh_linear)
use_prebuilt_binary(glh-linear)
endif (USESYSTEMLIBS)

View File

@ -2,7 +2,7 @@
include(Prebuilt)
if (NOT USESYSTEMLIBS)
use_prebuilt_binary(GLOD)
use_prebuilt_binary(glod)
endif (NOT USESYSTEMLIBS)
set(GLOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)

View File

@ -2,20 +2,20 @@
include(Prebuilt)
include(Linking)
use_prebuilt_binary(gmock)
use_prebuilt_binary(googlemock)
set(GOOGLEMOCK_INCLUDE_DIRS
set(GOOGLEMOCK_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/include)
if (LINUX)
# VWR-24366: gmock is underlinked, it needs gtest.
set(GOOGLEMOCK_LIBRARIES
set(GOOGLEMOCK_LIBRARIES
gmock -Wl,--no-as-needed
gtest -Wl,--as-needed)
elseif(WINDOWS)
set(GOOGLEMOCK_LIBRARIES
set(GOOGLEMOCK_LIBRARIES
gmock)
set(GOOGLEMOCK_INCLUDE_DIRS
set(GOOGLEMOCK_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/include
${LIBS_PREBUILT_DIR}/include/gmock
${LIBS_PREBUILT_DIR}/include/gmock/boost/tr1/tr1)

View File

@ -1,5 +1,5 @@
# -*- cmake -*-
include(Prebuilt)
if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
@ -61,14 +61,14 @@ foreach(HAVOK_LIB ${HAVOK_LIBS})
set(relwithdebinfo_dir "${HAVOK_RELWITHDEBINFO_LIBRARY_PATH}/${HAVOK_LIB}")
# Try to avoid extracting havok library each time we run cmake.
if("${havok_${HAVOK_LIB}_extracted}" STREQUAL "" AND EXISTS "${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted")
file(READ ${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted "havok_${HAVOK_LIB}_extracted")
if("${havok_${HAVOK_LIB}_extracted}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted")
file(READ ${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted "havok_${HAVOK_LIB}_extracted")
if(DEBUG_PREBUILT)
message(STATUS "havok_${HAVOK_LIB}_extracted: \"${havok_${HAVOK_LIB}_extracted}\"")
endif(DEBUG_PREBUILT)
endif("${havok_${HAVOK_LIB}_extracted}" STREQUAL "" AND EXISTS "${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted")
endif("${havok_${HAVOK_LIB}_extracted}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted")
if(${CMAKE_BINARY_DIR}/temp/havok-source_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted OR NOT ${havok_${HAVOK_LIB}_extracted} EQUAL 0)
if(${PREBUILD_TRACKING_DIR}/havok_source_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted OR NOT ${havok_${HAVOK_LIB}_extracted} EQUAL 0)
if(DEBUG_PREBUILT)
MESSAGE(STATUS "Extracting ${HAVOK_LIB}...")
endif(DEBUG_PREBUILT)
@ -109,9 +109,9 @@ foreach(HAVOK_LIB ${HAVOK_LIBS})
# Just assume success for now.
set(havok_${HAVOK_LIB}_extracted 0)
file(WRITE ${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted "${havok_${HAVOK_LIB}_extracted}")
file(WRITE ${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted "${havok_${HAVOK_LIB}_extracted}")
endif(${CMAKE_BINARY_DIR}/temp/havok-source_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted OR NOT ${havok_${HAVOK_LIB}_extracted} EQUAL 0)
endif(${PREBUILD_TRACKING_DIR}/havok_source_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted OR NOT ${havok_${HAVOK_LIB}_extracted} EQUAL 0)
file(GLOB extracted_debug "${debug_dir}/*.o")
file(GLOB extracted_release "${release_dir}/*.o")

View File

@ -11,10 +11,10 @@ else (USESYSTEMLIBS)
use_prebuilt_binary(jsoncpp)
if (WINDOWS)
set(JSONCPP_LIBRARIES
debug json_vc100debug_libmt.lib
optimized json_vc100_libmt)
debug json_libmdd.lib
optimized json_libmd.lib)
elseif (DARWIN)
set(JSONCPP_LIBRARIES libjson_linux-gcc-4.0.1_libmt.a)
set(JSONCPP_LIBRARIES libjson_darwin_libmt.a)
elseif (LINUX)
set(JSONCPP_LIBRARIES libjson_linux-gcc-4.1.3_libmt.a)
endif (WINDOWS)

View File

@ -137,7 +137,7 @@ INCLUDE(GoogleMock)
#
# Setup test targets
#
GET_TARGET_PROPERTY(TEST_EXE PROJECT_${project}_TEST_${name} LOCATION)
SET(TEST_EXE $<TARGET_FILE:PROJECT_${project}_TEST_${name}>)
SET(TEST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/PROJECT_${project}_TEST_${name}_ok.txt)
SET(TEST_CMD ${TEST_EXE} --touch=${TEST_OUTPUT} --sourcedir=${CMAKE_CURRENT_SOURCE_DIR})
@ -225,7 +225,7 @@ FUNCTION(LL_ADD_INTEGRATION_TEST
# Create the test running command
SET(test_command ${ARGN})
GET_TARGET_PROPERTY(TEST_EXE INTEGRATION_TEST_${testname} LOCATION)
SET(TEST_EXE $<TARGET_FILE:INTEGRATION_TEST_${testname}>)
LIST(FIND test_command "{}" test_exe_pos)
IF(test_exe_pos LESS 0)
# The {} marker means "the full pathname of the test executable."

View File

@ -4,7 +4,7 @@ include(Prebuilt)
# Linux proprietary build only
if (INSTALL_PROPRIETARY)
if(LINUX)
use_prebuilt_binary(llappearanceutility-source)
use_prebuilt_binary(llappearance_utility)
set(LLAPPEARANCEUTILITY_SRC_DIR ${LIBS_PREBUILT_DIR}/llappearanceutility/src)
set(LLAPPEARANCEUTILITY_BIN_DIR ${CMAKE_BINARY_DIR}/llappearanceutility)
endif (LINUX)

View File

@ -1,7 +1,7 @@
# ll_deploy_sharedlibs_command
# target_exe: the cmake target of the executable for which the shared libs will be deployed.
macro(ll_deploy_sharedlibs_command target_exe)
get_target_property(TARGET_LOCATION ${target_exe} LOCATION)
set(TARGET_LOCATION $<TARGET_FILE:${target_exe}>)
get_filename_component(OUTPUT_PATH ${TARGET_LOCATION} PATH)
if(DARWIN)

View File

@ -6,7 +6,7 @@ set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
include(Variables)
set(ARCH_PREBUILT_DIRS ${AUTOBUILD_INSTALL_DIR}/lib)
set(ARCH_PREBUILT_DIRS_PLUGINS ${AUTOBUILD_INSTALL_DIR}/plugins)
##set(ARCH_PREBUILT_DIRS_PLUGINS ${AUTOBUILD_INSTALL_DIR}/plugins)
set(ARCH_PREBUILT_DIRS_RELEASE ${AUTOBUILD_INSTALL_DIR}/lib/release)
set(ARCH_PREBUILT_DIRS_DEBUG ${AUTOBUILD_INSTALL_DIR}/lib/debug)
if (WINDOWS)

View File

@ -8,7 +8,11 @@ if (NDOF)
set(NDOF_FIND_REQUIRED ON)
include(FindNDOF)
else (USESYSTEMLIBS)
use_prebuilt_binary(ndofdev)
if (WINDOWS OR DARWIN)
use_prebuilt_binary(libndofdev)
elseif (LINUX)
use_prebuilt_binary(open-libndofdev)
endif (WINDOWS OR DARWIN)
if (WINDOWS)
set(NDOF_LIBRARY libndofdev)

View File

@ -16,7 +16,7 @@ if (OPENAL)
pkg_check_modules(OPENAL_LIB REQUIRED openal)
pkg_check_modules(FREEALUT_LIB REQUIRED freealut)
else (USESYSTEMLIBS)
use_prebuilt_binary(openal_soft)
use_prebuilt_binary(openal)
endif (USESYSTEMLIBS)
if(WINDOWS)
set(OPENAL_LIBRARIES
@ -30,7 +30,3 @@ if (OPENAL)
)
endif()
endif (OPENAL)
if (OPENAL)
message(STATUS "Building with OpenAL audio support")
endif (OPENAL)

View File

@ -8,44 +8,50 @@ if(INSTALL_PROPRIETARY)
include(FindSCP)
endif(INSTALL_PROPRIETARY)
set(PREBUILD_TRACKING_DIR ${AUTOBUILD_INSTALL_DIR}/cmake_tracking)
# For the library installation process;
# see cmake/Prebuild.cmake for the counterpart code.
if ("${CMAKE_SOURCE_DIR}/../autobuild.xml" IS_NEWER_THAN "${PREBUILD_TRACKING_DIR}/sentinel_installed")
file(MAKE_DIRECTORY ${PREBUILD_TRACKING_DIR})
file(WRITE ${PREBUILD_TRACKING_DIR}/sentinel_installed "0")
endif ("${CMAKE_SOURCE_DIR}/../autobuild.xml" IS_NEWER_THAN "${PREBUILD_TRACKING_DIR}/sentinel_installed")
# The use_prebuilt_binary macro handles automated installation of package
# dependencies using autobuild. The goal is that 'autobuild install' should
# only be run when we know we need to install a new package. This should be
# the case in a clean checkout, or if autobuild.xml has been updated since the
# last run (encapsulated by the file ${CMAKE_BINARY_DIR}/temp/sentinel_installed),
# last run (encapsulated by the file ${PREBUILD_TRACKING_DIR}/sentinel_installed),
# or if a previous attempt to install the package has failed (the exit status
# of previous attempts is serialized in the file
# ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
# ${PREBUILD_TRACKING_DIR}/${_binary}_installed)
macro (use_prebuilt_binary _binary)
if (NOT DEFINED USESYSTEMLIBS_${_binary})
set(USESYSTEMLIBS_${_binary} ${USESYSTEMLIBS})
endif (NOT DEFINED USESYSTEMLIBS_${_binary})
if (NOT USESYSTEMLIBS_${_binary})
if("${${_binary}_installed}" STREQUAL "" AND EXISTS "${CMAKE_BINARY_DIR}/temp/${_binary}_installed")
file(READ ${CMAKE_BINARY_DIR}/temp/${_binary}_installed "${_binary}_installed")
if("${${_binary}_installed}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/${_binary}_installed")
file(READ ${PREBUILD_TRACKING_DIR}/${_binary}_installed "${_binary}_installed")
if(DEBUG_PREBUILT)
message(STATUS "${_binary}_installed: \"${${_binary}_installed}\"")
endif(DEBUG_PREBUILT)
endif("${${_binary}_installed}" STREQUAL "" AND EXISTS "${CMAKE_BINARY_DIR}/temp/${_binary}_installed")
endif("${${_binary}_installed}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/${_binary}_installed")
if(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0)
if(${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0)
if(DEBUG_PREBUILT)
message("cd ${CMAKE_SOURCE_DIR} && ${AUTOBUILD_EXECUTABLE} install
--install-dir=${AUTOBUILD_INSTALL_DIR}
--skip-license-check
${_binary} ")
endif(DEBUG_PREBUILT)
execute_process(COMMAND "${AUTOBUILD_EXECUTABLE}"
install
--install-dir=${AUTOBUILD_INSTALL_DIR}
--skip-license-check
${_binary}
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE ${_binary}_installed
)
file(WRITE ${CMAKE_BINARY_DIR}/temp/${_binary}_installed "${${_binary}_installed}")
endif(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0)
file(WRITE ${PREBUILD_TRACKING_DIR}/${_binary}_installed "${${_binary}_installed}")
endif(${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0)
if(NOT ${_binary}_installed EQUAL 0)
message(FATAL_ERROR

View File

@ -2,7 +2,9 @@
if(INSTALL_PROPRIETARY)
include(Prebuilt)
use_prebuilt_binary(quicktime)
if (WINDOWS)
use_prebuilt_binary(quicktime)
endif (WINDOWS)
endif(INSTALL_PROPRIETARY)
if (DARWIN)

View File

@ -32,7 +32,10 @@ if (USESYSTEMLIBS)
add_definitions(${${pkg}_CFLAGS_OTHERS})
endforeach(pkg)
else (USESYSTEMLIBS)
use_prebuilt_binary(gtk-atk-pango-glib)
if (LINUX OR WINDOWS)
use_prebuilt_binary(gtk-atk-pango-glib)
endif (LINUX OR WINDOWS)
if (LINUX)
set(UI_LIBRARIES
atk-1.0

View File

@ -26,6 +26,7 @@ set(VIEWER_PREFIX)
set(INTEGRATION_TESTS_PREFIX)
set(LL_TESTS ON CACHE BOOL "Build and run unit and integration tests (disable for build timing runs to reduce variation")
set(INCREMENTAL_LINK OFF CACHE BOOL "Use incremental linking on win32 builds (enable for faster links on some machines)")
set(ENABLE_MEDIA_PLUGINS OFF CACHE BOOL "Turn off building media plugins if they are imported by third-party library mechanism")
if(LIBS_CLOSED_DIR)
file(TO_CMAKE_PATH "${LIBS_CLOSED_DIR}" LIBS_CLOSED_DIR)
@ -129,44 +130,25 @@ endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(DARWIN 1)
execute_process(
COMMAND sh -c "xcodebuild -version | grep Xcode | cut -d ' ' -f2 | cut -d'.' -f1-2"
OUTPUT_VARIABLE XCODE_VERSION )
# now we only support Xcode 6.0 using 10.9 (Mavericks), minimum OS 10.7 (Lion)
set(XCODE_VERSION 6.0)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7)
set(CMAKE_OSX_SYSROOT macosx10.9)
# To support a different SDK update these Xcode settings:
if (XCODE_VERSION GREATER 4.5)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.8)
set(CMAKE_OSX_SYSROOT macosx10.8)
else (XCODE_VERSION GREATER 4.5)
if (XCODE_VERSION GREATER 4.2)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
set(CMAKE_OSX_SYSROOT macosx10.7)
else (XCODE_VERSION GREATER 4.2)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
set(CMAKE_OSX_SYSROOT macosx10.7)
endif (XCODE_VERSION GREATER 4.2)
endif (XCODE_VERSION GREATER 4.5)
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42")
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0")
set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL 3)
set(CMAKE_XCODE_ATTRIBUTE_GCC_STRICT_ALIASING NO)
set(CMAKE_XCODE_ATTRIBUTE_GCC_FAST_MATH NO)
set(CMAKE_XCODE_ATTRIBUTE_CLANG_X86_VECTOR_INSTRUCTIONS ssse3)
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libstdc++")
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym)
# NOTE: To attempt an i386/PPC Universal build, add this on the configure line:
# -DCMAKE_OSX_ARCHITECTURES:STRING='i386;ppc'
# Build only for i386 by default, system default on MacOSX 10.6 is x86_64
# Build only for i386 by default, system default on MacOSX 10.6+ is x86_64
if (NOT CMAKE_OSX_ARCHITECTURES)
set(CMAKE_OSX_ARCHITECTURES i386)
set(CMAKE_OSX_ARCHITECTURES "i386")
endif (NOT CMAKE_OSX_ARCHITECTURES)
if (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
set(ARCH universal)
else (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc")
set(ARCH ppc)
else (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc")
set(ARCH i386)
endif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc")
endif (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
set(ARCH ${CMAKE_OSX_ARCHITECTURES})
set(LL_ARCH ${ARCH}_darwin)
set(LL_ARCH_DIR universal-darwin)
set(WORD_SIZE 32)
@ -177,10 +159,8 @@ set(GRID agni CACHE STRING "Target Grid")
set(VIEWER_CHANNEL "Second Life Test" CACHE STRING "Viewer Channel Name")
if (XCODE_VERSION GREATER 4.2)
set(ENABLE_SIGNING OFF CACHE BOOL "Enable signing the viewer")
set(SIGNING_IDENTITY "" CACHE STRING "Specifies the signing identity to use, if necessary.")
endif (XCODE_VERSION GREATER 4.2)
set(ENABLE_SIGNING OFF CACHE BOOL "Enable signing the viewer")
set(SIGNING_IDENTITY "" CACHE STRING "Specifies the signing identity to use, if necessary.")
set(VERSION_BUILD "0" CACHE STRING "Revision number passed in from the outside")
set(USESYSTEMLIBS OFF CACHE BOOL "Use libraries from your system rather than Linden-supplied prebuilt libraries.")

View File

@ -2,9 +2,11 @@
include(Prebuilt)
if (NOT USESYSTEMLIBS)
if (LINUX)
use_prebuilt_binary(libuuid)
use_prebuilt_binary(fontconfig)
endif (LINUX)
use_prebuilt_binary(libhunspell)
use_prebuilt_binary(libuuid)
use_prebuilt_binary(slvoice)
use_prebuilt_binary(fontconfig)
endif(NOT USESYSTEMLIBS)

View File

@ -9,7 +9,7 @@ if (USESYSTEMLIBS)
else (USESYSTEMLIBS)
use_prebuilt_binary(xmlrpc-epi)
if (WINDOWS)
set(XMLRPCEPI_LIBRARIES
set(XMLRPCEPI_LIBRARIES
debug xmlrpc-epid
optimized xmlrpc-epi
)

View File

@ -46,6 +46,7 @@ $/LicenseInfo$
import os
import sys
import errno
import signal
import subprocess
@ -112,7 +113,23 @@ def main(command, libpath=[], vars={}):
print "Running: %s" % " ".join(command)
# Make sure we see all relevant output *before* child-process output.
sys.stdout.flush()
return subprocess.call(command)
try:
return subprocess.call(command)
except OSError as err:
# If the caller is trying to execute a test program that doesn't
# exist, we want to produce a reasonable error message rather than a
# traceback. This happens when the build is halted by errors, but
# CMake tries to proceed with testing anyway <eyeroll/>. However, do
# NOT attempt to handle any error but "doesn't exist."
if err.errno != errno.ENOENT:
raise
# In practice, the pathnames into CMake's build tree are so long as to
# obscure the name of the test program. Just print its basename.
print "No such program %s; check for preceding build errors" % \
os.path.basename(command[0])
# What rc should we simulate for missing executable? Windows produces
# 9009.
return 9009
# swiped from vita, sigh, seems like a Bad Idea to introduce dependency
def translate_rc(rc):

View File

@ -182,6 +182,16 @@ public:
void applyMask(U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert);
void addPendingMorphMask() { mNumMorphMasksPending++; }
void* operator new(size_t size)
{
return ll_aligned_malloc_16(size);
}
void operator delete(void* ptr)
{
ll_aligned_free_16(ptr);
}
protected:
LLPolyMorphTarget(const LLPolyMorphTarget& pOther);

View File

@ -73,6 +73,19 @@ public:
/*virtual*/ BOOL parseXml(LLXmlTreeNode* node);
void* operator new(size_t size)
{
return ll_aligned_malloc_16(size);
}
void operator delete(void* ptr)
{
ll_aligned_free_16(ptr);
}
protected:
typedef std::vector<LLPolySkeletalBoneInfo> bone_info_list_t;
bone_info_list_t mBoneInfoList;

View File

@ -35,6 +35,8 @@
class LLTextureManagerBridge
{
public:
virtual ~LLTextureManagerBridge() {}
virtual LLPointer<LLGLTexture> getLocalTexture(BOOL usemipmaps = TRUE, BOOL generate_gl_tex = TRUE) = 0;
virtual LLPointer<LLGLTexture> getLocalTexture(const U32 width, const U32 height, const U8 components, BOOL usemipmaps, BOOL generate_gl_tex = TRUE) = 0;
virtual LLGLTexture* getFetchedTexture(const LLUUID &image_id) = 0;

View File

@ -86,10 +86,10 @@ LLAssetType::EType LLWearable::getAssetType() const
return LLWearableType::getAssetType(mType);
}
BOOL LLWearable::exportFile(LLFILE* fp) const
BOOL LLWearable::exportFile(const std::string& filename) const
{
llofstream ofs(fp);
return exportStream(ofs);
llofstream ofs(filename.c_str(), std::ios_base::out | std::ios_base::trunc | std::ios_base::binary);
return ofs.is_open() && exportStream(ofs);
}
// virtual
@ -201,10 +201,11 @@ void LLWearable::createLayers(S32 te, LLAvatarAppearance *avatarp)
}
}
LLWearable::EImportResult LLWearable::importFile(LLFILE* fp, LLAvatarAppearance* avatarp )
LLWearable::EImportResult LLWearable::importFile(const std::string& filename,
LLAvatarAppearance* avatarp )
{
llifstream ifs(fp);
return importStream(ifs, avatarp);
llifstream ifs(filename.c_str(), std::ios_base::in | std::ios_base::binary);
return (! ifs.is_open())? FAILURE : importStream(ifs, avatarp);
}
// virtual

View File

@ -81,8 +81,8 @@ public:
SUCCESS,
BAD_HEADER
};
BOOL exportFile(LLFILE* file) const;
EImportResult importFile(LLFILE* file, LLAvatarAppearance* avatarp );
BOOL exportFile(const std::string& filename) const;
EImportResult importFile(const std::string& filename, LLAvatarAppearance* avatarp );
virtual BOOL exportStream( std::ostream& output_stream ) const;
virtual EImportResult importStream( std::istream& input_stream, LLAvatarAppearance* avatarp );
@ -113,6 +113,9 @@ public:
// Update the baked texture hash.
virtual void addToBakedTextureHash(LLMD5& hash) const = 0;
typedef std::map<S32, LLVisualParam *> visual_param_index_map_t;
visual_param_index_map_t mVisualParamIndexMap;
protected:
typedef std::map<S32, LLLocalTextureObject*> te_map_t;
void syncImages(te_map_t &src, te_map_t &dst);
@ -132,9 +135,6 @@ protected:
typedef std::map<S32, F32> param_map_t;
param_map_t mSavedVisualParamMap; // last saved version of visual params
typedef std::map<S32, LLVisualParam *> visual_param_index_map_t;
visual_param_index_map_t mVisualParamIndexMap;
te_map_t mTEMap; // maps TE to LocalTextureObject
te_map_t mSavedTEMap; // last saved version of TEMap
};

View File

@ -173,8 +173,9 @@ bool LLWearableData::swapWearables(const LLWearableType::EType type, U32 index_a
}
wearableentry_vec_t& wearable_vec = wearable_iter->second;
if (0 > index_a || index_a >= wearable_vec.size()) return false;
if (0 > index_b || index_b >= wearable_vec.size()) return false;
// removed 0 > index_a and index_b comparisions - can never be true
if (index_a >= wearable_vec.size()) return false;
if (index_b >= wearable_vec.size()) return false;
LLWearable* wearable = wearable_vec[index_a];
wearable_vec[index_a] = wearable_vec[index_b];

View File

@ -35,6 +35,9 @@
class LLTranslationBridge
{
public:
// clang needs this to be happy
virtual ~LLTranslationBridge() {}
virtual std::string getString(const std::string &xml_desc) = 0;
};

View File

@ -3,7 +3,6 @@
project(llaudio)
include(00-Common)
include(Audio)
include(LLAudio)
include(FMODEX)
include(OPENAL)

View File

@ -247,8 +247,7 @@ BOOL LLVorbisDecodeState::initDecode()
LL_WARNS("AudioEngine") << "Illegal sample count: " << sample_count << LL_ENDL;
}
if( size_guess > LLVORBIS_CLIP_REJECT_SIZE ||
size_guess < 0)
if( size_guess > LLVORBIS_CLIP_REJECT_SIZE )
{
abort_decode = true;
LL_WARNS("AudioEngine") << "Illegal sample size: " << size_guess << LL_ENDL;
@ -697,11 +696,3 @@ BOOL LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid)
LL_DEBUGS("AudioEngine") << "addDecodeRequest for " << uuid << " no file available" << LL_ENDL;
return FALSE;
}
#if LL_DARWIN || LL_LINUX
// HACK: to fool the compiler into not emitting unused warnings.
namespace {
const ov_callbacks callback_array[4] = {OV_CALLBACKS_DEFAULT, OV_CALLBACKS_NOCLOSE, OV_CALLBACKS_STREAMONLY,
OV_CALLBACKS_STREAMONLY_NOCLOSE};
}
#endif

View File

@ -39,8 +39,6 @@
//-----------------------------------------------------------------------------
const LLQuaternion EDIT_MOTION_WRIST_ROTATION(F_PI_BY_TWO * 0.7f, LLVector3(1.0f, 0.0f, 0.0f));
const F32 TARGET_LAG_HALF_LIFE = 0.1f; // half-life of IK targeting
const F32 TORSO_LAG_HALF_LIFE = 0.2f;
const F32 MAX_TIME_DELTA = 2.f; //max two seconds a frame for calculating interpolation
S32 LLEditingMotion::sHandPose = LLHandMotion::HAND_POSE_RELAXED_R;
S32 LLEditingMotion::sHandPosePriority = 3;

View File

@ -43,11 +43,8 @@ const F32 TORSO_LAG = 0.35f; // torso rotation factor
const F32 NECK_LAG = 0.5f; // neck rotation factor
const F32 HEAD_LOOKAT_LAG_HALF_LIFE = 0.15f; // half-life of lookat targeting for head
const F32 TORSO_LOOKAT_LAG_HALF_LIFE = 0.27f; // half-life of lookat targeting for torso
const F32 EYE_LOOKAT_LAG_HALF_LIFE = 0.06f; // half-life of lookat targeting for eye
const F32 HEAD_ROTATION_CONSTRAINT = F_PI_BY_TWO * 0.8f; // limit angle for head rotation
const F32 MIN_HEAD_LOOKAT_DISTANCE = 0.3f; // minimum distance from head before we turn to look at it
const F32 MAX_TIME_DELTA = 2.f; //max two seconds a frame for calculating interpolation
const F32 EYE_JITTER_MIN_TIME = 0.3f; // min amount of time between eye "jitter" motions
const F32 EYE_JITTER_MAX_TIME = 2.5f; // max amount of time between eye "jitter" motions
const F32 EYE_JITTER_MAX_YAW = 0.08f; // max yaw of eye jitter motion

View File

@ -902,7 +902,7 @@ void LLKeyframeMotion::deactivateConstraint(JointConstraint *constraintp)
constraintp->mSourceVolume->mUpdateXform = FALSE;
}
if (!constraintp->mSharedData->mConstraintTargetType == CONSTRAINT_TARGET_TYPE_GROUND)
if (constraintp->mSharedData->mConstraintTargetType != CONSTRAINT_TARGET_TYPE_GROUND)
{
if (constraintp->mTargetVolume)
{
@ -1048,7 +1048,7 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8
LLVector3 source_to_target = target_pos - keyframe_source_pos;
S32 max_iteration_count = llround(clamp_rescale(
S32 max_iteration_count = ll_round(clamp_rescale(
mCharacter->getPixelArea(),
MAX_PIXEL_AREA_CONSTRAINTS,
MIN_PIXEL_AREA_CONSTRAINTS,

View File

@ -45,10 +45,7 @@ const F32 TIME_EPSILON = 0.001f; // minumum frame time
const F32 MAX_TIME_DELTA = 2.f; // max two seconds a frame for calculating interpolation
F32 SPEED_ADJUST_MAX_SEC = 2.f; // maximum adjustment to walk animation playback speed for a second
F32 ANIM_SPEED_MAX = 1.5f; // absolute upper limit on animation speed
const F32 DRIFT_COMP_MAX_TOTAL = 0.1f; // maximum drift compensation overall, in any direction
const F32 DRIFT_COMP_MAX_SPEED = 4.f; // speed at which drift compensation total maxes out
const F32 MAX_ROLL = 0.6f;
const F32 PELVIS_COMPENSATION_WIEGHT = 0.7f; // proportion of foot drift that is compensated by moving the avatar directly
const F32 SPEED_ADJUST_TIME_CONSTANT = 0.1f; // time constant for speed adjustment interpolation
//-----------------------------------------------------------------------------

View File

@ -38,9 +38,6 @@
// Constants
//-----------------------------------------------------------------------------
const F32 TORSO_TARGET_HALF_LIFE = 0.25f;
const F32 MAX_TIME_DELTA = 2.f; //max two seconds a frame for calculating interpolation
const F32 TARGET_PLANE_THRESHOLD_DOT = 0.6f;
const F32 TORSO_ROT_FRACTION = 0.5f;
//-----------------------------------------------------------------------------
// LLTargetingMotion()

View File

@ -306,7 +306,7 @@ if (LL_TESTS)
LL_ADD_INTEGRATION_TEST(llunits "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(stringize "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(lleventdispatcher "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(lleventcoro "" "${test_libs};${BOOST_CONTEXT_LIBRARY};${BOOST_COROUTINE_LIBRARY};${BOOST_SYSTEM_LIBRARY}")
LL_ADD_INTEGRATION_TEST(lleventcoro "" "${test_libs};${BOOST_CONTEXT_LIBRARY};${BOOST_THREAD_LIBRARY};${BOOST_COROUTINE_LIBRARY};${BOOST_SYSTEM_LIBRARY}")
LL_ADD_INTEGRATION_TEST(llprocess "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(llleap "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(llstreamqueue "" "${test_libs}")

View File

@ -113,7 +113,7 @@ namespace {
public:
RecordToFile(const std::string& filename)
{
mFile.open(filename, llofstream::out | llofstream::app);
mFile.open(filename.c_str(), std::ios_base::out | std::ios_base::app);
if (!mFile)
{
LL_INFOS() << "Error setting log file to " << filename << LL_ENDL;
@ -127,7 +127,7 @@ namespace {
mFile.close();
}
bool okay() { return mFile; }
bool okay() { return mFile.good(); }
virtual void recordMessage(LLError::ELevel level,
const std::string& message)
@ -336,7 +336,7 @@ namespace
LLSD configuration;
{
llifstream file(filename());
llifstream file(filename().c_str());
if (file.is_open())
{
LLSDSerialize::fromXML(configuration, file);

View File

@ -67,7 +67,7 @@ public:
LLEventPumpOrPumpName() {}
operator LLEventPump& () const { return *mPump; }
LLEventPump& getPump() const { return *mPump; }
operator bool() const { return mPump; }
operator bool() const { return bool(mPump); }
bool operator!() const { return ! mPump; }
private:
@ -102,6 +102,9 @@ LLVoidListener<LISTENER> voidlistener(const LISTENER& listener)
namespace LLEventDetail
{
/// Implementation for listenerNameForCoro(), see below
LL_COMMON_API std::string listenerNameForCoroImpl(const void* self_id);
/**
* waitForEventOn() permits a coroutine to temporarily listen on an
* LLEventPump any number of times. We don't really want to have to ask
@ -129,9 +132,6 @@ namespace LLEventDetail
return listenerNameForCoroImpl(self.get_id());
}
/// Implementation for listenerNameForCoro()
LL_COMMON_API std::string listenerNameForCoroImpl(const void* self_id);
/**
* Implement behavior described for postAndWait()'s @a replyPumpNamePath
* parameter:

View File

@ -424,26 +424,6 @@ LLFILE * LLFile::_Fiopen(const std::string& filename,
/************** llstdio file buffer ********************************/
//llstdio_filebuf* llstdio_filebuf::open(const char *_Filename,
// ios_base::openmode _Mode)
//{
//#if LL_WINDOWS
// _Filet *_File;
// if (is_open() || (_File = LLFILE::_Fiopen(_Filename, _Mode)) == 0)
// return (0); // open failed
//
// _Init(_File, _Openfl);
// _Initcvt(&_USE(_Mysb::getloc(), _Cvt));
// return (this); // open succeeded
//#else
// std::filebuf* _file = std::filebuf::open(_Filename, _Mode);
// if (NULL == _file) return NULL;
// return this;
//#endif
//}
// *TODO: Seek the underlying c stream for better cross-platform compatibility?
#if !LL_WINDOWS
llstdio_filebuf::int_type llstdio_filebuf::overflow(llstdio_filebuf::int_type __c)
{
@ -807,7 +787,7 @@ std::streamsize llstdio_filebuf::xsgetn(char_type* __s, std::streamsize __n)
return __ret;
}
std::streamsize llstdio_filebuf::xsputn(char_type* __s, std::streamsize __n)
std::streamsize llstdio_filebuf::xsputn(const char_type* __s, std::streamsize __n)
{
// Optimization in the always_noconv() case, to be generalized in the
// future: when __n is sufficiently large we write directly instead of
@ -865,23 +845,19 @@ int llstdio_filebuf::sync()
}
#endif
#if LL_WINDOWS
/************** input file stream ********************************/
llifstream::llifstream() : _M_filebuf(),
#if LL_WINDOWS
std::istream(&_M_filebuf) {}
#else
std::istream()
llifstream::llifstream() :
_M_filebuf(),
std::istream(&_M_filebuf)
{
this->init(&_M_filebuf);
}
#endif
// explicit
llifstream::llifstream(const std::string& _Filename,
ios_base::openmode _Mode) : _M_filebuf(),
#if LL_WINDOWS
ios_base::openmode _Mode) :
_M_filebuf(),
std::istream(&_M_filebuf)
{
llutf16string wideName = utf8str_to_utf16str( _Filename );
@ -890,18 +866,11 @@ llifstream::llifstream(const std::string& _Filename,
_Myios::setstate(ios_base::failbit);
}
}
#else
std::istream()
{
this->init(&_M_filebuf);
this->open(_Filename.c_str(), _Mode | ios_base::in);
}
#endif
// explicit
llifstream::llifstream(const char* _Filename,
ios_base::openmode _Mode) : _M_filebuf(),
#if LL_WINDOWS
ios_base::openmode _Mode) :
_M_filebuf(),
std::istream(&_M_filebuf)
{
llutf16string wideName = utf8str_to_utf16str( _Filename );
@ -910,38 +879,6 @@ llifstream::llifstream(const char* _Filename,
_Myios::setstate(ios_base::failbit);
}
}
#else
std::istream()
{
this->init(&_M_filebuf);
this->open(_Filename, _Mode | ios_base::in);
}
#endif
// explicit
llifstream::llifstream(_Filet *_File,
ios_base::openmode _Mode, size_t _Size) :
_M_filebuf(_File, _Mode, _Size),
#if LL_WINDOWS
std::istream(&_M_filebuf) {}
#else
std::istream()
{
this->init(&_M_filebuf);
}
#endif
#if !LL_WINDOWS
// explicit
llifstream::llifstream(int __fd,
ios_base::openmode _Mode, size_t _Size) :
_M_filebuf(__fd, _Mode, _Size),
std::istream()
{
this->init(&_M_filebuf);
}
#endif
bool llifstream::is_open() const
{ // test if C stream has been opened
@ -950,8 +887,6 @@ bool llifstream::is_open() const
void llifstream::open(const char* _Filename, ios_base::openmode _Mode)
{ // open a C stream with specified mode
#if LL_WINDOWS
llutf16string wideName = utf8str_to_utf16str( _Filename );
if (_M_filebuf.open( wideName.c_str(), _Mode | ios_base::in) == 0)
{
@ -961,27 +896,13 @@ void llifstream::open(const char* _Filename, ios_base::openmode _Mode)
{
_Myios::clear();
}
#else
if (_M_filebuf.open(_Filename, _Mode | ios_base::in) == 0)
{
this->setstate(ios_base::failbit);
}
else
{
this->clear();
}
#endif
}
void llifstream::close()
{ // close the C stream
if (_M_filebuf.close() == 0)
{
#if LL_WINDOWS
_Myios::setstate(ios_base::failbit);
#else
this->setstate(ios_base::failbit);
#endif
}
}
@ -989,20 +910,16 @@ void llifstream::close()
/************** output file stream ********************************/
llofstream::llofstream() : _M_filebuf(),
#if LL_WINDOWS
std::ostream(&_M_filebuf) {}
#else
std::ostream()
llofstream::llofstream() :
_M_filebuf(),
std::ostream(&_M_filebuf)
{
this->init(&_M_filebuf);
}
#endif
// explicit
llofstream::llofstream(const std::string& _Filename,
ios_base::openmode _Mode) : _M_filebuf(),
#if LL_WINDOWS
ios_base::openmode _Mode) :
_M_filebuf(),
std::ostream(&_M_filebuf)
{
llutf16string wideName = utf8str_to_utf16str( _Filename );
@ -1011,18 +928,11 @@ llofstream::llofstream(const std::string& _Filename,
_Myios::setstate(ios_base::failbit);
}
}
#else
std::ostream()
{
this->init(&_M_filebuf);
this->open(_Filename.c_str(), _Mode | ios_base::out);
}
#endif
// explicit
llofstream::llofstream(const char* _Filename,
ios_base::openmode _Mode) : _M_filebuf(),
#if LL_WINDOWS
ios_base::openmode _Mode) :
_M_filebuf(),
std::ostream(&_M_filebuf)
{
llutf16string wideName = utf8str_to_utf16str( _Filename );
@ -1031,37 +941,6 @@ llofstream::llofstream(const char* _Filename,
_Myios::setstate(ios_base::failbit);
}
}
#else
std::ostream()
{
this->init(&_M_filebuf);
this->open(_Filename, _Mode | ios_base::out);
}
#endif
// explicit
llofstream::llofstream(_Filet *_File,
ios_base::openmode _Mode, size_t _Size) :
_M_filebuf(_File, _Mode, _Size),
#if LL_WINDOWS
std::ostream(&_M_filebuf) {}
#else
std::ostream()
{
this->init(&_M_filebuf);
}
#endif
#if !LL_WINDOWS
// explicit
llofstream::llofstream(int __fd,
ios_base::openmode _Mode, size_t _Size) :
_M_filebuf(__fd, _Mode, _Size),
std::ostream()
{
this->init(&_M_filebuf);
}
#endif
bool llofstream::is_open() const
{ // test if C stream has been opened
@ -1070,7 +949,6 @@ bool llofstream::is_open() const
void llofstream::open(const char* _Filename, ios_base::openmode _Mode)
{ // open a C stream with specified mode
#if LL_WINDOWS
llutf16string wideName = utf8str_to_utf16str( _Filename );
if (_M_filebuf.open( wideName.c_str(), _Mode | ios_base::out) == 0)
{
@ -1080,27 +958,13 @@ void llofstream::open(const char* _Filename, ios_base::openmode _Mode)
{
_Myios::clear();
}
#else
if (_M_filebuf.open(_Filename, _Mode | ios_base::out) == 0)
{
this->setstate(ios_base::failbit);
}
else
{
this->clear();
}
#endif
}
void llofstream::close()
{ // close the C stream
if (_M_filebuf.close() == 0)
{
#if LL_WINDOWS
_Myios::setstate(ios_base::failbit);
#else
this->setstate(ios_base::failbit);
#endif
}
}
@ -1130,4 +994,4 @@ std::streamsize llofstream_size(llofstream& ofstr)
return pos_end - pos_beg;
}
#endif // LL_WINDOWS

View File

@ -188,11 +188,11 @@ protected:
/*virtual*/ int sync();
std::streamsize xsgetn(char_type*, std::streamsize);
std::streamsize xsputn(char_type*, std::streamsize);
std::streamsize xsputn(const char_type*, std::streamsize);
#endif
};
#if LL_WINDOWS
/**
* @brief Controlling input for files.
*
@ -201,11 +201,11 @@ protected:
* sequence, an instance of std::basic_filebuf (or a platform-specific derivative)
* which allows construction using a pre-exisintg file stream buffer.
* We refer to this std::basic_filebuf (or derivative) as @c sb.
*/
*/
class LL_COMMON_API llifstream : public std::istream
{
// input stream associated with a C stream
public:
public:
// Constructors:
/**
* @brief Default constructor.
@ -213,7 +213,7 @@ public:
* Initializes @c sb using its default constructor, and passes
* @c &sb to the base class initializer. Does not open any files
* (you haven't given it a filename to open).
*/
*/
llifstream();
/**
@ -222,44 +222,18 @@ public:
* @param Mode Open file in specified mode (see std::ios_base).
*
* @c ios_base::in is automatically included in @a mode.
*/
*/
explicit llifstream(const std::string& _Filename,
ios_base::openmode _Mode = ios_base::in);
ios_base::openmode _Mode = ios_base::in);
explicit llifstream(const char* _Filename,
ios_base::openmode _Mode = ios_base::in);
/**
* @brief Create a stream using an open c file stream.
* @param File An open @c FILE*.
@param Mode Same meaning as in a standard filebuf.
@param Size Optimal or preferred size of internal buffer, in chars.
Defaults to system's @c BUFSIZ.
*/
explicit llifstream(_Filet *_File,
ios_base::openmode _Mode = ios_base::in,
//size_t _Size = static_cast<size_t>(BUFSIZ));
size_t _Size = static_cast<size_t>(1));
/**
* @brief Create a stream using an open file descriptor.
* @param fd An open file descriptor.
@param Mode Same meaning as in a standard filebuf.
@param Size Optimal or preferred size of internal buffer, in chars.
Defaults to system's @c BUFSIZ.
*/
#if !LL_WINDOWS
explicit llifstream(int __fd,
ios_base::openmode _Mode = ios_base::in,
//size_t _Size = static_cast<size_t>(BUFSIZ));
size_t _Size = static_cast<size_t>(1));
#endif
ios_base::openmode _Mode = ios_base::in);
/**
* @brief The destructor does nothing.
*
* The file is closed by the filebuf object, not the formatting
* stream.
*/
*/
virtual ~llifstream() {}
// Members:
@ -275,7 +249,7 @@ public:
/**
* @brief Wrapper to test for an open file.
* @return @c rdbuf()->is_open()
*/
*/
bool is_open() const;
/**
@ -285,22 +259,22 @@ public:
*
* Calls @c llstdio_filebuf::open(s,mode|in). If that function
* fails, @c failbit is set in the stream's error state.
*/
*/
void open(const std::string& _Filename,
ios_base::openmode _Mode = ios_base::in)
ios_base::openmode _Mode = ios_base::in)
{ open(_Filename.c_str(), _Mode); }
void open(const char* _Filename,
ios_base::openmode _Mode = ios_base::in);
ios_base::openmode _Mode = ios_base::in);
/**
* @brief Close the file.
*
* Calls @c llstdio_filebuf::close(). If that function
* fails, @c failbit is set in the stream's error state.
*/
*/
void close();
private:
private:
llstdio_filebuf _M_filebuf;
};
@ -316,7 +290,7 @@ private:
*/
class LL_COMMON_API llofstream : public std::ostream
{
public:
public:
// Constructors:
/**
* @brief Default constructor.
@ -324,7 +298,7 @@ public:
* Initializes @c sb using its default constructor, and passes
* @c &sb to the base class initializer. Does not open any files
* (you haven't given it a filename to open).
*/
*/
llofstream();
/**
@ -334,37 +308,11 @@ public:
*
* @c ios_base::out|ios_base::trunc is automatically included in
* @a mode.
*/
*/
explicit llofstream(const std::string& _Filename,
ios_base::openmode _Mode = ios_base::out|ios_base::trunc);
ios_base::openmode _Mode = ios_base::out|ios_base::trunc);
explicit llofstream(const char* _Filename,
ios_base::openmode _Mode = ios_base::out|ios_base::trunc);
/**
* @brief Create a stream using an open c file stream.
* @param File An open @c FILE*.
@param Mode Same meaning as in a standard filebuf.
@param Size Optimal or preferred size of internal buffer, in chars.
Defaults to system's @c BUFSIZ.
*/
explicit llofstream(_Filet *_File,
ios_base::openmode _Mode = ios_base::out,
//size_t _Size = static_cast<size_t>(BUFSIZ));
size_t _Size = static_cast<size_t>(1));
/**
* @brief Create a stream using an open file descriptor.
* @param fd An open file descriptor.
@param Mode Same meaning as in a standard filebuf.
@param Size Optimal or preferred size of internal buffer, in chars.
Defaults to system's @c BUFSIZ.
*/
#if !LL_WINDOWS
explicit llofstream(int __fd,
ios_base::openmode _Mode = ios_base::out,
//size_t _Size = static_cast<size_t>(BUFSIZ));
size_t _Size = static_cast<size_t>(1));
#endif
ios_base::openmode _Mode = ios_base::out|ios_base::trunc);
/**
* @brief The destructor does nothing.
@ -397,22 +345,22 @@ public:
*
* Calls @c llstdio_filebuf::open(s,mode|out). If that function
* fails, @c failbit is set in the stream's error state.
*/
*/
void open(const std::string& _Filename,
ios_base::openmode _Mode = ios_base::out|ios_base::trunc)
ios_base::openmode _Mode = ios_base::out|ios_base::trunc)
{ open(_Filename.c_str(), _Mode); }
void open(const char* _Filename,
ios_base::openmode _Mode = ios_base::out|ios_base::trunc);
ios_base::openmode _Mode = ios_base::out|ios_base::trunc);
/**
* @brief Close the file.
*
* Calls @c llstdio_filebuf::close(). If that function
* fails, @c failbit is set in the stream's error state.
*/
*/
void close();
private:
private:
llstdio_filebuf _M_filebuf;
};
@ -427,4 +375,12 @@ private:
std::streamsize LL_COMMON_API llifstream_size(llifstream& fstr);
std::streamsize LL_COMMON_API llofstream_size(llofstream& fstr);
#else // ! LL_WINDOWS
// on non-windows, llifstream and llofstream are just mapped directly to the std:: equivalents
typedef std::ifstream llifstream;
typedef std::ofstream llofstream;
#endif // LL_WINDOWS or ! LL_WINDOWS
#endif // not LL_LLFILE_H

View File

@ -37,7 +37,6 @@ U64 LLFrameTimer::sTotalTime = 0;
F64 LLFrameTimer::sTotalSeconds = 0.0;
S32 LLFrameTimer::sFrameCount = 0;
U64 LLFrameTimer::sFrameDeltaTime = 0;
const F64 USEC_PER_SECOND = 1000000.0;
const F64 USEC_TO_SEC_F64 = 0.000001;
// static

View File

@ -27,26 +27,7 @@
#ifndef LL_LLHASH_H
#define LL_LLHASH_H
#include "llpreprocessor.h" // for GCC_VERSION
#if (LL_WINDOWS)
#include <hash_map>
#include <algorithm>
#elif LL_DARWIN || LL_LINUX
# if GCC_VERSION >= 40300 // gcc 4.3 and up
# include <backward/hashtable.h>
# elif GCC_VERSION >= 30400 // gcc 3.4 and up
# include <ext/hashtable.h>
# elif __GNUC__ >= 3
# include <ext/stl_hashtable.h>
# else
# include <hashtable.h>
# endif
#elif LL_SOLARIS
#include <ext/hashtable.h>
#else
#error Please define your platform.
#endif
#include <boost/functional/hash.hpp>
// Warning - an earlier template-based version of this routine did not do
// the correct thing on Windows. Since this is only used to get
@ -55,17 +36,17 @@
inline size_t llhash( const char * value )
{
#if LL_WINDOWS
return stdext::hash_value(value);
#elif ( (defined _STLPORT_VERSION) || ((LL_LINUX) && (__GNUC__ <= 2)) )
std::hash<const char *> H;
return H(value);
#elif LL_DARWIN || LL_LINUX || LL_SOLARIS
__gnu_cxx::hash<const char *> H;
return H(value);
#else
#error Please define your platform.
#endif
// boost::hash is defined for std::string and for char, but there's no
// special overload for const char*. The lazy approach would be to
// instantiate a std::string and take its hash, but that might be more
// overhead than our callers want. Or we could use boost::hash_range() --
// but that would require a preliminary pass over the value to determine
// the end iterator. Instead, use boost::hash_combine() to hash individual
// characters.
std::size_t seed = 0;
for ( ; *value; ++value)
boost::hash_combine(seed, *value);
return seed;
}
#endif

View File

@ -435,7 +435,7 @@ namespace LLInitParam
typedef self_t type_value_t;
TypeValuesHelper(const std::string& val)
: TypeValuesHelper(val)
: base_t(val)
{}
void operator ()(const std::string& name)
@ -1123,7 +1123,7 @@ namespace LLInitParam
void set(const value_t& val, bool flag_as_provided = true)
{
named_value_t::clearValueName();
setValue(val);
named_value_t::setValue(val);
setProvided(flag_as_provided);
}
@ -1287,7 +1287,7 @@ namespace LLInitParam
// assign block contents to this param-that-is-a-block
void set(const value_t& val, bool flag_as_provided = true)
{
setValue(val);
named_value_t::setValue(val);
named_value_t::clearValueName();
setProvided(flag_as_provided);
}
@ -2054,7 +2054,7 @@ namespace LLInitParam
Optional& operator =(const value_t& val)
{
set(val);
super_t::set(val);
return *this;
}
@ -2084,7 +2084,7 @@ namespace LLInitParam
Mandatory& operator =(const value_t& val)
{
set(val);
super_t::set(val);
return *this;
}
@ -2120,7 +2120,7 @@ namespace LLInitParam
Multiple& operator =(const container_t& val)
{
set(val);
super_t::set(val);
return *this;
}

View File

@ -49,7 +49,7 @@ bool LLLiveAppConfig::loadFile()
{
LL_INFOS() << "LLLiveAppConfig::loadFile(): reading from "
<< filename() << LL_ENDL;
llifstream file(filename());
llifstream file(filename().c_str());
LLSD config;
if (file.is_open())
{

View File

@ -51,6 +51,8 @@ public:
bool mLastExists;
LLEventTimer* mEventTimer;
private:
LOG_CLASS(LLLiveFile);
};
LLLiveFile::Impl::Impl(const std::string& filename, const F32 refresh_period)
@ -83,46 +85,51 @@ LLLiveFile::~LLLiveFile()
bool LLLiveFile::Impl::check()
{
if (!mForceCheck && mRefreshTimer.getElapsedTimeF32() < mRefreshPeriod)
bool detected_change = false;
// Skip the check if not enough time has elapsed and we're not
// forcing a check of the file
if (mForceCheck || mRefreshTimer.getElapsedTimeF32() >= mRefreshPeriod)
{
// Skip the check if not enough time has elapsed and we're not
// forcing a check of the file
return false;
}
mForceCheck = false;
mRefreshTimer.reset();
mForceCheck = false; // force only forces one check
mRefreshTimer.reset(); // don't check again until mRefreshPeriod has passed
// Stat the file to see if it exists and when it was last modified.
llstat stat_data;
int res = LLFile::stat(mFilename, &stat_data);
if (res)
{
// Couldn't stat the file, that means it doesn't exist or is
// broken somehow. Clear flags and return.
if (mLastExists)
{
mLastExists = false;
return true; // no longer existing is a change!
}
return false;
}
// The file exists, decide if we want to load it.
if (mLastExists)
{
// The file existed last time, don't read it if it hasn't changed since
// last time.
if (stat_data.st_mtime <= mLastModTime)
{
return false;
}
}
// We want to read the file. Update status info for the file.
mLastExists = true;
mLastStatTime = stat_data.st_mtime;
return true;
// Stat the file to see if it exists and when it was last modified.
llstat stat_data;
if (LLFile::stat(mFilename, &stat_data))
{
// Couldn't stat the file, that means it doesn't exist or is
// broken somehow.
if (mLastExists)
{
mLastExists = false;
detected_change = true; // no longer existing is a change!
LL_DEBUGS() << "detected deleted file '" << mFilename << "'" << LL_ENDL;
}
}
else
{
// The file exists
if ( ! mLastExists )
{
// last check, it did not exist - that counts as a change
LL_DEBUGS() << "detected created file '" << mFilename << "'" << LL_ENDL;
detected_change = true;
}
else if ( stat_data.st_mtime > mLastModTime )
{
// file modification time is newer than last check
LL_DEBUGS() << "detected updated file '" << mFilename << "'" << LL_ENDL;
detected_change = true;
}
mLastExists = true;
mLastStatTime = stat_data.st_mtime;
}
}
if (detected_change)
{
LL_INFOS() << "detected file change '" << mFilename << "'" << LL_ENDL;
}
return detected_change;
}
void LLLiveFile::Impl::changed()

View File

@ -139,9 +139,9 @@ namespace LLPredicate
Rule()
{}
void require(ENUM e)
void require(ENUM e, bool match)
{
mRule.set(e, require);
mRule.set(e, match);
}
void allow(ENUM e)

View File

@ -101,6 +101,11 @@
#endif
#if LL_WINDOWS
# define LL_THREAD_LOCAL __declspec(thread)
#else
# define LL_THREAD_LOCAL __thread
#endif
// Static linking with apr on windows needs to be declared.
#if LL_WINDOWS && !LL_COMMON_LINK_SHARED

View File

@ -204,21 +204,6 @@ namespace
return "Unknown";
}
std::string compute_CPUFamilyName(const char* cpu_vendor, int composed_family)
{
const char* intel_string = "GenuineIntel";
const char* amd_string = "AuthenticAMD";
if(!strncmp(cpu_vendor, intel_string, strlen(intel_string)))
{
return intel_CPUFamilyName(composed_family);
}
else if(!strncmp(cpu_vendor, amd_string, strlen(amd_string)))
{
return amd_CPUFamilyName(composed_family);
}
return "Unknown";
}
std::string compute_CPUFamilyName(const char* cpu_vendor, int family, int ext_family)
{
const char* intel_string = "GenuineIntel";
@ -793,7 +778,7 @@ private:
setInfo(eFamily, family);
}
setInfo(eFamilyName, compute_CPUFamilyName(cpuinfo["vendor_id"].c_str(), family));
setInfo(eFamilyName, compute_CPUFamilyName(cpuinfo["vendor_id"].c_str(), family, 0));
// setInfo(eExtendedModel, getSysctlInt("machdep.cpu.extmodel"));
// setInfo(eBrandID, getSysctlInt("machdep.cpu.brand"));

View File

@ -151,29 +151,25 @@ private:
* intrusive pointer support for LLThreadSafeRefCount
* this allows you to use boost::intrusive_ptr with any LLThreadSafeRefCount-derived type
*/
namespace boost
inline void intrusive_ptr_add_ref(LLThreadSafeRefCount* p)
{
inline void intrusive_ptr_add_ref(LLThreadSafeRefCount* p)
{
p->ref();
}
p->ref();
}
inline void intrusive_ptr_release(LLThreadSafeRefCount* p)
{
p->unref();
}
inline void intrusive_ptr_add_ref(LLRefCount* p)
{
p->ref();
}
inline void intrusive_ptr_release(LLRefCount* p)
{
p->unref();
}
};
inline void intrusive_ptr_release(LLThreadSafeRefCount* p)
{
p->unref();
}
inline void intrusive_ptr_add_ref(LLRefCount* p)
{
p->ref();
}
inline void intrusive_ptr_release(LLRefCount* p)
{
p->unref();
}
#endif

View File

@ -789,10 +789,7 @@ namespace
{
inline LLSD::Impl& safe(LLSD::Impl* impl)
{ return LLSD::Impl::safe(impl); }
inline const LLSD::Impl& safe(const LLSD::Impl* impl)
{ return LLSD::Impl::safe(impl); }
inline ImplMap& makeMap(LLSD::Impl*& var)
{ return safe(var).makeMap(var); }

View File

@ -106,7 +106,6 @@ private:
Parser::name_stack_t mNameStack;
const LLSD* mCurReadSD;
LLSD* mWriteRootSD;
LLSD* mCurWriteSD;
};

View File

@ -572,7 +572,7 @@ std::string llsd_matches(const LLSD& prototype, const LLSD& data, const std::str
return match_types(prototype.type(), TypeVector(), data.type(), pfx);
}
bool llsd_equals(const LLSD& lhs, const LLSD& rhs, unsigned bits)
bool llsd_equals(const LLSD& lhs, const LLSD& rhs, int bits)
{
// We're comparing strict equality of LLSD representation rather than
// performing any conversions. So if the types aren't equal, the LLSD

View File

@ -126,7 +126,7 @@ LL_COMMON_API std::string llsd_matches(const LLSD& prototype, const LLSD& data,
/// Deep equality. If you want to compare LLSD::Real values for approximate
/// equality rather than bitwise equality, pass @a bits as for
/// is_approx_equal_fraction().
LL_COMMON_API bool llsd_equals(const LLSD& lhs, const LLSD& rhs, unsigned bits=-1);
LL_COMMON_API bool llsd_equals(const LLSD& lhs, const LLSD& rhs, int bits=-1);
// Simple function to copy data out of input & output iterators if
// there is no need for casting.

View File

@ -107,7 +107,7 @@ bool iswindividual(llwchar elem)
bool _read_file_into_string(std::string& str, const std::string& filename)
{
llifstream ifs(filename, llifstream::binary);
llifstream ifs(filename.c_str(), llifstream::binary);
if (!ifs.is_open())
{
LL_INFOS() << "Unable to open file " << filename << LL_ENDL;
@ -1397,7 +1397,7 @@ void LLStringUtilBase<T>::testHarness()
s2.erase( 4, 1 );
llassert( s2 == "hell");
s2.insert( 0, 'y' );
s2.insert( 0, "y" );
llassert( s2 == "yhell");
s2.erase( 1, 3 );
llassert( s2 == "yl");

View File

@ -99,8 +99,6 @@ const char MEMINFO_FILE[] = "/proc/meminfo";
extern int errno;
#endif
static const S32 CPUINFO_BUFFER_SIZE = 16383;
LLCPUInfo gSysCPU;
// Don't log memory info any more often than this. It also serves as our
@ -672,8 +670,6 @@ const std::string& LLOSInfo::getOSVersionString() const
return mOSVersionString;
}
const S32 STATUS_SIZE = 8192;
//static
U32 LLOSInfo::getProcessVirtualSizeKB()
{
@ -681,6 +677,7 @@ U32 LLOSInfo::getProcessVirtualSizeKB()
#if LL_WINDOWS
#endif
#if LL_LINUX
# define STATUS_SIZE 2048
LLFILE* status_filep = LLFile::fopen("/proc/self/status", "rb");
if (status_filep)
{

View File

@ -92,13 +92,7 @@ void set_thread_name( DWORD dwThreadID, const char* threadName)
//
//----------------------------------------------------------------------------
#if LL_DARWIN
// statically allocated thread local storage not supported in Darwin executable formats
#elif LL_WINDOWS
U32 __declspec(thread) sThreadID = 0;
#elif LL_LINUX
U32 __thread sThreadID = 0;
#endif
U32 LL_THREAD_LOCAL sThreadID = 0;
U32 LLThread::sIDIter = 0;
@ -115,9 +109,7 @@ LL_COMMON_API void assert_main_thread()
void LLThread::registerThreadID()
{
#if !LL_DARWIN
sThreadID = ++sIDIter;
#endif
}
//
@ -134,9 +126,7 @@ void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap
// for now, hard code all LLThreads to report to single master thread recorder, which is known to be running on main thread
threadp->mRecorder = new LLTrace::ThreadRecorder(*LLTrace::get_master_thread_recorder());
#if !LL_DARWIN
sThreadID = threadp->mID;
#endif
// Run the user supplied function
threadp->run();
@ -347,13 +337,7 @@ void LLThread::setQuitting()
// static
U32 LLThread::currentID()
{
#if LL_DARWIN
// statically allocated thread local storage not supported in Darwin executable formats
return (U32)apr_os_thread_current();
#else
return sThreadID;
#endif
}
// static

View File

@ -130,56 +130,19 @@ class LLThreadLocalSingletonPointer
public:
LL_FORCE_INLINE static DERIVED_TYPE* getInstance()
{
#if LL_DARWIN
createTLSKey();
return (DERIVED_TYPE*)pthread_getspecific(sInstanceKey);
#else
return sInstance;
#endif
}
static void setInstance(DERIVED_TYPE* instance)
{
#if LL_DARWIN
createTLSKey();
pthread_setspecific(sInstanceKey, (void*)instance);
#else
sInstance = instance;
#endif
}
private:
#if LL_WINDOWS
static __declspec(thread) DERIVED_TYPE* sInstance;
#elif LL_LINUX
static __thread DERIVED_TYPE* sInstance;
#elif LL_DARWIN
static void TLSError()
{
LL_ERRS() << "Could not create thread local storage" << LL_ENDL;
}
static void createTLSKey()
{
static S32 key_created = pthread_key_create(&sInstanceKey, NULL);
if (key_created != 0)
{
LL_ERRS() << "Could not create thread local storage" << LL_ENDL;
}
}
static pthread_key_t sInstanceKey;
#endif
static LL_THREAD_LOCAL DERIVED_TYPE* sInstance;
};
#if LL_WINDOWS
template<typename DERIVED_TYPE>
__declspec(thread) DERIVED_TYPE* LLThreadLocalSingletonPointer<DERIVED_TYPE>::sInstance = NULL;
#elif LL_LINUX
template<typename DERIVED_TYPE>
__thread DERIVED_TYPE* LLThreadLocalSingletonPointer<DERIVED_TYPE>::sInstance = NULL;
#elif LL_DARWIN
template<typename DERIVED_TYPE>
pthread_key_t LLThreadLocalSingletonPointer<DERIVED_TYPE>::sInstanceKey;
#endif
LL_THREAD_LOCAL DERIVED_TYPE* LLThreadLocalSingletonPointer<DERIVED_TYPE>::sInstance = NULL;
#endif // LL_LLTHREADLOCALSTORAGE_H

View File

@ -39,14 +39,10 @@
# error "architecture not supported"
#endif
//
// Locally used constants
//
const F64 SEC_TO_MICROSEC = 1000000.f;
const U64 SEC_TO_MICROSEC_U64 = 1000000;
const F64 USEC_TO_SEC_F64 = 0.000001;
//---------------------------------------------------------------------------
// Globals and statics

View File

@ -62,11 +62,11 @@ namespace LLTrace
{}
public:
AccumulatorBuffer(const AccumulatorBuffer& other = *getDefaultBuffer())
: mStorageSize(0),
AccumulatorBuffer()
: mStorageSize(0),
mStorage(NULL)
{
const AccumulatorBuffer& other = *getDefaultBuffer();
resize(sNextStorageSlot);
for (S32 i = 0; i < sNextStorageSlot; i++)
{
@ -93,6 +93,18 @@ namespace LLTrace
return mStorage[index];
}
AccumulatorBuffer(const AccumulatorBuffer& other)
: mStorageSize(0),
mStorage(NULL)
{
resize(sNextStorageSlot);
for (S32 i = 0; i < sNextStorageSlot; i++)
{
mStorage[i] = other.mStorage[i];
}
}
void addSamples(const AccumulatorBuffer<ACCUMULATOR>& other, EBufferAppendType append_type)
{
llassert(mStorageSize >= sNextStorageSlot && other.mStorageSize >= sNextStorageSlot);

View File

@ -87,6 +87,40 @@ struct LLUnit
: mValue(value)
{}
LL_FORCE_INLINE static self_t convert(self_t v)
{
return v;
}
template<typename FROM_STORAGE_TYPE>
LL_FORCE_INLINE static self_t convert(LLUnit<FROM_STORAGE_TYPE, UNITS> v)
{
self_t result;
result.mValue = (STORAGE_TYPE)v.value();
return result;
}
template<typename FROM_UNITS>
LL_FORCE_INLINE static self_t convert(LLUnit<STORAGE_TYPE, FROM_UNITS> v)
{
self_t result;
STORAGE_TYPE divisor = ll_convert_units(v, result);
result.mValue /= divisor;
return result;
}
template<typename FROM_STORAGE_TYPE, typename FROM_UNITS>
LL_FORCE_INLINE static self_t convert(LLUnit<FROM_STORAGE_TYPE, FROM_UNITS> v)
{
typedef typename LLResultTypePromote<FROM_STORAGE_TYPE, STORAGE_TYPE>::type_t result_storage_t;
LLUnit<result_storage_t, UNITS> result;
result_storage_t divisor = ll_convert_units(v, result);
result.value(result.value() / divisor);
return self_t(result.value());
}
// unit initialization and conversion
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE LLUnit(LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other)
@ -183,38 +217,6 @@ struct LLUnit
return mValue >= convert(other).value();
}
LL_FORCE_INLINE static self_t convert(self_t v)
{
return v;
}
template<typename FROM_STORAGE_TYPE>
LL_FORCE_INLINE static self_t convert(LLUnit<FROM_STORAGE_TYPE, UNITS> v)
{
self_t result;
result.mValue = (STORAGE_TYPE)v.value();
return result;
}
template<typename FROM_UNITS>
LL_FORCE_INLINE static self_t convert(LLUnit<STORAGE_TYPE, FROM_UNITS> v)
{
self_t result;
STORAGE_TYPE divisor = ll_convert_units(v, result);
result.mValue /= divisor;
return result;
}
template<typename FROM_STORAGE_TYPE, typename FROM_UNITS>
LL_FORCE_INLINE static self_t convert(LLUnit<FROM_STORAGE_TYPE, FROM_UNITS> v)
{
typedef typename LLResultTypePromote<FROM_STORAGE_TYPE, STORAGE_TYPE>::type_t result_storage_t;
LLUnit<result_storage_t, UNITS> result;
result_storage_t divisor = ll_convert_units(v, result);
result.value(result.value() / divisor);
return self_t(result.value());
}
protected:
storage_t mValue;
};
@ -269,7 +271,7 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE void operator += (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other)
{
base_t::mValue += convert(other).value();
base_t::mValue += base_t::convert(other).value();
}
using base_t::operator -=;
@ -283,19 +285,19 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE void operator -= (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other)
{
base_t::mValue -= convert(other).value();
base_t::mValue -= base_t::convert(other).value();
}
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE bool operator == (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
{
return base_t::mValue == convert(other).value();
return base_t::mValue == base_t::convert(other).value();
}
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE bool operator == (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
{
return base_t::mValue == convert(other).value();
return base_t::mValue == base_t::convert(other).value();
}
template<typename STORAGE_T>
@ -313,7 +315,7 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE bool operator != (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
{
return base_t::mValue != convert(other).value();
return base_t::mValue != base_t::convert(other).value();
}
template<typename STORAGE_T>
@ -325,13 +327,13 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE bool operator < (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
{
return base_t::mValue < convert(other).value();
return base_t::mValue < base_t::convert(other).value();
}
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE bool operator < (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
{
return base_t::mValue < convert(other).value();
return base_t::mValue < base_t::convert(other).value();
}
template<typename STORAGE_T>
@ -343,13 +345,13 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE bool operator <= (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
{
return base_t::mValue <= convert(other).value();
return base_t::mValue <= base_t::convert(other).value();
}
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE bool operator <= (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
{
return base_t::mValue <= convert(other).value();
return base_t::mValue <= base_t::convert(other).value();
}
template<typename STORAGE_T>
@ -361,13 +363,13 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE bool operator > (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
{
return base_t::mValue > convert(other).value();
return base_t::mValue > base_t::convert(other).value();
}
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE bool operator > (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
{
return base_t::mValue > convert(other).value();
return base_t::mValue > base_t::convert(other).value();
}
template<typename STORAGE_T>
@ -379,13 +381,13 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE bool operator >= (LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
{
return base_t::mValue >= convert(other).value();
return base_t::mValue >= base_t::convert(other).value();
}
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE bool operator >= (LLUnitImplicit<OTHER_STORAGE_TYPE, OTHER_UNITS> other) const
{
return base_t::mValue >= convert(other).value();
return base_t::mValue >= base_t::convert(other).value();
}
template<typename STORAGE_T>

View File

@ -118,38 +118,19 @@ void LLUriParser::fragment(const std::string& s)
void LLUriParser::textRangeToString(UriTextRangeA& textRange, std::string& str)
{
str = "";
if(&textRange == NULL)
if (textRange.first != NULL && textRange.afterLast != NULL && textRange.first < textRange.afterLast)
{
return;
const ptrdiff_t len = textRange.afterLast - textRange.first;
str.assign(textRange.first, static_cast<std::string::size_type>(len));
}
if(textRange.first == NULL)
else
{
return;
}
if(textRange.afterLast == NULL)
{
return;
}
S32 len = textRange.afterLast - textRange.first;
if (len)
{
str.assign(textRange.first, len);
str = LLStringUtil::null;
}
}
void LLUriParser::extractParts()
{
if(&mUri == NULL)
{
LL_WARNS() << "mUri is NULL for uri: " << mNormalizedUri << LL_ENDL;
return;
}
if (mTmpScheme || mNormalizedTmp)
{
mScheme.clear();

View File

@ -36,7 +36,7 @@ class LL_COMMON_API LLUriParser
{
public:
LLUriParser(const std::string& u);
virtual ~LLUriParser();
~LLUriParser();
const char * scheme() const;
void sheme (const std::string& s);

View File

@ -30,7 +30,7 @@
#define LL_STRINGIZE_H
#include <sstream>
#include <boost/lambda/lambda.hpp>
#include <boost/phoenix/phoenix.hpp>
#include <llstring.h>
/**
@ -108,7 +108,7 @@ std::string stringize_f(Functor const & f)
* return out.str();
* @endcode
*/
#define STRINGIZE(EXPRESSION) (stringize_f(boost::lambda::_1 << EXPRESSION))
#define STRINGIZE(EXPRESSION) (stringize_f(boost::phoenix::placeholders::arg1 << EXPRESSION))
/**
@ -144,7 +144,7 @@ void destringize_f(std::string const & str, Functor const & f)
* in >> item1 >> item2 >> item3 ... ;
* @endcode
*/
#define DESTRINGIZE(STR, EXPRESSION) (destringize_f((STR), (boost::lambda::_1 >> EXPRESSION)))
#define DESTRINGIZE(STR, EXPRESSION) (destringize_f((STR), (boost::phoenix::placeholders::arg1 >> EXPRESSION)))
#endif /* ! defined(LL_STRINGIZE_H) */

View File

@ -37,29 +37,14 @@
// associated header
#include "../lldependencies.h"
// other Linden headers
#include "../test/lltut.h"
using boost::assign::list_of;
#if LL_WINDOWS
#pragma warning (disable : 4675) // "resolved by ADL" -- just as I want!
#endif
typedef LLDependencies<> StringDeps;
typedef StringDeps::KeyList StringList;
// We use the very cool boost::assign::list_of() construct to specify vectors
// of strings inline. For reasons on which I'm not entirely clear, though, it
// needs a helper function. You can use list_of() to construct an implicit
// StringList (std::vector<std::string>) by conversion, e.g. for a function
// parameter -- but if you simply write StringList(list_of("etc.")), you get
// ambiguity errors. Shrug!
template<typename CONTAINER>
CONTAINER make(const CONTAINER& data)
{
return data;
}
/*****************************************************************************
* Display helpers: must be defined BEFORE lltut.h!
*****************************************************************************/
// Display an arbitary value as itself...
template<typename T>
std::ostream& display(std::ostream& out, const T& value)
@ -113,6 +98,31 @@ std::ostream& operator<<(std::ostream& out, const std::set<ENTRY>& set)
return out;
}
/*****************************************************************************
* Now we can #include lltut.h
*****************************************************************************/
#include "../test/lltut.h"
/*****************************************************************************
* Other helpers
*****************************************************************************/
using boost::assign::list_of;
typedef LLDependencies<> StringDeps;
typedef StringDeps::KeyList StringList;
// We use the very cool boost::assign::list_of() construct to specify vectors
// of strings inline. For reasons on which I'm not entirely clear, though, it
// needs a helper function. You can use list_of() to construct an implicit
// StringList (std::vector<std::string>) by conversion, e.g. for a function
// parameter -- but if you simply write StringList(list_of("etc.")), you get
// ambiguity errors. Shrug!
template<typename CONTAINER>
CONTAINER make(const CONTAINER& data)
{
return data;
}
const std::string& extract_key(const LLDependencies<>::value_type& entry)
{
return entry.first;

View File

@ -38,6 +38,9 @@
namespace
{
#ifdef __clang__
# pragma clang diagnostic ignored "-Wunused-function"
#endif
void test_that_error_h_includes_enough_things_to_compile_a_message()
{
LL_INFOS() << "!" << LL_ENDL;
@ -381,8 +384,6 @@ namespace
};
std::string logFromNamespace(bool id) { return Foo::logFromNamespace(id); }
std::string logFromClassWithNoLogTypeMember(bool id) { ClassWithNoLogType c; return c.logFromMember(id); }
std::string logFromClassWithNoLogTypeStatic(bool id) { return ClassWithNoLogType::logFromStatic(id); }
std::string logFromClassWithLogTypeMember(bool id) { ClassWithLogType c; return c.logFromMember(id); }
std::string logFromClassWithLogTypeStatic(bool id) { return ClassWithLogType::logFromStatic(id); }
@ -393,8 +394,8 @@ namespace
if (n1 == std::string::npos)
{
std::stringstream ss;
ss << message << ": " << "expected to find a copy of " << expected
<< " in actual " << actual;
ss << message << ": " << "expected to find a copy of '" << expected
<< "' in actual '" << actual << "'";
throw tut::failure(ss.str().c_str());
}
}
@ -435,9 +436,6 @@ namespace tut
testLogName(mRecorder, logFromStatic);
testLogName(mRecorder, logFromAnon);
testLogName(mRecorder, logFromNamespace);
//testLogName(mRecorder, logFromClassWithNoLogTypeMember, "ClassWithNoLogType");
//testLogName(mRecorder, logFromClassWithNoLogTypeStatic, "ClassWithNoLogType");
// XXX: figure out what the exepcted response is for these
testLogName(mRecorder, logFromClassWithLogTypeMember, "ClassWithLogType");
testLogName(mRecorder, logFromClassWithLogTypeStatic, "ClassWithLogType");
}
@ -457,11 +455,6 @@ namespace
return "bar";
}
void uberLogger()
{
LL_INFOS() << "uber(" << outerLogger() << "," << innerLogger() << ")" << LL_ENDL;
}
class LogWhileLogging
{
public:
@ -494,17 +487,10 @@ namespace tut
ensure_message_contains(1, "outside(moo)");
ensure_message_count(2);
uberLogger();
ensure_message_contains(2, "inside");
ensure_message_contains(3, "inside");
ensure_message_contains(4, "outside(moo)");
ensure_message_contains(5, "uber(bar,moo)");
ensure_message_count(6);
metaLogger();
ensure_message_contains(6, "logging");
ensure_message_contains(7, "meta(baz)");
ensure_message_count(8);
ensure_message_contains(2, "logging");
ensure_message_contains(3, "meta(baz)");
ensure_message_count(4);
}
template<> template<>

View File

@ -94,7 +94,6 @@ using coroutines::coroutine;
template<typename Iter>
bool match(Iter first, Iter last, std::string match) {
std::string::iterator i = match.begin();
i != match.end();
for(; (first != last) && (i != match.end()); ++i) {
if (*first != *i)
return false;

View File

@ -84,25 +84,34 @@ namespace tut
template<> template<>
void frametimer_object_t::test<3>()
{
clock_t t1 = clock();
ms_sleep(200);
clock_t t2 = clock();
clock_t elapsed = t2 - t1 + 1;
std::cout << "Note: using clock(), ms_sleep() actually took " << (long)elapsed << "ms" << std::endl;
F64 seconds_since_epoch = LLFrameTimer::getTotalSeconds();
seconds_since_epoch += 2.0;
LLFrameTimer timer;
timer.setExpiryAt(seconds_since_epoch);
ensure("timer not expired on create", !timer.hasExpired());
int ii;
for(ii = 0; ii < 10; ++ii)
/*
* Note that the ms_sleep(200) below is only guaranteed to return
* in 200ms _or_more_, so it should be true that by the 10th
* iteration we've gotten to the 2 seconds requested above
* and the timer should expire, but it can expire in fewer iterations
* if one or more of the ms_sleep calls takes longer.
* (as it did when we moved to Mac OS X 10.10)
*/
int iterations_until_expiration = 0;
while ( !timer.hasExpired() )
{
ms_sleep(150);
LLFrameTimer::updateFrameTime();
ms_sleep(200);
LLFrameTimer::updateFrameTime();
iterations_until_expiration++;
}
ensure("timer not expired after a bit", !timer.hasExpired());
for(ii = 0; ii < 10; ++ii)
{
ms_sleep(100);
LLFrameTimer::updateFrameTime();
}
ensure("timer expired", timer.hasExpired());
ensure("timer took too long to expire", iterations_until_expiration <= 10);
}
/*
template<> template<>
void frametimer_object_t::test<4>()

View File

@ -17,7 +17,7 @@
// std headers
// external library headers
#include <boost/assign/list_of.hpp>
#include <boost/lambda/lambda.hpp>
#include <boost/phoenix/core/argument.hpp>
#include <boost/foreach.hpp>
// other Linden headers
#include "../test/lltut.h"
@ -38,24 +38,7 @@ StringVec sv(const StringVec& listof) { return listof; }
#define sleep(secs) _sleep((secs) * 1000)
#endif
#if ! LL_WINDOWS
const size_t BUFFERED_LENGTH = 1023*1024; // try wrangling just under a megabyte of data
#else
// "Then there's Windows... sigh." The "very large message" test is flaky in a
// way that seems to point to either the OS (nonblocking writes to pipes) or
// possibly the apr_file_write() function. Poring over log messages reveals
// that at some point along the way apr_file_write() returns 11 (Resource
// temporarily unavailable, i.e. EAGAIN) and says it wrote 0 bytes -- even
// though it did write the chunk! Our next write attempt retries the same
// chunk, resulting in the chunk being duplicated at the child end, corrupting
// the data stream. Much as I would love to be able to fix it for real, such a
// fix would appear to require distinguishing bogus EAGAIN returns from real
// ones -- how?? Empirically this behavior is only observed when writing a
// "very large message". To be able to move forward at all, try to bypass this
// particular failure by adjusting the size of a "very large message" on
// Windows.
const size_t BUFFERED_LENGTH = 65336;
#endif // LL_WINDOWS
void waitfor(const std::vector<LLLeap*>& instances, int timeout=60)
{
@ -109,7 +92,7 @@ namespace tut
llleap_data():
reader(".py",
// This logic is adapted from vita.viewerclient.receiveEvent()
boost::lambda::_1 <<
boost::phoenix::placeholders::arg1 <<
"import re\n"
"import os\n"
"import sys\n"
@ -403,7 +386,7 @@ namespace tut
AckAPI api;
Result result;
NamedTempFile script("py",
boost::lambda::_1 <<
boost::phoenix::placeholders::arg1 <<
"from " << reader_module << " import *\n"
// make a request on our little API
"request(pump='" << api.getName() << "', data={})\n"
@ -441,7 +424,7 @@ namespace tut
ReqIDAPI api;
Result result;
NamedTempFile script("py",
boost::lambda::_1 <<
boost::phoenix::placeholders::arg1 <<
"import sys\n"
"from " << reader_module << " import *\n"
// Note that since reader imports llsd, this
@ -484,7 +467,7 @@ namespace tut
ReqIDAPI api;
Result result;
NamedTempFile script("py",
boost::lambda::_1 <<
boost::phoenix::placeholders::arg1 <<
"import sys\n"
"from " << reader_module << " import *\n"
// Generate a very large string value.

View File

@ -85,7 +85,7 @@ static std::string readfile(const std::string& pathname, const std::string& desc
}
std::ifstream inf(pathname.c_str());
std::string output;
tut::ensure(STRINGIZE("No output " << use_desc), std::getline(inf, output));
tut::ensure(STRINGIZE("No output " << use_desc), bool(std::getline(inf, output)));
std::string more;
while (std::getline(inf, more))
{
@ -154,7 +154,7 @@ struct PythonProcessLauncher
void launch()
{
mPy = LLProcess::create(mParams);
tut::ensure(STRINGIZE("Couldn't launch " << mDesc << " script"), mPy);
tut::ensure(STRINGIZE("Couldn't launch " << mDesc << " script"), bool(mPy));
}
/// Run Python script and wait for it to complete.
@ -873,7 +873,7 @@ namespace tut
std::string threw; \
/* Both the following calls should work. */ \
(PROCESS).GETPIPE(VALID); \
ensure(#GETOPTPIPE "(" #VALID ") failed", (PROCESS).GETOPTPIPE(VALID)); \
ensure(#GETOPTPIPE "(" #VALID ") failed", bool((PROCESS).GETOPTPIPE(VALID))); \
/* pass obviously bogus PIPESLOT */ \
CATCH_IN(threw, LLProcess::NoPipe, (PROCESS).GETPIPE(LLProcess::FILESLOT(4))); \
ensure_contains("didn't reject bad slot", threw, "no slot"); \

View File

@ -46,9 +46,10 @@ typedef U32 uint32_t;
#include "boost/range.hpp"
#include "boost/foreach.hpp"
#include "boost/function.hpp"
#include "boost/lambda/lambda.hpp"
#include "boost/lambda/bind.hpp"
namespace lambda = boost::lambda;
#include "boost/bind.hpp"
#include "boost/phoenix/bind/bind_function.hpp"
#include "boost/phoenix/core/argument.hpp"
using namespace boost::phoenix;
#include "../llsd.h"
#include "../llsdserialize.h"
@ -1612,6 +1613,20 @@ namespace tut
"print 'Running on', sys.platform\n");
}
// helper for test<3>
static void writeLLSDArray(std::ostream& out, const LLSD& array)
{
BOOST_FOREACH(LLSD item, llsd::inArray(array))
{
LLSDSerialize::toNotation(item, out);
// It's important to separate with newlines because Python's llsd
// module doesn't support parsing from a file stream, only from a
// string, so we have to know how much of the file to read into a
// string.
out << '\n';
}
}
template<> template<>
void TestPythonCompatibleObject::test<3>()
{
@ -1639,26 +1654,16 @@ namespace tut
" assert False, 'Too many data items'\n";
// Create an llsdXXXXXX file containing 'data' serialized to
// notation. It's important to separate with newlines because Python's
// llsd module doesn't support parsing from a file stream, only from a
// string, so we have to know how much of the file to read into a
// string.
// notation.
NamedTempFile file("llsd",
// NamedTempFile's boost::function constructor
// takes a callable. To this callable it passes the
// std::ostream with which it's writing the
// NamedTempFile. This lambda-based expression
// first calls LLSD::Serialize() with that ostream,
// then streams a newline to it, etc.
(lambda::bind(LLSDSerialize::toNotation, cdata[0], lambda::_1),
lambda::_1 << '\n',
lambda::bind(LLSDSerialize::toNotation, cdata[1], lambda::_1),
lambda::_1 << '\n',
lambda::bind(LLSDSerialize::toNotation, cdata[2], lambda::_1),
lambda::_1 << '\n'));
// NamedTempFile.
boost::bind(writeLLSDArray, _1, cdata));
python("read C++ notation",
lambda::_1 <<
placeholders::arg1 <<
import_llsd <<
"def parse_each(iterable):\n"
" for item in iterable:\n"
@ -1679,7 +1684,7 @@ namespace tut
NamedTempFile file("llsd", "");
python("write Python notation",
lambda::_1 <<
placeholders::arg1 <<
"from __future__ import with_statement\n" <<
import_llsd <<
"DATA = [\n"

View File

@ -27,11 +27,11 @@
*/
#include "linden_common.h"
#include "../test/lltut.h"
#include <boost/assign/list_of.hpp>
#include "../llstring.h"
#include "StringVec.h"
#include "StringVec.h" // must come BEFORE lltut.h
#include "../test/lltut.h"
using boost::assign::list_of;

View File

@ -104,7 +104,6 @@ char * os_strltrim(char * str);
void os_strlower(char * str);
// Error testing and reporting for libcurl status codes
void check_curl_easy_code(CURLcode code);
void check_curl_easy_code(CURLcode code, int curl_setopt_option);
static const char * const LOG_CORE("CoreHttp");
@ -588,9 +587,18 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service)
(mReqLength ? fmt1 : fmt2),
(unsigned long) mReqOffset, (unsigned long) (mReqOffset + mReqLength - 1));
#else
snprintf(range_line, sizeof(range_line),
(mReqLength ? fmt1 : fmt2),
(unsigned long) mReqOffset, (unsigned long) (mReqOffset + mReqLength - 1));
if ( mReqLength )
{
snprintf(range_line, sizeof(range_line),
fmt1,
(unsigned long) mReqOffset, (unsigned long) (mReqOffset + mReqLength - 1));
}
else
{
snprintf(range_line, sizeof(range_line),
fmt2,
(unsigned long) mReqOffset);
}
#endif // LL_WINDOWS
range_line[sizeof(range_line) - 1] = '\0';
mCurlHeaders = curl_slist_append(mCurlHeaders, range_line);
@ -1151,18 +1159,4 @@ void check_curl_easy_code(CURLcode code, int curl_setopt_option)
}
}
void check_curl_easy_code(CURLcode code)
{
if (CURLE_OK != code)
{
// Comment from old llcurl code which may no longer apply:
//
// linux appears to throw a curl error once per session for a bad initialization
// at a pretty random time (when enabling cookies).
LL_WARNS(LOG_CORE) << "libcurl error detected: " << curl_easy_strerror(code)
<< LL_ENDL;
}
}
} // end anonymous namespace

View File

@ -257,8 +257,6 @@ std::streampos BufferArrayStreamBuf::seekoff(std::streamoff off,
return ret;
}
if (pos < 0)
return ret;
if (pos > mBufferArray->size())
{
pos = mBufferArray->size();

View File

@ -212,7 +212,7 @@ int main(int argc, char** argv)
char * end;
value = strtoul(optarg, &end, 10);
if (value < 0 || value > 100 || *end != '\0')
if (value > 100 || *end != '\0')
{
usage(std::cerr);
return 1;
@ -227,7 +227,7 @@ int main(int argc, char** argv)
char * end;
value = strtoul(optarg, &end, 10);
if (value < 0 || value > 3 || *end != '\0')
if (value > 3 || *end != '\0')
{
usage(std::cerr);
return 1;

View File

@ -106,7 +106,7 @@ LLSD LLCrashLock::getLockFile(std::string filename)
{
LLSD lock_sd = LLSD::emptyMap();
llifstream ifile(filename);
llifstream ifile(filename.c_str());
if (ifile.is_open())
{
@ -120,7 +120,7 @@ LLSD LLCrashLock::getLockFile(std::string filename)
bool LLCrashLock::putLockFile(std::string filename, const LLSD& data)
{
bool result = true;
llofstream ofile(filename);
llofstream ofile(filename.c_str());
if (!LLSDSerialize::toXML(data,ofile))
{

View File

@ -1036,13 +1036,13 @@ void LLImageRaw::copyLineScaled( U8* in, U8* out, S32 in_pixel_len, S32 out_pixe
a *= norm_factor; // skip conditional
S32 t4 = x * out_pixel_step * components;
out[t4 + 0] = U8(llround(r));
out[t4 + 0] = U8(ll_round(r));
if (components >= 2)
out[t4 + 1] = U8(llround(g));
out[t4 + 1] = U8(ll_round(g));
if (components >= 3)
out[t4 + 2] = U8(llround(b));
out[t4 + 2] = U8(ll_round(b));
if( components == 4)
out[t4 + 3] = U8(llround(a));
out[t4 + 3] = U8(ll_round(a));
}
}
}
@ -1117,10 +1117,10 @@ void LLImageRaw::compositeRowScaled4onto3( U8* in, U8* out, S32 in_pixel_len, S3
b *= norm_factor;
a *= norm_factor;
in_scaled_r = U8(llround(r));
in_scaled_g = U8(llround(g));
in_scaled_b = U8(llround(b));
in_scaled_a = U8(llround(a));
in_scaled_r = U8(ll_round(r));
in_scaled_g = U8(ll_round(g));
in_scaled_b = U8(ll_round(b));
in_scaled_a = U8(ll_round(a));
}
if( in_scaled_a )
@ -1172,7 +1172,7 @@ static std::string find_file(std::string &name, S8 *codec)
for (int i=0; i<(int)(NUM_FILE_EXTENSIONS); i++)
{
tname = name + "." + std::string(file_extensions[i].exten);
llifstream ifs(tname, llifstream::binary);
llifstream ifs(tname.c_str(), llifstream::binary);
if (ifs.is_open())
{
ifs.close();
@ -1219,7 +1219,7 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip
return false; // format not recognized
}
llifstream ifs(name, llifstream::binary);
llifstream ifs(name.c_str(), llifstream::binary);
if (!ifs.is_open())
{
// SJB: changed from LL_INFOS() to LL_DEBUGS() to reduce spam

View File

@ -54,7 +54,7 @@ LLImageFilter::LLImageFilter(const std::string& file_path) :
mStencilMax(1.0)
{
// Load filter description from file
llifstream filter_xml(file_path);
llifstream filter_xml(file_path.c_str());
if (filter_xml.is_open())
{
// Load and parse the file

View File

@ -36,7 +36,17 @@
#include "kdu_elementary.h"
#include "kdu_messaging.h"
#include "kdu_params.h"
// don't *really* want to rebuild KDU so turn off specific warnings for this header
#if LL_DARWIN
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#include "kdu_compressed.h"
#pragma clang diagnostic pop
#else
#include "kdu_compressed.h"
#endif
#include "kdu_sample_processing.h"
class LLKDUDecodeState;

View File

@ -29,7 +29,17 @@
// Support classes for reading and writing from memory buffers in KDU
#define KDU_NO_THREADS
// don't *really* want to rebuild KDU so turn off specific warnings for this header
#if LL_DARWIN
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wself-assign-field"
#pragma clang diagnostic ignored "-Wunused-private-field"
#include "kdu_image.h"
#pragma clang diagnostic pop
#else
#include "kdu_image.h"
#endif
#include "kdu_elementary.h"
#include "kdu_messaging.h"
#include "kdu_params.h"

View File

@ -28,7 +28,16 @@
#include "linden_common.h"
// Class to test
#include "llimagej2ckdu.h"
#if LL_DARWIN
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#include "llkdumem.h"
#pragma clang diagnostic pop
#else
#include "llkdumem.h"
#endif
#include "kdu_block_coding.h"
// Tut header
#include "lltut.h"
@ -114,7 +123,6 @@ kdu_block_encoder::kdu_block_encoder() { }
kdu_block_decoder::kdu_block_decoder() { }
void kdu_block::set_max_passes(int , bool ) { }
void kdu_block::set_max_bytes(int , bool ) { }
void kdu_block::set_max_samples(int ) { }
void kdu_tile::close(kdu_thread_env* ) { }
int kdu_tile::get_num_components() { return 0; }
bool kdu_tile::get_ycc() { return false; }
@ -157,7 +165,7 @@ void kdu_codestream::get_valid_tiles(kdu_dims& ) { }
void kdu_codestream::create(kdu_compressed_source*, kdu_thread_env*) { }
void kdu_codestream::apply_input_restrictions( int, int, int, int, kdu_dims*, kdu_component_access_mode ) { }
void kdu_codestream::get_subsampling(int , kdu_coords&, bool ) { }
void kdu_codestream::flush(kdu_long *, int , kdu_uint16 *, bool, bool, double, kdu_thread_env*) { }
void kdu_codestream::flush(kdu_long *, int, kdu_uint16 *, bool, bool, double, kdu_thread_env*, int) { }
void kdu_codestream::set_resilient(bool ) { }
int kdu_codestream::get_num_components(bool ) { return 0; }
kdu_long kdu_codestream::get_total_bytes(bool ) { return 0; }
@ -175,8 +183,7 @@ kdu_block* kdu_subband::open_block(kdu_coords, int*, kdu_thread_env*) { return N
bool kdu_codestream_comment::put_text(const char*) { return false; }
void kdu_customize_warnings(kdu_message*) { }
void kdu_customize_errors(kdu_message*) { }
kdu_long kdu_multi_analysis::create(kdu_codestream, kdu_tile, bool, kdu_roi_image*, bool, int, kdu_thread_env*, kdu_thread_queue*, bool ) { kdu_long a = 0; return a; }
kdu_long kdu_multi_analysis::create(kdu_codestream, kdu_tile, kdu_thread_env*, kdu_thread_queue*, int, kdu_roi_image*, int) { kdu_long a = 0; return a; }
siz_params::siz_params() : kdu_params(NULL, false, false, false, false, false) { }
void siz_params::finalize(bool ) { }
void siz_params::copy_with_xforms(kdu_params*, int, int, bool, bool, bool) { }
@ -184,20 +191,12 @@ int siz_params::write_marker_segment(kdu_output*, kdu_params*, int) { return 0;
bool siz_params::check_marker_segment(kdu_uint16, int, kdu_byte a[], int&) { return false; }
bool siz_params::read_marker_segment(kdu_uint16, int, kdu_byte a[], int) { return false; }
#ifdef LL_LINUX
// Linux use the old pre KDU v7.0.0
// *TODO: Supress this legacy stubbs once Linux migrates to v7.0.0
kdu_decoder::kdu_decoder(kdu_subband , kdu_sample_allocator*, bool , float, int, kdu_thread_env*, kdu_thread_queue*) { }
void kdu_codestream::create(siz_params*, kdu_compressed_target*, kdu_dims*, int, kdu_long ) { }
void kdu_convert_ycc_to_rgb(kdu_line_buf&, kdu_line_buf&, kdu_line_buf&, int) { }
#else
kdu_decoder::kdu_decoder(kdu_subband , kdu_sample_allocator*, bool , float, int, kdu_thread_env*, kdu_thread_queue*, int) { }
void kdu_codestream::create(siz_params*, kdu_compressed_target*, kdu_dims*, int, kdu_long, kdu_thread_env* ) { }
void (*kdu_convert_ycc_to_rgb_rev16)(kdu_int16*,kdu_int16*,kdu_int16*,int);
void (*kdu_convert_ycc_to_rgb_irrev16)(kdu_int16*,kdu_int16*,kdu_int16*,int);
void (*kdu_convert_ycc_to_rgb_rev32)(kdu_int32*,kdu_int32*,kdu_int32*,int);
void (*kdu_convert_ycc_to_rgb_irrev32)(float*,float*,float*,int);
#endif
// -------------------------------------------------------------------------------------------
// TUT

View File

@ -30,7 +30,6 @@
#include "llline.h"
#include "llrand.h"
const F32 SOME_SMALL_NUMBER = 1.0e-5f;
const F32 SOME_VERY_SMALL_NUMBER = 1.0e-8f;
LLLine::LLLine()

View File

@ -206,16 +206,16 @@ inline S32 llceil( F32 f )
#ifndef BOGUS_ROUND
// Use this round. Does an arithmetic round (0.5 always rounds up)
inline S32 llround(const F32 val)
inline S32 ll_round(const F32 val)
{
return llfloor(val + 0.5f);
}
#else // BOGUS_ROUND
// Old llround implementation - does banker's round (toward nearest even in the case of a 0.5.
// Old ll_round implementation - does banker's round (toward nearest even in the case of a 0.5.
// Not using this because we don't have a consistent implementation on both platforms, use
// llfloor(val + 0.5f), which is consistent on all platforms.
inline S32 llround(const F32 val)
inline S32 ll_round(const F32 val)
{
#if LL_WINDOWS
// Note: assumes that the floating point control word is set to rounding mode (the default)
@ -254,12 +254,12 @@ inline int round_int(double x)
}
#endif // BOGUS_ROUND
inline F32 llround( F32 val, F32 nearest )
inline F32 ll_round( F32 val, F32 nearest )
{
return F32(floor(val * (1.0f / nearest) + 0.5f)) * nearest;
}
inline F64 llround( F64 val, F64 nearest )
inline F64 ll_round( F64 val, F64 nearest )
{
return F64(floor(val * (1.0 / nearest) + 0.5)) * nearest;
}
@ -309,25 +309,6 @@ const S32 LL_SHIFT_AMOUNT = 16; //16.16 fixed point represe
#define LL_MAN_INDEX 1
#endif
/* Deprecated: use llround(), lltrunc(), or llfloor() instead
// ================================================================================================
// Real2Int
// ================================================================================================
inline S32 F64toS32(F64 val)
{
val = val + LL_DOUBLE_TO_FIX_MAGIC;
return ((S32*)&val)[LL_MAN_INDEX] >> LL_SHIFT_AMOUNT;
}
// ================================================================================================
// Real2Int
// ================================================================================================
inline S32 F32toS32(F32 val)
{
return F64toS32 ((F64)val);
}
*/
////////////////////////////////////////////////
//
// Fast exp and log
@ -351,9 +332,7 @@ static union
#define LL_EXP_A (1048576 * OO_LN2) // use 1512775 for integer
#define LL_EXP_C (60801) // this value of C good for -4 < y < 4
#define LL_FAST_EXP(y) (LLECO.n.i = llround(F32(LL_EXP_A*(y))) + (1072693248 - LL_EXP_C), LLECO.d)
#define LL_FAST_EXP(y) (LLECO.n.i = ll_round(F32(LL_EXP_A*(y))) + (1072693248 - LL_EXP_C), LLECO.d)
inline F32 llfastpow(const F32 x, const F32 y)
{
@ -370,9 +349,6 @@ inline F32 snap_to_sig_figs(F32 foo, S32 sig_figs)
bar *= 10.f;
}
//F32 new_foo = (F32)llround(foo * bar);
// the llround() implementation sucks. Don't us it.
F32 sign = (foo > 0.f) ? 1.f : -1.f;
F32 new_foo = F32( S64(foo * bar + sign * 0.5f));
new_foo /= bar;

View File

@ -322,7 +322,7 @@ public:
//is it here?
if (isInside(data->getPositionGroup()))
{
if (((getElementCount() < gOctreeMaxCapacity || getSize()[0] <= gOctreeMinSize) && contains(data->getBinRadius()) ||
if ((((getElementCount() < gOctreeMaxCapacity || getSize()[0] <= gOctreeMinSize) && contains(data->getBinRadius())) ||
(data->getBinRadius() > getSize()[0] && parent && parent->getElementCount() >= gOctreeMaxCapacity)))
{ //it belongs here
mData.push_back(NULL);
@ -445,7 +445,7 @@ public:
mDataEnd = &mData[0];
}
notifyRemoval(data);
this->notifyRemoval(data);
checkAlive();
}
@ -711,7 +711,7 @@ public:
//(don't notify listeners of addition)
for (U32 i = 0; i < child->getChildCount(); i++)
{
addChild(child->getChild(i), TRUE);
this->addChild(child->getChild(i), TRUE);
}
//destroy child
@ -755,10 +755,10 @@ public:
return false;
}
if (this->getSize()[0] > data->getBinRadius() && isInside(data->getPositionGroup()))
if (this->getSize()[0] > data->getBinRadius() && this->isInside(data->getPositionGroup()))
{
//we got it, just act like a branch
oct_node* node = getNodeAt(data);
oct_node* node = this->getNodeAt(data);
if (node == this)
{
LLOctreeNode<T>::insert(data);
@ -771,7 +771,7 @@ public:
else if (this->getChildCount() == 0)
{
//first object being added, just wrap it up
while (!(this->getSize()[0] > data->getBinRadius() && isInside(data->getPositionGroup())))
while (!(this->getSize()[0] > data->getBinRadius() && this->isInside(data->getPositionGroup())))
{
LLVector4a center, size;
center = this->getCenter();
@ -786,7 +786,7 @@ public:
}
else
{
while (!(this->getSize()[0] > data->getBinRadius() && isInside(data->getPositionGroup())))
while (!(this->getSize()[0] > data->getBinRadius() && this->isInside(data->getPositionGroup())))
{
//the data is outside the root node, we need to grow
LLVector4a center(this->getCenter());
@ -814,7 +814,7 @@ public:
//clear our children and add the root copy
this->clearChildren();
addChild(newnode);
this->addChild(newnode);
}
//insert the data

View File

@ -52,7 +52,7 @@ inline U16 F32_to_U16_ROUND(F32 val, F32 lower, F32 upper)
val /= (upper - lower);
// round the value. Sreturn the U16
return (U16)(llround(val*U16MAX));
return (U16)(ll_round(val*U16MAX));
}
@ -92,7 +92,7 @@ inline U8 F32_to_U8_ROUND(F32 val, F32 lower, F32 upper)
val /= (upper - lower);
// return the rounded U8
return (U8)(llround(val*U8MAX));
return (U8)(ll_round(val*U8MAX));
}

View File

@ -56,8 +56,6 @@
#define DEBUG_SILHOUETTE_NORMALS 0 // TomY: Use this to display normals using the silhouette
#define DEBUG_SILHOUETTE_EDGE_MAP 0 // DaveP: Use this to display edge map using the silhouette
const F32 CUT_MIN = 0.f;
const F32 CUT_MAX = 1.f;
const F32 MIN_CUT_DELTA = 0.02f;
const F32 HOLLOW_MIN = 0.f;
@ -560,7 +558,7 @@ void LLProfile::genNGon(const LLProfileParams& params, S32 sides, F32 offset, F3
// Scale to have size "match" scale. Compensates to get object to generally fill bounding box.
S32 total_sides = llround(sides / ang_scale); // Total number of sides all around
S32 total_sides = ll_round(sides / ang_scale); // Total number of sides all around
if (total_sides < 8)
{
@ -2076,7 +2074,7 @@ LLVolume::LLVolume(const LLVolumeParams &params, const F32 detail, const BOOL ge
generate();
if (mParams.getSculptID().isNull() && mParams.getSculptType() == LL_SCULPT_TYPE_NONE || mParams.getSculptType() == LL_SCULPT_TYPE_MESH)
if ((mParams.getSculptID().isNull() && mParams.getSculptType() == LL_SCULPT_TYPE_NONE) || mParams.getSculptType() == LL_SCULPT_TYPE_MESH)
{
createVolumeFaces();
}
@ -4038,7 +4036,6 @@ LLVertexIndexPair::LLVertexIndexPair(const LLVector3 &vertex, const S32 index)
}
const F32 VERTEX_SLOP = 0.00001f;
const F32 VERTEX_SLOP_SQRD = VERTEX_SLOP * VERTEX_SLOP;
struct lessVertex
{
@ -4925,9 +4922,7 @@ F64 find_vertex_score(LLVCacheVertexData& data)
{
F64 score = -1.0;
if (data.mActiveTriangles >= 0)
{
score = 0.0;
score = 0.0;
S32 cache_idx = data.mCacheTag;
@ -4949,9 +4944,8 @@ F64 find_vertex_score(LLVCacheVertexData& data)
}
//bonus points for having low valence
F64 valence_boost = pow((F64)data.mActiveTriangles, -FindVertexScore_ValenceBoostPower);
F64 valence_boost = pow((F64)data.mActiveTriangles, -FindVertexScore_ValenceBoostPower);
score += FindVertexScore_ValenceBoostScale * valence_boost;
}
return score;
}

View File

@ -175,10 +175,10 @@ namespace tut
void llquat_test_object_t::test<6>()
{
LLQuaternion quat1(3.0f, 2.0f, 6.0f, 0.0f), quat2(1.0f, 1.0f, 1.0f, 1.0f);
ensure("1. The two values are different", llround(12.000000f, 2) == llround(dot(quat1, quat2), 2));
ensure("1. The two values are different", ll_round(12.000000f, 2) == ll_round(dot(quat1, quat2), 2));
LLQuaternion quat0(3.0f, 9.334f, 34.5f, 23.0f), quat(34.5f, 23.23f, 2.0f, 45.5f);
ensure("2. The two values are different", llround(1435.828807f, 2) == llround(dot(quat0, quat), 2));
ensure("2. The two values are different", ll_round(1435.828807f, 2) == ll_round(dot(quat0, quat), 2));
}
//test case for LLQuaternion &LLQuaternion::constrain(F32 radians) fn.

View File

@ -128,33 +128,33 @@ namespace tut
void math_object::test<8>()
{
F32 val = 430903.2f;
S32 val1 = llround(val);
ensure("float llround value 1", (430903 == val1));
S32 val1 = ll_round(val);
ensure("float ll_round value 1", (430903 == val1));
val = -430903.9f;
val1 = llround(val);
ensure("float llround value 2", (-430904 == val1));
val1 = ll_round(val);
ensure("float ll_round value 2", (-430904 == val1));
}
template<> template<>
void math_object::test<9>()
{
F32 val = 430905.2654f, nearest = 100.f;
val = llround(val, nearest);
ensure("float llround value 1", (430900 == val));
val = ll_round(val, nearest);
ensure("float ll_round value 1", (430900 == val));
val = -430905.2654f, nearest = 10.f;
val = llround(val, nearest);
ensure("float llround value 1", (-430910 == val));
val = ll_round(val, nearest);
ensure("float ll_round value 1", (-430910 == val));
}
template<> template<>
void math_object::test<10>()
{
F64 val = 430905.2654, nearest = 100.0;
val = llround(val, nearest);
ensure("double llround value 1", (430900 == val));
val = ll_round(val, nearest);
ensure("double ll_round value 1", (430900 == val));
val = -430905.2654, nearest = 10.0;
val = llround(val, nearest);
ensure("double llround value 1", (-430910.00000 == val));
val = ll_round(val, nearest);
ensure("double ll_round value 1", (-430910.00000 == val));
}
template<> template<>

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