Changeset 667247 in git


Ignore:
Timestamp:
May 2, 1997, 5:10:23 PM (27 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
713fe8641a9dff2efe5d93b24d2de16fb640aeda
Parents:
fde1a8734f321f72cbe87001fd682d36e955e8a1
Message:
* hannes: -fixed exitVoice in febase.cc
          -changed used of TEST in ideals.cc ipassign.cc ipconv.cc
            mmallocb.c modulop.cc polys2.cc numbers.cc
          - made nfCharQ, nfCharM1 extern in ffields.cc


git-svn-id: file:///usr/local/Singular/svn/trunk@226 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • Singular/febase.cc

    rfde1a8 r667247  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: febase.cc,v 1.14 1997-04-30 17:44:35 Singular Exp $ */
     4/* $Id: febase.cc,v 1.15 1997-05-02 15:10:11 Singular Exp $ */
    55/*
    66* ABSTRACT: i/o system, handling of 'voices'
     
    147147FILE * feFopen(char *path, char *mode, char *where,int useWerror)
    148148{
     149  FILE * f=fopen(path,mode);
    149150  if (where!=NULL) strcpy(where,path);
    150   FILE * f=fopen(path,mode);
    151   if ((*mode=='a') ||(*mode=='w') || (path[0]==DIR_SEP)||(path[0]=='.')
    152   ||(f!=NULL))
    153     return f;
    154   char found = 0;
    155 #ifdef MSDOS
    156   char *env=getenv("SPATH");
    157 #else
    158   char *env=getenv("SINGULARPATH");
    159 #endif
    160   char *s;
    161   if (where==NULL) s=(char *)AllocL(250);
    162   else             s=where;
    163   if (env!=NULL)
    164   {
    165     char *p,*q;
    166     p = env;
    167     while( (q=strchr(p, FS_SEP)) != NULL)
    168     {
    169       *q = '\0';
    170       strcpy(s,p);
    171       *q = FS_SEP;
    172       strcat(s, DIR_SEPP);
    173       strcat(s, path);
    174 #ifndef macintosh
    175       if(!access(s, R_OK)) { found++; break; }
    176 #else
     151  if ((*mode=='r') && (path[0]!=DIR_SEP)&&(path[0]!='.')
     152  &&(f==NULL))
     153  {
     154    char found = 0;
     155    #ifdef MSDOS
     156      char *env=getenv("SPATH");
     157    #else
     158      char *env=getenv("SINGULARPATH");
     159    #endif
     160    char *s;
     161    if (where==NULL) s=(char *)AllocL(250);
     162    else             s=where;
     163    if (env!=NULL)
     164    {
     165      char *p,*q;
     166      p = env;
     167      while( (q=strchr(p, FS_SEP)) != NULL)
     168      {
     169        *q = '\0';
     170        strcpy(s,p);
     171        *q = FS_SEP;
     172        strcat(s, DIR_SEPP);
     173        strcat(s, path);
     174        #ifndef macintosh
     175          if(!access(s, R_OK)) { found++; break; }
     176        #else
     177          f=fopen(s,mode);
     178          if (f!=NULL)  { found++; fclose(f); break; }
     179        #endif
     180        p = q+1;
     181      }
     182      if(!found)
     183      {
     184        strcpy(s,p);
     185        strcat(s, DIR_SEPP);
     186        strcat(s, path);
     187      }
    177188      f=fopen(s,mode);
    178       if (f!=NULL)  { found++; fclose(f); break; }
    179 #endif
    180       p = q+1;
    181     }
    182     if(!found)
    183     {
    184       strcpy(s,p);
    185       strcat(s, DIR_SEPP);
    186       strcat(s, path);
    187     }
    188     f=fopen(s,mode);
    189     if (f!=NULL)
    190     {
    191       if (where==NULL) FreeL((ADDRESS)s);
    192       return f;
    193     }
    194   }
    195   else
    196   {
    197     if (where!=NULL) strcpy(s/*where*/,path);
    198     f=fopen(path,mode);
    199   } 
    200 #ifndef macintosh
    201   if (f==NULL)
    202   {
    203     char* ss = s;
    204     int need_len = strlen(path) + strlen(SINGULAR_DATADIR) + 2;
    205    
    206     if (where == NULL)
    207     {
    208       if (need_len > 250) ss = (char *) AllocL(need_len);
    209       strcpy(ss,s);
     189      if (f!=NULL)
     190      {
     191        if (where==NULL) FreeL((ADDRESS)s);
     192        return f;
     193      }
    210194    }
    211195    else
    212196    {
    213       if (need_len > strlen(where)) ss = (char *) AllocL(need_len);
    214       strcpy(ss, s);
    215     }
    216     strcpy(ss,SINGULAR_DATADIR);
    217     strcat(s, DIR_SEPP);
    218     strcat(ss,path);
    219     f=fopen(ss,mode);
    220     if (ss != s) FreeL((ADDRESS)ss);
    221   }
    222 #endif
    223   if (where==NULL) FreeL((ADDRESS)s);
     197      if (where!=NULL) strcpy(s/*where*/,path);
     198      f=fopen(path,mode);
     199    }
     200    #ifndef macintosh
     201      if (f==NULL)
     202      {
     203        char* ss = s;
     204        int need_len = strlen(path) + strlen(SINGULAR_DATADIR) + 2;
     205
     206        if (where == NULL)
     207        {
     208          if (need_len > 250) ss = (char *) AllocL(need_len);
     209          strcpy(ss,s);
     210        }
     211        else
     212        {
     213          if (need_len > strlen(where)) ss = (char *) AllocL(need_len);
     214          strcpy(ss, s);
     215        }
     216        strcpy(ss,SINGULAR_DATADIR);
     217        strcat(s, DIR_SEPP);
     218        strcat(ss,path);
     219        f=fopen(ss,mode);
     220        if (ss != s) FreeL((ADDRESS)ss);
     221      }
     222    #endif
     223    if (where==NULL) FreeL((ADDRESS)s);
     224  }
    224225  if ((f==NULL)&&(useWerror))
    225226    Werror("cannot open `%s`",path);
  • Singular/ffields.cc

    rfde1a8 r667247  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ffields.cc,v 1.10 1997-04-25 15:54:02 Singular Exp $ */
     4/* $Id: ffields.cc,v 1.11 1997-05-02 15:10:12 Singular Exp $ */
    55/*
    66* ABSTRACT: finite fields with a none-prime number of elements (via tables)
     
    1616#include "ffields.h"
    1717
    18 static int nfCharQ=0;  /* the number of elemts: q*/
     18int nfCharQ=0;  /* the number of elemts: q*/
     19int nfM1;       /*representation of -1*/
    1920static int nfCharP=0;  /* the characteristic: p*/
    2021static int nfCharQ1=0; /* q-1 */
    21 static int nfM1;       /*representation of -1*/
    2222CARDINAL *nfPlus1Table=NULL; /* the table i=log(z^i) -> log(z^i+1) */
    2323char * nfParameter;          /*  the name of the primitive element */
  • Singular/ideals.cc

    rfde1a8 r667247  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ideals.cc,v 1.5 1997-04-12 16:04:35 Singular Exp $ */
     4/* $Id: ideals.cc,v 1.6 1997-05-02 15:10:13 Singular Exp $ */
    55/*
    66* ABSTRACT - all basic methods to manipulate ideals
     
    221221  ideal h2;
    222222
    223 #ifdef TEST
     223//#ifdef TEST
    224224  if (h1 == NULL)
    225225  {
     
    231231  }
    232232  else
    233 #endif
     233//#endif
    234234  {
    235235#ifdef MDEBUG
  • Singular/ipassign.cc

    rfde1a8 r667247  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipassign.cc,v 1.9 1997-04-12 16:04:39 Singular Exp $ */
     4/* $Id: ipassign.cc,v 1.10 1997-05-02 15:10:14 Singular Exp $ */
    55
    66/*
     
    13581358      nok=TRUE;
    13591359      break;
    1360 #ifdef TEST
    13611360    default:
    13621361      WerrorS("assign not impl.");
    13631362      nok=TRUE;
    13641363      break;
    1365 #endif
    13661364  } /* end switch: typ */
    13671365  if (nok && (!errorreported)) WerrorS("incompatible type in list assignment");
  • Singular/ipconv.cc

    rfde1a8 r667247  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipconv.cc,v 1.4 1997-04-02 15:07:10 Singular Exp $ */
     4/* $Id: ipconv.cc,v 1.5 1997-05-02 15:10:15 Singular Exp $ */
    55/*
    66* ABSTRACT: automatic type conversions
     
    279279        else
    280280        {
    281           Werror("wrong name, should not happen");
     281          WerrorS("wrong name, should not happen");
    282282          output->name=mstrdup("?");
    283283        }
  • Singular/iplib.cc

    rfde1a8 r667247  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: iplib.cc,v 1.5 1997-04-25 15:04:00 obachman Exp $ */
     4/* $Id: iplib.cc,v 1.6 1997-05-02 15:10:15 Singular Exp $ */
    55/*
    66* ABSTRACT: interpreter: LIB and help
     
    634634          v=0;
    635635          sscanf( buf+7, "%d", &v);
    636           if(v!=(VERSION/100))
     636          if(v!=(SINGULAR_VERSION/100))
    637637            Warn("version mismatch - library `%s` requires:%d.%d",
    638638                  newlib,v/1000,(v%1000)/100);
  • Singular/ipshell.cc

    rfde1a8 r667247  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipshell.cc,v 1.8 1997-04-30 15:25:32 Singular Exp $ */
     4/* $Id: ipshell.cc,v 1.9 1997-05-02 15:10:17 Singular Exp $ */
    55/*
    66* ABSTRACT:
     
    207207      {
    208208        idhdl nexth = IDNEXT(h);
    209 #ifdef TEST
    210 //        if ((('0'<r) && (r<='9'))
    211 //        && ((IDTYP(h)==RING_CMD) || (IDTYP(h)==QRING_CMD)))
    212 //        {
    213 //          PrintS("## parameter type was (q)ring\n");
    214 //          IDTYP(h)=0;
    215 //        }
    216 #endif
    217209        //Print("kill %s, lev: %d\n",IDID(h),IDLEV(h));
    218210        killhdl(h,localhdl);
  • Singular/longalg.cc

    rfde1a8 r667247  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: longalg.cc,v 1.3 1997-04-02 15:07:21 Singular Exp $ */
     4/* $Id: longalg.cc,v 1.4 1997-05-02 15:10:19 Singular Exp $ */
    55/*
    66* ABSTRACT:   algebraic numbers
     
    156156  else
    157157  {
    158     Print("hier ging was schief:c=%d compl=%d param=%d\n",i,complete,param);
     158    Print("naSetChar:c=%d compl=%d param=%d\n",i,complete,param);
    159159  }
    160160#endif
     
    17141714  mmTestP(a,sizeof(rnumber));
    17151715#ifdef TEST
    1716   if (a->z==NULL) WerrorS("internal zero error(4)");
     1716  if (a->z==NULL) WerrorS("internal zero error(5)");
    17171717#endif
    17181718  if (a->n==NULL)
  • Singular/misc.cc

    rfde1a8 r667247  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: misc.cc,v 1.8 1997-04-28 09:57:56 Singular Exp $ */
     4/* $Id: misc.cc,v 1.9 1997-05-02 15:10:20 Singular Exp $ */
    55/*
    66* ABSTRACT:
     
    393393struct soptionStruct optionStruct[]=
    394394{
    395 /*Aenderung: Namen fuer test 24,23,27 einfuehren*/
    396395  {"prot",         Sy_bit(OPT_PROT),           ~Sy_bit(OPT_PROT)   },
    397396  {"redSB",        Sy_bit(OPT_REDSB),          ~Sy_bit(OPT_REDSB)   },
     
    480479      } 
    481480    }
     481    if(strcmp(n,"none")==0)
     482    {
     483      test=0;
     484      verbose=0;
     485      goto okay;
     486    } 
    482487    for (i=0; (i==0) || (optionStruct[i-1].setval!=0); i++)
    483488    {
     
    497502      && (strcmp(n+2,optionStruct[i].name)==0))
    498503      {
    499         if ((optionStruct[i].setval & validOpts)
    500         || (strcmp(n+2,"ne")==0))
     504        if (optionStruct[i].setval & validOpts)
    501505        {
    502506          test &= optionStruct[i].resetval;
  • Singular/modulop.cc

    rfde1a8 r667247  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: modulop.cc,v 1.5 1997-04-12 16:04:42 Singular Exp $ */
     4/* $Id: modulop.cc,v 1.6 1997-05-02 15:10:22 Singular Exp $ */
    55/*
    66* ABSTRACT: numbers modulo p (<=32003)
     
    221221
    222222  if (c==npPrimeM) return;
    223 #ifdef TEST
    224   if ((c==-npPrimeM) || ((c^1)==0))
    225   {
    226     Print("internal error: %d as np\n",c);
    227     return;
    228   }
    229   // should never happen:if ((c^1)==0) return;
    230 #endif
    231223  if (npPrimeM > 1)
    232224  {
  • Singular/numbers.cc

    rfde1a8 r667247  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 /* $Id: numbers.cc,v 1.3 1997-04-02 15:07:43 Singular Exp $ */
     4/* $Id: numbers.cc,v 1.4 1997-05-02 15:10:23 Singular Exp $ */
    55
    66/*
     
    289289  }
    290290  else
    291   if (c==(-1))
     291  //if (c==(-1)) // the rest...
    292292  {
    293293#ifdef LDEBUG
     
    330330    }
    331331  }
    332 #ifdef TEST
    333   else
    334   {
    335     Werror("invalid char %d\n",c);
    336   }
    337 #endif
    338332  if (complete&&(!errorreported)) nNULL=nInit(0);
    339333}
Note: See TracChangeset for help on using the changeset viewer.