VirtualBox

Changeset 103000 in vbox


Ignore:
Timestamp:
Jan 23, 2024 3:58:08 PM (14 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
161232
Message:

iprt/bldprog-strtab-template.cpp.h: Fix comments to clang v15 doesn't barf on invalid UTF-8 source comments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/bldprog-strtab-template.cpp.h

    r98103 r103000  
    821821    size_t cWords = 0;
    822822    size_t iDict  = 0;
     823# ifdef BLDPROG_STRTAB_PURE_ASCII
    823824    for (size_t i = 0; i < RT_ELEMENTS(pThis->aCompDict); i++)
     825# else
     826    for (size_t i = 0; i < RT_ELEMENTS(pThis->aCompDict) - 1; i++)
     827# endif
    824828    {
    825829        char        szTmp[2] = { (char)i, '\0' };
     
    979983            bldProgStrTab_AddStringToHashTab(pThis, &pThis->aCompDict[i]);
    980984# ifdef RT_STRICT
    981         else if (pThis->aCompDict[i].cchString != 1)
     985        else if (   pThis->aCompDict[i].cchString != 1
     986#  ifndef BLDPROG_STRTAB_PURE_ASCII
     987                 && i != 0xff
     988#  endif
     989                )
    982990            abort();
    983991# endif
     
    11411149#endif
    11421150        {
     1151#ifdef BLDPROG_STRTAB_WITH_COMPRESSION
     1152            if (uch == 0xff)
     1153                abort();
     1154#endif
    11431155            if (uch != '\'' && uch != '\\')
    11441156                fputc((char)uch, pOut);
     
    11571169            fprintf(pOut, "\\u%04x", uc);
    11581170        }
    1159 # else
     1171# endif
    11601172        else
    11611173            fputs(pThis->aCompDict[uch].pszString, pOut);
    1162 # endif
    11631174#else
    11641175        else
     
    11941205    {
    11951206        if (BldProgBitIsSet(pThis->bmUsedChars, i)
    1196             ? pThis->aCompDict[i].cchString != 1 : pThis->aCompDict[i].cchString < 1)
     1207#  ifdef BLDPROG_STRTAB_PURE_ASCII
     1208            ? pThis->aCompDict[i].cchString != 1
     1209#  else
     1210            ? pThis->aCompDict[i].cchString != (i != 0xff ? 1 : 0)
     1211#  endif
     1212            : pThis->aCompDict[i].cchString < 1)
    11971213            abort();
    11981214        if (pThis->aCompDict[i].cchString > 1)
     
    12911307        else if (i == 0)
    12921308            fprintf(pOut, "    /*[%3u]=*/ { 0x000000, 0x00 }, // unused, because zero terminator\n", i);
    1293         else if (i < 0x20)
     1309        else if (i < 0x20 || i >= 0x7f)
    12941310            fprintf(pOut, "    /*[%3u]=*/ { 0x000000, 0x00 }, // %02x\n", i, i);
    12951311        else
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