Changeset 75fde54 in git


Ignore:
Timestamp:
Nov 21, 2014, 5:49:34 PM (9 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'a719bcf0b8dbc648b128303a49777a094b57592c')
Children:
cecb7ea8a22076db547d32bfdc5c879d5283420d
Parents:
cb6dc33c118a894b213ceda9734ce618f5c616b9
Message:
fix: var(i)/gen(i)/farey(i,j) with no ring defined
Location:
Singular
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/gentable.cc

    rcb6dc33 r75fde54  
    2020#include "grammar.h"
    2121#include "tok.h"
     22
     23inline int RingDependend(int t) { return (BEGIN_RING<t)&&(t<END_RING); }
    2224
    2325// to produce convert_table.texi for doc:
     
    348350          Tok2Cmdname(dArith1[i].arg),
    349351          Tok2Cmdname(dArith1[i].res));
     352    if (RingDependend(dArith1[i].res) && (!RingDependend(dArith1[i].arg)))
     353    {
     354      fprintf(outfile,"// WARNING: %s requires currRing\n",s);
     355    }
    350356    i++;
    351357  }
     
    362368          Tok2Cmdname(dArith2[i].arg2),
    363369          Tok2Cmdname(dArith2[i].res));
     370    if (RingDependend(dArith2[i].res)
     371       && (!RingDependend(dArith2[i].arg1))
     372       && (!RingDependend(dArith2[i].arg2)))
     373    {
     374      fprintf(outfile,"// WARNING: %s requires currRing\n",s);
     375    }
    364376    i++;
    365377  }
     
    377389          Tok2Cmdname(dArith3[i].arg3),
    378390          Tok2Cmdname(dArith3[i].res));
     391    if (RingDependend(dArith3[i].res)
     392       && (!RingDependend(dArith3[i].arg1))
     393       && (!RingDependend(dArith3[i].arg2))
     394       && (!RingDependend(dArith3[i].arg3)))
     395    {
     396      fprintf(outfile,"// WARNING: %s requires currRing\n",s);
     397    }
    379398    i++;
    380399  }
  • Singular/iparith.cc

    rcb6dc33 r75fde54  
    108108  #include <polys/nc/nc.h>
    109109  #include <polys/nc/sca.h>
    110   #define ALLOW_PLURAL     1
    111   #define NO_PLURAL        0
    112   #define COMM_PLURAL      2
    113110  #define  PLURAL_MASK 3
    114111#else /* HAVE_PLURAL */
    115   #define ALLOW_PLURAL     0
    116   #define NO_PLURAL        0
    117   #define COMM_PLURAL      0
    118112  #define  PLURAL_MASK     0
    119113#endif /* HAVE_PLURAL */
     
    126120  #define ZERODIVISOR_MASK 0
    127121#endif
     122#define ALLOW_PLURAL     1
     123#define NO_PLURAL        0
     124#define COMM_PLURAL      2
    128125#define ALLOW_RING       4
    129126#define NO_RING          0
     
    77927789          if (check_valid(dA2[i].valid_for,op)) break;
    77937790        }
     7791        else
     7792        {
     7793          if (RingDependend(dA2[i].res))
     7794          {
     7795            WerrorS("no ring active");
     7796            break;
     7797          }
     7798        }
    77947799        if (traceit&TRACE_CALL)
    77957800          Print("call %s(%s,%s)\n",iiTwoOps(op),Tok2Cmdname(at),Tok2Cmdname(bt));
     
    78257830            {
    78267831              if (check_valid(dA2[i].valid_for,op)) break;
     7832            }
     7833            else
     7834            {
     7835              if (RingDependend(dA2[i].res))
     7836              {
     7837                WerrorS("no ring active");
     7838                break;
     7839              }
    78277840            }
    78287841            if (traceit&TRACE_CALL)
     
    80038016          if (check_valid(dA1[i].valid_for,op)) break;
    80048017        }
     8018        else
     8019        {
     8020          if (RingDependend(dA1[i].res))
     8021          {
     8022            WerrorS("no ring active");
     8023            break;
     8024          }
     8025        }
    80058026        if (traceit&TRACE_CALL)
    80068027          Print("call %s(%s)\n",iiTwoOps(op),Tok2Cmdname(at));
     
    80358056          {
    80368057            if (check_valid(dA1[i].valid_for,op)) break;
     8058          }
     8059          else
     8060          {
     8061            if (RingDependend(dA1[i].res))
     8062            {
     8063              WerrorS("no ring active");
     8064              break;
     8065            }
    80378066          }
    80388067          if (traceit&TRACE_CALL)
Note: See TracChangeset for help on using the changeset viewer.