summaryrefslogtreecommitdiff
path: root/indra/lscript/lscript_byteconvert.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/lscript/lscript_byteconvert.h')
-rw-r--r--indra/lscript/lscript_byteconvert.h59
1 files changed, 27 insertions, 32 deletions
diff --git a/indra/lscript/lscript_byteconvert.h b/indra/lscript/lscript_byteconvert.h
index e8b727b737..5b08481d7d 100644
--- a/indra/lscript/lscript_byteconvert.h
+++ b/indra/lscript/lscript_byteconvert.h
@@ -2,30 +2,25 @@
* @file lscript_byteconvert.h
* @brief Shared code for compiler and assembler for LSL
*
- * $LicenseInfo:firstyear=2002&license=viewergpl$
- *
- * Copyright (c) 2002-2007, Linden Research, Inc.
- *
+ * $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
- * The source code in this file ("Source Code") is provided by Linden Lab
- * to you under the terms of the GNU General Public License, version 2.0
- * ("GPL"), unless you have obtained a separate licensing agreement
- * ("Other License"), formally executed by you and Linden Lab. Terms of
- * the GPL can be found in doc/GPL-license.txt in this distribution, or
- * online at http://secondlife.com/developers/opensource/gplv2
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
*
- * There are special exceptions to the terms and conditions of the GPL as
- * it is applied to this Source Code. View the full text of the exception
- * in the file doc/FLOSS-exception.txt in this software distribution, or
- * online at http://secondlife.com/developers/opensource/flossexception
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
- * By copying, modifying or distributing this software, you acknowledge
- * that you have read and understood your obligations described above,
- * and agree to abide by those obligations.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
- * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
- * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
- * COMPLETENESS OR PERFORMANCE.
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -250,7 +245,7 @@ inline void bytestream2vector(LLVector3 &vector, const U8 *stream, S32 &offset)
}
}
-inline void vector2bytestream(U8 *stream, S32 &offset, LLVector3 &vector)
+inline void vector2bytestream(U8 *stream, S32 &offset, const LLVector3 &vector)
{
S32 value = *(S32 *)&vector.mV[VZ];
integer2bytestream(stream, offset, value);
@@ -292,7 +287,7 @@ inline void bytestream2quaternion(LLQuaternion &quat, const U8 *stream, S32 &off
}
}
-inline void quaternion2bytestream(U8 *stream, S32 &offset, LLQuaternion &quat)
+inline void quaternion2bytestream(U8 *stream, S32 &offset, const LLQuaternion &quat)
{
S32 value = *(S32 *)&quat.mQ[VS];
integer2bytestream(stream, offset, value);
@@ -415,7 +410,7 @@ inline void set_fault(const U8 *stream, LSCRIPTRunTimeFaults fault)
reset_hp_to_safe_spot(stream);
// lsa_print_heap((U8 *)stream);
}
- fr = LSCRIPTRunTimeFaultBits[fault];
+ fr = fault;
set_register((U8 *)stream, LREG_FR, fr);
}
}
@@ -528,7 +523,7 @@ inline void lscript_push(U8 *stream, F32 value)
}
}
-inline void lscript_push(U8 *stream, LLVector3 &value)
+inline void lscript_push(U8 *stream, const LLVector3 &value)
{
S32 sp = get_register(stream, LREG_SP);
sp -= LSCRIPTDataSize[LST_VECTOR];
@@ -539,7 +534,7 @@ inline void lscript_push(U8 *stream, LLVector3 &value)
}
}
-inline void lscript_push(U8 *stream, LLQuaternion &value)
+inline void lscript_push(U8 *stream, const LLQuaternion &value)
{
S32 sp = get_register(stream, LREG_SP);
sp -= LSCRIPTDataSize[LST_QUATERNION];
@@ -679,13 +674,13 @@ inline void lscript_local_store(U8 *stream, S32 address, F32 value)
float2bytestream(stream, address, value);
}
-inline void lscript_local_store(U8 *stream, S32 address, LLVector3 value)
+inline void lscript_local_store(U8 *stream, S32 address, const LLVector3 value)
{
if (lscript_check_local(stream, address, LSCRIPTDataSize[LST_VECTOR]))
vector2bytestream(stream, address, value);
}
-inline void lscript_local_store(U8 *stream, S32 address, LLQuaternion value)
+inline void lscript_local_store(U8 *stream, S32 address, const LLQuaternion value)
{
if (lscript_check_local(stream, address, LSCRIPTDataSize[LST_QUATERNION]))
quaternion2bytestream(stream, address, value);
@@ -703,13 +698,13 @@ inline void lscript_global_store(U8 *stream, S32 address, F32 value)
float2bytestream(stream, address, value);
}
-inline void lscript_global_store(U8 *stream, S32 address, LLVector3 value)
+inline void lscript_global_store(U8 *stream, S32 address, const LLVector3 value)
{
if (lscript_check_global(stream, address, LSCRIPTDataSize[LST_VECTOR]))
vector2bytestream(stream, address, value);
}
-inline void lscript_global_store(U8 *stream, S32 address, LLQuaternion value)
+inline void lscript_global_store(U8 *stream, S32 address, const LLQuaternion value)
{
if (lscript_check_global(stream, address, LSCRIPTDataSize[LST_QUATERNION]))
quaternion2bytestream(stream, address, value);
@@ -1110,7 +1105,7 @@ inline void safe_heap_bytestream_count_char(U8 *stream, S32 &offset)
;
}
-inline void safe_instruction_char2bytestream(U8 *stream, S32 &offset, char *buffer)
+inline void safe_instruction_char2bytestream(U8 *stream, S32 &offset, const char* buffer)
{
while ( (safe_instruction_check_address(stream, offset, 1))
&&(*(stream + offset++) = *buffer++))
@@ -1125,7 +1120,7 @@ inline void safe_instruction_bytestream2vector(LLVector3 &value, U8 *stream, S32
}
}
-inline void safe_instruction_vector2bytestream(U8 *stream, S32 &offset, LLVector3 &value)
+inline void safe_instruction_vector2bytestream(U8 *stream, S32 &offset, const LLVector3 &value)
{
if (safe_instruction_check_address(stream, offset, LSCRIPTDataSize[LST_VECTOR]))
{
@@ -1141,7 +1136,7 @@ inline void safe_instruction_bytestream2quaternion(LLQuaternion &value, U8 *stre
}
}
-inline void safe_instruction_quaternion2bytestream(U8 *stream, S32 &offset, LLQuaternion &value)
+inline void safe_instruction_quaternion2bytestream(U8 *stream, S32 &offset, const LLQuaternion &value)
{
if (safe_instruction_check_address(stream, offset, LSCRIPTDataSize[LST_QUATERNION]))
{