Changeset e1859b in git for Singular/iparith.cc


Ignore:
Timestamp:
May 26, 2019, 9:33:22 PM (5 years ago)
Author:
Murray Heymann <heymann.murray@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38dfc5131670d387a89455159ed1e071997eec94')
Children:
1708fac9cfbd392cceea00167eaa2746d291cd98
Parents:
5c0680a81e434b189faabda5d2d0aa0bbcff343c
Message:
Add proc reservedNamesList, similar to reservedNames
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/iparith.cc

    r5c0680 re1859b  
    79307930  return FALSE;
    79317931}
     7932
     7933static BOOLEAN jjRESERVEDLIST0(leftv res, leftv)
     7934{
     7935        unsigned i=1;
     7936        int l = 0;
     7937        int k = 0;
     7938        lists L = (lists)omAllocBin(slists_bin);
     7939        struct blackbox_list *bb_list = NULL;
     7940        unsigned nCount = (sArithBase.nCmdUsed-1) / 3;
     7941        if ((3*nCount) < sArithBase.nCmdUsed) {
     7942                nCount++;
     7943        }
     7944        bb_list = getBlackboxTypes();
     7945        // count the  number of entries;
     7946        for (i=0; i<nCount; i++) {
     7947                l++;
     7948                if (i + 1 + nCount < sArithBase.nCmdUsed) {
     7949                        l++;
     7950                }
     7951                if(i+1+2*nCount<sArithBase.nCmdUsed) {
     7952                        l++;
     7953                }
     7954        }
     7955        for (i = 0; i < bb_list->count; i++) {
     7956                if (bb_list->list[i] != NULL) {
     7957                        l++;
     7958                }
     7959        }
     7960        // initiate list
     7961        L->Init(l);
     7962        k = 0;
     7963        for (i=0; i<nCount; i++) {
     7964                L->m[k].rtyp = STRING_CMD;
     7965                L->m[k].data = omStrDup(sArithBase.sCmds[i+1].name);
     7966                k++;
     7967                // Print("%-20s", sArithBase.sCmds[i+1].name);
     7968                if (i + 1 + nCount < sArithBase.nCmdUsed) {
     7969                        L->m[k].rtyp = STRING_CMD;
     7970                        L->m[k].data = omStrDup(sArithBase.sCmds[i+1+nCount].name);
     7971                        k++;
     7972                        // Print("%-20s", sArithBase.sCmds[i+1 + nCount].name);
     7973                }
     7974                if(i+1+2*nCount<sArithBase.nCmdUsed) {
     7975                        L->m[k].rtyp = STRING_CMD;
     7976                        L->m[k].data = omStrDup(sArithBase.sCmds[i+1+2*nCount].name);
     7977                        k++;
     7978                        // Print("%-20s", sArithBase.sCmds[i+1+2*nCount].name);
     7979                }
     7980                // PrintLn();
     7981        }
     7982
     7983        // assign blackbox types
     7984        for (i = 0; i < bb_list->count; i++) {
     7985                if (bb_list->list[i] != NULL) {
     7986                        L->m[k].rtyp = STRING_CMD;
     7987                        // already used strdup in getBlackBoxTypes
     7988                        L->m[k].data = bb_list->list[i];
     7989                        k++;
     7990                }
     7991        }
     7992        // free the struct (not the list itself)
     7993        omfree(bb_list);
     7994
     7995        // pass the resultant list to the res datastructure
     7996        res->data=(void *)L;
     7997
     7998        return FALSE;
     7999}
    79328000static BOOLEAN jjSTRING_PL(leftv res, leftv v)
    79338001{
     
    81528220  leftv w = v->next;
    81538221  if (w==NULL) return TRUE;
    8154   leftv rest = w->next;;
     8222  leftv rest = w->next;
    81558223
    81568224  u->next = NULL;
     
    97579825  int at=a->Typ();
    97589826  leftv b=(leftv)bb;
    9759   int bt=b->Typ();;
     9827  int bt=b->Typ();
    97609828  if (at < bt) return -1;
    97619829  if (at > bt) return 1;
Note: See TracChangeset for help on using the changeset viewer.