MathgeomGLS

Форк
0
/
Velthuis.Sizes.pas 
65 строк · 3.4 Кб
1
{---------------------------------------------------------------------------}
2
{                                                                           }
3
{ File:       Velthuis.Sizes.pas                                            }
4
{ Function:   Constants for sizes and bit sizes of Delphi's integral types. }
5
{ Language:   Delphi version XE3 or later                                   }
6
{ Author:     Rudy Velthuis                                                 }
7
{ Copyright:  (c) 2016 Rudy Velthuis                                        }
8
{                                                                           }
9
{ License:    Redistribution and use in source and binary forms, with or    }
10
{             without modification, are permitted provided that the         }
11
{             following conditions are met:                                 }
12
{                                                                           }
13
{             * Redistributions of source code must retain the above        }
14
{               copyright notice, this list of conditions and the following }
15
{               disclaimer.                                                 }
16
{             * Redistributions in binary form must reproduce the above     }
17
{               copyright notice, this list of conditions and the following }
18
{               disclaimer in the documentation and/or other materials      }
19
{               provided with the distribution.                             }
20
{                                                                           }
21
{ Disclaimer: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS"     }
22
{             AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     }
23
{             LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND     }
24
{             FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO        }
25
{             EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE     }
26
{             FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,     }
27
{             OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,      }
28
{             PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,     }
29
{             DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED    }
30
{             AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT   }
31
{             LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)        }
32
{             ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF   }
33
{             ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                    }
34
{                                                                           }
35
{---------------------------------------------------------------------------}
36

37
unit Velthuis.Sizes;
38

39
interface
40

41
const
42
  CUInt8Bits    = 8;
43
  CInt8Bits     = CUInt8Bits - 1;
44
  CUInt16Bits   = 16;
45
  CInt16Bits    = CUInt16Bits - 1;
46
  CUInt32Bits   = 32;
47
  CInt32Bits    = CUInt32Bits - 1;
48
  CUInt64Bits   = 64;
49
  CInt64Bits    = CUInt64Bits - 1;
50
  CByteBits     = CUInt8Bits;
51
  CShortintBits = CByteBits - 1;
52
  CWordBits     = CByteBits * SizeOf(Word);
53
  CSmallintBits = CWordBits - 1;
54

55
  // Note: up to XE8, Longword and Longint were fixed sizes (32 bit). This has changed in XE8.
56
  CLongwordBits = CByteBits * SizeOf(Longword);
57
  CLongintBits  = CLongwordBits - 1;
58

59
  // Note: up to XE8, Integer and Cardinal were platform dependent. This has changed in XE8.
60
  CCardinalBits = CByteBits * SizeOf(Cardinal);
61
  CIntegerBits  = CCardinalBits - 1;
62

63
implementation
64

65
end.
66

67

68

69

70

71

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.