VirtualBox

Changeset 103140 in vbox for trunk


Ignore:
Timestamp:
Jan 31, 2024 3:01:57 PM (13 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
161388
Message:

libs/xpcom: Some warning fixes about externally visible functions which should be static, bugref:3409

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

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/xpcom/build/nsXPComInit.cpp

    r102320 r103140  
    454454}
    455455
    456 nsresult NS_COM NS_InitXPCOM(nsIServiceManager* *result,
    457                              nsIFile* binDirectory)
    458 {
    459     return NS_InitXPCOM2(result, binDirectory, nsnull);
    460 }
    461 
    462456nsresult NS_COM NS_InitXPCOM2(nsIServiceManager* *result,
    463457                              nsIFile* binDirectory,
  • trunk/src/libs/xpcom18a4/xpcom/tests/TestArray.cpp

    r1 r103140  
    9494NS_IMPL_ISUPPORTS1(Foo, IFoo)
    9595
    96 const char* AssertEqual(PRInt32 aValue1, PRInt32 aValue2)
     96static const char* AssertEqual(PRInt32 aValue1, PRInt32 aValue2)
    9797{
    9898  if (aValue1 == aValue2) {
     
    105105}
    106106
    107 void DumpArray(nsISupportsArray* aArray, PRInt32 aExpectedCount, PRInt32 aElementIDs[], PRInt32 aExpectedTotal)
     107static void DumpArray(nsISupportsArray* aArray, PRInt32 aExpectedCount, PRInt32 aElementIDs[], PRInt32 aExpectedTotal)
    108108{
    109109  PRUint32 cnt = 0;
     
    127127}
    128128
    129 void FillArray(nsISupportsArray* aArray, PRInt32 aCount)
     129static void FillArray(nsISupportsArray* aArray, PRInt32 aCount)
    130130{
    131131  PRInt32 index;
  • trunk/src/libs/xpcom18a4/xpcom/tests/TestCRT.cpp

    r102458 r103140  
    4343// The return from strcmp etc is only defined to be postive, zero or
    4444// negative. The magnitude of a non-zero return is irrelevant.
    45 PRIntn sign(PRIntn val) {
     45static PRIntn sign(PRIntn val) {
    4646    if (val == 0)
    4747        return 0;
  • trunk/src/libs/xpcom18a4/xpcom/tests/TestHashtables.cpp

    r102996 r103140  
    114114};
    115115
    116 PLDHashOperator
    117 nsTEnumGo(EntityToUnicodeEntry* aEntry, void* userArg) {
     116static PLDHashOperator nsTEnumGo(EntityToUnicodeEntry* aEntry, void* userArg) {
    118117  printf("  enumerated \"%s\" = %u\n",
    119118         aEntry->mNode->mStr, aEntry->mNode->mUnicode);
     
    122121}
    123122
    124 PLDHashOperator
    125 nsTEnumStop(EntityToUnicodeEntry* aEntry, void* userArg) {
     123static PLDHashOperator nsTEnumStop(EntityToUnicodeEntry* aEntry, void* userArg) {
    126124  printf("  enumerated \"%s\" = %u\n",
    127125         aEntry->mNode->mStr, aEntry->mNode->mUnicode);
     
    130128}
    131129
    132 void
    133 testTHashtable(nsTHashtable<EntityToUnicodeEntry>& hash, PRUint32 numEntries) {
     130static void testTHashtable(nsTHashtable<EntityToUnicodeEntry>& hash, PRUint32 numEntries) {
    134131  printf("Filling hash with %d entries.\n", numEntries);
    135132
     
    190187}
    191188
    192 PLDHashOperator
    193 nsDEnumRead(const PRUint32& aKey, const char* aData, void* userArg) {
     189static PLDHashOperator nsDEnumRead(const PRUint32& aKey, const char* aData, void* userArg) {
    194190  printf("  enumerated %u = \"%s\"\n", aKey, aData);
    195191  return PL_DHASH_NEXT;
    196192}
    197193
    198 PLDHashOperator
    199 nsDEnum(const PRUint32& aKey, const char*& aData, void* userArg) {
     194static PLDHashOperator nsDEnum(const PRUint32& aKey, const char*& aData, void* userArg) {
    200195  printf("  enumerated %u = \"%s\"\n", aKey, aData);
    201196  return PL_DHASH_NEXT;
    202197}
    203198
    204 PLDHashOperator
    205 nsCEnumRead(const nsACString& aKey, TestUniChar* aData, void* userArg) {
     199static PLDHashOperator nsCEnumRead(const nsACString& aKey, TestUniChar* aData, void* userArg) {
    206200  printf("  enumerated \"%s\" = %u\n",
    207201         PromiseFlatCString(aKey).get(), aData->GetChar());
     
    209203}
    210204
    211 PLDHashOperator
    212 nsCEnum(const nsACString& aKey, nsAutoPtr<TestUniChar>& aData, void* userArg) {
     205static PLDHashOperator nsCEnum(const nsACString& aKey, nsAutoPtr<TestUniChar>& aData, void* userArg) {
    213206    printf("  enumerated \"%s\" = %u\n",
    214207           PromiseFlatCString(aKey).get(), aData->GetChar());
     
    346339}
    347340
    348 nsresult
    349 CreateIFoo( IFoo** result )
     341static nsresult CreateIFoo( IFoo** result )
    350342    // a typical factory function (that calls AddRef)
    351343  {
     
    361353  }
    362354
    363 PLDHashOperator
    364 nsIEnumRead(const PRUint32& aKey, IFoo* aFoo, void* userArg) {
     355static PLDHashOperator nsIEnumRead(const PRUint32& aKey, IFoo* aFoo, void* userArg) {
    365356  nsCAutoString str;
    366357  aFoo->GetString(str);
     
    370361}
    371362
    372 PLDHashOperator
    373 nsIEnum(const PRUint32& aKey, nsCOMPtr<IFoo>& aData, void* userArg) {
     363static PLDHashOperator nsIEnum(const PRUint32& aKey, nsCOMPtr<IFoo>& aData, void* userArg) {
    374364  nsCAutoString str;
    375365  aData->GetString(str);
     
    379369}
    380370
    381 PLDHashOperator
    382 nsIEnum2Read(nsISupports* aKey, PRUint32 aData, void* userArg) {
     371static PLDHashOperator nsIEnum2Read(nsISupports* aKey, PRUint32 aData, void* userArg) {
    383372  nsCAutoString str;
    384373  nsCOMPtr<IFoo> foo = do_QueryInterface(aKey);
     
    390379}
    391380
    392 PLDHashOperator
    393 nsIEnum2(nsISupports* aKey, PRUint32& aData, void* userArg) {
     381static PLDHashOperator nsIEnum2(nsISupports* aKey, PRUint32& aData, void* userArg) {
    394382  nsCAutoString str;
    395383  nsCOMPtr<IFoo> foo = do_QueryInterface(aKey);
  • trunk/src/libs/xpcom18a4/xpcom/tests/TestObserverService.cpp

    r102348 r103140  
    6868#endif
    6969
    70 void printString(nsString &str) {
     70static void printString(nsString &str) {
    7171#ifdef VBOX  /* asan complains about mixing different allocators */
    7272    char *cstr = ToNewCString(str);
  • trunk/src/libs/xpcom18a4/xpcom/tests/TestStrings.cpp

    r40300 r103140  
    4141#include "nsCRT.h"
    4242
    43 void test_assign_helper(const nsACString& in, nsACString &_retval)
     43static void test_assign_helper(const nsACString& in, nsACString &_retval)
    4444  {
    4545    _retval = in;
    4646  }
    4747
    48 PRBool test_assign()
     48static PRBool test_assign()
    4949  {
    5050    nsCString result;
     
    5656  }
    5757
    58 PRBool test_assign_c()
     58static PRBool test_assign_c()
    5959  {
    6060    nsCString c; c.Assign('c');
     
    6565  }
    6666
    67 PRBool test1()
     67static PRBool test1()
    6868  {
    6969    NS_NAMED_LITERAL_STRING(empty, "");
     
    8585  }
    8686
    87 PRBool test2()
     87static PRBool test2()
    8888  {
    8989    nsCString data("hello world");
     
    9999  }
    100100
    101 PRBool test_find()
     101static PRBool test_find()
    102102  {
    103103    nsCString src("<!DOCTYPE blah blah blah>");
     
    111111  }
    112112
    113 PRBool test_rfind()
     113static PRBool test_rfind()
    114114  {
    115115    const char text[] = "<!DOCTYPE blah blah blah>";
     
    149149  }
    150150
    151 PRBool test_rfind_2()
     151static PRBool test_rfind_2()
    152152  {
    153153    const char text[] = "<!DOCTYPE blah blah blah>";
     
    161161  }
    162162
    163 PRBool test_rfind_3()
     163static PRBool test_rfind_3()
    164164  {
    165165    const char text[] = "urn:mozilla:locale:en-US:necko";
     
    173173  }
    174174
    175 PRBool test_rfind_4()
     175static PRBool test_rfind_4()
    176176  {
    177177    nsCString value("a.msf");
     
    186186  }
    187187
    188 PRBool test_distance()
     188static PRBool test_distance()
    189189  {
    190190    const char text[] = "abc-xyz";
     
    200200  }
    201201
    202 PRBool test_length()
     202static PRBool test_length()
    203203  {
    204204    const char text[] = "abc-xyz";
     
    211211  }
    212212
    213 PRBool test_trim()
     213static PRBool test_trim()
    214214  {
    215215    const char text[] = " a\t    $   ";
     
    224224  }
    225225
    226 PRBool test_replace_substr()
     226static PRBool test_replace_substr()
    227227  {
    228228    const char text[] = "abc-ppp-qqq-ppp-xyz";
     
    267267  }
    268268
    269 PRBool test_replace_substr_2()
     269static PRBool test_replace_substr_2()
    270270  {
    271271    const char *oldName = nsnull;
     
    288288  }
    289289
    290 PRBool test_strip_ws()
     290static PRBool test_strip_ws()
    291291  {
    292292    const char text[] = " a    $   ";
     
    299299  }
    300300
    301 PRBool test_equals_ic()
     301static PRBool test_equals_ic()
    302302  {
    303303    nsCString s;
     
    308308  }
    309309
    310 PRBool test_fixed_string()
     310static PRBool test_fixed_string()
    311311  {
    312312    char buf[256] = "hello world";
     
    327327  }
    328328
    329 PRBool test_concat()
     329static PRBool test_concat()
    330330  {
    331331    nsCString bar("bar");
     
    343343  }
    344344
    345 PRBool test_concat_2()
     345static PRBool test_concat_2()
    346346  {
    347347    nsCString fieldTextStr("xyz");
     
    370370#endif
    371371
    372 PRBool test_xpidl_string()
     372static PRBool test_xpidl_string()
    373373  {
    374374    nsXPIDLCString a, b;
     
    422422  }
    423423
    424 PRBool test_empty_assign()
     424static PRBool test_empty_assign()
    425425  {
    426426    nsCString a;
     
    434434  }
    435435
    436 PRBool test_set_length()
     436static PRBool test_set_length()
    437437  {
    438438    const char kText[] = "Default Plugin";
     
    446446  }
    447447
    448 PRBool test_substring()
     448static PRBool test_substring()
    449449  {
    450450    nsCString super("hello world"), sub("hello");
     
    465465  }
    466466
    467 PRBool test_appendint64()
     467static PRBool test_appendint64()
    468468  {
    469469    nsCString str;
     
    516516  }
    517517
    518 PRBool test_findcharinset()
     518static PRBool test_findcharinset()
    519519  {
    520520    nsCString buf("hello, how are you?");
     
    535535  }
    536536
    537 PRBool test_rfindcharinset()
     537static PRBool test_rfindcharinset()
    538538  {
    539539    nsCString buf("hello, how are you?");
  • trunk/src/libs/xpcom18a4/xpcom/tests/nsIFileTest.cpp

    r101856 r103140  
    1515#include "nsCOMPtr.h"
    1616
    17 void Passed();
    18 void Failed(const char* explanation = nsnull);
    19 void Inspect();
    20 void Banner(const char* bannerString);
    21 
    22 void VerifyResult(nsresult rv)
     17static void Passed();
     18static void Failed(const char* explanation = nsnull);
     19static void Inspect();
     20static void Banner(const char* bannerString);
     21
     22static void VerifyResult(nsresult rv)
    2323{
    2424    if (NS_FAILED(rv))
     
    2929}
    3030//----------------------------------------------------------------------------
    31 void Banner(const char* bannerString)
     31static void Banner(const char* bannerString)
    3232//----------------------------------------------------------------------------
    3333{
     
    3838
    3939//----------------------------------------------------------------------------
    40 void Passed()
     40static void Passed()
    4141//----------------------------------------------------------------------------
    4242{
     
    4545
    4646//----------------------------------------------------------------------------
    47 void Failed(const char* explanation)
     47static void Failed(const char* explanation)
    4848//----------------------------------------------------------------------------
    4949{
     
    5353
    5454//----------------------------------------------------------------------------
    55 void Inspect()
     55static void Inspect()
    5656//----------------------------------------------------------------------------
    5757{
     
    5959}
    6060
    61 void GetPaths(nsILocalFile* file)
     61static void GetPaths(nsILocalFile* file)
    6262{
    6363    nsresult rv;
     
    7272}
    7373
    74 void InitTest(const char* creationPath, const char* appendPath)
     74static void InitTest(const char* creationPath, const char* appendPath)
    7575{
    7676    nsILocalFile* file = nsnull;
     
    123123
    124124
    125 void CreationTest(const char* creationPath, const char* appendPath,
    126                   PRInt32 whatToCreate, PRInt32 perm)
     125static void CreationTest(const char* creationPath, const char* appendPath,
     126                                 PRInt32 whatToCreate, PRInt32 perm)
    127127{
    128128    nsresult rv;
     
    172172}
    173173
    174 void CreateUniqueTest(const char* creationPath, const char* appendPath,
    175                  PRInt32 whatToCreate, PRInt32 perm)
     174static void CreateUniqueTest(const char* creationPath, const char* appendPath,
     175                             PRInt32 whatToCreate, PRInt32 perm)
    176176{
    177177    nsresult rv;
     
    222222
    223223
    224 void
    225 CopyTest(const char *testFile, const char *targetDir)
     224static void CopyTest(const char *testFile, const char *targetDir)
    226225{
    227226  printf("start copy test\n");
     
    258257}
    259258
    260 void
    261 DeletionTest(const char* creationPath, const char* appendPath, PRBool recursive)
     259static void DeletionTest(const char* creationPath, const char* appendPath, PRBool recursive)
    262260{
    263261    nsresult rv;
     
    305303}
    306304
    307 void
    308 MoveTest(const char *testFile, const char *targetDir)
     305static void MoveTest(const char *testFile, const char *targetDir)
    309306{
    310307  Banner("Move Test");
     
    345342
    346343// move up the number of directories in moveUpCount, then append "foo/bar"
    347 void
    348 NormalizeTest(const char *testPath, int moveUpCount,
    349               const char *expected)
     344static void NormalizeTest(const char *testPath, int moveUpCount,
     345                          const char *expected)
    350346{
    351347  Banner("Normalize Test");
  • trunk/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl.h

    r62449 r103140  
    5858#include <xpt_struct.h>
    5959
    60 /*
    61  * IDL_tree_warning bombs on libIDL version 6.5, and I don't want to not write
    62  * warnings... so I define a versioned one here.  Thanks to Mike Shaver for the
    63  * this solution, which allows us to pass through varargs calls.
    64  */
    65 #if !(LIBIDL_MAJOR_VERSION == 0 && LIBIDL_MINOR_VERSION == 6 && \
    66       LIBIDL_MICRO_VERSION == 5) && !defined(DEBUG_shaver)
    67 /*
    68  * This turns a varargs call to XPIDL_WARNING directly into a varargs
    69  * call to IDL_tree_warning or xpidl_tree_warning as appropriate.  The
    70  * only tricky bit is that you must call XPIDL_WARNING with extra
    71  * parens, e.g. XPIDL_WARNING((foo, bar, "sil"))
    72  *
    73  * Probably best removed when we leave 6.5.  */
    7460#define XPIDL_WARNING(x) IDL_tree_warning x
    75 #else
    76 extern void xpidl_tree_warning(IDL_tree p, int level, const char *fmt, ...);
    77 #define XPIDL_WARNING(x) xpidl_tree_warning x
    78 #endif
    7961
    8062/*
  • trunk/src/libs/xpcom18a4/xpcom/typelib/xpidl/xpidl_idl.c

    r103130 r103140  
    815815    return ok;
    816816}
    817 
    818 /*
    819  * Our own version of IDL_tree_warning, which we use when IDL_tree_warning
    820  * would crash on us.
    821  */
    822 void
    823 xpidl_tree_warning(IDL_tree p, int level, const char *fmt, ...)
    824 {
    825     va_list ap;
    826     char *msg, *file;
    827     int lineno;
    828 
    829     /* XXX need to check against __IDL_max_msg_level, no accessor */
    830     va_start(ap, fmt);
    831     msg = g_strdup_vprintf(fmt, ap);
    832 
    833     if (p) {
    834         file = p->_file;
    835         lineno = p->_line;
    836     } else {
    837         file = NULL;
    838         lineno = 0;
    839     }
    840 
    841     /* call our message callback, like IDL_tree_warning would */
    842     msg_callback(level, 0, lineno, file, msg);
    843     g_free(msg);
    844     va_end(ap);
    845 }
  • trunk/src/libs/xpcom18a4/xpcom/typelib/xpt/tests/PrimitiveTest.c

    r3149 r103140  
    7070  output = {0, 0, {0, 0}, NULL, NULL };
    7171
    72 void
    73 dump_struct(char *label, struct TestData *str)
     72static void dump_struct(char *label, struct TestData *str)
    7473{
    7574    fprintf(stderr, "%s: {%#08x, %#04x, {%#02x, %#02x}, %s, %d/%s}\n",
     
    7877}
    7978
    80 PRBool
    81 XDR(XPTArena *arena, XPTCursor *cursor, struct TestData *str)
     79static PRBool XDR(XPTArena *arena, XPTCursor *cursor, struct TestData *str)
    8280{
    8381    TRY("Do32", XPT_Do32(cursor, &str->bit32));
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