Home

Resume

Blog

Teikitu


/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
/*  »Project«   Teikitu Gaming System (TgS) (∂)
    »File«      TgS Common - Base - Type [Limits].h
    »Author«    Andrew Aye (EMail: mailto:andrew.aye@gmail.com, Web: http://www.andrewaye.com)
    »Version«   4.51 / »GUID« A9981407-3EC9-42AF-8B6F-8BE6DD919615                                                                                                        */
/*   -------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
/*  Copyright: © 2002-2017, Andrew Aye.  All Rights Reserved.
    This software is free for non-commercial use.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
      following conditions are met:
        Redistribution of source code must retain this copyright notice, this list of conditions and the following disclaimers.
        Redistribution in binary form must reproduce this copyright notice, this list of conditions and the following disclaimers in the documentation and other materials
          provided with the distribution.
    The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
    The intellectual property rights of the algorithms used reside with Andrew Aye.
    You may not use this software, in whole or in part, in support of any commercial product without the express written consent of the author.
    There is no warranty or other guarantee of fitness of this software for any purpose. It is provided solely "as is".                                                   */
/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
#if !defined(TGS_COMMON_BASE_TYPE_LIMITS_H)
#define TGS_COMMON_BASE_TYPE_LIMITS_H
#pragma once


/* == Common ============================================================================================================================================================ */

/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */
/*  Public Constants                                                                                                                                                      */
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */

TgTYPE_UNION_ALIGN(TgMASK_TYPE,8,)
{
    TgUINT64                                    m_ui64;
    TgUINT32                                    m_ui32;
    TgFLOAT64                                   m_f64;
    TgFLOAT32                                   m_f32;
};

TgEXTN const TgMASK_TYPE                    KTgMASK_TRUE;

#define KTgMIN_U08                          ((TgUINT08)0)
#define KTgMIN_U16                          ((TgUINT16)0)
#define KTgMIN_U32                          ((TgUINT32)0)
#define KTgMIN_U64                          ((TgUINT64)0)
#define KTgMIN_S08                          ((TgSINT08)(-127 - 1))
#define KTgMIN_S16                          ((TgSINT16)(-32767 - 1))
#define KTgMIN_S32                          ((TgSINT32)(-2147483647 - 1))
#define KTgMIN_S64                          ((TgSINT64)(-9223372036854775807LL - 1))
TgEXTN C_TgFLOAT32                          KTgMIN_F32;
TgEXTN C_TgFLOAT64                          KTgMIN_F64;

#define KTgMAX_U08                          ((TgUINT08)0xffu)
#define KTgMAX_U16                          ((TgUINT16)0xffffu)
#define KTgMAX_U32                          ((TgUINT32)0xffffffffu)
#define KTgMAX_U64                          ((TgUINT64)0xffffffffffffffffULL)
#define KTgMAX_S08                          ((TgSINT08)127)
#define KTgMAX_S16                          ((TgSINT16)32767)
#define KTgMAX_S32                          ((TgSINT32)2147483647)
#define KTgMAX_S64                          ((TgSINT64)9223372036854775807LL)
TgEXTN C_TgFLOAT32                          KTgMAX_F32;
TgEXTN C_TgFLOAT64                          KTgMAX_F64;

TgEXTN C_TgFLOAT32                          KTgEPS_F32;
TgEXTN C_TgFLOAT32                          KTgROOT_EPS_F32;
TgEXTN C_TgFLOAT64                          KTgEPS_F64;
TgEXTN C_TgFLOAT64                          KTgROOT_EPS_F64;

enum { KTgHASH_SM_SIZE                      = 53 };
enum { KTgHASH_MD_SIZE                      = 5003 };
enum { KTgHASH_LG_SIZE                      = 12289 };

TgEXTN C_TgUINT32                           KTgEMPTY_HASH;

#if TgCOMPILE_64BIT_POINTER
#define KTgMIN_INTPTR                       KTgMIN_S64
#define KTgMAX_INTPTR                       KTgMAX_S64
#define KTgMAX_UINTPTR                      KTgMAX_U64
#elif TgCOMPILE_32BIT_POINTER
#define KTgMIN_INTPTR                       KTgMIN_S32
#define KTgMAX_INTPTR                       KTgMAX_S32
#define KTgMAX_UINTPTR                      KTgMAX_U32
#else
#error Unsupported pointer size
#endif

#define KTgMIN_PTRDIFF                      KTgMAX_INTPTR
#define KTgMAX_PTRDIFF                      KTgMAX_INTPTR
#define KTgMAX_SIZE                         KTgMAX_UINTPTR
#define KTgMAX_UXX                          KTgMAX_UINTPTR

#define KTgEMPTY_HASH                       (5381)


/* ====================================================================================================================================================================== */
#endif