Harlequin RIP SDK
hq32x2.h File Reference

Compatibility support for 64-bit integer types. More...

#include "hqncall.h"

Data Structures

struct  Hq32x2
 Signed 64 bit integer, represented as a 2s complement pair. More...
 
struct  HqU32x2
 Unsigned 64 bit integer, represented as a 2s complement pair. More...
 

Macros

#define Hq32x2FromInt32(p32x2, i32)
 Fill in a 64-bit signed integer from a 32-bit signed integer.
 
#define HqU32x2FromInt32(pU32x2, i32)
 Fill in a 64-bit unsigned integer from a 32-bit signed integer, asserting that the 32-bit integer is not negative.
 
#define Hq32x2FromUint32(p32x2, ui32)
 Fill in a 64-bit signed integer from a 32-bit unsigned integer.
 
#define HqU32x2FromUint32(pU32x2, ui32)
 Fill in a 64-bit unsigned integer from a 32-bit unsigned integer.
 
#define HQ32X2_INIT_ZERO   { 0, 0 }
 Static or auto zero-value initialiser for Hq32x2 and HqU32x2.
 
#define HQ32X2_INIT_MONE   { MAXUINT32, -1 }
 Static or auto -1-value initialiser for Hq32x2.
 
#define HQ32X2_INIT_MAX   { MAXUINT32, MAXINT32 }
 Static or auto maximum-value initialiser for Hq32x2.
 
#define HQ32X2_INIT_MIN   { 0, MININT32 }
 Static or auto minimum-value initialiser for Hq32x2.
 
#define HQU32X2_INIT_MAX   { MAXUINT32, MAXUINT32 }
 Static or auto maximum-value initialiser for HqU32x2.
 
#define Hq32x2Max(p32x2)
 Fill in a 64-bit signed integer with its maximum possible value.
 
#define HqU32x2Max(pU32x2)
 Fill in a 64-bit unsigned integer with its maximum possible value.
 
#define Hq32x2IsZero(p32x2)   ((p32x2)->high == 0 && (p32x2)->low == 0)
 A predicate to tell if a 64-bit signed integer's value is zero.
 
#define HqU32x2IsZero(pU32x2)   Hq32x2IsZero( pU32x2 )
 A predicate to tell if a 64-bit unsigned integer's value is zero.
 
#define HqU32x2From32x2(pU32x2, p32x2)
 Fill in a 64-bit unsigned integer from a 64-bit signed integer, asserting that its value is not negative.
 
#define Hq32x2FromU32x2(p32x2, pU32x2)
 Fill in a 64-bit signed integer from a 64-bit unsigned integer, asserting that its value is within range.
 
#define Hq32x2ToInt64(p32x2, pi64)
 Convert a 64-bit signed 32x2 integer to a native 64-bit signed integer.
 
#define HqU32x2ToUint64(pU32x2, pu64)
 Convert a 64-bit unsigned 32x2 integer to a native 64-bit unsigned integer.
 

Typedefs

typedef struct Hq32x2 Hq32x2
 Signed 64 bit integer, represented as a 2s complement pair.
 
typedef struct HqU32x2 HqU32x2
 Unsigned 64 bit integer, represented as a 2s complement pair.
 

Functions

HqBool Hq32x2ToInt32 (const Hq32x2 *p32x2, int32 *pReturn)
 Convert a 64-bit signed integer to a 32-bit signed integer. More...
 
HqBool HqU32x2ToInt32 (const HqU32x2 *pU32x2, int32 *pReturn)
 Convert a 64-bit unsigned integer to a 32-bit signed integer. More...
 
HqBool Hq32x2ToUint32 (const Hq32x2 *p32x2, uint32 *pReturn)
 Convert a 64-bit signed integer to a 32-bit unsigned integer. More...
 
HqBool HqU32x2ToUint32 (const HqU32x2 *pU32x2, uint32 *pReturn)
 Convert a 64-bit unsigned integer to a 32-bit unsigned integer. More...
 
int32 Hq32x2BoundToInt32 (const Hq32x2 *p32x2)
 Convert a 64-bit signed integer to a 32-bit signed integer, limiting to the range of the 32-bit integer. More...
 
int32 HqU32x2BoundToInt32 (const HqU32x2 *pU32x2)
 Convert a 64-bit unsigned integer to a 32-bit signed integer, limiting to the range of the 32-bit integer. More...
 
uint32 Hq32x2BoundToUint32 (const Hq32x2 *p32x2)
 Convert a 64-bit signed integer to a 32-bit unsigned integer, limiting to the range of the 32-bit integer. More...
 
uint32 HqU32x2BoundToUint32 (const HqU32x2 *pU32x2)
 Convert a 64-bit unsigned integer to a 32-bit unsigned integer, limiting to the range of the 32-bit integer. More...
 
int32 Hq32x2AssertToInt32 (const Hq32x2 *p32x2)
 Convert a 64-bit signed integer to a 32-bit signed integer, limiting to the range of the 32-bit integer. More...
 
int32 HqU32x2AssertToInt32 (const HqU32x2 *pU32x2)
 Convert a 64-bit unsigned integer to a 32-bit signed integer, limiting to the range of the 32-bit integer. More...
 
uint32 Hq32x2AssertToUint32 (const Hq32x2 *p32x2)
 Convert a 64-bit signed integer to a 32-bit unsigned integer, limiting to the range of the 32-bit integer. More...
 
uint32 HqU32x2AssertToUint32 (const HqU32x2 *pU32x2)
 Convert a 64-bit unsigned integer to a 32-bit unsigned integer, limiting to the range of the 32-bit integer. More...
 
void Hq32x2FromPtrdiff_t (Hq32x2 *p32x2, ptrdiff_t ptrdiff)
 Fill in a 64-bit signed integer from the difference between two pointers. More...
 
void Hq32x2FromSize_t (Hq32x2 *p32x2, size_t sizet)
 Fill in a 64-bit signed integer from an integral value representing the result of the sizeof() operator. More...
 
HqBool Hq32x2ToSize_t (const Hq32x2 *p32x2, size_t *sizet)
 Convert a 64-bit signed integer to an unsigned value sufficient to represent the size of an object. More...
 
void HqU32x2FromSize_t (HqU32x2 *pU32x2, size_t sizet)
 Fill in a 64-bit unsigned integer from an integral value representing the result of the sizeof() operator. More...
 
HqBool HqU32x2ToSize_t (const HqU32x2 *pU32x2, size_t *sizet)
 Convert a 64-bit unsigned integer to an unsigned value sufficient to represent the size of an object. More...
 
void Hq32x2FromDouble (Hq32x2 *p32x2, double dbl)
 Fill in a 64-bit signed integer from a double-precision floating point value. The double is asserted to be in the range of an Hq32x2. More...
 
void HqU32x2FromDouble (HqU32x2 *pU32x2, double dbl)
 Fill in a 64-bit unsigned integer from a double-precision floating point value. The double is asserted to be in the range of an HqU32x2. More...
 
double Hq32x2ToDouble (const Hq32x2 *p32x2)
 Convert a 64-bit signed integer to a double-precision floating point value. Precision may be silently reduced, depending on the magnitude of the 64-bit integral value. More...
 
double HqU32x2ToDouble (const HqU32x2 *pU32x2)
 Convert a 64-bit unsigned integer to a double-precision floating point value. Precision may be silently reduced, depending on the magnitude of the 64-bit integral value. More...
 
int32 Hq32x2Sign (const Hq32x2 *p32x2)
 Return the sign of a 64-bit signed integer. More...
 
uint32 HqU32x2Sign (const HqU32x2 *pU32x2)
 Return the sign of a 64-bit unsigned integer. More...
 
void Hq32x2Add (Hq32x2 *p32x2Result, const Hq32x2 *p32x2A, const Hq32x2 *p32x2B)
 Add two signed 64-bit numbers, storing the sum into a third. More...
 
void HqU32x2Add (HqU32x2 *pU32x2Result, const HqU32x2 *pU32x2A, const HqU32x2 *pU32x2B)
 Add two unsigned 64-bit numbers, storing the sum into a third. More...
 
void Hq32x2Subtract (Hq32x2 *p32x2Result, const Hq32x2 *p32x2A, const Hq32x2 *p32x2B)
 Subtract two signed 64-bit numbers, storing the difference into a third. More...
 
void HqU32x2Subtract (HqU32x2 *pU32x2Result, const HqU32x2 *pU32x2A, const HqU32x2 *pU32x2B)
 Subtract two unsigned 64-bit numbers, storing the difference into a third. More...
 
int32 Hq32x2Compare (const Hq32x2 *p32x2A, const Hq32x2 *p32x2B)
 Compare two 64-bit signed integers. More...
 
int32 HqU32x2Compare (const HqU32x2 *pU32x2A, const HqU32x2 *pU32x2B)
 Compare two 64-bit unsigned integers. More...
 
void Hq32x2AddUint32 (Hq32x2 *p32x2Result, const Hq32x2 *p32x2A, uint32 ui32)
 Add an unsigned 32-bit integer to a signed 64-bit integer, storing the sum into a signed 64-bit integer. More...
 
void HqU32x2AddUint32 (HqU32x2 *pU32x2Result, const HqU32x2 *pU32x2A, uint32 ui32)
 Add an unsigned 32-bit integer to an unsigned 64-bit integer, storing the sum into an unsigned 64-bit integer. More...
 
void Hq32x2SubtractUint32 (Hq32x2 *p32x2Result, const Hq32x2 *p32x2A, uint32 ui32)
 Subtract an unsigned 32-bit integer from a signed 64-bit integer, storing the sum into a signed 64-bit integer. More...
 
void HqU32x2SubtractUint32 (HqU32x2 *pU32x2Result, const HqU32x2 *pU32x2A, uint32 ui32)
 Subtract an unsigned 32-bit integer from an unsigned 64-bit integer, storing the sum into an unsigned 64-bit integer. More...
 
int32 Hq32x2CompareUint32 (const Hq32x2 *p32x2A, uint32 ui32)
 Compare an unsigned 32-bit integer to a signed 64-bit integer. More...
 
int32 HqU32x2CompareUint32 (const HqU32x2 *pU32x2A, uint32 ui32)
 Compare an unsigned 32-bit integer to an unsigned 64-bit integer. More...
 
void Hq32x2AddInt32 (Hq32x2 *p32x2Result, const Hq32x2 *p32x2A, int32 i32)
 Add a signed 32-bit integer to a signed 64-bit integer, storing the sum into a signed 64-bit integer. More...
 
void Hq32x2SubtractInt32 (Hq32x2 *p32x2Result, const Hq32x2 *p32x2A, int32 i32)
 Subtract a signed 32-bit integer from a signed 64-bit integer, storing the sum into a signed 64-bit integer. More...
 
int32 Hq32x2CompareInt32 (const Hq32x2 *p32x2A, int32 i32)
 Compare a signed 32-bit integer to a signed 64-bit integer. More...
 
HqBool Hq32x2DivRemUint32 (Hq32x2 *result, uint32 *remainder, const Hq32x2 *p32x2, uint32 divisor)
 Divide an Hq32x2 by an unsigned 32 bit integer, getting an Hq32x2 result and optional remainder. More...
 
HqBool Hq32x2MultUint32Uint32 (Hq32x2 *result, uint32 ui32A, uint32 ui32B)
 Multiply two unsigned 32-bit integers together, storing the product into a signed 64-bit integer. More...
 

Detailed Description

Compatibility support for 64-bit integer types.

Hq32x2 is a 64-bit signed integer type. HqU32x2 is an unsigned 64 bit type. These types are used in interfaces which tend not to be performance-critical, such as file lengths or positions. A set of initialisers, type conversions to and from native 32-bit and 64-bit integers, and basic arithmetic and comparison operations are provided.

Copyright (C) 2023 Global Graphics Software Ltd. All rights reserved. This source code contains the confidential and trade secret information of Global Graphics Software Ltd. It may not be used, copied or distributed for any reason except as set forth in the applicable Global Graphics license agreement.

Function Documentation

◆ Hq32x2Add()

void Hq32x2Add ( Hq32x2 p32x2Result,
const Hq32x2 p32x2A,
const Hq32x2 p32x2B 
)

Add two signed 64-bit numbers, storing the sum into a third.

Parameters
[in]p32x2ResultA pointer where the sum of the two inputs is stored. This pointer may be the same as either or both of the inputs.
[in]p32x2AA pointer to the first operand.
[in]p32x2BA pointer to the second operand.

◆ Hq32x2AddInt32()

void Hq32x2AddInt32 ( Hq32x2 p32x2Result,
const Hq32x2 p32x2A,
int32  i32 
)

Add a signed 32-bit integer to a signed 64-bit integer, storing the sum into a signed 64-bit integer.

Parameters
[in]p32x2ResultA pointer where the sum of the two inputs is stored. This pointer may be the same as the pointer to the first operand.
[in]p32x2AA pointer to the first operand.
[in]i32A 32-bit signed integer to be added to the first operand.

◆ Hq32x2AddUint32()

void Hq32x2AddUint32 ( Hq32x2 p32x2Result,
const Hq32x2 p32x2A,
uint32  ui32 
)

Add an unsigned 32-bit integer to a signed 64-bit integer, storing the sum into a signed 64-bit integer.

Parameters
[in]p32x2ResultA pointer where the sum of the two inputs is stored. This pointer may be the same as the pointer to the first operand.
[in]p32x2AA pointer to the first operand.
[in]ui32A 32-bit unsigned integer to be added to the first operand.

◆ Hq32x2AssertToInt32()

int32 Hq32x2AssertToInt32 ( const Hq32x2 p32x2)

Convert a 64-bit signed integer to a 32-bit signed integer, limiting to the range of the 32-bit integer.

Parameters
[in]p32x2The 64-bit signed integer to convert.
Returns
The value of the 64-bit integer, clamped to the range MININT32 to MAXINT32.
Note
This function asserts if the value of the 64-bit integer is clamped to the 32-bit range.

◆ Hq32x2AssertToUint32()

uint32 Hq32x2AssertToUint32 ( const Hq32x2 p32x2)

Convert a 64-bit signed integer to a 32-bit unsigned integer, limiting to the range of the 32-bit integer.

Parameters
[in]p32x2The 64-bit signed integer to convert.
Returns
The value of the 64-bit integer, clamped to the range 0 to MAXUINT32.
Note
This function asserts if the value of the 64-bit integer is clamped to the 32-bit range.

◆ Hq32x2BoundToInt32()

int32 Hq32x2BoundToInt32 ( const Hq32x2 p32x2)

Convert a 64-bit signed integer to a 32-bit signed integer, limiting to the range of the 32-bit integer.

Parameters
[in]p32x2The 64-bit signed integer to convert.
Returns
The value of the 64-bit integer, clamped to the range MININT32 to MAXINT32.

◆ Hq32x2BoundToUint32()

uint32 Hq32x2BoundToUint32 ( const Hq32x2 p32x2)

Convert a 64-bit signed integer to a 32-bit unsigned integer, limiting to the range of the 32-bit integer.

Parameters
[in]p32x2The 64-bit signed integer to convert.
Returns
The value of the 64-bit integer, clamped to the range 0 to MAXUINT32.

◆ Hq32x2Compare()

int32 Hq32x2Compare ( const Hq32x2 p32x2A,
const Hq32x2 p32x2B 
)

Compare two 64-bit signed integers.

Parameters
[in]p32x2AA pointer to the first operand.
[in]p32x2BA pointer to the second operand.
Return values
-1Returned if the first operand is less than the second.
0Returned if the operands have the same value.
1Returned if the first operand is greater than the second.

◆ Hq32x2CompareInt32()

int32 Hq32x2CompareInt32 ( const Hq32x2 p32x2A,
int32  i32 
)

Compare a signed 32-bit integer to a signed 64-bit integer.

Parameters
[in]p32x2AA pointer to the first operand.
[in]i32A 32-bit signed integer to be compared with the first operand.
Return values
-1Returned if the first operand is less than the second.
0Returned if the operands have the same value.
1Returned if the first operand is greater than the second.

◆ Hq32x2CompareUint32()

int32 Hq32x2CompareUint32 ( const Hq32x2 p32x2A,
uint32  ui32 
)

Compare an unsigned 32-bit integer to a signed 64-bit integer.

Parameters
[in]p32x2AA pointer to the first operand.
[in]ui32A 32-bit unsigned integer to be compared with the first operand.
Return values
-1Returned if the first operand is less than the second.
0Returned if the operands have the same value.
1Returned if the first operand is greater than the second.

◆ Hq32x2DivRemUint32()

HqBool Hq32x2DivRemUint32 ( Hq32x2 result,
uint32 remainder,
const Hq32x2 p32x2,
uint32  divisor 
)

Divide an Hq32x2 by an unsigned 32 bit integer, getting an Hq32x2 result and optional remainder.

Parameters
[out]resultA location to store the result of p32x2/divisor, truncated towards zero.
[out]remainderAn optional location to store the remainder of p32x2/divisor.
[in]p32x2A large number to divide
[in]divisorA positive divisor to divide p32x2 by.
Return values
TRUEThe division succeeded, and the result and remainder are stored in the locations provided.
FALSEThe divisor was zero, or the dividend was negative and remainder is non-NULL; this function follows C division which truncates towards zero, so the remainder of dividing a negative divisor will be negative or zero. If the remainder pointer is NULL, then division of negative dividends is supported.

◆ Hq32x2FromDouble()

void Hq32x2FromDouble ( Hq32x2 p32x2,
double  dbl 
)

Fill in a 64-bit signed integer from a double-precision floating point value. The double is asserted to be in the range of an Hq32x2.

Parameters
[out]p32x2A pointer to the 64-bit signed integer filled in with the truncated double value.
[in]dblA double precision floating point value to be truncated and converted to a signed 64-bit integral integer.

◆ Hq32x2FromPtrdiff_t()

void Hq32x2FromPtrdiff_t ( Hq32x2 p32x2,
ptrdiff_t  ptrdiff 
)

Fill in a 64-bit signed integer from the difference between two pointers.

Parameters
[out]p32x2A pointer to the 64-bit signed integer filled in with the pointer difference value.
[in]ptrdiffAn integral value, representing the difference between two pointers.

◆ Hq32x2FromSize_t()

void Hq32x2FromSize_t ( Hq32x2 p32x2,
size_t  sizet 
)

Fill in a 64-bit signed integer from an integral value representing the result of the sizeof() operator.

Parameters
[out]p32x2A pointer to the 64-bit signed integer filled in with the pointer difference value.
[in]sizetAn integral value, representing the maximum size of an object.

◆ Hq32x2MultUint32Uint32()

HqBool Hq32x2MultUint32Uint32 ( Hq32x2 result,
uint32  ui32A,
uint32  ui32B 
)

Multiply two unsigned 32-bit integers together, storing the product into a signed 64-bit integer.

Parameters
[in]resultA pointer where the product of the two inputs is stored.
[in]ui32AThe first operand.
[in]ui32BThe second operand.

◆ Hq32x2Sign()

int32 Hq32x2Sign ( const Hq32x2 p32x2)

Return the sign of a 64-bit signed integer.

Parameters
[in]p32x2A pointer to the 64-bit signed integer to be tested.
Return values
-1Returned if the value stored at p32x2 is negative.
0Returned if the value stored at p32x2 is zero.
1Returned if the value stored at p32x2 is positive.

◆ Hq32x2Subtract()

void Hq32x2Subtract ( Hq32x2 p32x2Result,
const Hq32x2 p32x2A,
const Hq32x2 p32x2B 
)

Subtract two signed 64-bit numbers, storing the difference into a third.

Parameters
[in]p32x2ResultA pointer where the difference of the two inputs is stored. This pointer may be the same as either or both of the inputs.
[in]p32x2AA pointer to the first operand.
[in]p32x2BA pointer to the second operand.

◆ Hq32x2SubtractInt32()

void Hq32x2SubtractInt32 ( Hq32x2 p32x2Result,
const Hq32x2 p32x2A,
int32  i32 
)

Subtract a signed 32-bit integer from a signed 64-bit integer, storing the sum into a signed 64-bit integer.

Parameters
[in]p32x2ResultA pointer where the difference of the two inputs is stored. This pointer may be the same as the pointer to the first operand.
[in]p32x2AA pointer to the first operand.
[in]i32A 32-bit signed integer to be subtracted from the first operand.

◆ Hq32x2SubtractUint32()

void Hq32x2SubtractUint32 ( Hq32x2 p32x2Result,
const Hq32x2 p32x2A,
uint32  ui32 
)

Subtract an unsigned 32-bit integer from a signed 64-bit integer, storing the sum into a signed 64-bit integer.

Parameters
[in]p32x2ResultA pointer where the difference of the two inputs is stored. This pointer may be the same as the pointer to the first operand.
[in]p32x2AA pointer to the first operand.
[in]ui32A 32-bit unsigned integer to be subtracted from the first operand.

◆ Hq32x2ToDouble()

double Hq32x2ToDouble ( const Hq32x2 p32x2)

Convert a 64-bit signed integer to a double-precision floating point value. Precision may be silently reduced, depending on the magnitude of the 64-bit integral value.

Parameters
[in]p32x2A pointer to the 64-bit signed integer to be converted to double.
Returns
The value stored at p32x2, converted to a double precision floating point value.

◆ Hq32x2ToInt32()

HqBool Hq32x2ToInt32 ( const Hq32x2 p32x2,
int32 pReturn 
)

Convert a 64-bit signed integer to a 32-bit signed integer.

Parameters
[in]p32x2The 64-bit signed integer to convert.
[out]pReturnA pointer to the converted integer.
Return values
TRUEReturned if the 64-bit integer's value was in range of the 32-bit integer.
FALSEReturned if the 64-bit integer's value was out of range of the 32-bit integer. The value stored in pReturn is not modified in this case.

◆ Hq32x2ToSize_t()

HqBool Hq32x2ToSize_t ( const Hq32x2 p32x2,
size_t *  sizet 
)

Convert a 64-bit signed integer to an unsigned value sufficient to represent the size of an object.

Parameters
[in]p32x2The 64-bit unsigned integer to convert.
[out]sizetA pointer to the converted integer.
Return values
TRUEReturned if the 64-bit integer's value was in range of size_t.
FALSEReturned if the 64-bit integer's value was out of range of size_t.

◆ Hq32x2ToUint32()

HqBool Hq32x2ToUint32 ( const Hq32x2 p32x2,
uint32 pReturn 
)

Convert a 64-bit signed integer to a 32-bit unsigned integer.

Parameters
[in]p32x2The 64-bit signed integer to convert.
[out]pReturnA pointer to the converted integer.
Return values
TRUEReturned if the 64-bit integer's value was in range of the 32-bit integer.
FALSEReturned if the 64-bit integer's value was out of range of the 32-bit integer. The value stored in pReturn is not modified in this case.

◆ HqU32x2Add()

void HqU32x2Add ( HqU32x2 pU32x2Result,
const HqU32x2 pU32x2A,
const HqU32x2 pU32x2B 
)

Add two unsigned 64-bit numbers, storing the sum into a third.

Parameters
[in]pU32x2ResultA pointer where the sum of the two inputs is stored. This pointer may be the same as either or both of the inputs.
[in]pU32x2AA pointer to the first operand.
[in]pU32x2BA pointer to the second operand.

◆ HqU32x2AddUint32()

void HqU32x2AddUint32 ( HqU32x2 pU32x2Result,
const HqU32x2 pU32x2A,
uint32  ui32 
)

Add an unsigned 32-bit integer to an unsigned 64-bit integer, storing the sum into an unsigned 64-bit integer.

Parameters
[in]pU32x2ResultA pointer where the sum of the two inputs is stored. This pointer may be the same as the pointer to the first operand.
[in]pU32x2AA pointer to the first operand.
[in]ui32A 32-bit unsigned integer to be added to the first operand.

◆ HqU32x2AssertToInt32()

int32 HqU32x2AssertToInt32 ( const HqU32x2 pU32x2)

Convert a 64-bit unsigned integer to a 32-bit signed integer, limiting to the range of the 32-bit integer.

Parameters
[in]pU32x2The 64-bit unsigned integer to convert.
Returns
The value of the 64-bit integer, clamped to the range MININT32 to MAXINT32.
Note
This function asserts if the value of the 64-bit integer is clamped to the 32-bit range.

◆ HqU32x2AssertToUint32()

uint32 HqU32x2AssertToUint32 ( const HqU32x2 pU32x2)

Convert a 64-bit unsigned integer to a 32-bit unsigned integer, limiting to the range of the 32-bit integer.

Parameters
[in]pU32x2The 64-bit unsigned integer to convert.
Returns
The value of the 64-bit integer, clamped to the range 0 to MAXUINT32.
Note
This function asserts if the value of the 64-bit integer is clamped to the 32-bit range.

◆ HqU32x2BoundToInt32()

int32 HqU32x2BoundToInt32 ( const HqU32x2 pU32x2)

Convert a 64-bit unsigned integer to a 32-bit signed integer, limiting to the range of the 32-bit integer.

Parameters
[in]pU32x2The 64-bit unsigned integer to convert.
Returns
The value of the 64-bit integer, clamped to the range MININT32 to MAXINT32.

◆ HqU32x2BoundToUint32()

uint32 HqU32x2BoundToUint32 ( const HqU32x2 pU32x2)

Convert a 64-bit unsigned integer to a 32-bit unsigned integer, limiting to the range of the 32-bit integer.

Parameters
[in]pU32x2The 64-bit unsigned integer to convert.
Returns
The value of the 64-bit integer, clamped to the range 0 to MAXUINT32.

◆ HqU32x2Compare()

int32 HqU32x2Compare ( const HqU32x2 pU32x2A,
const HqU32x2 pU32x2B 
)

Compare two 64-bit unsigned integers.

Parameters
[in]pU32x2AA pointer to the first operand.
[in]pU32x2BA pointer to the second operand.
Return values
-1Returned if the first operand is less than the second.
0Returned if the operands have the same value.
1Returned if the first operand is greater than the second.

◆ HqU32x2CompareUint32()

int32 HqU32x2CompareUint32 ( const HqU32x2 pU32x2A,
uint32  ui32 
)

Compare an unsigned 32-bit integer to an unsigned 64-bit integer.

Parameters
[in]pU32x2AA pointer to the first operand.
[in]ui32A 32-bit unsigned integer to be compared with the first operand.
Return values
-1Returned if the first operand is less than the second.
0Returned if the operands have the same value.
1Returned if the first operand is greater than the second.

◆ HqU32x2FromDouble()

void HqU32x2FromDouble ( HqU32x2 pU32x2,
double  dbl 
)

Fill in a 64-bit unsigned integer from a double-precision floating point value. The double is asserted to be in the range of an HqU32x2.

Parameters
[out]pU32x2A pointer to the 64-bit unsigned integer filled in with the truncated double value.
[in]dblA double precision floating point value to be truncated and converted to a 64-bit integral integer.

◆ HqU32x2FromSize_t()

void HqU32x2FromSize_t ( HqU32x2 pU32x2,
size_t  sizet 
)

Fill in a 64-bit unsigned integer from an integral value representing the result of the sizeof() operator.

Parameters
[out]pU32x2A pointer to the 64-bit unsigned integer filled in with the pointer difference value.
[in]sizetAn integral value, representing the maximum size of an object.

◆ HqU32x2Sign()

uint32 HqU32x2Sign ( const HqU32x2 pU32x2)

Return the sign of a 64-bit unsigned integer.

Parameters
[in]pU32x2A pointer to the 64-bit unsigned integer to be tested.
Return values
0Returned if the value stored at pU32x2 is zero.
1Returned if the value stored at pU32x2 is positive.

◆ HqU32x2Subtract()

void HqU32x2Subtract ( HqU32x2 pU32x2Result,
const HqU32x2 pU32x2A,
const HqU32x2 pU32x2B 
)

Subtract two unsigned 64-bit numbers, storing the difference into a third.

Parameters
[in]pU32x2ResultA pointer where the sum of the two inputs is stored. This pointer may be the same as either or both of the inputs.
[in]pU32x2AA pointer to the first operand.
[in]pU32x2BA pointer to the second operand.

◆ HqU32x2SubtractUint32()

void HqU32x2SubtractUint32 ( HqU32x2 pU32x2Result,
const HqU32x2 pU32x2A,
uint32  ui32 
)

Subtract an unsigned 32-bit integer from an unsigned 64-bit integer, storing the sum into an unsigned 64-bit integer.

Parameters
[in]pU32x2ResultA pointer where the difference of the two inputs is stored. This pointer may be the same as the pointer to the first operand.
[in]pU32x2AA pointer to the first operand.
[in]ui32A 32-bit unsigned integer to be subtracted from the first operand.

◆ HqU32x2ToDouble()

double HqU32x2ToDouble ( const HqU32x2 pU32x2)

Convert a 64-bit unsigned integer to a double-precision floating point value. Precision may be silently reduced, depending on the magnitude of the 64-bit integral value.

Parameters
[in]pU32x2A pointer to the 64-bit unsigned integer to be converted to double.
Returns
The value stored at pU32x2, converted to a double precision floating point value.

◆ HqU32x2ToInt32()

HqBool HqU32x2ToInt32 ( const HqU32x2 pU32x2,
int32 pReturn 
)

Convert a 64-bit unsigned integer to a 32-bit signed integer.

Parameters
[in]pU32x2The 64-bit unsigned integer to convert.
[out]pReturnA pointer to the converted integer.
Return values
TRUEReturned if the 64-bit integer's value was in range of the 32-bit integer.
FALSEReturned if the 64-bit integer's value was out of range of the 32-bit integer. The value stored in pReturn is not modified in this case.

◆ HqU32x2ToSize_t()

HqBool HqU32x2ToSize_t ( const HqU32x2 pU32x2,
size_t *  sizet 
)

Convert a 64-bit unsigned integer to an unsigned value sufficient to represent the size of an object.

Parameters
[in]pU32x2The 64-bit unsigned integer to convert.
[out]sizetA pointer to the converted integer.
Return values
TRUEReturned if the 64-bit integer's value was in range of size_t.
FALSEReturned if the 64-bit integer's value was out of range of size_t.

◆ HqU32x2ToUint32()

HqBool HqU32x2ToUint32 ( const HqU32x2 pU32x2,
uint32 pReturn 
)

Convert a 64-bit unsigned integer to a 32-bit unsigned integer.

Parameters
[in]pU32x2The 64-bit unsigned integer to convert.
[out]pReturnA pointer to the converted integer.
Return values
TRUEReturned if the 64-bit integer's value was in range of the 32-bit integer.
FALSEReturned if the 64-bit integer's value was out of range of the 32-bit integer. The value stored in pReturn is not modified in this case.