Changeset a2cdd62 in git


Ignore:
Timestamp:
Nov 15, 2011, 7:28:26 PM (12 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
7d58b610fedb008c184de5ef38c1cd5bc05d1ecc
Parents:
4e855a74192517a72dcb8d0b593d1a3706ed88d9
Message:
fix: avoid limits.h
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • Singular/walk.cc

    r4e855a7 ra2cdd62  
    4343#include <stdio.h>
    4444#include <float.h>
    45 #include <limits.h>
     45#include <misc/mylimits.h>
    4646#include <sys/types.h>
    4747
  • kernel/semic.cc

    r4e855a7 ra2cdd62  
    413413    Rational alpha2 = -1;
    414414
    415     int      mult=INT_MAX,nthis,nt;
     415    int      mult=MAX_INT_VAL,nthis,nt;
    416416
    417417    while( u.next_interval( &alpha1,&alpha2 ) )
     
    442442    Rational alpha2 = -1;
    443443
    444     int      mult=INT_MAX,nthis,nt;
     444    int      mult=MAX_INT_VAL,nthis,nt;
    445445
    446446    while( u.next_interval( &alpha1,&alpha2 ) )
  • libpolys/coeffs/ffields.cc

    r4e855a7 ra2cdd62  
    464464      *i *= 10;
    465465      *i += *s++ - '0';
    466       if (*i > (INT_MAX / 10)) *i = *i % r->m_nfCharP;
     466      if (*i > (MAX_INT_VAL / 10)) *i = *i % r->m_nfCharP;
    467467    }
    468468    while (*s >= '0' && *s <= '9');
  • libpolys/coeffs/shortfl.cc

    r4e855a7 ra2cdd62  
    8888  int i;
    8989  float f = nf(n).F();
    90   if (((float)INT_MIN <= f) || ((float)INT_MAX >= f))
     90  if (((float)(-MAX_INT_VAL-1) <= f) || ((float)MAX_INT_VAL >= f))
    9191    i = (int)f;
    9292  else
  • libpolys/misc/mylimits.h

    r4e855a7 ra2cdd62  
    1010#define _MYLIMITS_H
    1111
    12 #include <limits.h>
     12static const int MAX_INT_VAL = 2147483647;
    1313
    14 static const int MAX_INT_VAL = INT_MAX;
     14#define ULONG_MAX (~0L)
     15
     16#if ~0UL == 4294967295UL
     17#define LONG_MAX 9223372036854775807L
     18#else
     19#define LONG_MAX 2147483647L
     20#endif
    1521
    1622#endif /* _MYLIMITS_H */
  • libpolys/polys/matpol.cc

    r4e855a7 ra2cdd62  
    4848{
    4949  if (r<=0) r=1;
    50   if ( (((int)(INT_MAX/sizeof(poly))) / r) <= c)
     50  if ( (((int)(MAX_INT_VAL/sizeof(poly))) / r) <= c)
    5151  {
    5252    Werror("internal error: creating matrix[%d][%d]",r,c);
  • libpolys/polys/monomials/ring.cc

    r4e855a7 ra2cdd62  
    38043804static void rSetVarL(ring r)
    38053805{
    3806   int  min = INT_MAX, min_j = -1;
     3806  int  min = MAX_INT_VAL, min_j = -1;
    38073807  int* VarL_Number = (int*) omAlloc0(r->ExpL_Size*sizeof(int));
    38083808
Note: See TracChangeset for help on using the changeset viewer.