VirtualBox

Changeset 92827 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Dec 8, 2021 4:17:03 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
148750
Message:

Main: bugref:1909: Fixed compilation errors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp

    r92826 r92827  
    263263};
    264264
    265 
    266 static void setBuiltInHelpLanguage(const char *pszLang)
    267 {
    268 #ifdef VBOX_WITH_VBOXMANAGE_NLS
    269     if (pszLang == NULL || pszLang[0] == 0 || (pszLang[0] == 'C' && pszLang[1] == 0))
    270         pszLang = "en_US";
    271     void *pHelpLangEntry = NULL;
    272     /* find language entry matching exactly pszLang */
    273     for (uint32_t i = 0; i < g_cHelpLangEntries; i++)
    274     {
    275         if (strcmp(g_apHelpLangEntries[i].pszLang, pszLang) == 0)
    276         {
    277             pHelpLangEntry = (void *)&g_apHelpLangEntries[i];
    278             break;
    279         }
    280     }
    281     /* find first entry containing language specified if pszLang contains only language */
    282     if (pHelpLangEntry == NULL)
    283     {
    284         size_t cbLang = strlen(pszLang);
    285         for (uint32_t i = 0; i < g_cHelpLangEntries; i++)
    286         {
    287             if (   cbLang < g_apHelpLangEntries[i].cbLang
    288                 && memcmp(g_apHelpLangEntries[i].pszLang, pszLang, cbLang) == 0)
    289             {
    290                 pHelpLangEntry = (void *)&g_apHelpLangEntries[i];
    291                 break;
    292             }
    293         }
    294     }
    295     /* set to en_US (i.e. untranslated) if not found */
    296     if (pHelpLangEntry == NULL)
    297         pHelpLangEntry = (void *)&g_apHelpLangEntries[0];
    298 
    299      ASMAtomicWritePtrVoid(&g_pHelpLangEntry, pHelpLangEntry);
    300 #endif
    301 }
    302 
    303 
    304265/**
    305266 * Looks up a command by name.
     
    543504
    544505#endif /* !VBOX_ONLY_DOCS */
     506
     507
     508static void setBuiltInHelpLanguage(const char *pszLang)
     509{
     510#ifdef VBOX_WITH_VBOXMANAGE_NLS
     511    if (pszLang == NULL || pszLang[0] == 0 || (pszLang[0] == 'C' && pszLang[1] == 0))
     512        pszLang = "en_US";
     513    void *pHelpLangEntry = NULL;
     514    /* find language entry matching exactly pszLang */
     515    for (uint32_t i = 0; i < g_cHelpLangEntries; i++)
     516    {
     517        if (strcmp(g_apHelpLangEntries[i].pszLang, pszLang) == 0)
     518        {
     519            pHelpLangEntry = (void *)&g_apHelpLangEntries[i];
     520            break;
     521        }
     522    }
     523    /* find first entry containing language specified if pszLang contains only language */
     524    if (pHelpLangEntry == NULL)
     525    {
     526        size_t cbLang = strlen(pszLang);
     527        for (uint32_t i = 0; i < g_cHelpLangEntries; i++)
     528        {
     529            if (   cbLang < g_apHelpLangEntries[i].cbLang
     530                && memcmp(g_apHelpLangEntries[i].pszLang, pszLang, cbLang) == 0)
     531            {
     532                pHelpLangEntry = (void *)&g_apHelpLangEntries[i];
     533                break;
     534            }
     535        }
     536    }
     537    /* set to en_US (i.e. untranslated) if not found */
     538    if (pHelpLangEntry == NULL)
     539        pHelpLangEntry = (void *)&g_apHelpLangEntries[0];
     540
     541     ASMAtomicWritePtrVoid(&g_pHelpLangEntry, pHelpLangEntry);
     542#else
     543    NOREF(pszLang);
     544#endif
     545}
    545546
    546547
Note: See TracChangeset for help on using the changeset viewer.

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