Ignore:
Timestamp:
Feb 10, 2010 10:45:07 AM (14 years ago)
Author:
bennylp
Message:

More ticket #1018: fixed some more warnings about pointer conversions, or errors if the library is compiled in C++ mode (thanks Atik Khan for the report)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib-util/src/pjlib-util-test/http_client.c

    r3089 r3095  
    6868 
    6969    while (!thread_quit) { 
    70         char *pkt = pj_pool_alloc(pool, srv->buf_size); 
     70        char *pkt = (char*)pj_pool_alloc(pool, srv->buf_size); 
    7171        pj_ssize_t pkt_len; 
    7272        int rc; 
     
    155155    send_size += sendsz; 
    156156 
    157     sdata = pj_pool_alloc(pool, sendsz); 
     157    sdata = (char*)pj_pool_alloc(pool, sendsz); 
    158158    pj_create_random_string(sdata, sendsz); 
    159159    pj_ansi_sprintf(sdata, "\nSegment #%d\n", ++counter); 
     
    419419#endif 
    420420 
    421     pj_http_headers_add_elmt2(&param.headers, "Accept",  
    422                               "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*"); 
    423     pj_http_headers_add_elmt2(&param.headers, "Accept-Language", "en-sg"); 
    424     pj_http_headers_add_elmt2(&param.headers, "User-Agent",  
    425                               "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506)"); 
     421    pj_http_headers_add_elmt2(&param.headers, (char*)"Accept", 
     422                             (char*)"image/gif, image/x-xbitmap, image/jpeg, " 
     423                                    "image/pjpeg, application/x-ms-application," 
     424                                    " application/vnd.ms-xpsdocument, " 
     425                                    "application/xaml+xml, " 
     426                                    "application/x-ms-xbap, " 
     427                                    "application/x-shockwave-flash, " 
     428                                    "application/vnd.ms-excel, " 
     429                                    "application/vnd.ms-powerpoint, " 
     430                                    "application/msword, */*"); 
     431    pj_http_headers_add_elmt2(&param.headers, (char*)"Accept-Language", 
     432                              (char*)"en-sg"); 
     433    pj_http_headers_add_elmt2(&param.headers, (char*)"User-Agent", 
     434                              (char*)"Mozilla/4.0 (compatible; MSIE 7.0; " 
     435                                     "Windows NT 6.0; SLCC1; " 
     436                                     ".NET CLR 2.0.50727; " 
     437                                     ".NET CLR 3.0.04506)"); 
    426438    if (pj_http_req_create(pool, &url, timer_heap, ioqueue,  
    427439                           &param, &hcb, &http_req)) 
     
    523535 
    524536    pj_http_req_param_default(&param); 
    525     pj_strset2(&param.method, "PUT"); 
    526     data = pj_pool_alloc(pool, length); 
     537    pj_strset2(&param.method, (char*)"PUT"); 
     538    data = (char*)pj_pool_alloc(pool, length); 
    527539    pj_create_random_string(data, length); 
    528540    pj_ansi_sprintf(data, "PUT test\n"); 
     
    613625 
    614626    pj_http_req_param_default(&param); 
    615     pj_strset2(&param.method, "PUT"); 
     627    pj_strset2(&param.method, (char*)"PUT"); 
    616628    total_size = 15383; 
    617629    send_size = 0; 
     
    694706 
    695707    pj_http_req_param_default(&param); 
    696     pj_strset2(&param.method, "DELETE"); 
     708    pj_strset2(&param.method, (char*)"DELETE"); 
    697709    if (pj_http_req_create(pool, &url, timer_heap, ioqueue,  
    698710                           &param, &hcb, &http_req)) 
Note: See TracChangeset for help on using the changeset viewer.