Changeset 73a9ffb in git for libpolys/coeffs/rmodulo2m.cc


Ignore:
Timestamp:
May 26, 2011, 10:29:03 AM (13 years ago)
Author:
Frank Seelisch <seelisch@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38077648e7239f98078663eb941c3c979511150a')
Children:
488808e90a9444d2ce5d16be059643fdd2e8629e
Parents:
e676cdf123bc41ae953d7fd58106263f5fd02d0c
git-author:
Frank Seelisch <seelisch@mathematik.uni-kl.de>2011-05-26 10:29:03+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:36:53+01:00
Message:
made sure that ch is properly set everywhere, and ch >= 0; more ASSUMEs
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/rmodulo2m.cc

    re676cd r73a9ffb  
    2424#include <string.h>
    2525
     26/// Our Type!
     27static const n_coeffType ID = n_Z2m;
     28
    2629extern omBin gmp_nrz_bin; /* init in rintegers*/
    2730
     
    4447BOOLEAN nr2mInitChar (coeffs r, void* p)
    4548{
     49  assume( getCoeffType(r) == ID );
    4650  nr2mInitExp((int)(long)(p), r);
    4751  r->cfKillChar    = ndKillChar; /* dummy*/
     
    4953
    5054  r->ringtype = 1;
    51   r->type = n_Z2m;
     55 
     56  /* next cast may yield an overflow as mod2mMask is an unsigned long */
     57  r->ch = (int)r->mod2mMask + 1;
    5258
    5359  r->cfInit        = nr2mInit;
     
    640646  else
    641647  {
    642     /* code unexpectedly called with m = 1; we go on with m = 2: */
     648    /* code unexpectedly called with m = 1; we continue with m = 2: */
    643649    r->mod2mMask = 3; /* i.e., '11' in binary representation */
    644650  }
    645   r->ch = r->mod2mMask + 1;
    646651}
    647652
     
    650655  nr2mSetExp(m, r);
    651656  if (m < 2)
    652     WarnS("nr2mInitExp unexpectedly called with m = 1 (we go on with Z/2^2");
     657    WarnS("nr2mInitExp unexpectedly called with m = 1 (we continue with Z/2^2");
    653658}
    654659
Note: See TracChangeset for help on using the changeset viewer.