Changeset 285 for Include/Classes


Ignore:
Timestamp:
Jul 26, 2007, 5:43:54 PM (17 years ago)
Author:
イグトランス (egtra)
Message:

wtypes.abを追加

Location:
Include/Classes
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • Include/Classes/ActiveBasic/Math/Math.ab

    r276 r285  
    1313Function CopySign(x As Single, y As Single) As Single
    1414    SetDWord(VarPtr(CopySign), (GetDWord(VarPtr(x)) And &h7fffffff) Or (GetDWord(VarPtr(y)) And &h80000000))
     15End Function
     16
     17Function Hypot(x As Double, y As Double) As Double
     18    If x = 0 Then
     19        Hypot = Abs(y)
     20    Else If y = 0 Then
     21        Hypot = Abs(x)
     22    Else
     23        Dim ax = Abs(x)
     24        Dim ay = Abs(y)
     25        If ay > ax Then
     26            Dim t = x / y
     27            Hypot = ay * Sqr(1 + t * t)
     28        Else
     29            Dim t = y / x
     30            Hypot = ax * Sqr(1 + t * t)
     31        End If
     32    End If
    1533End Function
    1634
     
    3957
    4058Function IsInf(x As Double) As Boolean
    41     Dim p As *DWord, nan As Double
    42     p = VarPtr(x) As *DWord
     59    Dim p = VarPtr(x) As *DWord
    4360    p[1] And= &h7fffffff
    44     nan = ActiveBasic.Math.Detail.GetInf(False)
    45     IsInf = (memcmp(p As *Byte, VarPtr(nan), SizeOf (Double)) = 0)
     61    Dim inf = ActiveBasic.Math.Detail.GetInf(False)
     62    IsInf = (memcmp(p As *Byte, VarPtr(inf), SizeOf (Double)) = 0)
    4663End Function
    4764
    4865Function IsFinite(x As Double) As Boolean
    49     Dim p As *DWord, nan As Double
    50     p = VarPtr(x) As *DWord
    51 '   p[1] And= &h7ffe0000
     66    Dim p = VarPtr(x) As *DWord
    5267    p[1] And= &H7FF00000
    53     p[0] = 0
    54     nan = ActiveBasic.Math.Detail.GetInf(/*x,*/ False)
    55     IsFinite = (memcmp(p As BytePtr, VarPtr(nan), SizeOf (Double)) = 0)
     68    IsFinite = p[1] And &H7FF00000 = &H7FF00000
    5669End Function
    5770
     
    8295
    8396Function GetNaN() As Double
    84     Dim p As *DWord
    85     p = VarPtr(GetNaN) As *DWord
     97    Dim p = VarPtr(GetNaN) As *DWord
    8698    p[0] = 0
    8799    p[1] = &H7FF80000
     
    104116    While i >= 1
    105117        Dim t = (i * x) As Double
    106         s = t / (2 + t / (2 * i + 1 + s))
     118        s = t * (2 * i + 1 + s) / (2 + t)
    107119        i--
    108120    Wend
     
    111123
    112124Function _Support_tan(x As Double, ByRef k As Long) As Double
    113     Dim i As Long
    114     Dim t As Double, x2 As Double
    115 
    116125    If x>=0 Then
    117126        k=Fix(x/(_System_PI/2)+0.5)
     
    122131    x=(x-(CDbl(3217)/CDbl(2048))*k)+4.4544551033807686783083602485579e-6*k
    123132
    124     x2=x*x
    125     t=0
     133    Dim x2 = x * x
     134    Dim t = 0 As Double
    126135
     136    Dim i As Long
    127137    For i=19 To 3 Step -2
    128138        t=x2/(i-t)
  • Include/Classes/System/IO/DirectoryInfo.ab

    r271 r285  
    4545
    4646            ' 終端の '\' を除去
    47             If dirPath[dirPath.Length-1] = Asc("\\") Then
    48                 dirPath = dirPath.SubString(0, dirPath.Length-1)
     47            If dirPath[dirPath.Length-1] = Asc("\") Then
     48                dirPath = dirPath.Substring(0, dirPath.Length-1)
    4949            End If
    5050
     
    5555            op.hwnd = NULL
    5656            op.wFunc = FO_DELETE
    57             op.pFrom = dirPath.Chars
     57            op.pFrom = ToTCStr(dirPath)
    5858            op.pTo = NULL
    5959            op.fFlags = FOF_NOCONFIRMATION or FOF_NOERRORUI or FOF_SILENT
  • Include/Classes/System/IO/DriveInfo.ab

    r271 r285  
    4040    Function DriveFormat() As String
    4141        Dim systemName[15] As TCHAR
    42         If GetVolumeInformation(m_DriveName, NULL, NULL, NULL, NULL, NULL, systemName, Len (systemName)) Then
     42        If GetVolumeInformation(m_DriveName, NULL, 0, NULL, NULL, NULL, systemName, Len (systemName)) Then
    4343            Return systemName
    4444        Else
     
    5252
    5353    Function IsReady() As Boolean
    54         If GetVolumeInformation(m_DriveName, NULL, NULL, NULL, NULL, NULL, NULL, NULL) Then
     54        If GetVolumeInformation(m_DriveName, NULL, 0, NULL, NULL, NULL, NULL, 0) Then
    5555            Return True
    5656        Else
  • Include/Classes/System/IO/Path.ab

    r281 r285  
    7272
    7373        Dim tempFileName[ELM(MAX_PATH)] As TCHAR
    74         __GetTempFileName(tempPath, "ABT", 0, tempFileName)
    75         free(tempPath)
    76         Return tempFileName
     74        Dim len = __GetTempFileName(tempPath, "ABT", 0, tempFileName)
     75        _System_free(tempPath)
     76        Return New String(tempFileName, len As Long)
    7777    End Function
    7878
  • Include/Classes/System/Math.ab

    r268 r285  
    172172            End If
    173173        End If
    174         Dim i As Long, k As Long
    175         Dim x2 As Double, w As Double
    176 
     174        Dim k As Long
    177175        If x >= 0 Then
    178176            k = Fix(x / _System_LOG2 + 0.5)
     
    183181        x -= k * _System_LOG2
    184182
    185         x2 = x * x
    186         w = x2 / 22
    187 
    188         i = 18
     183        Dim x2 = x * x
     184        Dim w = x2 / 22
     185
     186        Dim i = 18
    189187        While i >= 6
    190188            w = x2 / (w + i)
  • Include/Classes/System/String.ab

    r272 r285  
    506506            Clone = This
    507507        End Function
     508
    508509        Static Function Copy(s As String) As String
    509510            Copy = New String(s.Chars, s.m_Length)
     
    520521            Dim size = m_Length
    521522#endif
    522             Return _System_GetHashFromWordArray(Chars As *Word, size)
     523            Return _System_GetHashFromWordArray(Chars As *Word, size) Xor size
    523524        End Function
    524525
     
    541542
    542543        Function PadRight(total As Long) As String
    543             PadLeft(total, &h30 As StrChar)
     544            PadRight(total, &h30 As StrChar)
    544545        End Function
    545546
  • Include/Classes/System/Windows/Forms/Control.ab

    r282 r285  
    309309        ' EndInvokeがDeleteする
    310310        Dim asyncResult = New System.Windows.Forms.Detail.AsyncResultForInvoke(CreateEvent(0, FALSE, FALSE, 0))
    311         ' OnControlBeginInvokeがDeleteする
    312311        Dim asyncInvokeData = New System.Windows.Forms.Detail.AsyncInvokeData
    313312        With asyncInvokeData
Note: See TracChangeset for help on using the changeset viewer.