Ignore:
Timestamp:
Apr 10, 2007, 2:16:15 AM (18 years ago)
Author:
dai
Message:

空のソースコードによって生成された実行ファイルのバイナリサイズを300KBから100KBに落とした(Enum制御に関するコードジェネレータを改良)。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Include/system/enum.sbp

    r201 r210  
    11Class EnumBase
    22Protected
    3     m_Value As Long
     3    value As Long
     4    lpszName As LPSTR
    45Public
    5     Sub EnumBase(value As Long)
    6         m_Value=value
     6    Sub EnumBase(value As Long,lpszName As LPSTR)
     7        This.value = value
     8        This.lpszName = lpszName
    79    End Sub
    810   
     
    1012    End Sub
    1113
    12     'Abstract Function ToString() As String
     14    Override Function ToString() As String
     15        Return New String( lpszName )
     16    End Function
    1317
    14     Sub Copy(ByRef obj As EnumBase)
    15         m_Value=obj.m_Value
     18    Sub Copy(obj As EnumBase)
     19        This.value = obj.value
     20        This.lpszName = obj.lpszName
    1621    End Sub
    1722   
    1823    Function Operator() As Long
    19         Return m_Value
     24        Return This.value
    2025    End Function
    2126
    22     Function Operator == (Value As Long) As Boolean
    23         If m_Value = Value Then
     27    Function Operator == (value As Long) As Boolean
     28        If This.value = value Then
    2429            Return True
    2530        Else
     
    2833    End Function
    2934
    30     Function Operator or (ByRef value As EnumBase) As EnumBase
    31         Return New EnumBase(m_Value Or value.m_Value)
     35    Function Operator == (enumBase As EnumBase) As Boolean
     36        If This.value = enumBase.value Then
     37            Return True
     38        Else
     39            Return False
     40        End If
    3241    End Function
    3342
    34     Function Operator and (ByRef value As EnumBase) As EnumBase
    35         Return New EnumBase(m_Value And value.m_Value)
     43    Function Operator or (enumBase As EnumBase) As EnumBase
     44        Return New EnumBase(This.value Or enumBase.value)
    3645    End Function
    3746
    38     Function Operator not (ByRef value As EnumBase) As EnumBase
    39         Return New EnumBase(Not m_Value)
     47    Function Operator and (enumBase As EnumBase) As EnumBase
     48        Return New EnumBase(This.value And enumBase.value)
    4049    End Function
    4150
    42     Function Operator xor (ByRef value As EnumBase) As EnumBase
    43         Return New EnumBase(m_Value Xor value.m_Value)
     51    Function Operator xor (enumBase As EnumBase) As EnumBase
     52        Return New EnumBase(This.value Xor enumBase.value)
    4453    End Function
    4554End Class
Note: See TracChangeset for help on using the changeset viewer.