Changeset 497 for trunk/Include/basic


Ignore:
Timestamp:
Mar 28, 2008, 5:43:34 PM (17 years ago)
Author:
イグトランス (egtra)
Message:

インクルードガードとその他不要な前処理定義などの削除

Location:
trunk/Include/basic
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Include/basic/command.sbp

    r478 r497  
    11'command.sbp
    2 
    3 
    4 #ifndef _INC_COMMAND
    5 #define _INC_COMMAND
    62
    73Const _System_Type_SByte = 1
     
    152148Sub INPUT_FromFile(FileNumber As Long)
    153149    FileNumber--
    154    
     150
    155151    Dim i = 0 As Long
    156152    Dim buffer = New System.Text.StringBuilder(256)
    157     Dim temp[1] As StrChar
     153    Dim temp[1] As Char
    158154    Dim dwAccessBytes As DWord
    159155    Dim IsStr As Long
     
    162158        '次のデータをサーチ
    163159        Do
    164             Dim ret = ReadFile(_System_hFile[FileNumber],temp,SizeOf (StrChar),VarPtr(dwAccessBytes),ByVal 0)
     160            Dim ret = ReadFile(_System_hFile[FileNumber],temp,SizeOf (Char),VarPtr(dwAccessBytes),ByVal 0)
    165161            If ret=0 or dwAccessBytes=0 Then
    166162                'error
     
    173169        IsStr=0
    174170        While 1
    175             Dim ret = ReadFile(_System_hFile[FileNumber],temp,SizeOf (StrChar),VarPtr(dwAccessBytes),ByVal 0)
     171            Dim ret = ReadFile(_System_hFile[FileNumber],temp,SizeOf (Char),VarPtr(dwAccessBytes),ByVal 0)
    176172            If ret = 0 or dwAccessBytes = 0 Then
    177173                'error
     
    183179            If dwAccessBytes=0 or temp[0]=0 or temp[0]=13 or temp[0]=10 or (IsStr=0 and temp[0]=Asc(",")) or (IsStr=0 and (temp[0]=32 or temp[0]=9) and _System_InputDataType[i]<>_System_Type_String) Then
    184180                If temp[0]=13 Then
    185                     ReadFile(_System_hFile[FileNumber],temp,SizeOf (StrChar),VarPtr(dwAccessBytes),ByVal 0)
     181                    ReadFile(_System_hFile[FileNumber],temp,SizeOf (Char),VarPtr(dwAccessBytes),ByVal 0)
    186182                    If Not(dwAccessBytes<>0 And temp[0]=10) Then
    187183                        SetFilePointer(_System_hFile[FileNumber],-1,0,FILE_CURRENT)
     
    202198                End If
    203199
    204                 buffer.Append(0 As StrChar)
     200                buffer.Append(0 As Char)
    205201                Exit While
    206202            End If
     
    252248Function _System_GetUsingFormat(UsingStr As String) As String
    253249    Dim i2 As Long, i3 As Long, i4 As Long, i5 As Long, ParmNum As Long
    254     Dim temporary[255] As StrChar
     250    Dim temporary[255] As Char
    255251    Dim buffer = New System.Text.StringBuilder(1024)
    256252
     
    270266        If UsingStr[i2]=Asc("#") Then
    271267            Dim dec As Long, sign As Long
    272             Dim temp2 As *StrChar
     268            Dim temp2 As *Char
    273269
    274270            Dim length_num As Long, length_buf As Long
     
    325321
    326322                If dec > 0 Then
    327                     memcpy(VarPtr(buffer.Chars[i3]), temp2, SizeOf (StrChar) * length_num)
     323                    memcpy(VarPtr(buffer.Chars[i3]), temp2, SizeOf (Char) * length_num)
    328324                Else
    329325                    buffer[i3] = &H30
     
    376372                    ActiveBasic.Strings.Detail.ChrFill(VarPtr(buffer.Chars[i3]), i4, &h20) 'Asc(" ")
    377373                End If
    378                 memcpy(VarPtr(buffer.Chars[i3]), _System_UsingStrData[ParmNum], SizeOf (StrChar) * i5)
     374                memcpy(VarPtr(buffer.Chars[i3]), _System_UsingStrData[ParmNum], SizeOf (Char) * i5)
    379375                i3 += i4
    380376            Else
     
    416412    RecodeNumber--
    417413
    418     SetFilePointer(_System_hFile(FileNumber), SizeOf (StrChar) * RecodeNumber * _System_FieldSize(FileNumber), 0, FILE_BEGIN)
     414    SetFilePointer(_System_hFile(FileNumber), SizeOf (Char) * RecodeNumber * _System_FieldSize(FileNumber), 0, FILE_BEGIN)
    419415    Dim t = ZeroString(_System_FieldSize(FileNumber))
    420     ReadFile(_System_hFile(FileNumber), StrPtr(t), SizeOf (StrChar) * _System_FieldSize(FileNumber), VarPtr(dwAccessByte), ByVal 0)
     416    ReadFile(_System_hFile(FileNumber), StrPtr(t), SizeOf (Char) * _System_FieldSize(FileNumber), VarPtr(dwAccessByte), ByVal 0)
    421417    If dwAccessByte = _System_FieldSize(FileNumber) Then
    422418        buffer = t.ToString
     
    431427    RecodeNumber--
    432428
    433     SetFilePointer(_System_hFile(FileNumber), SizeOf (StrChar) * RecodeNumber*_System_FieldSize(FileNumber), 0, FILE_BEGIN)
    434     WriteFile(_System_hFile(FileNumber), StrPtr(buffer), SizeOf (StrChar) * _System_FieldSize(FileNumber), VarPtr(dwAccessByte), ByVal 0)
     429    SetFilePointer(_System_hFile(FileNumber), SizeOf (Char) * RecodeNumber*_System_FieldSize(FileNumber), 0, FILE_BEGIN)
     430    WriteFile(_System_hFile(FileNumber), StrPtr(buffer), SizeOf (Char) * _System_FieldSize(FileNumber), VarPtr(dwAccessByte), ByVal 0)
    435431End Macro
    436432
     
    444440    DeleteFile(ToTCStr(path))
    445441End Macro
    446 
    447 
    448 #endif '_INC_COMMAND
  • trunk/Include/basic/dos_console.sbp

    r473 r497  
    3030
    3131    'データを変数に格納
    32     Const comma = &h2c As StrChar 'Asc(",")
     32    Const comma = &h2c As Char 'Asc(",")
    3333    Dim broken = ActiveBasic.Strings.Detail.Split(input, comma)
    3434    Dim i As Long
  • trunk/Include/basic/function.sbp

    r457 r497  
    11'function.sbp
    2 
    3 
    4 #ifndef _INC_FUNCTION
    5 #define _INC_FUNCTION
    6 
    72
    83Const _System_PI = 3.14159265358979323846264
     
    105Const _System_SQRT2 = 1.41421356237309504880168872421
    116Const _System_Log_N = 7 As Long
    12 
    13 
    14 #require <Classes/System/Math.ab>
    15 #require <Classes/System/DateTime.ab>
    16 #require <Classes/System/Text/StringBuilder.ab>
    17 #require <Classes/ActiveBasic/Math/Math.ab>
    18 #require <Classes/ActiveBasic/Strings/Strings.ab>
    19 
    207
    218'------------- サポート関数の定義 -------------
     
    243230'------------
    244231
    245 Function Asc(buf As String) As StrChar
     232Function Asc(buf As String) As Char
    246233    Asc = buf[0]
    247234End Function
    248235
    249 Function Chr$(code As StrChar) As String
     236Function Chr$(code As Char) As String
    250237    Chr$ = New String(code, 1)
    251238End Function
    252239
    253 #ifndef __STRING_IS_NOT_UNICODE
     240#ifdef UNICODE
    254241Function AscW(s As String) As UCSCHAR
    255242    If String.IsNullOrEmpty(s) Then
     
    275262Function ChrW(c As UCSCHAR) As String
    276263    If c <= &hFFFF Then
    277         Return New String(c As StrChar, 1)
     264        Return New String(c As Char, 1)
    278265    ElseIf c <= &h10FFFF Then
    279266        c -= &h10000
     
    390377
    391378Function Space$(length As Long) As String
    392     Return New String(&h20 As StrChar, length)
    393 End Function
    394 
    395 Sub _ecvt_support(buf As *StrChar, count As Long, size As Long)
     379    Return New String(&h20 As Char, length)
     380End Function
     381
     382Sub _ecvt_support(buf As *Char, count As Long, size As Long)
    396383    Dim i As Long
    397384    If buf[count] = 9 Then
     
    410397End Sub
    411398
    412 Sub _ecvt(buffer As *StrChar, value As Double, count As Long, ByRef dec As Long, ByRef sign As Boolean)
     399Sub _ecvt(buffer As *Char, value As Double, count As Long, ByRef dec As Long, ByRef sign As Boolean)
    413400    Dim i As Long, i2 As Long
    414401
    415402    '値が0の場合
    416403    If value = 0 Then
    417         ActiveBasic.Strings.ChrFill(buffer, count As SIZE_T, &h30 As StrChar)
     404        ActiveBasic.Strings.ChrFill(buffer, count As SIZE_T, &h30 As Char)
    418405        buffer[count] = 0
    419406        dec = 0
     
    442429
    443430    For i = 0 To count - 1
    444         buffer[i] = Int(value) As StrChar
     431        buffer[i] = Int(value) As Char
    445432        value = (value-CDbl(Int(value))) * 10
    446433    Next
     
    471458    End If
    472459    Dim dec As Long, sign As Boolean
    473     Dim buffer[32] As StrChar, temp[15] As StrChar
     460    Dim buffer[32] As Char, temp[15] As Char
    474461    Dim i = 0 As Long
    475462
     
    585572End Function
    586573
    587 Function String$(n As Long, s As StrChar) As String
     574Function String$(n As Long, s As Char) As String
    588575    Return New String(s, n)
    589576End Function
    590        
     577
    591578#ifdef _AB4_COMPATIBILITY_STRING$_
    592579Function String$(n As Long, s As String) As String
     
    594581        'Throw ArgumentOutOfRangeException
    595582    End If
    596 
    597583    Dim buf = New System.Text.StringBuilder(s.Length * n)
    598584    Dim i As Long
    599     For i = 0 To n
     585    For i = 1 To n
    600586        buf.Append(s)
    601587    Next
     
    603589#else
    604590Function String$(n As Long, s As String) As String
     591    Dim c As Char
    605592    If String.IsNullOrEmpty(s) Then
    606         Return New String(0 As StrChar, n)
    607     Else
    608         Return New String(s[0], n)
    609     End If
     593        c = 0
     594    Else
     595        c = s[0]
     596    End If
     597    String$ = New String(c, n)
    610598End Function
    611599#endif
     
    613601Function Time$() As String
    614602    Dim time = System.DateTime.Now
    615 
    616603    Dim buf = New System.Text.StringBuilder(8)
    617 
    618604    'hour
    619605    If time.Hour < 10 Then
     
    640626End Function
    641627
    642 Function Val(buf As *StrChar) As Double
     628Function Val(buf As *Char) As Double
    643629    Dim i As Long, i2 As Long, i3 As Long, i4 As Long
    644630    Dim temporary As String
    645     Dim TempPtr As *StrChar
     631    Dim TempPtr As *Char
    646632    Dim dbl As Double
    647633    Dim i64data As Int64
     
    665651                If Not (0<=i3 And i3<=7) Then Exit While
    666652
    667                 TempPtr[i]=i3 As StrChar
     653                TempPtr[i]=i3 As Char
    668654                i++
    669655            Wend
     
    688674                End If
    689675
    690                 TempPtr[i]=i3 As StrChar
     676                TempPtr[i]=i3 As Char
    691677                i++
    692678            Wend
     
    703689    Else
    704690        '10進数
    705 #ifdef __STRING_IS_NOT_UNICODE
     691#ifdef UNICODE
     692        swscanf(buf,"%lf",VarPtr(Val))
     693#else
    706694        sscanf(buf,"%lf",VarPtr(Val))
    707 #else
    708         swscanf(buf,ToWCStr("%lf"),VarPtr(Val))
    709695#endif
    710696    End If
     
    981967
    982968Function _System_IsLowSurrogate(c As WCHAR) As Boolean
    983     Return &hDC00 <= c And c < &hE000 
     969    Return &hDC00 <= c And c < &hE000
    984970End Function
    985971
     
    1000986    _System_GetHashFromWordArray = hash As Long
    1001987End Function
    1002 
    1003 #endif '_INC_FUNCTION
  • trunk/Include/basic/prompt.sbp

    r411 r497  
    88Namespace Prompt
    99Namespace Detail
    10    
     10
    1111Function _PromptSys_GetTextExtentPoint32(hdc As HDC, psz As PCSTR, cb As Long, ByRef Size As SIZE) As Long
    1212    _PromptSys_GetTextExtentPoint32 = GetTextExtentPoint32A(hdc, psz, cb, Size)
     
    4747Type _PromptSys_LineInformation
    4848    Length As Long
    49     Text As *StrChar
     49    Text As *Char
    5050    CharInfo As *_PromptSys_CharacterInformation
    5151End Type
     
    5353Dim _PromptSys_hFont As HFONT
    5454Dim _PromptSys_FontSize As SIZE
    55 Dim _PromptSys_InputStr[255] As StrChar
     55Dim _PromptSys_InputStr[255] As Char
    5656Dim _PromptSys_InputLen = -1 As Long
    5757Dim _PromptSys_KeyChar As Byte
     
    9797        Next
    9898        _PromptSys_TextLine[100].Length = 0
    99         _PromptSys_TextLine[100].Text = _System_calloc(SizeOf (StrChar) * 255)
     99        _PromptSys_TextLine[100].Text = _System_calloc(SizeOf (Char) * 255)
    100100        _PromptSys_TextLine[100].CharInfo = _System_calloc(SizeOf (_PromptSys_CharacterInformation) * 255)
    101101        _PromptSys_CurPos.y--
     
    136136                End If
    137137                With _PromptSys_FontSize
    138                     _PromptSys_TextOut(hDC, currentLineCharInfo[i2].StartPos, i * .cy, VarPtr(_PromptSys_TextLine[i].Text[i2]) As *StrChar, tempLen)
     138                    _PromptSys_TextOut(hDC, currentLineCharInfo[i2].StartPos, i * .cy, VarPtr(_PromptSys_TextLine[i].Text[i2]) As *Char, tempLen)
    139139                End With
    140140                i2 += tempLen
     
    191191                        EndIf
    192192                        Dim p = buf.StrPtr
    193                         _PromptSys_GetTextExtentPoint32(hdc, VarPtr(p[i2]) As *StrChar, charLen, sz)
     193                        _PromptSys_GetTextExtentPoint32(hdc, VarPtr(p[i2]) As *Char, charLen, sz)
    194194                        currentLineCharInfo[.x + 1].StartPos = currentLineCharInfo[.x].StartPos + sz.cx
    195195                    End If
     
    421421        End If
    422422        Dim tempStr = Nothing As String
    423         Dim str As *StrChar
    424 #ifdef __STRING_IS_NOT_UNICODE
    425         Dim size = _PromptWnd_GetCompositionStringA(himc, str)
    426         tempStr = New String(str, size As Long)
    427 #else
     423        Dim str As *Char
     424#ifdef UNICODE
    428425        Dim osver = System.Environment.OSVersion
    429426        With osver
    430             ' GetCompositionStringW is not implimented in Windows 95 
     427            ' GetCompositionStringW is not implimented in Windows 95
    431428            If .Version.Major = 4 And .Version.Minor = 0 And .Platform = System.PlatformID.Win32Windows Then
    432429                Dim strA As PCSTR
     
    438435            End If
    439436        End With
     437#else
     438        Dim size = _PromptWnd_GetCompositionStringA(himc, str)
     439        tempStr = New String(str, size As Long)
    440440#endif
    441441        ImmReleaseContext(hwnd, himc)
     
    460460        With _PromptSys_TextLine[i]
    461461            .Length = 0
    462             .Text = _System_calloc(SizeOf (StrChar) * 255)
     462            .Text = _System_calloc(SizeOf (Char) * 255)
    463463            .CharInfo = _System_calloc(SizeOf (_PromptSys_CharacterInformation) * 255)
    464464        End With
     
    543543        For i = 0 To 100
    544544            With _PromptSys_TextLine[i]
    545                 .Text[0] = 0 '_System_FillChar(_PromptSys_TextLine[i].Text, -1 As StrChar, 0)
     545                .Text[0] = 0 '_System_FillChar(_PromptSys_TextLine[i].Text, -1 As Char, 0)
    546546                .Length = 0
    547547            End With
     
    589589
    590590    'Set value to variable
    591     Const comma = &h2c As StrChar 'Asc(",")
     591    Const comma = &h2c As Char 'Asc(",")
    592592    Dim broken = ActiveBasic.Strings.Detail.Split(New String(_PromptSys_InputStr), comma)
    593593    Dim i As Long
     
    617617    Dim i = _PromptSys_TextLine[y].Length
    618618    If i < x Then
    619         ActiveBasic.Strings.ChrFill(VarPtr(_PromptSys_TextLine[y].Text[i]), x - i, &h20 As StrChar) 'Asc(" ")
     619        ActiveBasic.Strings.ChrFill(VarPtr(_PromptSys_TextLine[y].Text[i]), x - i, &h20 As Char) 'Asc(" ")
    620620        Dim i2 As Long
    621621        For i2 = i To ELM(x)
Note: See TracChangeset for help on using the changeset viewer.