<commit_before>//----------------------------------------------------------------------------
// Anti-Grain Geometry - Version 2.4 (Public License)
// Copyright (C) 2002-2005 <NAME> (http://www.antigrain.com)
//
// Anti-Grain Geometry - Version 2.4 Release Milano 3 (AggPas 2.4 RM3)
// Pascal Port By: <NAME> alias Milano
//                 <EMAIL>
//                 http://www.aggpas.org
// Copyright (c) 2005-2006
//
// Permission to copy, use, modify, sell and distribute this software
// is granted provided this copyright notice appears in all copies.
// This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
//
//----------------------------------------------------------------------------
// Contact: <EMAIL>
//          <EMAIL>
//          http://www.antigrain.com
//
// [Pascal Port History] -----------------------------------------------------
//
// 23.06.2006-Milano: added ptrcomp type + ptrcomp adjustments
// 26.09.2005-Milano: Complete unit port
//
{ agg_basics.pas }
unit
 agg_basics ;

INTERFACE

{$I agg_mode.inc }
{$Q- }
{$R- }

uses
 Math ;

{ TYPES DEFINITION }
type
 agg_types = (

  int8_type ,
  int8u_type ,
  int16_type ,
  int16u_type ,
  int32_type ,
  int32u_type ,
  int64_type ,
  int64u_type

  );

 agg_type = (agg_int ,agg_unsigned ,agg_double ); 

 AGG_INT8  = shortint;
 AGG_INT8U = byte;

 AGG_INT16  = smallint;
 AGG_INT16U = word;

 AGG_INT32  = longint;
 AGG_INT32U = longword;

 AGG_INT64  = int64;
{$IFDEF FPC }
 AGG_INT64U = qword;
{$ELSE }
 AGG_INT64U = int64;
{$ENDIF }

 int8   = AGG_INT8;
 int8u  = AGG_INT8U;
 int16  = AGG_INT16;
 int16u = AGG_INT16U;
 int32  = AGG_INT32;
 int32u = AGG_INT32U;
 int64  = AGG_INT64;
 int64u = AGG_INT64U;

 int8_ptr   = ^int8;
 int8u_ptr  = ^int8u;
 int16_ptr  = ^int16;
 int16u_ptr = ^int16u;
 int32_ptr  = ^int32;
 int32u_ptr = ^int32u;
 int64_ptr  = ^int64;
 int64u_ptr = ^int64u;

 int8u_ptr_ptr = ^int8u_ptr;

 cover_type_ptr = ^cover_type;
 cover_type = byte;

 int_ptr = ^int;
 int = int32;

 unsigned_ptr = ^unsigned;
 unsigned = int32u;

 int8u_01_ptr = ^int8u_01;
 int8u_01 = array[0..1 ] of int8u;

 int16u_ = record
   low  ,
   high : int8u;

  end;

 int32_ = record
   low  ,
   high : int16;

  end;

 int32_int8u = record
   _0 ,_1 ,_2 ,_3 : int8u;

  end;

 int32u_ = record
   low  ,
   high : int16u;

  end;

{ To achive maximum compatiblity with older code, FPC doesn't change the size
  of predefined data types like integer, longint or word when changing from
  32 to 64 Bit. However, the size of a pointer is 8 bytes on a 64 bit
  architecture so constructs like longint(pointer(p)) are doomed to crash on
  64 bit architectures. However, to allow you to write portable code, the
  FPC system unit introduces the types PtrInt and PtrUInt which are signed
  and unsigned integer data types with the same size as a pointer.

  Keep in mind that the size change of the "pointer" type also affects record
  sizes. If you allocate records with fixed sizes, and not with new or with
  getmem (<x>,sizeof(<x>)), this will have to be fixed. }
// Pascal Pointer Computation Type
{$IFDEF CPU64 }
 ptrcomp = system.int64;

{$ELSE }
 ptrcomp = integer;

{$ENDIF }

// Pascal's pointer-in-an-array-access helper structures
 p32_ptr = ^p32;
 p32 = record
   case integer of
    1 : (ptr : pointer );

   {$IFDEF CPU64 }
    2 : (int : system.int64 );

   {$ELSE }
    2 : (int : integer );

   {$ENDIF }

  end;

 double_ptr_ptr = ^double_ptr;
 double_ptr = ^double;

 double_2_ptr = ^double_2;
 double_2     = array[0..1 ] of double;

 double_8_ptr = ^double_8;
 double_8     = array[0..7 ] of double;

 double_42_ptr = ^double_42;
 double_42     = array[0..3 ,0..1 ] of double;

 double_44_ptr = ^double_44;<commit_msg>agg: no need for these IFDEF's we have a dedicated type defined that we can use.<commit_after>//----------------------------------------------------------------------------
// Anti-Grain Geometry - Version 2.4 (Public License)
// Copyright (C) 2002-2005 <NAME> (http://www.antigrain.com)
//
// Anti-Grain Geometry - Version 2.4 Release Milano 3 (AggPas 2.4 RM3)
// Pascal Port By: <NAME> Milano
//                 <EMAIL>.sk
//                 http://www.aggpas.org
// Copyright (c) 2005-2006
//
// Permission to copy, use, modify, sell and distribute this software
// is granted provided this copyright notice appears in all copies.
// This software is provided "as is" without express or implied
// warranty, and with no claim as to its suitability for any purpose.
//
//----------------------------------------------------------------------------
// Contact: <EMAIL>
//          <EMAIL>
//          http://www.antigrain.com
//
// [Pascal Port History] -----------------------------------------------------
//
// 23.06.2006-Milano: added ptrcomp type + ptrcomp adjustments
// 26.09.2005-Milano: Complete unit port
//
{ agg_basics.pas }
unit
 agg_basics ;

INTERFACE

{$I agg_mode.inc }
{$Q- }
{$R- }

uses
 Math ;

{ TYPES DEFINITION }
type
 agg_types = (

  int8_type ,
  int8u_type ,
  int16_type ,
  int16u_type ,
  int32_type ,
  int32u_type ,
  int64_type ,
  int64u_type

  );

 agg_type = (agg_int ,agg_unsigned ,agg_double ); 

 AGG_INT8  = shortint;
 AGG_INT8U = byte;

 AGG_INT16  = smallint;
 AGG_INT16U = word;

 AGG_INT32  = longint;
 AGG_INT32U = longword;

 AGG_INT64  = int64;
{$IFDEF FPC }
 AGG_INT64U = qword;
{$ELSE }
 AGG_INT64U = int64;
{$ENDIF }

 int8   = AGG_INT8;
 int8u  = AGG_INT8U;
 int16  = AGG_INT16;
 int16u = AGG_INT16U;
 int32  = AGG_INT32;
 int32u = AGG_INT32U;
 int64  = AGG_INT64;
 int64u = AGG_INT64U;

 int8_ptr   = ^int8;
 int8u_ptr  = ^int8u;
 int16_ptr  = ^int16;
 int16u_ptr = ^int16u;
 int32_ptr  = ^int32;
 int32u_ptr = ^int32u;
 int64_ptr  = ^int64;
 int64u_ptr = ^int64u;

 int8u_ptr_ptr = ^int8u_ptr;

 cover_type_ptr = ^cover_type;
 cover_type = byte;

 int_ptr = ^int;
 int = int32;

 unsigned_ptr = ^unsigned;
 unsigned = int32u;

 int8u_01_ptr = ^int8u_01;
 int8u_01 = array[0..1 ] of int8u;

 int16u_ = record
   low  ,
   high : int8u;

  end;

 int32_ = record
   low  ,
   high : int16;

  end;

 int32_int8u = record
   _0 ,_1 ,_2 ,_3 : int8u;

  end;

 int32u_ = record
   low  ,
   high : int16u;

  end;

{ To achive maximum compatiblity with older code, FPC doesn't change the size
  of predefined data types like integer, longint or word when changing from
  32 to 64 Bit. However, the size of a pointer is 8 bytes on a 64 bit
  architecture so constructs like longint(pointer(p)) are doomed to crash on
  64 bit architectures. However, to allow you to write portable code, the
  FPC system unit introduces the types PtrInt and PtrUInt which are signed
  and unsigned integer data types with the same size as a pointer.

  Keep in mind that the size change of the "pointer" type also affects record
  sizes. If you allocate records with fixed sizes, and not with new or with
  getmem (<x>,sizeof(<x>)), this will have to be fixed. }
// Pascal Pointer Computation Type
{$IFDEF CPU64 }
 ptrcomp = system.int64;

{$ELSE }
 ptrcomp = integer;

{$ENDIF }

// Pascal's pointer-in-an-array-access helper structures
 p32_ptr = ^p32;
 p32 = record
   case integer of
    1 : (ptr : pointer );
    2 : (int : ptrcomp );
  end;

 double_ptr_ptr = ^double_ptr;
 double_ptr = ^double;

 double_2_ptr = ^double_2;
 double_2     = array[0..1 ] of double;

 double_8_ptr = ^double_8;
 double_8     = array[0..7 ] of double;

 double_42_ptr = ^double_42;
 double_42     = array[0..3 ,0..1 ] of double;

 double_44_ptr = ^double_44;
{'fraction_non_alphanumeric': 0.1562954155106355, 'fraction_numerical': 0.05667855727308759, 'mean_word_length': 2.412984670874662, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2128653', 'n_tokens_mistral': 2966, 'n_tokens_neox': 2660, 'n_words': 812}