Changeset b8ad3a in git


Ignore:
Timestamp:
Jan 4, 2024, 4:39:13 PM (4 months ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'c5facdfddea2addfd91babd8b9019161dea4b695')
Children:
4b0877fd8b06e461f8c2450538a142d631260806
Parents:
dff47b7996ab7bb15ce9bd372c7fc531a02308f7
Message:
compiler warnings, format
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/primdec.lib

    rdff47b rb8ad3a  
    64606460  list qr = simplifyIdeal(i);
    64616461  map phi = @P, qr[2];  // map from the same ring, to simplify the ideal
    6462  
    6463  
     6462
     6463
    64646464  option(redSB);
    6465   i = groebner(qr[1]);  // We use the transformed variables, and we 
     6465  i = groebner(qr[1]);  // We use the transformed variables, and we
    64666466                        // will use map phi to go back to the original
    64676467                        // variables
     
    65386538    }
    65396539  }
    6540    
     6540
    65416541  rad=interred(phi(rad));  // Eliminate redundant polynomials
    65426542  setring(P0);
  • Singular/LIB/puiseuxexpansions.lib

    rdff47b rb8ad3a  
    479479        @c = puiseuxStep(fTemp, slN, 1);
    480480        fc = factorize(@c);
    481        
     481
    482482        for(j = 2; j <= size(fc[1]); j++)
    483483        {
     
    505505              {
    506506                sizeErg = size(erg);
    507               } else 
     507              } else
    508508              {
    509509                sizeErg = 1;
     
    538538                    {
    539539                      cs[size(cs) + 1] = list((csT[k][1] + c1)*(var(1)^(csT[k][2]*slN)), csT[k][2]*slD);
    540                     } else 
     540                    } else
    541541                    {
    542542                      cs[size(cs) + 1] = list(csT[k][1] + c1, csT[k][2]*slD);
     
    547547                    // NEW CODING FOR CONJUGATED EXPANSIONS
    548548                    cs[size(cs)][6] = insert(csT[k][6], cod);
    549                    
     549
    550550                    if(newExt == 1)
    551551                    {
     
    565565                      }
    566566                    }
    567                   } else 
     567                  } else
    568568                  {
    569569                    def RT = csT[k];
     
    928928
    929929      fNew1 = subst(f, var(1), var(1)^slD);
    930      
     930
    931931      for(ii = 2; ii <= size(fJe[1]); ii++)
    932932      {
     
    948948        @c = puiseuxStep(fTemp, slN, 1);
    949949        fc = factorize(@c);
    950        
     950
    951951        // Stopping criterium
    952952        stop = 0;
     
    957957            stop = 1;
    958958          }
    959         } else 
     959        } else
    960960        {
    961961          if(slN >= slD * maxDeg)
     
    968968        {
    969969          //minP = fc[1][j];
    970          
     970
    971971          // The minpoly of Y^5-1 is Y-1 and the minpoly of Y^5-2 is Y^5-2.
    972972          minPBefore = subst(fJe[1][ii],var(1),1);
     
    981981            {
    982982              sizeErg = size(erg);
    983             } else 
     983            } else
    984984            {
    985985              sizeErg = 1;
     
    10141014                  {
    10151015                    cs[size(cs) + 1] = list((csT[k][1] + c1)*(var(1)^(csT[k][2]*slN)), csT[k][2]*slD);
    1016                   } else 
     1016                  } else
    10171017                  {
    10181018                    cs[size(cs) + 1] = list(csT[k][1] + c1, csT[k][2]*slD);
     
    10231023                  // NEW CODING FOR CONJUGATED EXPANSIONS
    10241024                  cs[size(cs)][6] = insert(csT[k][6], cod);
    1025                  
     1025
    10261026                  if(newExt == 1)
    10271027                  {
     
    10391039                    }
    10401040                  }
    1041                 } else 
     1041                } else
    10421042                {
    10431043                  def RT = csT[k];
  • Singular/extra.cc

    rdff47b rb8ad3a  
    41474147    }
    41484148    else
    4149 #endif   
     4149#endif
    41504150/*==================== Error =================*/
    41514151      Werror( "(extended) system(\"%s\",...) %s", sys_cmd, feNotImplemented );
  • Singular/fehelp.cc

    rdff47b rb8ad3a  
    10281028  }
    10291029  Print("running `%s`\n",sys);
    1030   if (!FE_OPT_NO_SHELL_FLAG) 
     1030  if (!FE_OPT_NO_SHELL_FLAG)
    10311031  {
    10321032    int err=system(sys);
  • Singular/iplib.cc

    rdff47b rb8ad3a  
    206206  }
    207207
    208   fseek(fp, pi->data.s.proc_start, SEEK_SET);
     208  int res=fseek(fp, pi->data.s.proc_start, SEEK_SET);
     209  if (res==1) return NULL;
    209210  if(part==0)
    210211  { // load help string
     
    220221    //    pi->data.s.proc_start, procbuflen);
    221222    s = (char *)omAlloc(procbuflen+head+3);
    222     myfread(s, head, 1, fp);
     223    res=myfread(s, head, 1, fp);
     224    if (res<=0) /* error*/ { omFree(s); return NULL; }
    223225    s[head] = '\n';
    224     fseek(fp, pi->data.s.help_start, SEEK_SET);
    225     myfread(s+head+1, procbuflen, 1, fp);
     226    int res=fseek(fp, pi->data.s.help_start, SEEK_SET);
     227    if (res==-1) /*error*/ { omFree(s); return NULL; }
     228    res=myfread(s+head+1, procbuflen, 1, fp);
     229    if (res<=0) /* error*/ { omFree(s); return NULL; }
    226230    fclose(fp);
    227231    s[procbuflen+head+1] = '\n';
     
    281285    // load example
    282286    fseek(fp, pi->data.s.example_start, SEEK_SET);
    283     /*char *dummy=*/ (void) fgets(buf, sizeof(buf), fp); // skip line with "example"
     287    char* res=fgets(buf, sizeof(buf), fp); // skip line with "example"
     288    if (res==NULL) /*error or eof*/
     289    {
     290      return omStrDup("");
     291    }
    284292    procbuflen = pi->data.s.proc_end - pi->data.s.example_start - strlen(buf);
    285293    //Print("Example=%ld-%ld=%d\n", pi->data.s.proc_end,
  • Singular/links/ssiLink.cc

    rdff47b rb8ad3a  
    10241024      if (strcmp(mode,"fork")==0)
    10251025      {
     1026        int pc[2];
     1027        int cp[2];
     1028        int err1=pipe(pc);
     1029        int err2=pipe(cp);
     1030        if (err1 || err2)
     1031        {
     1032          Werror("pipe failed with %d\n",errno);
     1033          return TRUE;
     1034        }
    10261035        link_list n=(link_list)omAlloc(sizeof(link_struct));
    10271036        n->u=u;
     
    10301039        ssiToBeClosed=n;
    10311040
    1032         int pc[2];
    1033         int cp[2];
    1034         pipe(pc);
    1035         pipe(cp);
    10361041        pid_t pid = fork();
    10371042        if (pid == -1 && errno == EAGAIN)   // RLIMIT_NPROC too low?
     
    12571262        omFree(cli_host);
    12581263        if (TEST_OPT_PROT) { Print("running >>%s<<\n",ssh_command); }
    1259         system(ssh_command);
     1264        int re=system(ssh_command);
     1265        if (re<0)
     1266        {
     1267          Werror("ERROR running `%s` (%d)",ssh_command,re);
     1268          l->data=NULL;
     1269          l->flags=0;
     1270          omFree(d);
     1271          return TRUE;
     1272        }
    12601273        omFree(ssh_command);
    12611274        omFree(ser_host);
  • Singular/sdb.cc

    rdff47b rb8ad3a  
    144144    }
    145145
    146     write(f,pi->data.s.body,strlen(pi->data.s.body));
     146    size_t res=write(f,pi->data.s.body,strlen(pi->data.s.body));
    147147    close(f);
     148    if (res==-1)
     149    {
     150      PrintS("cannot write the procedure body\n");
     151      si_unlink(filename);
     152      omFree(filename);
     153      return;
     154    }
    148155
    149156    int pid=fork();
     
    164171        char *p=(char *)omAlloc(len);
    165172        snprintf(p,len,"%s %s",editor,filename);
    166         system(p);
     173        int res=system(p);
     174        if (res<0)
     175        {
     176          Print("cannot call `%s`\n",editor);
     177        }
    167178      }
    168179      exit(0);
  • libpolys/coeffs/flintcf_Qrat.cc

    rdff47b rb8ad3a  
    7070}
    7171
    72 static void fmpq_rat_canonicalise(fmpq_rat_ptr a, const coeffs r)
     72static void fmpq_rat_canonicalise(fmpq_rat_ptr a, const coeffs /*r*/)
    7373{
    7474  fmpz_t n, d;
     
    9999  if (c->type == n)
    100100  {
    101     const fmpq_ctx_ptr ctx = (fmpq_ctx_ptr) ((data_ptr)c->data)->ctx;
    102101    const QaInfo *par=(QaInfo*)parameter;
    103102    if (par->N != c->iNumberOfParameters) return FALSE;
     
    630629  if (fmpq_mpoly_is_fmpq(x->den, ctx) && fmpq_mpoly_is_fmpq(x->num, ctx))
    631630  {
    632     long nl = 0;
    633631    fmpq_t r;
    634632    fmpq_init(r);
     
    11841182}
    11851183
    1186 static number ExtGcd(number a, number b, number *s, number *t, const coeffs c)
     1184static number ExtGcd(number /*a*/, number /*b*/, number* /*s*/, number* /*t*/, const coeffs /*c*/)
    11871185{
    11881186  WerrorS("not a Euclidean ring: ExtGcd");
     
    11901188}
    11911189
    1192 static number Lcm(number a, number b, const coeffs c)
     1190static number Lcm(number /*a*/, number /*b*/, const coeffs /*c*/)
    11931191{
    11941192  WerrorS("not yet: Lcm");
     
    11961194}
    11971195
    1198 static number Q2Frac(number a, const coeffs src, const coeffs dst)
     1196static number Q2Frac(number a, const coeffs /*src*/, const coeffs dst)
    11991197{
    12001198  number res;
     
    12221220}
    12231221
    1224 static number Z2Frac(number a, const coeffs src, const coeffs dst)
     1222static number Z2Frac(number a, const coeffs /*src*/, const coeffs dst)
    12251223{
    12261224  return InitMPZ((mpz_ptr)a,dst);
     
    15081506{
    15091507  const fmpq_rat_ptr x = (fmpq_rat_ptr) c;
    1510   if ((x!=NULL)
    1511   && ((x->num==NULL)||(x->den==NULL)))
    1512   {
    1513     dReportError("NULL num., or den.\n");
    1514     return FALSE;
    1515   }
    1516   const fmpq_ctx_ptr ctx = (fmpq_ctx_ptr) ((data_ptr)cf->data)->ctx;
    1517   fmpq_mpoly_assert_canonical(x->num,ctx);
    1518   fmpq_mpoly_assert_canonical(x->den,ctx);
    1519   if (fmpq_mpoly_is_zero(x->den, ctx))
    1520   {
    1521     dReportError("den.==0\n");
    1522     return FALSE;
    1523   }
    1524   fmpz_t n, d;
    1525   fmpz_init(n);
    1526   fmpz_init(d);
    1527   fmpz_gcd(n, fmpq_numref(x->num->content), fmpq_numref(x->den->content));
    1528   fmpz_lcm(d, fmpq_denref(x->num->content), fmpq_denref(x->den->content));
    1529   if (!fmpz_is_one(d))
    1530   {
    1531      dReportError("canon needed (1)");
    1532      return TRUE;
    1533   }
    1534   if (!fmpz_is_one(n))
    1535   {
    1536      dReportError("canon needed (2)");
    1537      return TRUE;
    1538   }
    1539   fmpz_clear(n);
    1540   fmpz_clear(d);
    1541   #ifdef QA_DEBUG
    1542   poly pp=convFlintMPSingP(x->num,ctx,((data_ptr)cf->data)->C->extRing);
    1543   fraction f=(fraction)x->p;
    1544   if (f==NULL)
    1545   {
    1546     dReportError("x->p==NULL\n");
    1547     return FALSE;
    1548   }
    1549   else
    1550   {
    1551     if (!p_EqualPolys(pp,NUM(f),((data_ptr)cf->data)->C->extRing))
    1552     {
    1553       p_Write(pp,((data_ptr)cf->data)->C->extRing);
    1554       PrintS("num, p=");
    1555       p_Write(NUM(f),((data_ptr)cf->data)->C->extRing);
    1556       dReportError("num wrong.\n");
     1508  if (x!=NULL)
     1509  {
     1510    const fmpq_ctx_ptr ctx = (fmpq_ctx_ptr) ((data_ptr)cf->data)->ctx;
     1511    fmpq_mpoly_assert_canonical(x->num,ctx);
     1512    fmpq_mpoly_assert_canonical(x->den,ctx);
     1513    if (fmpq_mpoly_is_zero(x->den, ctx))
     1514    {
     1515      dReportError("den.==0\n");
    15571516      return FALSE;
    15581517    }
    1559     if (DEN(f)!=NULL)
    1560     {
    1561       pp=convFlintMPSingP(x->den,ctx,((data_ptr)cf->data)->C->extRing);
    1562       if (!p_EqualPolys(pp,DEN(f),((data_ptr)cf->data)->C->extRing))
     1518    fmpz_t n, d;
     1519    fmpz_init(n);
     1520    fmpz_init(d);
     1521    fmpz_gcd(n, fmpq_numref(x->num->content), fmpq_numref(x->den->content));
     1522    fmpz_lcm(d, fmpq_denref(x->num->content), fmpq_denref(x->den->content));
     1523    if (!fmpz_is_one(d))
     1524    {
     1525       dReportError("canon needed (1)");
     1526       return TRUE;
     1527    }
     1528    if (!fmpz_is_one(n))
     1529    {
     1530       dReportError("canon needed (2)");
     1531       return TRUE;
     1532    }
     1533    fmpz_clear(n);
     1534    fmpz_clear(d);
     1535    #ifdef QA_DEBUG
     1536    poly pp=convFlintMPSingP(x->num,ctx,((data_ptr)cf->data)->C->extRing);
     1537    fraction f=(fraction)x->p;
     1538    if (f==NULL)
     1539    {
     1540      dReportError("x->p==NULL\n");
     1541      return FALSE;
     1542    }
     1543    else
     1544    {
     1545      if (!p_EqualPolys(pp,NUM(f),((data_ptr)cf->data)->C->extRing))
    15631546      {
    15641547        p_Write(pp,((data_ptr)cf->data)->C->extRing);
    1565         PrintS("den, p=");
     1548        PrintS("num, p=");
    15661549        p_Write(NUM(f),((data_ptr)cf->data)->C->extRing);
    1567         dReportError("den wrong.\n");
     1550        dReportError("num wrong.\n");
    15681551        return FALSE;
    15691552      }
    1570     }
    1571   }
    1572   #endif
     1553      if (DEN(f)!=NULL)
     1554      {
     1555        pp=convFlintMPSingP(x->den,ctx,((data_ptr)cf->data)->C->extRing);
     1556        if (!p_EqualPolys(pp,DEN(f),((data_ptr)cf->data)->C->extRing))
     1557        {
     1558          p_Write(pp,((data_ptr)cf->data)->C->extRing);
     1559          PrintS("den, p=");
     1560          p_Write(NUM(f),((data_ptr)cf->data)->C->extRing);
     1561          dReportError("den wrong.\n");
     1562          return FALSE;
     1563        }
     1564      }
     1565    }
     1566    #endif
     1567  }
    15731568  return TRUE;
    15741569}
  • libpolys/coeffs/gnumpc.cc

    rdff47b rb8ad3a  
    603603    // cfSize  = ndSize;
    604604#ifdef LDEBUG
    605   //n->cfDBTest  = ndDBTest; // not yet implemented: ngcDBTest
     605  n->cfDBTest  = ngcDBTest; // not yet implemented: ngcDBTest
    606606#endif
    607607
  • libpolys/coeffs/longrat.cc

    rdff47b rb8ad3a  
    17581758    case 1:
    17591759            mpz_init_set(b->n,a->n);
     1760            /*no break*/
    17601761    case 3:
    17611762            mpz_init_set(b->z,a->z);
     
    17741775      case 1:
    17751776        mpz_clear((*a)->n);
     1777        /*no break*/
    17761778      case 3:
    17771779        mpz_clear((*a)->z);
  • libpolys/coeffs/rmodulon.cc

    rdff47b rb8ad3a  
    7272  nrnCoeffName_buff=(char*)omAlloc(l);
    7373  s= mpz_get_str (s, 10, r->modBase);
    74   int ll;
     74  int ll=0;
    7575  if (nCoeff_is_Zn(r))
    7676  {
  • m4/ccluster-check.m4

    rdff47b rb8ad3a  
    4646if test "x$HAVE_CCLUSTER" != "xyes"; then
    4747  AC_MSG_RESULT(not found)
    48 fi 
     48fi
    4949AM_CONDITIONAL(SING_HAVE_CCLUSTER, test "x$HAVE_CCLUSTER" = "xyes")
    5050])
  • m4/options.m4

    rdff47b rb8ad3a  
    173173  AC_SUBST(RESOURCES_LIBS)
    174174
    175   if test "x$htmldir" = "x\${docdir}"; then 
     175  if test "x$htmldir" = "x\${docdir}"; then
    176176    DEFAULT_HTMLDIR="--htmldir=$datarootdir/doc/singular"
    177177  fi
Note: See TracChangeset for help on using the changeset viewer.