diff --git a/uppsrc/Core/z.h b/uppsrc/Core/z.h index 299c5d29d..8c488172d 100644 --- a/uppsrc/Core/z.h +++ b/uppsrc/Core/z.h @@ -164,7 +164,7 @@ bool GZDecompressFile(const String& srcfile, Gate progress = Nul /// Backward compatibility: -Gate AsGate64(Gate2 gate); +Gate AsGate64(Gate gate); inline int ZCompress(Stream& out, Stream& in, Gate2 progress) { return (int)ZCompress(out, in, AsGate64(progress)); } inline String ZCompress(const void *data, int len, Gate2 progress) { return ZCompress(data, len, AsGate64(progress)); } diff --git a/uppsrc/Geom/geometry.h b/uppsrc/Geom/geometry.h index 2c1f34e5b..671b1fab2 100644 --- a/uppsrc/Geom/geometry.h +++ b/uppsrc/Geom/geometry.h @@ -495,7 +495,7 @@ class VecArcIterator { public: typedef Callback1 DrawProc; - typedef Gate2 ArcProc; + typedef Gate ArcProc; VecArcIterator(const VecArc& arc, DrawProc _lineto); VecArcIterator(Pointf start, Pointf end, double bulge, DrawProc _lineto); diff --git a/uppsrc/MySql/MySql.cpp b/uppsrc/MySql/MySql.cpp index cd3144a64..397e833a4 100644 --- a/uppsrc/MySql/MySql.cpp +++ b/uppsrc/MySql/MySql.cpp @@ -503,7 +503,7 @@ const char *MySqlReadString(const char *s, String& stmt) { return s; } -bool MySqlPerformScript(const String& txt, StatementExecutor& se, Gate2 progress_canceled) { +bool MySqlPerformScript(const String& txt, StatementExecutor& se, Gate progress_canceled) { const char *text = txt; for(;;) { String stmt; diff --git a/uppsrc/MySql/MySql.h b/uppsrc/MySql/MySql.h index 214baa27b..dae536c40 100644 --- a/uppsrc/MySql/MySql.h +++ b/uppsrc/MySql/MySql.h @@ -22,7 +22,7 @@ namespace Upp { const char *MySqlReadString(const char *s, String& stmt); -bool MySqlPerformScript(const String& text, StatementExecutor& se, Gate2 progress_canceled = false); +bool MySqlPerformScript(const String& text, StatementExecutor& se, Gate progress_canceled = Null); #ifdef NOAPPSQL bool MySqlUpdateSchema(const SqlSchema& sch, int i, StatementExecutor& se); #else diff --git a/uppsrc/PostgreSQL/PostgreSQL.cpp b/uppsrc/PostgreSQL/PostgreSQL.cpp index d3af7c8b4..4f665de0a 100644 --- a/uppsrc/PostgreSQL/PostgreSQL.cpp +++ b/uppsrc/PostgreSQL/PostgreSQL.cpp @@ -132,7 +132,7 @@ const char *PostgreSQLReadString(const char *s, String& stmt) return s; } -bool PostgreSQLPerformScript(const String& txt, StatementExecutor& se, Gate2 progress_canceled) +bool PostgreSQLPerformScript(const String& txt, StatementExecutor& se, Gate progress_canceled) { const char *text = txt; for(;;) { diff --git a/uppsrc/PostgreSQL/PostgreSQL.h b/uppsrc/PostgreSQL/PostgreSQL.h index e27c4020c..67ab70602 100644 --- a/uppsrc/PostgreSQL/PostgreSQL.h +++ b/uppsrc/PostgreSQL/PostgreSQL.h @@ -26,7 +26,7 @@ bool PostgreSQLPerformScript(const String& text, #else StatementExecutor& se = SQLStatementExecutor(), #endif - Gate2 progress_canceled = false + Gate progress_canceled = Null ); diff --git a/uppsrc/Sql/Script.cpp b/uppsrc/Sql/Script.cpp index 67fcd0d64..2898bd6e3 100644 --- a/uppsrc/Sql/Script.cpp +++ b/uppsrc/Sql/Script.cpp @@ -19,7 +19,7 @@ StatementExecutor& SQLStatementExecutor() { #endif bool SqlPerformScript(SqlSession& session, Stream& script, - Gate2 progress_canceled, bool stoponerror) + Gate progress_canceled, bool stoponerror) { String stmt; int level = 0; @@ -103,7 +103,7 @@ bool SqlPerformScript(SqlSession& session, Stream& script, } bool SqlPerformScript(SqlSession& session, const String& script, - Gate2 progress_canceled, bool stoponerror) + Gate progress_canceled, bool stoponerror) { StringStream ss(script); return SqlPerformScript(session, ss, progress_canceled, stoponerror); @@ -112,13 +112,13 @@ bool SqlPerformScript(SqlSession& session, const String& script, #ifndef NOAPPSQL bool SqlPerformScript(Stream& script, - Gate2 progress_canceled, bool stoponerror) + Gate progress_canceled, bool stoponerror) { return SqlPerformScript(SQL.GetSession(), script, progress_canceled, stoponerror); } bool SqlPerformScript(const String& script, - Gate2 progress_canceled, bool stoponerror) + Gate progress_canceled, bool stoponerror) { return SqlPerformScript(SQL.GetSession(), script, progress_canceled, stoponerror); } diff --git a/uppsrc/Sql/Sqls.h b/uppsrc/Sql/Sqls.h index 253ee31ca..c2c1d0dd5 100644 --- a/uppsrc/Sql/Sqls.h +++ b/uppsrc/Sql/Sqls.h @@ -292,7 +292,7 @@ struct StatementExecutor { // Deprecated, use SqlPerformScript }; // Deprecated, use SqlPerforScript -typedef bool (*RunScript)(const String& text, StatementExecutor& executor, Gate2 progress_canceled); +typedef bool (*RunScript)(const String& text, StatementExecutor& executor, Gate progress_canceled); class AppSql; class AppSqlR; @@ -444,13 +444,13 @@ Sql& AppCursorR(); class OciConnection; bool SqlPerformScript(SqlSession& session, Stream& script, - Gate2 progress_canceled = false, bool stoponerror = false); + Gate progress_canceled = Null, bool stoponerror = false); bool SqlPerformScript(Stream& script, - Gate2 progress_canceled = false, bool stoponerror = false); + Gate progress_canceled = Null, bool stoponerror = false); bool SqlPerformScript(SqlSession& session, const String& script, - Gate2 progress_canceled = false, bool stoponerror = false); + Gate progress_canceled = Null, bool stoponerror = false); bool SqlPerformScript(const String& script, - Gate2 progress_canceled = false, bool stoponerror = false); + Gate progress_canceled = Null, bool stoponerror = false); class SqlMassInsert { struct Row : Moveable { diff --git a/uppsrc/SqlCtrl/SqlConsole.cpp b/uppsrc/SqlCtrl/SqlConsole.cpp index 691ad2fac..0ffd32d54 100644 --- a/uppsrc/SqlCtrl/SqlConsole.cpp +++ b/uppsrc/SqlCtrl/SqlConsole.cpp @@ -22,7 +22,7 @@ static const int MAX_NESTING_LEVEL = 10; static const int PROGRESS_RANGE = 1000000000; bool SqlRunScript(int dialect, Stream& script_stream, - Gate1 executor, Gate2 progress, + Gate executor, Gate progress, Index& script_file_names, int progress_min, int progress_max) { int line_number = 1; @@ -131,7 +131,7 @@ bool SqlRunScript(int dialect, Stream& script_stream, } bool SqlRunScript(int dialect, Stream& script_stream, const String& file_name, - Gate1 executor, Gate2 progress) + Gate executor, Gate progress) { Index script_file_names; String fn = NormalizePath(file_name); @@ -207,7 +207,7 @@ protected: me->command <<= stmt; me->Sync(); me->Execute(quiet ? QUIET : SCRIPT); return true; } bool GateExec(String stmt) { return Execute(stmt); } - operator Gate1 () { return THISBACK(GateExec); } + operator Gate () { return THISBACK(GateExec); } }; diff --git a/uppsrc/plugin/zip/UnZip.cpp b/uppsrc/plugin/zip/UnZip.cpp index f0d2d6958..81742d47b 100644 --- a/uppsrc/plugin/zip/UnZip.cpp +++ b/uppsrc/plugin/zip/UnZip.cpp @@ -81,7 +81,7 @@ Time UnZip::GetZipTime(dword dt) int64 zPress(Stream& out, Stream& in, int64 size, Gate progress, bool gzip, bool compress, dword *crc, bool hdr); -bool UnZip::ReadFile(Stream& out, Gate2 progress) +bool UnZip::ReadFile(Stream& out, Gate progress) { if(error) return false; @@ -135,7 +135,7 @@ bool UnZip::ReadFile(Stream& out, Gate2 progress) return true; } -String UnZip::ReadFile(Gate2 progress) +String UnZip::ReadFile(Gate progress) { StringStream ss; return ReadFile(ss, progress) ? ss.GetResult() : String::GetVoid(); diff --git a/uppsrc/plugin/zip/Zip.cpp b/uppsrc/plugin/zip/Zip.cpp index c51ff8dc6..d2592628d 100644 --- a/uppsrc/plugin/zip/Zip.cpp +++ b/uppsrc/plugin/zip/Zip.cpp @@ -7,7 +7,7 @@ void Zip::WriteFolder(const char *path, Time tm) String p = UnixPath(path); if(*p.Last() != '/') p.Cat('/'); - WriteFile(~p, 0, p, false, tm); + WriteFile(~p, 0, p, Null, tm); } int64 zPress(Stream& out, Stream& in, int64 size, Gate progress, bool gzip, @@ -108,7 +108,7 @@ void Zip::PutCompressed(const void *ptr, int size) file.Top().csize += size; } -void Zip::WriteFile(const void *ptr, int size, const char *path, Gate2 progress, Time tm, bool deflate) +void Zip::WriteFile(const void *ptr, int size, const char *path, Gate progress, Time tm, bool deflate) { ASSERT(!IsFileOpened()); if(!deflate) { @@ -155,7 +155,7 @@ void Zip::WriteFile(const void *ptr, int size, const char *path, Gate2 if (zip->IsError()) WhenError(); } -void Zip::WriteFile(const String& s, const char *path, Gate2 progress, Time tm, bool deflate) +void Zip::WriteFile(const String& s, const char *path, Gate progress, Time tm, bool deflate) { WriteFile(~s, s.GetCount(), path, progress, tm, deflate); } diff --git a/uppsrc/plugin/zip/zip.h b/uppsrc/plugin/zip/zip.h index af37f4614..0fc88fcee 100644 --- a/uppsrc/plugin/zip/zip.h +++ b/uppsrc/plugin/zip/zip.h @@ -48,8 +48,8 @@ public: void Skip() { current++; } void SkipFile() { current++; } - bool ReadFile(Stream& out, Gate2 progress = false); - String ReadFile(Gate2 progress = false); + bool ReadFile(Stream& out, Gate progress = Null); + String ReadFile(Gate progress = Null); dword GetPos() const; @@ -108,7 +108,7 @@ class Zip { Crc32Stream crc32; // for uncompressed files bool uncompressed; - void WriteFile0(const void *ptr, int size, const char *path, Gate2 progress, Time tm, int method); + void WriteFile0(const void *ptr, int size, const char *path, Gate progress, Time tm, int method); void FileHeader(const char *path, Time tm); @@ -126,8 +126,8 @@ public: bool IsFileOpened() const { return pipeZLib || uncompressed; } void WriteFolder(const char *path, Time tm); - void WriteFile(const void *ptr, int size, const char *path, Gate2 progress = false, Time tm = GetSysTime(), bool deflate = true); - void WriteFile(const String& s, const char *path, Gate2 progress = false, Time tm = GetSysTime(), bool deflate = true); + void WriteFile(const void *ptr, int size, const char *path, Gate progress = Null, Time tm = GetSysTime(), bool deflate = true); + void WriteFile(const String& s, const char *path, Gate progress = Null, Time tm = GetSysTime(), bool deflate = true); void Create(Stream& out); void Finish();