Changeset 208 for Include/Classes


Ignore:
Timestamp:
Apr 7, 2007, 10:20:40 PM (17 years ago)
Author:
イグトランス (egtra)
Message:

[207]参照型変数のNothing初期化に対応する修正

Location:
Include/Classes/System
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Include/Classes/System/Environment.ab

    r173 r208  
    2121        Dim size = GetCurrentDirectory(0, 0)
    2222        Dim p = _System_malloc(SizeOf (TCHAR) * size) As PCTSTR
    23         GetCurrentDirectory(size, p)
    24         CurrentDirectory = p
    25         _System_free(p)
     23        Dim len = GetCurrentDirectory(size, p)
     24        If len < size Then
     25            CurrentDirectory = New String(p, size As Long)
     26            _System_free(p)
     27        End If
    2628    End Function
    2729
     
    7274            Dim size = GetSystemDirectory(0, 0)
    7375            Dim p = _System_malloc(SizeOf (TCHAR) * size)
    74             GetSystemDirectory(size, p)
    75             sysDir = p
     76            Dim len = GetSystemDirectory(size, p)
     77            sysDir = New String(p, len As Long)
    7678            _System_free(p)
    7779        End IF
     
    117119        Dim dst = _System_malloc(SizeOf (TCHAR) * size)
    118120        ExpandEnvironmentStrings(src, dst, size)
    119         ExpandEnvironmentVariables = dst
     121        ExpandEnvironmentVariables = New String(dst, size - 1)
    120122        _System_free(dst)
    121123    End Function
    122124
    123125    Static Sub FailFast(message As String)
    124         OutputDebugString(ToTCStr(message))
    125         ExitProcess(-1)
     126        FatalAppExit(0, ToTCStr(message))
    126127    End Sub
    127128
  • Include/Classes/System/Math.ab

    r162 r208  
    1717
    1818    Static Function Abs(value As Double) As Double
    19         If value<0 then
    20             return -value
    21         Else
    22             return value
    23         End If
     19        SetQWord(VarPtr(value), GetQWord(VarPtr(value)) And &h7fffffffffffffff)
    2420    End Function
    2521
    2622    Static Function Abs(value As Single) As Single
    27         If value<0 then
    28             return -value
    29         Else
    30             return value
    31         End If
     23        SetDWord(VarPtr(value), GetDWord(VarPtr(value)) And &h7fffffff)
    3224    End Function
    3325
     
    209201    'GetType
    210202
    211     Static Function IEEERemainder(value1 As Double,value2 As Double) As Double
     203    Static Function IEEERemainder(value1 As Double, value2 As Double) As Double
    212204        Dim q As Double
    213205        If value2=0 then return _System_GetNaN()
     
    616608Const _System_Atan_N = 20
    617609Const _System_UrTan_N = 17
    618 Const _System_D  = 4.4544551033807686783083602485579e-6
     610Const _System_D = 4.4544551033807686783083602485579e-6
    619611Const _System_HalfPI = (_System_PI * 0.5)
    620612Const _System_InverseHalfPI = (2 / _System_PI) '1 / (PI / 2)
  • Include/Classes/System/OperatingSystem.ab

    r175 r208  
    1 ' System/OperatingSystem.ab
     1' Classes/System/OperatingSystem.ab
    22
    3 #ifndef _SYSYTEM_OPERATINGSYSTEM_AB_
    4 #define _SYSYTEM_OPERATINGSYSTEM_AB_
     3#ifndef __SYSYTEM_OPERATINGSYSTEM_AB__
     4#define __SYSYTEM_OPERATINGSYSTEM_AB__
    55
    66#require <Classes/System/Version.ab>
     
    8383End Enum
    8484
    85 #endif '_SYSYTEM_OPERATINGSYSTEM_AB_
     85#endif '__SYSYTEM_OPERATINGSYSTEM_AB__
  • Include/Classes/System/Runtime/InteropServices/GCHandle.ab

    r203 r208  
    4646    End Function
    4747
    48     Function Operator = (y As GCHandle) As Boolean
     48    Function Operator == (y As GCHandle) As Boolean
    4949        Return Equals(y)
    5050    End Function
     
    5252    Function Operator <> (y As GCHandle) As Boolean
    5353        Return Not Equals(y)
     54    End Function
     55
     56    Override Function ToString() As String
     57        Return "System.Runtime.InteropServices.GCHandle"
    5458    End Function
    5559
Note: See TracChangeset for help on using the changeset viewer.