VirtualBox

Changeset 102506 in vbox for trunk/src/libs/xpcom18a4


Ignore:
Timestamp:
Dec 6, 2023 3:10:52 PM (15 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
160650
Message:

libs/xpcom: Fixed some warnings. bugref:10545

Location:
trunk/src/libs/xpcom18a4/xpcom
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/xpcom/components/nsComponentManager.cpp

    r102458 r102506  
    12371237            { 0 }
    12381238        };
    1239         for (int i=0; abusedContracts[i] && *abusedContracts[i]; i++) {
     1239        for (int i=0; i < RT_ELEMENTS(abusedContracts) && *abusedContracts[i]; i++) {
    12401240            nsFactoryEntry *entry = nsnull;
    12411241            nsContractIDTableEntry* contractIDTableEntry =
  • trunk/src/libs/xpcom18a4/xpcom/reflect/xptcall/tests/TestXPTCInvoke.cpp

    r102470 r102506  
    152152    NS_IMETHOD AddManyManyFloats(float p1, float p2, float p3, float p4,
    153153                                 float p5, float p6, float p7, float p8,
    154                                  float p9, float p10, float p11, float p12, 
    155                                  float p13, float p14, float p15, float p16, 
    156                                  float p17, float p18, float p19, float p20, 
     154                                 float p9, float p10, float p11, float p12,
     155                                 float p13, float p14, float p15, float p16,
     156                                 float p17, float p18, float p19, float p20,
    157157                                 float *retval) = 0;
    158158
     
    198198
    199199    NS_IMETHOD AddMixedInts(PRInt64 p1, PRInt32 p2, PRInt64 p3, PRInt32 p4,
    200                             PRInt32 p5, PRInt64 p6, PRInt32 p7, PRInt32 p8,
    201                             PRInt64 p9, PRInt32 p10, PRInt64* retval);
     200                PRInt32 p5, PRInt64 p6, PRInt32 p7, PRInt32 p8,
     201                PRInt64 p9, PRInt32 p10, PRInt64* retval);
    202202
    203203    NS_IMETHOD AddMixedInts2(PRInt32 p1, PRInt64 p2, PRInt32 p3, PRInt64 p4,
    204                              PRInt64 p5, PRInt32 p6, PRInt64 p7, PRInt64 p8,
    205                              PRInt32 p9, PRInt64 p10, PRInt64* retval);
     204                 PRInt64 p5, PRInt32 p6, PRInt64 p7, PRInt64 p8,
     205                 PRInt32 p9, PRInt64 p10, PRInt64* retval);
    206206
    207207    NS_IMETHOD AddMixedFloats(float p1, float p2, double p3, double p4,
     
    212212    NS_IMETHOD AddManyManyFloats(float p1, float p2, float p3, float p4,
    213213                                 float p5, float p6, float p7, float p8,
    214                                  float p9, float p10, float p11, float p12, 
    215                                  float p13, float p14, float p15, float p16, 
    216                                  float p17, float p18, float p19, float p20, 
     214                                 float p9, float p10, float p11, float p12,
     215                                 float p13, float p14, float p15, float p16,
     216                                 float p17, float p18, float p19, float p20,
    217217                                 float *retval);
    218218
     
    263263{
    264264#ifdef DEBUG_TESTINVOKE
    265     printf("%d, %d, %d, %d, %d, %d, %d, %d, %d, %d\n", 
     265    printf("%d, %d, %d, %d, %d, %d, %d, %d, %d, %d\n",
    266266           p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
    267267#endif
     
    286286{
    287287#ifdef DEBUG_TESTINVOKE
    288     printf("%lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf\n", 
     288    printf("%lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf, %lf\n",
    289289           p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
    290290#endif
     
    299299{
    300300#ifdef DEBUG_TESTINVOKE
    301     printf("%f, %f, %f, %f, %f, %f, %f, %f, %f, %f\n", 
     301    printf("%f, %f, %f, %f, %f, %f, %f, %f, %f, %f\n",
    302302           p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
    303303#endif
     
    313313{
    314314#ifdef DEBUG_TESTINVOKE
    315     printf("%f, %f, %lf, %lf, %f, %f, %lf, %lf, %f, %lf, %f\n", 
     315    printf("%f, %f, %lf, %lf, %f, %f, %lf, %lf, %f, %lf, %f\n",
    316316           p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);
    317317#endif
     
    323323InvokeTestTarget::AddManyManyFloats(float p1, float p2, float p3, float p4,
    324324                                    float p5, float p6, float p7, float p8,
    325                                     float p9, float p10, float p11, float p12, 
    326                                     float p13, float p14, float p15, float p16, 
     325                                    float p9, float p10, float p11, float p12,
     326                                    float p13, float p14, float p15, float p16,
    327327                                    float p17, float p18, float p19, float p20,
    328328                                    float *retval)
     
    330330#ifdef DEBUG_TESTINVOKE
    331331    printf("%f, %f, %f, %f, %f, %f, %f, %f, %f, %f, "
    332            "%f, %f, %f, %f, %f, %f, %f, %f, %f, %f\n", 
     332           "%f, %f, %f, %f, %f, %f, %f, %f, %f, %f\n",
    333333           p1, p2, p3, p4, p5, p6, p7, p8, p9, p10,
    334334           p11, p12, p13, p14, p15, p16, p17, p18, p19, p20);
     
    341341NS_IMETHODIMP
    342342InvokeTestTarget::AddMixedInts(PRInt64 p1, PRInt32 p2, PRInt64 p3, PRInt32 p4,
    343                                PRInt32 p5, PRInt64 p6, PRInt32 p7, PRInt32 p8,
    344                                PRInt64 p9, PRInt32 p10, PRInt64* retval)
     343                   PRInt32 p5, PRInt64 p6, PRInt32 p7, PRInt32 p8,
     344                   PRInt64 p9, PRInt32 p10, PRInt64* retval)
    345345{
    346346    *retval = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10;
     
    350350NS_IMETHODIMP
    351351InvokeTestTarget::AddMixedInts2(PRInt32 p1, PRInt64 p2, PRInt32 p3, PRInt64 p4,
    352                                 PRInt64 p5, PRInt32 p6, PRInt64 p7, PRInt64 p8,
    353                                 PRInt32 p9, PRInt64 p10, PRInt64* retval)
     352                PRInt64 p5, PRInt32 p6, PRInt64 p7, PRInt64 p8,
     353                PRInt32 p9, PRInt64 p10, PRInt64* retval)
    354354{
    355355    *retval = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10;
     
    361361{
    362362    const char milk[] = "milk";
    363     char *ret = (char*)nsMemory::Alloc(sizeof(milk));
     363    const size_t cb = sizeof(milk);
     364    char *ret = (char*)nsMemory::Alloc(cb);
    364365    if (!ret)
    365366      return NS_ERROR_OUT_OF_MEMORY;
    366     strncpy(ret, milk, sizeof(milk));
     367    strncpy(ret, milk, cb);
    367368    printf("\t%s %s", s1, s2);
    368369    *retval = ret;
     
    445446     else
    446447         bufprintf("\tFAILED");
    447  
     448
    448449     if(NS_SUCCEEDED(test->AddMixedInts2(1,2,3,4,5,6,7,8,9,10,&out64)))
    449450     {
     
    847848    if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 12, 11, var)))
    848849        bufprintf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %d\n",
    849                (int)var[10].val.i64);
     850           (int)var[10].val.i64);
    850851    else
    851852        bufprintf("\tFAILED");
     
    898899    if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 13, 11, var)))
    899900        bufprintf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %d\n",
    900                (int)var[10].val.i64);
     901           (int)var[10].val.i64);
    901902    else
    902903        bufprintf("\tFAILED");
     
    964965    var[1].type = nsXPTType::T_CHAR_STR;
    965966    var[1].flags = 0;
    966    
     967
    967968    var[2].val.p = 0;
    968969    var[2].type = nsXPTType::T_CHAR_STR;
    969970    var[2].flags = nsXPTCVariant::PTR_IS_DATA;
    970971    var[2].ptr = &var[2].val.p;
    971    
     972
    972973    if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 15, 3, var)))
    973974    {
     
    14431444
    14441445    printf("Speed test...\n\n");
    1445     printf("Doing %d direct call iterations...\n", count); 
     1446    printf("Doing %d direct call iterations...\n", count);
    14461447    start = RTTimeNanoTS();
    14471448    for(i = count; i; i--)
     
    14491450    interval_direct = RTTimeNanoTS() - start;
    14501451
    1451     printf("Doing %d invoked call iterations...\n", count); 
     1452    printf("Doing %d invoked call iterations...\n", count);
    14521453    start = RTTimeNanoTS();
    14531454    for(i = count; i; i--)
     
    14551456    interval_invoke = RTTimeNanoTS() - start;
    14561457
    1457     printf(" direct took %0.2f seconds\n", 
     1458    printf(" direct took %0.2f seconds\n",
    14581459            (double)interval_direct/(double)RT_NS_1SEC);
    1459     printf(" invoke took %0.2f seconds\n", 
     1460    printf(" invoke took %0.2f seconds\n",
    14601461            (double)interval_invoke/(double)RT_NS_1SEC);
    1461     printf(" So, invoke overhead was ~ %0.2f seconds (~ %0.0f%%)\n", 
     1462    printf(" So, invoke overhead was ~ %0.2f seconds (~ %0.0f%%)\n",
    14621463            (double)(interval_invoke-interval_direct)/(double)RT_NS_1SEC,
    14631464            (double)(interval_invoke-interval_direct)/(double)interval_invoke*100);
    1464 }       
     1465}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette