Skip to content

Commit 2bad8ad

Browse files
authored
Merge pull request #7 from fishca/очистка-кода-от-__fastcall-9e8a4
Update from task 1efe4d0c-f834-49e0-a988-6394cfe9e8a4
2 parents 990de99 + 91fb6b1 commit 2bad8ad

16 files changed

Lines changed: 60 additions & 47 deletions

.gitignore

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,30 @@
11
```
2-
# Build artifacts
2+
# Compiled and build artifacts
33
*.o
44
*.obj
5-
*.a
6-
*.so
7-
*.dll
85
*.exe
6+
*.dll
7+
*.so
8+
*.a
99
*.out
10+
build/
11+
dist/
12+
target/
1013

1114
# Dependencies
12-
3rdparty/
15+
venv/
16+
.venv/
17+
__pycache__/
18+
.mypy_cache/
19+
.pytest_cache/
20+
.gradle/
21+
node_modules/
1322

1423
# Logs and temp files
1524
*.log
1625
*.tmp
26+
*.swp
27+
*.swo
1728

1829
# Environment
1930
.env
@@ -24,7 +35,12 @@
2435
.vscode/
2536
.idea/
2637

27-
# OS specific
38+
# Coverage
39+
coverage/
40+
htmlcov/
41+
.coverage
42+
43+
# System files
2844
.DS_Store
2945
Thumbs.db
3046
```

src/APIcfBase.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#ifndef APIcfBaseH
99
#define APIcfBaseH
1010

11-
#include <System.Classes.hpp>
11+
#include "vcl_utils.h"
1212
#include <map>
1313
#include <set>
1414

@@ -110,7 +110,7 @@ class v8file
110110

111111
TCriticalSection *Lock;
112112

113-
TStream* data;
113+
vcl_utils::TStream* data;
114114

115115
v8catalog* parent;
116116

@@ -159,9 +159,9 @@ class v8file
159159
// перезапись целиком
160160
int Write(const void* Buffer, int Length);
161161
// дозапись/перезапись частично
162-
int Write(TStream* Stream, int Start, int Length);
162+
int Write(vcl_utils::TStream* Stream, int Start, int Length);
163163
// перезапись целиком
164-
int Write(TStream* Stream);
164+
int Write(vcl_utils::TStream* Stream);
165165

166166
String GetFileName();
167167
String GetFullName();
@@ -178,16 +178,16 @@ class v8file
178178
void Close();
179179

180180
// перезапись целиком и закрытие файла (для экономии памяти не используется data файла)
181-
int WriteAndClose(TStream* Stream, int Length = -1);
181+
int WriteAndClose(vcl_utils::TStream* Stream, int Length = -1);
182182

183183
void GetTimeCreate(FILETIME* ft);
184184
void GetTimeModify(FILETIME* ft);
185185
void SetTimeCreate(FILETIME* ft);
186186
void SetTimeModify(FILETIME* ft);
187187

188188
void SaveToFile(const String& FileName);
189-
void SaveToStream(TStream* stream);
190-
//TStream* get_data();
189+
void SaveToStream(vcl_utils::TStream* stream);
190+
//vcl_utils::TStream* get_data();
191191

192192
TV8FileStream* get_stream(bool own = false);
193193

@@ -204,8 +204,8 @@ class v8catalog
204204

205205
v8file* file; // файл, которым является каталог. Для корневого каталога NULL
206206

207-
TStream* data; // поток каталога. Если file не NULL (каталог не корневой), совпадает с file->data
208-
TStream* cfu; // поток файла cfu. Существует только при is_cfu == true
207+
vcl_utils::TStream* data; // поток каталога. Если file не NULL (каталог не корневой), совпадает с file->data
208+
vcl_utils::TStream* cfu; // поток файла cfu. Существует только при is_cfu == true
209209

210210
void initialize(int Offset = 0);
211211

@@ -236,12 +236,12 @@ class v8catalog
236236
void free_block(int start);
237237

238238
// возвращает адрес начала блока
239-
int write_block(TStream* block, int start, bool use_page_size, int len = -1);
239+
int write_block(vcl_utils::TStream* block, int start, bool use_page_size, int len = -1);
240240

241241
// возвращает адрес начала блока
242-
int write_datablock(TStream* block, int start, bool _zipped = false, int len = -1);
242+
int write_datablock(vcl_utils::TStream* block, int start, bool _zipped = false, int len = -1);
243243

244-
TStream* read_datablock(int start, int offset = 0);
244+
vcl_utils::TStream* read_datablock(int start, int offset = 0);
245245

246246
int get_nextblock(int start);
247247

@@ -254,7 +254,7 @@ class v8catalog
254254
v8catalog(v8file* f); // создать каталог из файла
255255
v8catalog(String name); // создать каталог из физического файла (cf, epf, erf, hbk, cfu)
256256
v8catalog(String name, bool _zipped); // создать каталог из физического файла (cf, epf, erf, hbk, cfu)
257-
v8catalog(TStream* stream, bool _zipped, bool leave_stream = false); // создать каталог из потока
257+
v8catalog(vcl_utils::TStream* stream, bool _zipped, bool leave_stream = false); // создать каталог из потока
258258

259259
~v8catalog();
260260

@@ -280,7 +280,7 @@ class v8catalog
280280
};
281281

282282
//===========================================================================
283-
class TV8FileStream : public TStream
283+
class TV8FileStream : public vcl_utils::TStream
284284
{
285285
protected:
286286
v8file* file;
@@ -296,8 +296,8 @@ class TV8FileStream : public TStream
296296
virtual int Write(const void *Buffer, int Count);
297297
virtual int Write(const ByteArr Buffer, int Offset, int Count);
298298

299-
virtual int Seek(int Offset, System::Word Origin);
300-
virtual __int64 Seek(const __int64 Offset, TSeekOrigin Origin);
299+
virtual int Seek(int Offset, int Origin); // Заменено System::Word на int
300+
virtual __int64 Seek(const __int64 Offset, int Origin); // Заменено TSeekOrigin на int
301301
};
302302

303303
#endif

src/Base64.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#ifndef Base64H
44
#define Base64H
55

6-
#include <System.Classes.hpp>
6+
#include "vcl_utils.h"
77
//---------------------------------------------------------------------------
88

99
void base64_encode(TStream* infile, TStream* outfile, int linesize);

src/Common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ String tohex64(__int64 n)
422422
}
423423

424424
//---------------------------------------------------------------------------
425-
String hexstring(TStream* str)
425+
String hexstring(vcl_utils::TStream* str)
426426
{
427427
int i;
428428
String s = L"";

src/Common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//#include <vcl.h>
77
#include <vector>
88
#include "APIcfBase.h"
9-
#include <System.Classes.hpp>
9+
#include "vcl_utils.h"
1010

1111
//---------------------------------------------------------------------------
1212
void time1CD_to_FileTime(FILETIME* ft, unsigned char* time1CD);
@@ -25,7 +25,7 @@ String date_to_string(const unsigned char* bytedate);
2525
String tohex(int n);
2626
String tohex64(__int64 n);
2727
String hexstring(char* buf, int n);
28-
String hexstring(TStream* str);
28+
String hexstring(vcl_utils::TStream* str);
2929
//---------------------------------------------------------------------------
3030

3131
String GetNameFromTreePath(v8catalog *cf, String &guid_md, const std::vector<int>& path);

src/ConfigStorage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#ifndef ConfigStorageH
44
#define ConfigStorageH
55

6-
#include <System.Classes.hpp>
6+
#include "vcl_utils.h"
77
#include <vector>
88
#include <map>
99
#include <set>

src/MainUnit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <unordered_map>
1414
#include <unordered_set>
1515

16-
#include <System.SysUtils.hpp>
16+
#include "vcl_utils.h"
1717

1818
#include "V8File.h"
1919
#include "ApicfBase.h"

src/MainUnit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#ifndef MainUnitH
44
#define MainUnitH
55
//---------------------------------------------------------------------------
6-
#include <System.Classes.hpp>
6+
#include "vcl_utils.h"
77
#include <Vcl.Controls.hpp>
88
#include <Vcl.StdCtrls.hpp>
99
#include <Vcl.Forms.hpp>

src/MessageRegistration.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#ifndef MessageRegistrationH
44
#define MessageRegistrationH
55

6-
#include <System.Classes.hpp>
6+
#include "vcl_utils.h"
77
//#include <vcl.h>
88
#pragma hdrstop
99

src/MetaObject.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616

1717
// Для совместимости с C++ Builder VCL
1818
#ifdef __BORLANDC__
19-
#include <System.Classes.hpp>
20-
#include <System.SysUtils.hpp>
19+
#include "vcl_utils.h"
2120
#endif
2221

2322
// Forward declarations

0 commit comments

Comments
 (0)