Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Data Structures | Macros | Functions | Variables
LIMITS.cpp File Reference
#include "config.h"
#include <stdio.h>
#include <limits.h>
#include "types.h"
Include dependency graph for LIMITS.cpp:

Go to the source code of this file.

Data Structures

struct  EmptyStruct
 

Macros

#define LONG_LONG   long long
 
#define SIZEOF(T)   unsigned (sizeof (T))
 
#define MKLIMITS(T, pfx, sfx, type)
 
#define LLong   long long
 
#define PRINT_SPECIFIC(width, least, type)
 

Functions

template<class T >
void print_limit (T n, const char *pfx, const char *sfx, bool is_max, const char *type)
 
template<class T >
T compute_min (T min)
 
template<class T >
const char * type_suffix (T)
 
const char * type_suffix (short)
 
const char * type_suffix (unsigned short)
 
const char * type_suffix (int)
 
const char * type_suffix (unsigned int)
 
const char * type_suffix (long)
 
const char * type_suffix (unsigned long)
 
const char * type_suffix (long long)
 
const char * type_suffix (unsigned long long)
 
template<class T >
T compute_limits (T *pval, const char *pfx, const char *sfx, const char *type)
 
unsigned compute_char_bits ()
 
int main ()
 

Variables

int no_twos_complement = 0
 
volatile int zero = 0
 
volatile int one = zero + 1
 
volatile int two = one + 1
 
volatile int zero_complement = ~zero
 

Macro Definition Documentation

◆ LLong

#define LLong   long long

◆ LONG_LONG

#define LONG_LONG   long long

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 1999-2007 Rogue Wave Software, Inc.

Definition at line 39 of file LIMITS.cpp.

◆ MKLIMITS

#define MKLIMITS (   T,
  pfx,
  sfx,
  type 
)
Value:
do { \
T buf = 0; \
compute_limits (&buf, pfx, sfx, type); \
} while (0)
#define T
Definition 17.names.cpp:163
#define buf
Definition 17.names.cpp:452

◆ PRINT_SPECIFIC

#define PRINT_SPECIFIC (   width,
  least,
  type 
)
Value:
do { \
/* avoid warnings about expression being constant */ \
const char* least_str = least; \
if (least_str && *least_str) \
printf ("#define _RWSTD_INT_LEAST%d_T %s _RWSTD_%s_T\n" \
"#define _RWSTD_UINT_LEAST%d_T %s _RWSTD_U%s_T\n", \
width, width < 10 ? " " : "", type, \
width, width < 10 ? " " : "", type); \
else \
printf ("#define _RWSTD_INT%d_T %s signed %s\n" \
"#define _RWSTD_UINT%d_T %s unsigned %s\n", \
width, width < 10 ? " " : "", type, \
width, width < 10 ? " " : "", type); \
} while (0)

◆ SIZEOF

#define SIZEOF (   T)    unsigned (sizeof (T))

Definition at line 232 of file LIMITS.cpp.

Function Documentation

◆ compute_char_bits()

unsigned compute_char_bits ( )

Definition at line 215 of file LIMITS.cpp.

◆ compute_limits()

template<class T >
T compute_limits ( T *  pval,
const char *  pfx,
const char *  sfx,
const char *  type 
)

Definition at line 173 of file LIMITS.cpp.

◆ compute_min()

template<class T >
T compute_min ( T  min)

Definition at line 137 of file LIMITS.cpp.

◆ main()

int main ( void  )

Definition at line 235 of file LIMITS.cpp.

◆ print_limit()

template<class T >
void print_limit ( T  n,
const char *  pfx,
const char *  sfx,
bool  is_max,
const char *  type 
)

Definition at line 68 of file LIMITS.cpp.

◆ type_suffix() [1/9]

const char * type_suffix ( int  )

Definition at line 156 of file LIMITS.cpp.

◆ type_suffix() [2/9]

const char * type_suffix ( long long  )

Definition at line 162 of file LIMITS.cpp.

◆ type_suffix() [3/9]

const char * type_suffix ( long  )

Definition at line 158 of file LIMITS.cpp.

◆ type_suffix() [4/9]

const char * type_suffix ( short  )

Definition at line 154 of file LIMITS.cpp.

◆ type_suffix() [5/9]

template<class T >
const char * type_suffix ( T  )

Definition at line 152 of file LIMITS.cpp.

◆ type_suffix() [6/9]

const char * type_suffix ( unsigned int  )

Definition at line 157 of file LIMITS.cpp.

◆ type_suffix() [7/9]

const char * type_suffix ( unsigned long long  )

Definition at line 163 of file LIMITS.cpp.

◆ type_suffix() [8/9]

const char * type_suffix ( unsigned long  )

Definition at line 159 of file LIMITS.cpp.

◆ type_suffix() [9/9]

const char * type_suffix ( unsigned short  )

Definition at line 155 of file LIMITS.cpp.

Variable Documentation

◆ no_twos_complement

int no_twos_complement = 0

Definition at line 57 of file LIMITS.cpp.

◆ one

volatile int one = zero + 1

Definition at line 61 of file LIMITS.cpp.

◆ two

volatile int two = one + 1

Definition at line 62 of file LIMITS.cpp.

◆ zero

volatile int zero = 0

Definition at line 60 of file LIMITS.cpp.

◆ zero_complement

volatile int zero_complement = ~zero

Definition at line 63 of file LIMITS.cpp.