Changeset 15282 for trunk/FACT++/dim/src/did
- Timestamp:
- 04/08/13 15:07:07 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/dim/src/did/did.c
r14698 r15282 129 129 XtSetArg(arglist[n], XmNadjustLast, False); n++; 130 130 sprintf(w_name,"matrix_row"); 131 row_col_id = XmCreateRowColumn(top_id,w_name,arglist, n);131 row_col_id = XmCreateRowColumn(top_id,w_name,arglist,(Cardinal)n); 132 132 XtManageChild(row_col_id); 133 133 Matrix_id[Curr_matrix] = row_col_id; … … 302 302 XtSetArg ( ar[n], XmNscrollingPolicy, XmAUTOMATIC); n++; 303 303 304 sl = XmCreateScrolledWindow ( f, "ScrollWin", ar, n );304 sl = XmCreateScrolledWindow ( f, "ScrollWin", ar, (Cardinal)n ); 305 305 /* 306 306 XtVaSetValues ( sl, … … 363 363 364 364 w = XmCreateSeparator(parent_id, "separator", 365 arglist, n);365 arglist,(Cardinal)n); 366 366 XtManageChild(w); 367 367 return(w); … … 758 758 XtSetArg ( arglist[n], XmNtraversalOn,True); n++; 759 759 return XtAppCreateShell(argv[0], NULL, applicationShellWidgetClass, 760 display, arglist, n);760 display, arglist, (Cardinal)n); 761 761 762 762 } … … 860 860 } 861 861 for(i = 0;*ptr; ptr++, i++) 862 Curr_view_opt_par[i] = toupper(*ptr);862 Curr_view_opt_par[i] = (char)toupper((int)*ptr); 863 863 Curr_view_opt_par[i] = '\0'; 864 864 } … … 1033 1033 Widget id,sel_id; 1034 1034 int i, j, n_nodes, curr_index = 0; 1035 char nodes_str[MAX_NODE_NAME*MAX_CONNS ], max_str[MAX_NODE_NAME];1036 char *ptr, *nodeptrs[MAX_CONNS ], *curr_str, *sptr;1035 char nodes_str[MAX_NODE_NAME*MAX_CONNS*2], max_str[MAX_NODE_NAME]; 1036 char *ptr, *nodeptrs[MAX_CONNS*2], *curr_str, *sptr; 1037 1037 int get_nodes(); 1038 1038 … … 1052 1052 sptr = ptr; 1053 1053 ptr = strchr(ptr,'\n'); 1054 *ptr++ = '\0'; 1054 1055 for(j = 0; j < (int)strlen(sptr); j++) 1055 sptr[j] = tolower(sptr[j]); 1056 *ptr++ = '\0'; 1056 sptr[j] = (char)tolower((int)sptr[j]); 1057 1057 } 1058 1058 strcpy(max_str,"zzzzzzzzzzzzzzzzzzzzzzzzzzzz"); … … 1169 1169 ptr1 = strchr(ptr,'|'); 1170 1170 } 1171 strncpy(Curr_service_format,ptr,( int)(ptr1 - ptr));1171 strncpy(Curr_service_format,ptr,(size_t)(ptr1 - ptr)); 1172 1172 Curr_service_format[(int)(ptr1-ptr)] = '\0'; 1173 1173 } … … 1183 1183 1184 1184 if(tag){} 1185 Service_content_str = malloc( 1024 + (*size)*16);1186 Service_buffer = malloc( *size);1187 memcpy(Service_buffer, (char *)buffer, *size);1185 Service_content_str = malloc((size_t)(1024 + (*size)*16)); 1186 Service_buffer = malloc((size_t)*size); 1187 memcpy(Service_buffer, (char *)buffer, (size_t)*size); 1188 1188 Service_size = *size; 1189 1189 get_service_format(); … … 1303 1303 strcat(Service_content_str," L"); 1304 1304 if(!num) 1305 size = ssize/ sizeof(int);1305 size = ssize/(int)sizeof(int); 1306 1306 else 1307 1307 size = num; 1308 psize = size * sizeof(int);1308 psize = size * (int)sizeof(int); 1309 1309 print_service_standard(ptr, size); 1310 1310 break; … … 1313 1313 strcat(Service_content_str," I"); 1314 1314 if(!num) 1315 size = ssize/ sizeof(int);1315 size = ssize/(int)sizeof(int); 1316 1316 else 1317 1317 size = num; 1318 psize = size * sizeof(int);1318 psize = size * (int)sizeof(int); 1319 1319 print_service_standard(ptr, size); 1320 1320 break; … … 1323 1323 strcat(Service_content_str," S"); 1324 1324 if(!num) 1325 size = ssize/ sizeof(short);1325 size = ssize/(int)sizeof(short); 1326 1326 else 1327 1327 size = num; 1328 psize = size * sizeof(short);1328 psize = size * (int)sizeof(short); 1329 1329 print_service_short(ptr, size); 1330 1330 break; … … 1333 1333 strcat(Service_content_str," F"); 1334 1334 if(!num) 1335 size = ssize/ sizeof(float);1335 size = ssize/(int)sizeof(float); 1336 1336 else 1337 1337 size = num; 1338 psize = size * sizeof(float);1338 psize = size * (int)sizeof(float); 1339 1339 print_service_float(ptr, size); 1340 1340 break; … … 1343 1343 strcat(Service_content_str," D"); 1344 1344 if(!num) 1345 size = ssize/ sizeof(double);1345 size = ssize/(int)sizeof(double); 1346 1346 else 1347 1347 size = num; 1348 psize = size * sizeof(double);1348 psize = size * (int)sizeof(double); 1349 1349 print_service_double(ptr, size); 1350 1350 break; … … 1353 1353 strcat(Service_content_str," X"); 1354 1354 if(!num) 1355 size = ssize/ sizeof(longlong);1355 size = ssize/(int)sizeof(longlong); 1356 1356 else 1357 1357 size = num; 1358 psize = size * sizeof(longlong);1358 psize = size * (int)sizeof(longlong); 1359 1359 print_service_standard(ptr, size*2); 1360 1360 break; … … 1997 1997 if(last_size) 1998 1998 free(last_buffer); 1999 last_buffer = malloc( full_size);1999 last_buffer = malloc((size_t)full_size); 2000 2000 last_size = full_size; 2001 2001 } … … 2143 2143 strp++; 2144 2144 } 2145 num = strlen(strp)+1;2146 strncpy((char *)ptr,strp, num);2145 num = (int)strlen(strp)+1; 2146 strncpy((char *)ptr,strp,(size_t)num); 2147 2147 if( (ptr1 = (char *)strchr((char *)ptr,'\"')) ) 2148 2148 { … … 2198 2198 Curr_service_id = 0; 2199 2199 } 2200 Curr_service_id = dic_info_service_stamped(Curr_service_name,2200 Curr_service_id = (int)dic_info_service_stamped(Curr_service_name, 2201 2201 MONITORED,10,0,0, 2202 2202 recv_service_info,0, … … 2218 2218 Curr_service_id = 0; 2219 2219 } 2220 Curr_service_id = dic_info_service_stamped(Curr_service_name,2220 Curr_service_id = (int)dic_info_service_stamped(Curr_service_name, 2221 2221 MONITORED,0,0,0, 2222 2222 recv_service_info,0, … … 2404 2404 if(n_services != -1) 2405 2405 { 2406 service_size = n_services* sizeof(DNS_SERVICE_INFO);2407 servp->service_ptr = (DNS_SERVICE_INFO *)malloc( service_size);2408 memcpy(servp->service_ptr, buffer->services, service_size);2406 service_size = n_services*(int)sizeof(DNS_SERVICE_INFO); 2407 servp->service_ptr = (DNS_SERVICE_INFO *)malloc((size_t)service_size); 2408 memcpy(servp->service_ptr, buffer->services, (size_t)service_size); 2409 2409 N_services += n_services; 2410 2410 } … … 2539 2539 strcpy(node, server_ptr->node); 2540 2540 strcpy(par, Curr_view_opt_par); 2541 ptr = strchr(node, '.'); 2542 if(ptr) 2543 *ptr = '\0'; 2544 ptr = strchr(par,'.'); 2545 if(ptr) 2546 *ptr = '\0'; 2541 if(!isdigit(node[0])) 2542 { 2543 ptr = strchr(node, '.'); 2544 if(ptr) 2545 *ptr = '\0'; 2546 ptr = strchr(par,'.'); 2547 if(ptr) 2548 *ptr = '\0'; 2549 } 2547 2550 ptr = node; 2548 2551 for(i = 0; i < (int)strlen(ptr); i++) 2549 ptr[i] = tolower(ptr[i]);2552 ptr[i] = (char)tolower((int)ptr[i]); 2550 2553 ptr = par; 2551 2554 for(i = 0; i < (int)strlen(ptr); i++) 2552 ptr[i] = tolower(ptr[i]);2555 ptr[i] = (char)tolower((int)ptr[i]); 2553 2556 if(!strcmp(/*server_ptr->*/node, /*Curr_view_opt_*/par)) 2554 2557 { … … 2661 2664 w_id = w = XmCreateMenuBar(Matrix_id[Curr_matrix], 2662 2665 (String)XmStringCreateLtoR ( w_name,XmSTRING_DEFAULT_CHARSET), 2663 arglist, n);2666 arglist,(Cardinal)n); 2664 2667 /* 2665 2668 if(n_services == -1) … … 2675 2678 w = XmCreateCascadeButton(w, 2676 2679 (String)XmStringCreateLtoR ( w_name,XmSTRING_DEFAULT_CHARSET), 2677 arglist, n);2680 arglist,(Cardinal)n); 2678 2681 set_something(w,XmNlabelString,name); 2679 2682 set_something(w,XmNalignment,XmALIGNMENT_CENTER); … … 2689 2692 ww = XmCreatePulldownMenu(w_id, 2690 2693 (String)XmStringCreateLtoR ( w_name,XmSTRING_DEFAULT_CHARSET), 2691 arglist, n);2694 arglist,(Cardinal)n); 2692 2695 set_something(w,XmNsubMenuId,ww); 2693 2696 XtManageChild(w); … … 2697 2700 w = XmCreatePushButton(ww, 2698 2701 (String)XmStringCreateLtoR ( w_name,XmSTRING_DEFAULT_CHARSET), 2699 arglist, n);2702 arglist,(Cardinal)n); 2700 2703 2701 2704 set_something(w,XmNlabelString,"Services"); … … 2709 2712 w = XmCreatePushButton(ww, 2710 2713 (String)XmStringCreateLtoR ( w_name,XmSTRING_DEFAULT_CHARSET), 2711 arglist, n);2714 arglist,(Cardinal)n); 2712 2715 2713 2716 set_something(w,XmNlabelString,"Clients"); … … 2857 2860 2858 2861 service_ptr = servp->service_ptr; 2859 service_list = (DID_SLOT *)malloc( ptr->n_services * MAX_NAME);2862 service_list = (DID_SLOT *)malloc((size_t)(ptr->n_services * MAX_NAME)); 2860 2863 n_services = ptr->n_services; 2861 2864 … … 3300 3303 XtSetArg(ar[n],XmNselectionLabelString, xmSelection); n++; 3301 3304 } 3302 sd = XmCreateSelectionDialog ( toplevel_widget, "Selection", ar, n );3305 sd = XmCreateSelectionDialog ( toplevel_widget, "Selection", ar, (Cardinal)n ); 3303 3306 XmStringFree(xmList); 3304 3307 XmStringFree(xmOk); … … 3338 3341 XtSetArg(ar[n],XmNwidth, 500); n++; 3339 3342 XtSetArg(ar[n],XmNdirMask, xm1); n++; 3340 sd = XmCreateFileSelectionDialog ( toplevel_widget, "FileSelection", ar, n );3343 sd = XmCreateFileSelectionDialog ( toplevel_widget, "FileSelection", ar, (Cardinal)n ); 3341 3344 3342 3345 XmStringFree(xm1); … … 3367 3370 */ 3368 3371 XtSetArg(ar[n],XmNselectionLabelString, xm1); n++; 3369 sd = XmCreatePromptDialog ( toplevel_widget, "Prompt", ar, n );3372 sd = XmCreatePromptDialog ( toplevel_widget, "Prompt", ar, (Cardinal)n ); 3370 3373 3371 3374 XmStringFree(xm1); … … 3396 3399 */ 3397 3400 XtSetArg(ar[n],XmNmessageString, xm1); n++; 3398 sd = XmCreateQuestionDialog ( toplevel_widget, "Question", ar, n );3401 sd = XmCreateQuestionDialog ( toplevel_widget, "Question", ar, (Cardinal)n ); 3399 3402 3400 3403 XmStringFree(xm1); … … 3419 3422 XtSetArg(ar[n],XmNborderWidth, 1); n++; 3420 3423 XtSetArg(ar[n],XmNresizePolicy, XmRESIZE_ANY); n++; 3421 fd = XmCreateFormDialog ( toplevel_widget, "Form", ar, n );3424 fd = XmCreateFormDialog ( toplevel_widget, "Form", ar, (Cardinal)n ); 3422 3425 XtManageChild(fd); 3423 3426 … … 3434 3437 XtSetArg(ar[n],XmNleftAttachment, XmATTACH_FORM); n++; 3435 3438 XtSetArg(ar[n],XmNleftOffset, 0); n++; 3436 rc = XmCreateRowColumn ( fd, "rowcol", ar, n );3439 rc = XmCreateRowColumn ( fd, "rowcol", ar, (Cardinal)n ); 3437 3440 XtManageChild(rc); 3438 3441 … … 3444 3447 XtSetArg ( ar[n], XmNscrollingPolicy, XmAUTOMATIC); n++; 3445 3448 3446 sw = XmCreateScrolledWindow ( rc, "ScrollWin", ar, n );3449 sw = XmCreateScrolledWindow ( rc, "ScrollWin", ar, (Cardinal)n ); 3447 3450 XtManageChild ( sw ); 3448 3451 … … 3453 3456 XtSetArg(ar[n],XmNlabelString, xm1); n++; 3454 3457 XtSetArg(ar[n],XmNalignment, XmALIGNMENT_BEGINNING); n++; 3455 lb = XmCreateLabel ( sw, "label", ar, n );3458 lb = XmCreateLabel ( sw, "label", ar, (Cardinal)n ); 3456 3459 XtManageChild(lb); 3457 3460 XmStringFree(xm1); … … 3467 3470 XtSetArg(ar[n],XmNnumColumns, 3); n++; 3468 3471 XtSetArg(ar[n],XmNpacking, XmPACK_COLUMN); n++; 3469 rc1 = XmCreateRowColumn ( rc, "buttons", ar, n );3472 rc1 = XmCreateRowColumn ( rc, "buttons", ar, (Cardinal)n ); 3470 3473 XtManageChild(rc1); 3471 3474 /* … … 3496 3499 XtSetArg(ar[n],XmNfontList, did_default_font); n++; 3497 3500 XtSetArg(ar[n],XmNlabelString, xm1); n++; 3498 b = XmCreatePushButton ( parent, "button", ar, n );3501 b = XmCreatePushButton ( parent, "button", ar, (Cardinal)n ); 3499 3502 3500 3503 XtManageChild(b); … … 3506 3509 } 3507 3510 3508 3509 3510
Note:
See TracChangeset
for help on using the changeset viewer.