VirtualBox

Changeset 7201 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 28, 2008 3:33:44 PM (17 years ago)
Author:
vboxsync
Message:

Runtime/Common: strformattype.cpp has to be compilable by a C compiler too, as it is built as part of the Guest Additions kernel module on Linux guests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/string/strformattype.cpp

    r7183 r7201  
    112112    if (RT_UNLIKELY(!ASMAtomicCmpXchgS32(&g_i32Spinlock, -RTSTRFORMATTYPE_LOCK_OFFSET, 0)))
    113113    {
     114        unsigned volatile i;
    114115        AssertFailed();
    115         for (unsigned volatile i = 0;; i++)
     116        for (i = 0;; i++)
    116117            if (    !g_i32Spinlock
    117118                &&  ASMAtomicCmpXchgS32(&g_i32Spinlock, -RTSTRFORMATTYPE_LOCK_OFFSET, 0))
     
    144145    if (RT_UNLIKELY(ASMAtomicIncS32(&g_i32Spinlock) < 0))
    145146    {
     147        unsigned volatile i;
    146148        AssertFailed();
    147         for (unsigned volatile i = 0;; i++)
     149        for (i = 0;; i++)
    148150            if (ASMAtomicUoReadS32(&g_i32Spinlock) > 0)
    149151                break;
     
    242244RTDECL(int) RTStrFormatTypeRegister(const char *pszType, PFNRTSTRFORMATTYPE pfnHandler, void *pvUser)
    243245{
     246    size_t cchType;
     247    int rc;
     248    uint32_t cTypes;
    244249    /*
    245250     * Validate input.
     
    247252    AssertPtr(pfnHandler);
    248253    AssertPtr(pszType);
    249     const size_t cchType = strlen(pszType);
     254    cchType = strlen(pszType);
    250255    AssertReturn(cchType < RT_SIZEOFMEMB(RTSTRDYNFMT, szType), VERR_INVALID_PARAMETER);
    251256
     
    256261
    257262    /* check that there are empty slots. */
    258     int rc;
    259     uint32_t const cTypes = g_cTypes;
     263    cTypes = g_cTypes;
    260264    if (cTypes < RT_ELEMENTS(g_aTypes))
    261265    {
     
    318322RTDECL(int) RTStrFormatTypeDeregister(const char *pszType)
    319323{
     324    uint32_t i;
    320325    /*
    321326     * Validate input.
     
    327332     */
    328333    rtstrFormatTypeWriteLock();
    329     int32_t i = rtstrFormatTypeLookup(pszType, strlen(pszType));
     334    i = rtstrFormatTypeLookup(pszType, strlen(pszType));
    330335    if (i >= 0)
    331336    {
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