VirtualBox

Changeset 85305 in vbox for trunk/src/VBox/Main/idl


Ignore:
Timestamp:
Jul 13, 2020 10:25:50 AM (4 years ago)
Author:
vboxsync
Message:

Main/comimpl.xsl,++: Make trivial internal setters return void rather than HRESULT/S_OK. bugref:9790

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/comimpl.xsl

    r85300 r85305  
    202202  <xsl:param name="type"/>
    203203  <xsl:param name="safearray"/>
     204  <xsl:param name="internal"/>
    204205
    205206  <xsl:choose>
     
    220221    <xsl:otherwise>
    221222      <xsl:value-of select="concat('         ', $member, ' = ', $param, ';&#10;')"/>
    222       <xsl:value-of select="       '         return S_OK;&#10;'" />
     223      <xsl:if test="$internal!='yes'">
     224        <xsl:text>         return S_OK;&#10;</xsl:text>
     225      </xsl:if>
    223226    </xsl:otherwise>
    224227  </xsl:choose>
     
    507510        <xsl:with-param name="param" select="$pName" />
    508511        <xsl:with-param name="safearray" select="@safearray" />
     512        <xsl:with-param name="internal" select="'no'" />
    509513      </xsl:call-template>
    510514      <xsl:value-of select="       '    }&#10;'" />
     
    512516
    513517    <xsl:value-of select="       '    // purely internal setter&#10;'" />
    514     <xsl:value-of select="concat('    inline HRESULT set_', @name,'(',$pTypeNameIn, ')&#10;    {&#10;')" />
     518    <xsl:text>    inline </xsl:text>
     519    <xsl:choose>
     520      <xsl:when test="(@safearray='yes') or (@type='wstring') or (@type = 'uuid')">
     521        <xsl:text>HRESULT</xsl:text>
     522      </xsl:when>
     523      <xsl:otherwise>
     524        <xsl:text>void</xsl:text>
     525      </xsl:otherwise>
     526    </xsl:choose>
     527    <xsl:value-of select="concat(' set_', @name,'(',$pTypeNameIn, ')&#10;    {&#10;')" />
    515528    <xsl:call-template name="genSetParam">
    516529      <xsl:with-param name="type" select="@type" />
     
    518531      <xsl:with-param name="param" select="$pName" />
    519532      <xsl:with-param name="safearray" select="@safearray" />
     533      <xsl:with-param name="internal" select="'yes'" />
    520534    </xsl:call-template>
    521535    <xsl:value-of select="       '    }&#10;'" />
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