Ignore:
Timestamp:
04/08/13 15:07:07 (11 years ago)
Author:
tbretz
Message:
Updated to v20r7.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/dim/src/discpp.cxx

    r14575 r15282  
    1717
    1818extern "C" {
     19extern void dis_init();
     20
    1921static void user_routine( void *tagp, void **buf, int *size, int *first_time)
    2022{
     
    3941        }
    4042        if( t->itsType == DisSTRING)
    41                         t->itsSize = strlen((char *)t->itsData)+1;
     43                        t->itsSize = (int)strlen((char *)t->itsData)+1;
    4244        *buf = t->itsData;
    4345        *size = t->itsSize;
     
    4951//      itsTagId = 0;
    5052        itsDns = dns;
    51         itsName = new char[strlen(name)+1];
     53        itsName = new char[(int)strlen(name)+1];
    5254        itsDataSize = 0;
    5355        strcpy( itsName, name);
     
    5759                itsServiceHandler = 0;
    5860//      itsTagId = id_get((void *)this, SRC_DIS);
     61        dis_init();
    5962        if(itsDns == 0)
    6063        {
     64                DISABLE_AST
    6165                itsId = dis_add_service( name, format, NULL, 0,
    6266//                              user_routine, itsTagId);
    6367                                user_routine, (dim_long)this);
     68                ENABLE_AST
    6469                DimServer::start();
    6570        }
    6671        else
    6772        {
     73                DISABLE_AST
    6874                itsId = dis_add_service_dns( itsDns->getDnsId(), name, format, NULL, 0,
    6975//                              user_routine, itsTagId);
    7076                                user_routine, (dim_long)this);
     77                ENABLE_AST
    7178//              itsDns->addServiceId(itsId);
    7279                DimServer::start(itsDns);
     
    8895                itsDataSize = size;
    8996        }
    90         memcpy(itsData, data, size);
     97        memcpy(itsData, data, (size_t)size);
    9198        itsSize = size;
    9299}
     
    125132//      itsTagId = 0;
    126133        itsDns = dns;
    127         itsName = new char[strlen(name)+1];
     134        itsName = new char[(int)strlen(name)+1];
    128135        strcpy( itsName, name);
    129         itsFormat = new char[strlen(format)+1];
     136        itsFormat = new char[(int)strlen(format)+1];
    130137        strcpy( itsFormat, format);
    131138        currCmnd = 0;
     
    135142                itsCommandHandler = 0;
    136143//      itsTagId = id_get((void *)this, SRC_DIS);
     144        dis_init();
    137145        if(!itsDns)
    138146        {
     147                DISABLE_AST
    139148                itsId = dis_add_cmnd( name, format, command_routine,
    140149//                              itsTagId);
    141150                                (dim_long)this);
     151                ENABLE_AST
    142152                DimServer::start();
    143153        }
    144154        else
    145155        {
     156                DISABLE_AST
    146157                itsId = dis_add_cmnd_dns( itsDns->getDnsId(), name, format, command_routine,
    147158//                      itsTagId);
    148159                        (dim_long)this);
     160                ENABLE_AST
    149161//              itsDns->addServiceId(itsId);
    150162                DimServer::start(itsDns);
     
    230242//      itsTagId = 0;
    231243        itsDns = dns;
    232         itsName = new char[strlen(name)+1];
     244        itsName = new char[(int)strlen(name)+1];
    233245        strcpy( itsName, name);
    234         itsNameIn = new char[strlen(name)+1+10];
     246        itsNameIn = new char[(int)strlen(name)+1+10];
    235247        strcpy( itsNameIn, name);
    236248        strcat(itsNameIn,(char *)"/RpcIn");
    237         itsNameOut = new char[strlen(name)+1+10];
     249        itsNameOut = new char[(int)strlen(name)+1+10];
    238250        strcpy( itsNameOut, name);
    239251        strcat(itsNameOut,(char *)"/RpcOut");
     
    244256       
    245257//      itsTagId = id_get((void *)this, SRC_DIS);
     258        dis_init();
    246259        if(!itsDns)
    247260        {
     261                DISABLE_AST
    248262                itsIdIn = dis_add_cmnd( itsNameIn, formatin,
    249263//                      rpcin_routine, itsTagId);
     
    252266//                      rpcout_routine, itsTagId);
    253267                        rpcout_routine, (dim_long)this);
     268                ENABLE_AST
    254269                DimServer::start();
    255270        }
    256271        else
    257272        {
     273                DISABLE_AST
    258274                itsIdIn = dis_add_cmnd_dns( itsDns->getDnsId(), itsNameIn, formatin,
    259275//                      rpcin_routine, itsTagId);
     
    262278//                      rpcout_routine, itsTagId);
    263279                        rpcout_routine, (dim_long)this);
     280                ENABLE_AST
    264281//              itsDns->addServiceId(itsIdIn);
    265282//              itsDns->addServiceId(itsIdOut);
     
    282299                itsDataOutSize = size;
    283300        }
    284         memcpy(itsDataOut, data, size);
     301        memcpy(itsDataOut, data, (size_t)size);
    285302        itsSizeOut = size;
    286303}
     
    314331//      if(!itsNode)
    315332//      {
    316                 itsNode = new char[strlen(node)+1];
     333                itsNode = new char[(int)strlen(node)+1];
    317334                strcpy(itsNode,node);
    318335//      }
     
    335352        {
    336353                tmp = new int[itsServiceIdListSize + DisDnsIdBlock];
    337                 memcpy(tmp, itsServiceIdList, itsServiceIdListSize*sizeof(int));
     354                memcpy(tmp, itsServiceIdList, (size_t)itsServiceIdListSize*sizeof(int));
    338355                delete itsServiceIdList;
    339356                itsServiceIdList = tmp;
     
    378395        if(!itsName)
    379396        {
    380                 itsName = new char[strlen(name)+1];
     397                itsName = new char[(int)strlen(name)+1];
    381398                strcpy(itsName,name);
    382399        }
     
    437454        if(!itsName)
    438455        {
    439                 itsName = new char[strlen(name)+1];
     456                itsName = new char[(int)strlen(name)+1];
    440457                strcpy(itsName,name);
    441458        }
     
    447464        dim_long dnsid;
    448465
     466        dis_init();
     467        {
    449468        DISABLE_AST
    450469        dns->setName(name);
     
    452471        dis_start_serving_dns(dnsid, (char *)name /*, dns->getServiceIdList()*/);
    453472        ENABLE_AST
     473        }
    454474}
    455475/*
     
    491511        int isAuto;
    492512
     513        dis_init();
     514        {
    493515        DISABLE_AST
    494516//      dns->itsNServices++;
     
    503525        }
    504526        ENABLE_AST
     527        }
    505528}
    506529
     
    798821{
    799822        itsData = string;
    800         itsSize = strlen(string)+1;
     823        itsSize = (int)strlen(string)+1;
    801824        itsType = DisSTRING;
    802825        declareIt((char *)name, (char *)"C", 0, 0);
     
    880903{
    881904        itsData = string;
    882         itsSize = strlen(string)+1;
     905        itsSize = (int)strlen(string)+1;
    883906        itsType = DisSTRING;
    884907        declareIt((char *)name, (char *)"C", 0, dns);
     
    9871010        {
    9881011                itsData = string;
    989                 itsSize = strlen(string)+1;
     1012                itsSize = (int)strlen(string)+1;
    9901013                return dis_update_service( itsId );
    9911014        }
     
    11061129        {
    11071130                itsData = string;
    1108                 itsSize = strlen(string)+1;
     1131                itsSize = (int)strlen(string)+1;
    11091132                if( cids == 0)
    11101133                {
     
    11791202void DimService::setData(char *data)
    11801203{
    1181         storeIt(data, strlen(data)+1);
     1204        storeIt(data, (int)strlen(data)+1);
    11821205}
    11831206
     
    12041227        secs = tsecs;
    12051228        millisecs = tmillisecs;
    1206         memcpy(itsData, data, datasize);
     1229        memcpy(itsData, data, (size_t)datasize);
    12071230}
    12081231
     
    14651488void DimRpc::setData(char *data)
    14661489{
    1467         storeIt(data,strlen(data)+1);
     1490        storeIt(data,(int)strlen(data)+1);
    14681491}
    14691492
Note: See TracChangeset for help on using the changeset viewer.