Changeset c06378c in tol


Ignore:
Timestamp:
Dec 15, 2010, 2:13:10 PM (16 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
a29d86c4
Parents:
4e10a23
Message:

Refs #1029
Using Gdouble and Gint

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@2830 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/btol/bgrammar/spfuninst.cpp

    r4e10a23 rc06378c  
    18111811      const BText& name = Text(uNam);
    18121812      int ptr = 0;
    1813       G__value g;
    18141813      if(gra==GraReal())
    18151814      {
    1816         g = G__calc(BText("(int)(double*)(")+name+")");
    1817         if(g.type == 105 ) { ptr = g.obj.i; }
    1818         if(ptr)
     1815        BDat cnt = G__double(G__calc(name));
     1816/*
     1817        g = G__calc(name);
     1818        bool ok = true;
     1819        switch (g.type)
    18191820        {
    1820           double cnt = *(double*)ptr;
     1821          case 100: cnt = g.obj.d; break;
     1822          case 105: cnt = g.obj.i; break;
     1823          default:  ok = false;
     1824        }
     1825        if(!ok)
     1826        {
     1827          Error(I2("Unknown CINT numerical type ",
     1828                   "Tipo CINT numérico desconocido ")<<g.type);
     1829        }
     1830        else
     1831*/
     1832        {
    18211833          result = new BContensDat("",cnt,"");
    18221834        }
    … …  
    18261838        int rows = -1, columns = -1;
    18271839        double* buffer = NULL;
    1828         g = G__calc(name+".rows_");
    1829         if(g.type == 105 ) { rows = g.obj.i; }
    1830         g = G__calc(name+".columns_");
    1831         if(g.type == 105 ) { columns = g.obj.i; }
    1832         g = G__calc(BText("(int)(double*)(")+name+".buffer_)");
    1833         if(g.type == 105 ) { buffer = (double*)g.obj.i; }
     1840        rows = G__int(G__calc(name+".rows_"));
     1841        columns = G__int(G__calc(name+".columns_"));
     1842        buffer = (double*)G__int(G__calc(BText("(int)(")+name+".buffer_)"));
    18341843        if(rows>0 && columns>0 && buffer!=NULL)
    18351844        {
    … …  
    18421851        int length = -1;
    18431852        char* buffer = NULL;
    1844         g = G__calc(name+".length_");
    1845         if(g.type == 105 ) { length = g.obj.i; }
    1846         g = G__calc(BText("(int)(char*)(")+name+".buffer_)");
    1847         if(g.type == 105 ) { buffer = (char*)g.obj.i; }
     1853        length = G__int(G__calc(name+".length_"));
     1854        buffer = (char*)G__int(G__calc(BText("(int)(")+name+".buffer_)"));
    18481855        if(length>0 && buffer!=NULL)
    18491856        {
    … …  
    23422349  AddInstance("Cint.export_to_tol",
    23432350     "(Text name)",
    2344      I2("Export global CINT variables to current TOL scope.\n"
     2351     I2("Exports global CINT variables to current TOL scope.\n"
    23452352     "CINT variables must have a valid name in TOL and C languages.\n"
    23462353     "At this moment these are the available TOL types :\n",   
    … …  
    23632370  return(true);
    23642371}
     2372
Note: See TracChangeset for help on using the changeset viewer.