Changeset 15282 for trunk/FACT++/dim/src/discpp.cxx
- Timestamp:
- 04/08/13 15:07:07 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/dim/src/discpp.cxx
r14575 r15282 17 17 18 18 extern "C" { 19 extern void dis_init(); 20 19 21 static void user_routine( void *tagp, void **buf, int *size, int *first_time) 20 22 { … … 39 41 } 40 42 if( t->itsType == DisSTRING) 41 t->itsSize = strlen((char *)t->itsData)+1;43 t->itsSize = (int)strlen((char *)t->itsData)+1; 42 44 *buf = t->itsData; 43 45 *size = t->itsSize; … … 49 51 // itsTagId = 0; 50 52 itsDns = dns; 51 itsName = new char[ strlen(name)+1];53 itsName = new char[(int)strlen(name)+1]; 52 54 itsDataSize = 0; 53 55 strcpy( itsName, name); … … 57 59 itsServiceHandler = 0; 58 60 // itsTagId = id_get((void *)this, SRC_DIS); 61 dis_init(); 59 62 if(itsDns == 0) 60 63 { 64 DISABLE_AST 61 65 itsId = dis_add_service( name, format, NULL, 0, 62 66 // user_routine, itsTagId); 63 67 user_routine, (dim_long)this); 68 ENABLE_AST 64 69 DimServer::start(); 65 70 } 66 71 else 67 72 { 73 DISABLE_AST 68 74 itsId = dis_add_service_dns( itsDns->getDnsId(), name, format, NULL, 0, 69 75 // user_routine, itsTagId); 70 76 user_routine, (dim_long)this); 77 ENABLE_AST 71 78 // itsDns->addServiceId(itsId); 72 79 DimServer::start(itsDns); … … 88 95 itsDataSize = size; 89 96 } 90 memcpy(itsData, data, size);97 memcpy(itsData, data, (size_t)size); 91 98 itsSize = size; 92 99 } … … 125 132 // itsTagId = 0; 126 133 itsDns = dns; 127 itsName = new char[ strlen(name)+1];134 itsName = new char[(int)strlen(name)+1]; 128 135 strcpy( itsName, name); 129 itsFormat = new char[ strlen(format)+1];136 itsFormat = new char[(int)strlen(format)+1]; 130 137 strcpy( itsFormat, format); 131 138 currCmnd = 0; … … 135 142 itsCommandHandler = 0; 136 143 // itsTagId = id_get((void *)this, SRC_DIS); 144 dis_init(); 137 145 if(!itsDns) 138 146 { 147 DISABLE_AST 139 148 itsId = dis_add_cmnd( name, format, command_routine, 140 149 // itsTagId); 141 150 (dim_long)this); 151 ENABLE_AST 142 152 DimServer::start(); 143 153 } 144 154 else 145 155 { 156 DISABLE_AST 146 157 itsId = dis_add_cmnd_dns( itsDns->getDnsId(), name, format, command_routine, 147 158 // itsTagId); 148 159 (dim_long)this); 160 ENABLE_AST 149 161 // itsDns->addServiceId(itsId); 150 162 DimServer::start(itsDns); … … 230 242 // itsTagId = 0; 231 243 itsDns = dns; 232 itsName = new char[ strlen(name)+1];244 itsName = new char[(int)strlen(name)+1]; 233 245 strcpy( itsName, name); 234 itsNameIn = new char[ strlen(name)+1+10];246 itsNameIn = new char[(int)strlen(name)+1+10]; 235 247 strcpy( itsNameIn, name); 236 248 strcat(itsNameIn,(char *)"/RpcIn"); 237 itsNameOut = new char[ strlen(name)+1+10];249 itsNameOut = new char[(int)strlen(name)+1+10]; 238 250 strcpy( itsNameOut, name); 239 251 strcat(itsNameOut,(char *)"/RpcOut"); … … 244 256 245 257 // itsTagId = id_get((void *)this, SRC_DIS); 258 dis_init(); 246 259 if(!itsDns) 247 260 { 261 DISABLE_AST 248 262 itsIdIn = dis_add_cmnd( itsNameIn, formatin, 249 263 // rpcin_routine, itsTagId); … … 252 266 // rpcout_routine, itsTagId); 253 267 rpcout_routine, (dim_long)this); 268 ENABLE_AST 254 269 DimServer::start(); 255 270 } 256 271 else 257 272 { 273 DISABLE_AST 258 274 itsIdIn = dis_add_cmnd_dns( itsDns->getDnsId(), itsNameIn, formatin, 259 275 // rpcin_routine, itsTagId); … … 262 278 // rpcout_routine, itsTagId); 263 279 rpcout_routine, (dim_long)this); 280 ENABLE_AST 264 281 // itsDns->addServiceId(itsIdIn); 265 282 // itsDns->addServiceId(itsIdOut); … … 282 299 itsDataOutSize = size; 283 300 } 284 memcpy(itsDataOut, data, size);301 memcpy(itsDataOut, data, (size_t)size); 285 302 itsSizeOut = size; 286 303 } … … 314 331 // if(!itsNode) 315 332 // { 316 itsNode = new char[ strlen(node)+1];333 itsNode = new char[(int)strlen(node)+1]; 317 334 strcpy(itsNode,node); 318 335 // } … … 335 352 { 336 353 tmp = new int[itsServiceIdListSize + DisDnsIdBlock]; 337 memcpy(tmp, itsServiceIdList, itsServiceIdListSize*sizeof(int));354 memcpy(tmp, itsServiceIdList, (size_t)itsServiceIdListSize*sizeof(int)); 338 355 delete itsServiceIdList; 339 356 itsServiceIdList = tmp; … … 378 395 if(!itsName) 379 396 { 380 itsName = new char[ strlen(name)+1];397 itsName = new char[(int)strlen(name)+1]; 381 398 strcpy(itsName,name); 382 399 } … … 437 454 if(!itsName) 438 455 { 439 itsName = new char[ strlen(name)+1];456 itsName = new char[(int)strlen(name)+1]; 440 457 strcpy(itsName,name); 441 458 } … … 447 464 dim_long dnsid; 448 465 466 dis_init(); 467 { 449 468 DISABLE_AST 450 469 dns->setName(name); … … 452 471 dis_start_serving_dns(dnsid, (char *)name /*, dns->getServiceIdList()*/); 453 472 ENABLE_AST 473 } 454 474 } 455 475 /* … … 491 511 int isAuto; 492 512 513 dis_init(); 514 { 493 515 DISABLE_AST 494 516 // dns->itsNServices++; … … 503 525 } 504 526 ENABLE_AST 527 } 505 528 } 506 529 … … 798 821 { 799 822 itsData = string; 800 itsSize = strlen(string)+1;823 itsSize = (int)strlen(string)+1; 801 824 itsType = DisSTRING; 802 825 declareIt((char *)name, (char *)"C", 0, 0); … … 880 903 { 881 904 itsData = string; 882 itsSize = strlen(string)+1;905 itsSize = (int)strlen(string)+1; 883 906 itsType = DisSTRING; 884 907 declareIt((char *)name, (char *)"C", 0, dns); … … 987 1010 { 988 1011 itsData = string; 989 itsSize = strlen(string)+1;1012 itsSize = (int)strlen(string)+1; 990 1013 return dis_update_service( itsId ); 991 1014 } … … 1106 1129 { 1107 1130 itsData = string; 1108 itsSize = strlen(string)+1;1131 itsSize = (int)strlen(string)+1; 1109 1132 if( cids == 0) 1110 1133 { … … 1179 1202 void DimService::setData(char *data) 1180 1203 { 1181 storeIt(data, strlen(data)+1);1204 storeIt(data, (int)strlen(data)+1); 1182 1205 } 1183 1206 … … 1204 1227 secs = tsecs; 1205 1228 millisecs = tmillisecs; 1206 memcpy(itsData, data, datasize);1229 memcpy(itsData, data, (size_t)datasize); 1207 1230 } 1208 1231 … … 1465 1488 void DimRpc::setData(char *data) 1466 1489 { 1467 storeIt(data, strlen(data)+1);1490 storeIt(data,(int)strlen(data)+1); 1468 1491 } 1469 1492
Note:
See TracChangeset
for help on using the changeset viewer.