VirtualBox

Changeset 75461 in vbox


Ignore:
Timestamp:
Nov 14, 2018 7:51:23 PM (6 years ago)
Author:
vboxsync
Message:

os2/VBoxSF: warnings / gcc.

Location:
trunk/src/VBox/Additions/os2/VBoxSF
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/os2/VBoxSF/Makefile.kmk

    r75337 r75461  
    210210#
    211211PROGRAMS += VBoxSFUtil
     212ifdef VBOX_USE_WATCOM_FOR_OS2
    212213VBoxSFUtil_TEMPLATE = DUMMY
    213214VBoxSFUtil_TOOL     = OPENWATCOM
     
    216217VBoxSFUtil_INCS     = $(PATH_TOOL_OPENWATCOM)/h/os2
    217218VBoxSFUtil_LDFLAGS  = -bcl=os2v2
     219else
     220VBoxSFUtil_TEMPLATE = VBoxGuestR3Exe
     221endif
    218222VBoxSFUtil_SOURCES  = \
    219223        VBoxSFUtil.cpp \
  • trunk/src/VBox/Additions/os2/VBoxSF/VBoxSF.cpp

    r75405 r75461  
    880880            if (cRefs)
    881881            {
    882                 /* If there are no zero drives, unlink it from the list and release
     882                /* If there are now zero drives, unlink it from the list and release
    883883                   the list reference.  This should almost always drop end up with us
    884884                   destroying the folder.*/
     
    897897                vboxSfOs2DestroyFolder(pFolder);
    898898            }
     899            rc = NO_ERROR;
    899900        }
    900901        else
     
    11361137            else
    11371138            {
    1138                 LogRel(("FS32_FSINFO: VbglR0SfFsInfo/SHFL_INFO_VOLUME failed: %Rrc\n", rc));
     1139                LogRel(("FS32_FSINFO: VbglR0SfFsInfo/SHFL_INFO_VOLUME failed: %Rrc\n", vrc));
    11391140                rc = ERROR_GEN_FAILURE;
    11401141            }
     
    14591460        if (RT_SUCCESS(vrc))
    14601461            rc = NO_ERROR;
    1461         else if (rc == VERR_FILE_NOT_FOUND)
     1462        else if (vrc == VERR_FILE_NOT_FOUND)
    14621463            rc = vboxSfOs2ConvertStatusToOs2(vrc, ERROR_ACCESS_DENIED);
    14631464
     
    17581759                pbSrc++;
    17591760                cbGetEasLeft--;
    1760                 if (cbName + 1 > cbGetEasLeft)
     1761                if (cbName + 1U > cbGetEasLeft)
    17611762                {
    17621763                    cbDstList = pbSrc - 1 - (uint8_t *)pEaOp->fpGEAList;
     
    20062007        }
    20072008        else
    2008             rc = vboxSfOs2ConvertStatusToOs2(rc, ERROR_FILE_NOT_FOUND);
     2009            rc = vboxSfOs2ConvertStatusToOs2(vrc, ERROR_FILE_NOT_FOUND);
    20092010        VbglR0PhysHeapFree(pParams);
    20102011    }
  • trunk/src/VBox/Additions/os2/VBoxSF/VBoxSFFile.cpp

    r75337 r75461  
    212212            }
    213213        }
    214         else if (rc == VERR_ALREADY_EXISTS)
     214        else if (vrc == VERR_ALREADY_EXISTS)
    215215            rc = ERROR_ACCESS_DENIED;
    216216        else
     
    748748                    *pcb = cbActual;
    749749                    pSfFsi->sfi_positionl = offRead + cbActual;
    750                     if (pSfFsi->sfi_sizel < offRead + cbActual)
     750                    if ((uint64_t)pSfFsi->sfi_sizel < offRead + cbActual)
    751751                        pSfFsi->sfi_sizel = offRead + cbActual;
    752752                    pSfFsi->sfi_tstamp   |= ST_SREAD | ST_PREAD;
     
    774774        *pcb = cbActual;
    775775        pSfFsi->sfi_positionl = offRead + cbActual;
    776         if (pSfFsi->sfi_sizel < offRead + cbActual)
     776        if ((uint64_t)pSfFsi->sfi_sizel < offRead + cbActual)
    777777            pSfFsi->sfi_sizel = offRead + cbActual;
    778778        pSfFsi->sfi_tstamp   |= ST_SREAD | ST_PREAD;
     
    822822                    *pcb = cbActual;
    823823                    pSfFsi->sfi_positionl = offWrite + cbActual;
    824                     if (pSfFsi->sfi_sizel < offWrite + cbActual)
     824                    if ((uint64_t)pSfFsi->sfi_sizel < offWrite + cbActual)
    825825                        pSfFsi->sfi_sizel = offWrite + cbActual;
    826826                    pSfFsi->sfi_tstamp   |= ST_SWRITE | ST_PWRITE;
     
    848848        *pcb = cbActual;
    849849        pSfFsi->sfi_positionl = offWrite + cbActual;
    850         if (pSfFsi->sfi_sizel < offWrite + cbActual)
     850        if ((uint64_t)pSfFsi->sfi_sizel < offWrite + cbActual)
    851851            pSfFsi->sfi_sizel = offWrite + cbActual;
    852852        pSfFsi->sfi_tstamp   |= ST_SWRITE | ST_PWRITE;
  • trunk/src/VBox/Additions/os2/VBoxSF/VBoxSFFind.cpp

    r75338 r75461  
    7474        if (uCp == '.')
    7575        {
    76             for (uint32_t cuc = 0; ; cuc++)
    77             {
    78                 RTUNICP uCp;
     76            for (cuc = 0; ; cuc++)
     77            {
    7978                RTStrGetCpEx(&pszCursor, &uCp);
    8079                if (!uCp)
     
    237236     */
    238237    EAOP    EaOp;
    239     PEAOP   pEaOpUser;
     238    PEAOP   pEaOpUser = NULL; /* Shut up gcc */
    240239    switch (uLevel)
    241240    {
  • trunk/src/VBox/Additions/os2/VBoxSF/VBoxSFUtil.cpp

    r75337 r75461  
    3838#include <stdlib.h>
    3939#define INCL_BASE
     40#define OS2EMX_PLAIN_CHAR
    4041#include <os2.h>
    4142
     
    7980    else
    8081    {
    81         fprintf(stderr, "syntax error: Shared folder name '%s' is too %s!\n", cchFolder >= 1 ? "long" : "short");
     82        fprintf(stderr, "syntax error: Shared folder name '%s' is too %s!\n", pszFolder, cchFolder >= 1 ? "long" : "short");
    8283        return 2;
    8384    }
     
    9293        return 0;
    9394    }
    94     fprintf(stderr, "error: DosFSAttach failed: %u\n", rc);
     95    fprintf(stderr, "error: DosFSAttach failed: %lu\n", rc);
    9596    return 1;
    9697}
     
    123124        rc = DosQueryPathInfo(argv[i], FIL_STANDARD, &u.Lvl1r1, sizeof(u.Lvl1r1));
    124125        printf("%s: FIL_STANDARD/%#x -> %u\n", argv[i], sizeof(u.Lvl1r1), rc);
     126#define D(x) (*(uint16_t *)&(x))
     127#define T(x) (*(uint16_t *)&(x))
    125128        if (rc == NO_ERROR)
    126129        {
    127130            printf("  Lvl1r1: creation=%u:%u write=%u:%u access=%u:%u\n",
    128                    u.Lvl1r1.fdateCreation, u.Lvl1r1.ftimeCreation,  u.Lvl1r1.fdateLastWrite, u.Lvl1r1.ftimeLastWrite,
    129                    u.Lvl1r1.fdateLastAccess, u.Lvl1r1.ftimeLastAccess);
    130             printf("  Lvl1r1:  attrib=%#x size=%u alloc=%u\n", u.Lvl1r1.attrFile, u.Lvl1r1.cbFile, u.Lvl1r1.cbFileAlloc);
     131                   D(u.Lvl1r1.fdateCreation), T(u.Lvl1r1.ftimeCreation),  D(u.Lvl1r1.fdateLastWrite), T(u.Lvl1r1.ftimeLastWrite),
     132                   D(u.Lvl1r1.fdateLastAccess), T(u.Lvl1r1.ftimeLastAccess));
     133            printf("  Lvl1r1:  attrib=%#x size=%lu alloc=%lu\n", u.Lvl1r1.attrFile, u.Lvl1r1.cbFile, u.Lvl1r1.cbFileAlloc);
    131134
    132135        }
     
    138141        {
    139142            printf("  Lvl1r3: creation=%u:%u write=%u:%u access=%u:%u\n",
    140                    u.Lvl1r3.fdateCreation, u.Lvl1r3.ftimeCreation,  u.Lvl1r3.fdateLastWrite, u.Lvl1r3.ftimeLastWrite,
    141                    u.Lvl1r3.fdateLastAccess, u.Lvl1r3.ftimeLastAccess);
    142             printf("  Lvl1r3:  attrib=%#x size=%u alloc=%u\n", u.Lvl1r3.attrFile, u.Lvl1r3.cbFile, u.Lvl1r3.cbFileAlloc);
     143                   D(u.Lvl1r3.fdateCreation), T(u.Lvl1r3.ftimeCreation), D(u.Lvl1r3.fdateLastWrite), T(u.Lvl1r3.ftimeLastWrite),
     144                   D(u.Lvl1r3.fdateLastAccess), T(u.Lvl1r3.ftimeLastAccess));
     145            printf("  Lvl1r3:  attrib=%#lx size=%lu alloc=%lu\n", u.Lvl1r3.attrFile, u.Lvl1r3.cbFile, u.Lvl1r3.cbFileAlloc);
    143146
    144147        }
     
    150153        {
    151154            printf("   Lvl11: creation=%u:%u write=%u:%u access=%u:%u\n",
    152                    u.Lvl11.fdateCreation, u.Lvl11.ftimeCreation,  u.Lvl11.fdateLastWrite, u.Lvl11.ftimeLastWrite,
    153                    u.Lvl11.fdateLastAccess, u.Lvl11.ftimeLastAccess);
    154             printf("   Lvl11:  attrib=%#x size=%llu alloc=%llu\n", u.Lvl11.attrFile, u.Lvl11.cbFile, u.Lvl11.cbFileAlloc);
     155                   D(u.Lvl11.fdateCreation), T(u.Lvl11.ftimeCreation), D(u.Lvl11.fdateLastWrite), T(u.Lvl11.ftimeLastWrite),
     156                   D(u.Lvl11.fdateLastAccess), T(u.Lvl11.ftimeLastAccess));
     157            printf("   Lvl11:  attrib=%#lx size=%llu alloc=%llu\n", u.Lvl11.attrFile, u.Lvl11.cbFile, u.Lvl11.cbFileAlloc);
    155158        }
    156159
     
    161164        {
    162165            printf("    Lvl2: creation=%u:%u write=%u:%u access=%u:%u\n",
    163                    u.Lvl2r2.fdateCreation, u.Lvl2r2.ftimeCreation,  u.Lvl2r2.fdateLastWrite, u.Lvl2r2.ftimeLastWrite,
    164                    u.Lvl2r2.fdateLastAccess, u.Lvl2r2.ftimeLastAccess);
    165             printf("    Lvl2:  attrib=%#x size=%u alloc=%u cbList=%#x\n",
     166                   D(u.Lvl2r2.fdateCreation), T(u.Lvl2r2.ftimeCreation),  D(u.Lvl2r2.fdateLastWrite), T(u.Lvl2r2.ftimeLastWrite),
     167                   D(u.Lvl2r2.fdateLastAccess), T(u.Lvl2r2.ftimeLastAccess));
     168            printf("    Lvl2:  attrib=%#x size=%lu alloc=%lu cbList=%#lx\n",
    166169                   u.Lvl2r2.attrFile, u.Lvl2r2.cbFile, u.Lvl2r2.cbFileAlloc, u.Lvl2r4.cbList);
    167170        }
     
    173176        {
    174177            printf("    Lvl2: creation=%u:%u write=%u:%u access=%u:%u\n",
    175                    u.Lvl2r4.fdateCreation, u.Lvl2r4.ftimeCreation,  u.Lvl2r4.fdateLastWrite, u.Lvl2r4.ftimeLastWrite,
    176                    u.Lvl2r4.fdateLastAccess, u.Lvl2r4.ftimeLastAccess);
    177             printf("    Lvl2:  attrib=%#x size=%u alloc=%u cbList=%#x\n",
     178                   D(u.Lvl2r4.fdateCreation), T(u.Lvl2r4.ftimeCreation),  D(u.Lvl2r4.fdateLastWrite), T(u.Lvl2r4.ftimeLastWrite),
     179                   D(u.Lvl2r4.fdateLastAccess), T(u.Lvl2r4.ftimeLastAccess));
     180            printf("    Lvl2:  attrib=%#lx size=%lu alloc=%lu cbList=%#lx\n",
    178181                   u.Lvl2r4.attrFile, u.Lvl2r4.cbFile, u.Lvl2r4.cbFileAlloc, u.Lvl2r4.cbList);
    179182        }
     
    185188        {
    186189            printf("   Lvl12: creation=%u:%u write=%u:%u access=%u:%u\n",
    187                    u.Lvl12.fdateCreation, u.Lvl12.ftimeCreation,  u.Lvl12.fdateLastWrite, u.Lvl12.ftimeLastWrite,
    188                    u.Lvl12.fdateLastAccess, u.Lvl12.ftimeLastAccess);
    189             printf("   Lvl12:  attrib=%#x size=%llu alloc=%llu cbList=%#x\n",
     190                   D(u.Lvl12.fdateCreation), T(u.Lvl12.ftimeCreation),  D(u.Lvl12.fdateLastWrite), T(u.Lvl12.ftimeLastWrite),
     191                   D(u.Lvl12.fdateLastAccess), T(u.Lvl12.ftimeLastAccess));
     192            printf("   Lvl12:  attrib=%#lx size=%llu alloc=%llu cbList=%#lx\n",
    190193                   u.Lvl12.attrFile, u.Lvl12.cbFile, u.Lvl12.cbFileAlloc, u.Lvl12.cbList);
    191194        }
     
    237240            BYTE  cchName;
    238241            char  szName[10];
    239         } Gea2List, const Gea2ListOrg = { sizeof(Gea2List), 0, sizeof(".LONGNAME") - 1, ".LONGNAME" };
     242        } Gea2List, Gea2ListOrg = { sizeof(Gea2List), 0, sizeof(".LONGNAME") - 1, ".LONGNAME" };
    240243        EAOP2 EaOp;
    241244        EaOp.fpGEA2List = (PGEA2LIST)memcpy(&Gea2List, &Gea2ListOrg, sizeof(Gea2List));
     
    247250        printf("%s: FIL_QUERYEASFROMLIST -> %u\n", argv[i], rc);
    248251        if (rc == NO_ERROR)
    249             printf("  Lvl3: FeaList.cbList=%#x oError=%#x\n", u.FeaList.cbList, EaOp.oError);
     252            printf("  Lvl3: FeaList.cbList=%#lx oError=%#lx\n", u.FeaList.cbList, EaOp.oError);
    250253
    251254        EaOp.fpGEA2List = (PGEA2LIST)memcpy(&Gea2List, &Gea2ListOrg, sizeof(Gea2List));
     
    266269        printf("%s: FIL_QUERYALLEAS/4 -> %u\n", argv[i], rc);
    267270        if (rc == NO_ERROR)
    268             printf("  Lvl4: FeaList.cbList=%#x oError=%#x\n", u.FeaList.cbList, EaOp.oError);
     271            printf("  Lvl4: FeaList.cbList=%#lx oError=%#lx\n", u.FeaList.cbList, EaOp.oError);
    269272
    270273        EaOp.fpGEA2List = (PGEA2LIST)memcpy(&Gea2List, &Gea2ListOrg, sizeof(Gea2List));
     
    285288        printf("%s: FIL_QUERYALLEAS/8 -> %u\n", argv[i], rc);
    286289        if (rc == NO_ERROR)
    287             printf("  Lvl8: FeaList.cbList=%#x oError=%#x\n", u.FeaList.cbList, EaOp.oError);
     290            printf("  Lvl8: FeaList.cbList=%#lx oError=%#lx\n", u.FeaList.cbList, EaOp.oError);
    288291
    289292        EaOp.fpGEA2List = (PGEA2LIST)memcpy(&Gea2List, &Gea2ListOrg, sizeof(Gea2List));
     
    420423            memset(pbBuf, 0xf6, cbBuf);
    421424            APIRET rc = DosFindFirst(pszArg, &hDir, fAttribs, pbBuf, cbBuf, &cMatches, uLevel);
    422             printf("DosFindFirst -> %u hDir=%p cMatches=%#x\n", rc, hDir, cMatches);
     425            printf("DosFindFirst -> %lu hDir=%#lx cMatches=%#lx\n", rc, hDir, cMatches);
    423426            if (rc == NO_ERROR)
    424427            {
     
    434437                            {
    435438                                PFILEFINDBUF3 pBuf = (PFILEFINDBUF3)pbTmp;
    436                                 printf("#%u: nx=%#x sz=%#x at=%#x nm=%#x:%s\n",
     439                                printf("#%u: nx=%#lx sz=%#lx at=%#lx nm=%#x:%s\n",
    437440                                       iMatch, pBuf->oNextEntryOffset, pBuf->cbFile, pBuf->attrFile, pBuf->cchName, pBuf->achName);
    438441                                if (strlen(pBuf->achName) != pBuf->cchName)
     
    443446                            {
    444447                                PFILEFINDBUF3L pBuf = (PFILEFINDBUF3L)pbTmp;
    445                                 printf("#%u: nx=%#x sz=%#llx at=%#x nm=%#x:%s\n",
     448                                printf("#%u: nx=%#lx sz=%#llx at=%#lx nm=%#x:%s\n",
    446449                                       iMatch, pBuf->oNextEntryOffset, pBuf->cbFile, pBuf->attrFile, pBuf->cchName, pBuf->achName);
    447450                                if (strlen(pBuf->achName) != pBuf->cchName)
     
    452455                            {
    453456                                PFILEFINDBUF4 pBuf = (PFILEFINDBUF4)pbTmp;
    454                                 printf("#%u: nx=%#x sz=%#x at=%#x nm=%#x:%s\n",
     457                                printf("#%u: nx=%#lx sz=%#lx at=%#lx nm=%#x:%s\n",
    455458                                       iMatch, pBuf->oNextEntryOffset, pBuf->cbFile, pBuf->attrFile, pBuf->cchName, pBuf->achName);
    456459                                if (strlen(pBuf->achName) != pBuf->cchName)
     
    461464                            {
    462465                                PFILEFINDBUF4L pBuf = (PFILEFINDBUF4L)pbTmp;
    463                                 printf("#%u: nx=%#x sz=%#llx at=%#x nm=%#x:%s\n",
     466                                printf("#%u: nx=%#lx sz=%#llx at=%#lx nm=%#x:%s\n",
    464467                                       iMatch, pBuf->oNextEntryOffset, pBuf->cbFile, pBuf->attrFile, pBuf->cchName, pBuf->achName);
    465468                                if (strlen(pBuf->achName) != pBuf->cchName)
     
    477480                    cMatches = cMaxMatches;
    478481                    rc = DosFindNext(hDir, pbBuf, cbBuf, &cMatches);
    479                     printf("DosFindNext -> %u hDir=%p cMatches=%#x\n", rc, hDir, cMatches);
     482                    printf("DosFindNext -> %lu hDir=%#lx cMatches=%#lx\n", rc, hDir, cMatches);
    480483                } while (rc == NO_ERROR);
    481484
    482485                rc = DosFindClose(hDir);
    483                 printf("DosFindClose -> %u\n", rc);
     486                printf("DosFindClose -> %lu\n", rc);
    484487            }
    485488        }
     
    494497    {
    495498        APIRET rc = DosCreateDir(argv[i], NULL);
    496         printf("DosCreateDir -> %u for '%s'\n", rc, argv[i]);
     499        printf("DosCreateDir -> %lu for '%s'\n", rc, argv[i]);
    497500    }
    498501    return 0;
     
    517520            return vboxSfOs2UtilMkDir(argc - i, argv + i);
    518521
    519         fprintf(stderr,  "Unknown command/option: %u\n", pszArg);
     522        fprintf(stderr,  "Unknown command/option: %s\n", pszArg);
    520523        return 2;
    521524    }
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