diff options
author | kaliki <kaliki@yandex-team.ru> | 2022-02-10 16:48:06 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:06 +0300 |
commit | 9741dc538ed4ca44e947c0965a2bbc50305eb996 (patch) | |
tree | b222e5ac2e2e98872661c51ccceee5da0d291e13 | |
parent | a79404df3a1d90f4b37ac8a1ce0a2bfb5dfd06f1 (diff) | |
download | ydb-9741dc538ed4ca44e947c0965a2bbc50305eb996.tar.gz |
Restoring authorship annotation for <kaliki@yandex-team.ru>. Commit 2 of 2.
45 files changed, 402 insertions, 402 deletions
diff --git a/contrib/libs/pire/pire/align.h b/contrib/libs/pire/pire/align.h index 2af149af75..fea084b598 100644 --- a/contrib/libs/pire/pire/align.h +++ b/contrib/libs/pire/pire/align.h @@ -25,9 +25,9 @@ #ifndef PIRE_ALIGN_H #define PIRE_ALIGN_H -#include <contrib/libs/pire/pire/stub/stl.h> -#include <contrib/libs/pire/pire/stub/saveload.h> - +#include <contrib/libs/pire/pire/stub/stl.h> +#include <contrib/libs/pire/pire/stub/saveload.h> + #include "platform.h" namespace Pire { diff --git a/contrib/libs/pire/pire/any.h b/contrib/libs/pire/pire/any.h index a447faa9f3..4646d25781 100644 --- a/contrib/libs/pire/pire/any.h +++ b/contrib/libs/pire/pire/any.h @@ -27,7 +27,7 @@ #include <typeinfo> -#include <contrib/libs/pire/pire/stub/stl.h> +#include <contrib/libs/pire/pire/stub/stl.h> namespace Pire { diff --git a/contrib/libs/pire/pire/classes.cpp b/contrib/libs/pire/pire/classes.cpp index bb6d106894..bbf021737d 100644 --- a/contrib/libs/pire/pire/classes.cpp +++ b/contrib/libs/pire/pire/classes.cpp @@ -21,11 +21,11 @@ */ -#include <contrib/libs/pire/pire/stub/stl.h> -#include <contrib/libs/pire/pire/stub/singleton.h> -#include <contrib/libs/pire/pire/stub/noncopyable.h> -#include <contrib/libs/pire/pire/stub/utf8.h> - +#include <contrib/libs/pire/pire/stub/stl.h> +#include <contrib/libs/pire/pire/stub/singleton.h> +#include <contrib/libs/pire/pire/stub/noncopyable.h> +#include <contrib/libs/pire/pire/stub/utf8.h> + #include "re_lexer.h" namespace Pire { diff --git a/contrib/libs/pire/pire/determine.h b/contrib/libs/pire/pire/determine.h index 9381e4ac26..fb48fdd0b3 100644 --- a/contrib/libs/pire/pire/determine.h +++ b/contrib/libs/pire/pire/determine.h @@ -24,8 +24,8 @@ #ifndef PIRE_DETERMINE_H #define PIRE_DETERMINE_H -#include <contrib/libs/pire/pire/stub/stl.h> - +#include <contrib/libs/pire/pire/stub/stl.h> + #include "partition.h" namespace Pire { diff --git a/contrib/libs/pire/pire/easy.h b/contrib/libs/pire/pire/easy.h index 4e6b9b709d..c70e965353 100644 --- a/contrib/libs/pire/pire/easy.h +++ b/contrib/libs/pire/pire/easy.h @@ -49,10 +49,10 @@ #ifndef PIRE_EASY_H_INCLUDED #define PIRE_EASY_H_INCLUDED -#include <iterator> - -#include <contrib/libs/pire/pire/stub/stl.h> - +#include <iterator> + +#include <contrib/libs/pire/pire/stub/stl.h> + #include "pire.h" #include "vbitset.h" diff --git a/contrib/libs/pire/pire/encoding.cpp b/contrib/libs/pire/pire/encoding.cpp index 654cf8fa11..842e2b534d 100644 --- a/contrib/libs/pire/pire/encoding.cpp +++ b/contrib/libs/pire/pire/encoding.cpp @@ -24,11 +24,11 @@ #include <stdexcept> #include <util/charset/utf8.h> #include <utility> - -#include <contrib/libs/pire/pire/stub/defaults.h> -#include <contrib/libs/pire/pire/stub/utf8.h> -#include <contrib/libs/pire/pire/stub/singleton.h> - + +#include <contrib/libs/pire/pire/stub/defaults.h> +#include <contrib/libs/pire/pire/stub/utf8.h> +#include <contrib/libs/pire/pire/stub/singleton.h> + #include "encoding.h" #include "fsm.h" diff --git a/contrib/libs/pire/pire/encoding.h b/contrib/libs/pire/pire/encoding.h index 1984cffffb..b2c8bb9b41 100644 --- a/contrib/libs/pire/pire/encoding.h +++ b/contrib/libs/pire/pire/encoding.h @@ -25,8 +25,8 @@ #define PIRE_ENCODING_H -#include <contrib/libs/pire/pire/stub/defaults.h> -#include <contrib/libs/pire/pire/stub/stl.h> +#include <contrib/libs/pire/pire/stub/defaults.h> +#include <contrib/libs/pire/pire/stub/stl.h> namespace Pire { diff --git a/contrib/libs/pire/pire/extra.h b/contrib/libs/pire/pire/extra.h index 28cd945d08..2e4358acdd 100644 --- a/contrib/libs/pire/pire/extra.h +++ b/contrib/libs/pire/pire/extra.h @@ -26,8 +26,8 @@ #define PIRE_EXTRA_H -#include <contrib/libs/pire/pire/extra/capture.h> -#include <contrib/libs/pire/pire/extra/count.h> -#include <contrib/libs/pire/pire/extra/glyphs.h> +#include <contrib/libs/pire/pire/extra/capture.h> +#include <contrib/libs/pire/pire/extra/count.h> +#include <contrib/libs/pire/pire/extra/glyphs.h> #endif diff --git a/contrib/libs/pire/pire/extra/capture.cpp b/contrib/libs/pire/pire/extra/capture.cpp index eb51fd3caa..fb4cdf6d81 100644 --- a/contrib/libs/pire/pire/extra/capture.cpp +++ b/contrib/libs/pire/pire/extra/capture.cpp @@ -22,7 +22,7 @@ #include <stdexcept> - + #include "capture.h" namespace Pire { diff --git a/contrib/libs/pire/pire/extra/capture.h b/contrib/libs/pire/pire/extra/capture.h index 709d40e38c..8399914a67 100644 --- a/contrib/libs/pire/pire/extra/capture.h +++ b/contrib/libs/pire/pire/extra/capture.h @@ -26,11 +26,11 @@ #include <contrib/libs/pire/pire/approx_matching.h> -#include <contrib/libs/pire/pire/scanners/loaded.h> +#include <contrib/libs/pire/pire/scanners/loaded.h> #include <contrib/libs/pire/pire/scanners/multi.h> #include <contrib/libs/pire/pire/scanners/slow.h> -#include <contrib/libs/pire/pire/fsm.h> -#include <contrib/libs/pire/pire/re_lexer.h> +#include <contrib/libs/pire/pire/fsm.h> +#include <contrib/libs/pire/pire/re_lexer.h> #include <contrib/libs/pire/pire/run.h> #include <array> diff --git a/contrib/libs/pire/pire/extra/count.cpp b/contrib/libs/pire/pire/extra/count.cpp index 245b272651..468ff61d92 100644 --- a/contrib/libs/pire/pire/extra/count.cpp +++ b/contrib/libs/pire/pire/extra/count.cpp @@ -23,13 +23,13 @@ #include "count.h" -#include <contrib/libs/pire/pire/fsm.h> -#include <contrib/libs/pire/pire/determine.h> -#include <contrib/libs/pire/pire/glue.h> +#include <contrib/libs/pire/pire/fsm.h> +#include <contrib/libs/pire/pire/determine.h> +#include <contrib/libs/pire/pire/glue.h> #include <contrib/libs/pire/pire/minimize.h> -#include <contrib/libs/pire/pire/stub/lexical_cast.h> +#include <contrib/libs/pire/pire/stub/lexical_cast.h> #include <contrib/libs/pire/pire/stub/stl.h> - + #include <tuple> namespace Pire { diff --git a/contrib/libs/pire/pire/extra/count.h b/contrib/libs/pire/pire/extra/count.h index 401de107bd..bd1526b98d 100644 --- a/contrib/libs/pire/pire/extra/count.h +++ b/contrib/libs/pire/pire/extra/count.h @@ -24,8 +24,8 @@ #ifndef PIRE_EXTRA_COUNT_H #define PIRE_EXTRA_COUNT_H -#include <contrib/libs/pire/pire/scanners/loaded.h> -#include <contrib/libs/pire/pire/fsm.h> +#include <contrib/libs/pire/pire/scanners/loaded.h> +#include <contrib/libs/pire/pire/fsm.h> #include <algorithm> diff --git a/contrib/libs/pire/pire/extra/glyphs.cpp b/contrib/libs/pire/pire/extra/glyphs.cpp index e16324f63d..a14d2baa56 100644 --- a/contrib/libs/pire/pire/extra/glyphs.cpp +++ b/contrib/libs/pire/pire/extra/glyphs.cpp @@ -28,12 +28,12 @@ #include <vector> #include <utility> -#include <contrib/libs/pire/pire/stub/singleton.h> -#include <contrib/libs/pire/pire/stub/noncopyable.h> -#include <contrib/libs/pire/pire/stub/utf8.h> -#include <contrib/libs/pire/pire/stub/stl.h> -#include <contrib/libs/pire/pire/re_lexer.h> - +#include <contrib/libs/pire/pire/stub/singleton.h> +#include <contrib/libs/pire/pire/stub/noncopyable.h> +#include <contrib/libs/pire/pire/stub/utf8.h> +#include <contrib/libs/pire/pire/stub/stl.h> +#include <contrib/libs/pire/pire/re_lexer.h> + namespace Pire { namespace { diff --git a/contrib/libs/pire/pire/fsm.cpp b/contrib/libs/pire/pire/fsm.cpp index 3a21e69dee..984d708dfa 100644 --- a/contrib/libs/pire/pire/fsm.cpp +++ b/contrib/libs/pire/pire/fsm.cpp @@ -29,11 +29,11 @@ #include <numeric> #include <queue> #include <utility> - -#include <iostream> -#include <stdio.h> -#include <contrib/libs/pire/pire/stub/lexical_cast.h> - + +#include <iostream> +#include <stdio.h> +#include <contrib/libs/pire/pire/stub/lexical_cast.h> + #include "fsm.h" #include "vbitset.h" #include "partition.h" diff --git a/contrib/libs/pire/pire/fsm.h b/contrib/libs/pire/pire/fsm.h index 8db1460ebd..4dad06ca06 100644 --- a/contrib/libs/pire/pire/fsm.h +++ b/contrib/libs/pire/pire/fsm.h @@ -25,8 +25,8 @@ #define PIRE_FSM_H -#include <contrib/libs/pire/pire/stub/stl.h> - +#include <contrib/libs/pire/pire/stub/stl.h> + #include "partition.h" #include "defs.h" diff --git a/contrib/libs/pire/pire/glue.h b/contrib/libs/pire/pire/glue.h index 64e5f0161a..bac086f2f0 100644 --- a/contrib/libs/pire/pire/glue.h +++ b/contrib/libs/pire/pire/glue.h @@ -26,7 +26,7 @@ #define PIRE_GLUE_H -#include <contrib/libs/pire/pire/stub/stl.h> +#include <contrib/libs/pire/pire/stub/stl.h> #include "partition.h" namespace Pire { diff --git a/contrib/libs/pire/pire/inline.l b/contrib/libs/pire/pire/inline.l index 4b3ac90a7d..a4d2e1a836 100644 --- a/contrib/libs/pire/pire/inline.l +++ b/contrib/libs/pire/pire/inline.l @@ -26,15 +26,15 @@ #include <vector> #include <string> #include <stdexcept> - -#include <contrib/libs/pire/pire/stub/hacks.h> -#include <contrib/libs/pire/pire/stub/lexical_cast.h> -#include <contrib/libs/pire/pire/stub/saveload.h> -#include <contrib/libs/pire/pire/stub/memstreams.h> -#include <contrib/libs/pire/pire/stub/stl.h> - -#include "pire.h" - + +#include <contrib/libs/pire/pire/stub/hacks.h> +#include <contrib/libs/pire/pire/stub/lexical_cast.h> +#include <contrib/libs/pire/pire/stub/saveload.h> +#include <contrib/libs/pire/pire/stub/memstreams.h> +#include <contrib/libs/pire/pire/stub/stl.h> + +#include "pire.h" + ystring filename = ""; int line = 1; TVector<ystring> args; diff --git a/contrib/libs/pire/pire/partition.h b/contrib/libs/pire/pire/partition.h index ec83384674..85a9af8863 100644 --- a/contrib/libs/pire/pire/partition.h +++ b/contrib/libs/pire/pire/partition.h @@ -25,8 +25,8 @@ #define PIRE_PARTITION_H -#include <contrib/libs/pire/pire/stub/stl.h> -#include <contrib/libs/pire/pire/stub/singleton.h> +#include <contrib/libs/pire/pire/stub/stl.h> +#include <contrib/libs/pire/pire/stub/singleton.h> namespace Pire { diff --git a/contrib/libs/pire/pire/pire.h b/contrib/libs/pire/pire/pire.h index 479f50abf9..12eb84ccb6 100644 --- a/contrib/libs/pire/pire/pire.h +++ b/contrib/libs/pire/pire/pire.h @@ -24,11 +24,11 @@ #ifndef PIRE_PIRE_H #define PIRE_PIRE_H -#include <contrib/libs/pire/pire/scanners/multi.h> +#include <contrib/libs/pire/pire/scanners/multi.h> #include <contrib/libs/pire/pire/scanners/half_final.h> -#include <contrib/libs/pire/pire/scanners/simple.h> -#include <contrib/libs/pire/pire/scanners/slow.h> -#include <contrib/libs/pire/pire/scanners/pair.h> +#include <contrib/libs/pire/pire/scanners/simple.h> +#include <contrib/libs/pire/pire/scanners/slow.h> +#include <contrib/libs/pire/pire/scanners/pair.h> #include "re_lexer.h" #include "fsm.h" diff --git a/contrib/libs/pire/pire/platform.h b/contrib/libs/pire/pire/platform.h index dc5b4103f2..54ded6b387 100644 --- a/contrib/libs/pire/pire/platform.h +++ b/contrib/libs/pire/pire/platform.h @@ -23,8 +23,8 @@ #ifndef PIRE_PLATFORM_H_INCLUDED #define PIRE_PLATFORM_H_INCLUDED -#include <contrib/libs/pire/pire/stub/defaults.h> -#include <contrib/libs/pire/pire/static_assert.h> +#include <contrib/libs/pire/pire/stub/defaults.h> +#include <contrib/libs/pire/pire/static_assert.h> #ifndef PIRE_FORCED_INLINE #ifdef __GNUC__ diff --git a/contrib/libs/pire/pire/re_lexer.cpp b/contrib/libs/pire/pire/re_lexer.cpp index 201e25ba16..132fbeb039 100644 --- a/contrib/libs/pire/pire/re_lexer.cpp +++ b/contrib/libs/pire/pire/re_lexer.cpp @@ -23,11 +23,11 @@ #include <ctype.h> #include <stdexcept> - -#include <contrib/libs/pire/pire/stub/stl.h> -#include <contrib/libs/pire/pire/stub/utf8.h> -#include <contrib/libs/pire/pire/stub/singleton.h> - + +#include <contrib/libs/pire/pire/stub/stl.h> +#include <contrib/libs/pire/pire/stub/utf8.h> +#include <contrib/libs/pire/pire/stub/singleton.h> + #include "fsm.h" #include "re_lexer.h" #include "re_parser.h" diff --git a/contrib/libs/pire/pire/re_lexer.h b/contrib/libs/pire/pire/re_lexer.h index 153196936c..5591c16d34 100644 --- a/contrib/libs/pire/pire/re_lexer.h +++ b/contrib/libs/pire/pire/re_lexer.h @@ -32,12 +32,12 @@ #include <stdexcept> #include <utility> #include <string.h> -#include <contrib/libs/pire/pire/stub/defaults.h> -#include <contrib/libs/pire/pire/stub/stl.h> +#include <contrib/libs/pire/pire/stub/defaults.h> +#include <contrib/libs/pire/pire/stub/stl.h> + +#include "encoding.h" +#include "any.h" -#include "encoding.h" -#include "any.h" - namespace Pire { namespace Consts { diff --git a/contrib/libs/pire/pire/re_parser.y b/contrib/libs/pire/pire/re_parser.y index 555ea2d428..dbad88e287 100644 --- a/contrib/libs/pire/pire/re_parser.y +++ b/contrib/libs/pire/pire/re_parser.y @@ -37,10 +37,10 @@ #include <stdexcept> -#include <contrib/libs/pire/pire/fsm.h> -#include <contrib/libs/pire/pire/re_lexer.h> -#include <contrib/libs/pire/pire/any.h> -#include <contrib/libs/pire/pire/stub/stl.h> +#include <contrib/libs/pire/pire/fsm.h> +#include <contrib/libs/pire/pire/re_lexer.h> +#include <contrib/libs/pire/pire/any.h> +#include <contrib/libs/pire/pire/stub/stl.h> #define YYSTYPE Any* #define YYSTYPE_IS_TRIVIAL 0 diff --git a/contrib/libs/pire/pire/run.h b/contrib/libs/pire/pire/run.h index c3dafd62e4..f6e1ff734d 100644 --- a/contrib/libs/pire/pire/run.h +++ b/contrib/libs/pire/pire/run.h @@ -24,15 +24,15 @@ #ifndef PIRE_RE_SCANNER_H #define PIRE_RE_SCANNER_H -#include <contrib/libs/pire/pire/stub/stl.h> -#include <contrib/libs/pire/pire/stub/memstreams.h> -#include <contrib/libs/pire/pire/scanners/pair.h> - -#include "platform.h" +#include <contrib/libs/pire/pire/stub/stl.h> +#include <contrib/libs/pire/pire/stub/memstreams.h> +#include <contrib/libs/pire/pire/scanners/pair.h> + +#include "platform.h" #include "defs.h" #include <string> - + namespace Pire { template<class Scanner> diff --git a/contrib/libs/pire/pire/scanner_io.cpp b/contrib/libs/pire/pire/scanner_io.cpp index 98d45999b7..3956e3c6ed 100644 --- a/contrib/libs/pire/pire/scanner_io.cpp +++ b/contrib/libs/pire/pire/scanner_io.cpp @@ -21,13 +21,13 @@ */ -#include <contrib/libs/pire/pire/stub/stl.h> -#include <contrib/libs/pire/pire/stub/saveload.h> +#include <contrib/libs/pire/pire/stub/stl.h> +#include <contrib/libs/pire/pire/stub/saveload.h> #include <contrib/libs/pire/pire/scanners/common.h> -#include <contrib/libs/pire/pire/scanners/slow.h> -#include <contrib/libs/pire/pire/scanners/simple.h> -#include <contrib/libs/pire/pire/scanners/loaded.h> - +#include <contrib/libs/pire/pire/scanners/slow.h> +#include <contrib/libs/pire/pire/scanners/simple.h> +#include <contrib/libs/pire/pire/scanners/loaded.h> + #include "align.h" namespace Pire { diff --git a/contrib/libs/pire/pire/scanners/common.h b/contrib/libs/pire/pire/scanners/common.h index fdb3214ac6..de5ea0af7b 100644 --- a/contrib/libs/pire/pire/scanners/common.h +++ b/contrib/libs/pire/pire/scanners/common.h @@ -24,10 +24,10 @@ #define PIRE_SCANNERS_COMMON_H_INCLUDED #include <stdlib.h> -#include <contrib/libs/pire/pire/align.h> -#include <contrib/libs/pire/pire/stub/defaults.h> -#include <contrib/libs/pire/pire/defs.h> -#include <contrib/libs/pire/pire/platform.h> +#include <contrib/libs/pire/pire/align.h> +#include <contrib/libs/pire/pire/stub/defaults.h> +#include <contrib/libs/pire/pire/defs.h> +#include <contrib/libs/pire/pire/platform.h> namespace Pire { namespace ScannerIOTypes { diff --git a/contrib/libs/pire/pire/scanners/loaded.h b/contrib/libs/pire/pire/scanners/loaded.h index c93d5a8268..120dc403b7 100644 --- a/contrib/libs/pire/pire/scanners/loaded.h +++ b/contrib/libs/pire/pire/scanners/loaded.h @@ -25,11 +25,11 @@ #define PIRE_SCANNERS_LOADED_H #include <string.h> - + #include <contrib/libs/pire/pire/approx_matching.h> -#include <contrib/libs/pire/pire/fsm.h> -#include <contrib/libs/pire/pire/partition.h> - +#include <contrib/libs/pire/pire/fsm.h> +#include <contrib/libs/pire/pire/partition.h> + #include "common.h" #ifdef PIRE_DEBUG diff --git a/contrib/libs/pire/pire/scanners/multi.h b/contrib/libs/pire/pire/scanners/multi.h index 4141a84228..29679e416e 100644 --- a/contrib/libs/pire/pire/scanners/multi.h +++ b/contrib/libs/pire/pire/scanners/multi.h @@ -27,17 +27,17 @@ #include <cstring> #include <string.h> #include <contrib/libs/pire/pire/approx_matching.h> -#include <contrib/libs/pire/pire/fsm.h> -#include <contrib/libs/pire/pire/partition.h> -#include <contrib/libs/pire/pire/run.h> -#include <contrib/libs/pire/pire/static_assert.h> -#include <contrib/libs/pire/pire/platform.h> -#include <contrib/libs/pire/pire/glue.h> -#include <contrib/libs/pire/pire/determine.h> -#include <contrib/libs/pire/pire/stub/stl.h> -#include <contrib/libs/pire/pire/stub/saveload.h> -#include <contrib/libs/pire/pire/stub/lexical_cast.h> - +#include <contrib/libs/pire/pire/fsm.h> +#include <contrib/libs/pire/pire/partition.h> +#include <contrib/libs/pire/pire/run.h> +#include <contrib/libs/pire/pire/static_assert.h> +#include <contrib/libs/pire/pire/platform.h> +#include <contrib/libs/pire/pire/glue.h> +#include <contrib/libs/pire/pire/determine.h> +#include <contrib/libs/pire/pire/stub/stl.h> +#include <contrib/libs/pire/pire/stub/saveload.h> +#include <contrib/libs/pire/pire/stub/lexical_cast.h> + #include "common.h" namespace Pire { diff --git a/contrib/libs/pire/pire/scanners/null.cpp b/contrib/libs/pire/pire/scanners/null.cpp index cf3000979a..f0e21ce4d3 100644 --- a/contrib/libs/pire/pire/scanners/null.cpp +++ b/contrib/libs/pire/pire/scanners/null.cpp @@ -1,4 +1,4 @@ -#include <contrib/libs/pire/pire/fsm.h> +#include <contrib/libs/pire/pire/fsm.h> #include "multi.h" #include "half_final.h" #include "simple.h" diff --git a/contrib/libs/pire/pire/scanners/simple.h b/contrib/libs/pire/pire/scanners/simple.h index 20e555a18a..ef959aeed1 100644 --- a/contrib/libs/pire/pire/scanners/simple.h +++ b/contrib/libs/pire/pire/scanners/simple.h @@ -25,10 +25,10 @@ #define PIRE_SCANNERS_SIMPLE_H #include <contrib/libs/pire/pire/approx_matching.h> -#include <contrib/libs/pire/pire/stub/stl.h> -#include <contrib/libs/pire/pire/stub/defaults.h> -#include <contrib/libs/pire/pire/stub/saveload.h> - +#include <contrib/libs/pire/pire/stub/stl.h> +#include <contrib/libs/pire/pire/stub/defaults.h> +#include <contrib/libs/pire/pire/stub/saveload.h> + #include "common.h" namespace Pire { diff --git a/contrib/libs/pire/pire/scanners/slow.h b/contrib/libs/pire/pire/scanners/slow.h index 0f5f42221c..6adfcb8c1d 100644 --- a/contrib/libs/pire/pire/scanners/slow.h +++ b/contrib/libs/pire/pire/scanners/slow.h @@ -25,18 +25,18 @@ #define PIRE_SCANNERS_SLOW_H #include <contrib/libs/pire/pire/approx_matching.h> -#include <contrib/libs/pire/pire/partition.h> -#include <contrib/libs/pire/pire/vbitset.h> -#include <contrib/libs/pire/pire/fsm.h> -#include <contrib/libs/pire/pire/run.h> -#include <contrib/libs/pire/pire/stub/saveload.h> -#include <contrib/libs/pire/pire/stub/stl.h> - +#include <contrib/libs/pire/pire/partition.h> +#include <contrib/libs/pire/pire/vbitset.h> +#include <contrib/libs/pire/pire/fsm.h> +#include <contrib/libs/pire/pire/run.h> +#include <contrib/libs/pire/pire/stub/saveload.h> +#include <contrib/libs/pire/pire/stub/stl.h> + #include "common.h" #ifdef PIRE_DEBUG #include <iostream> -#include <contrib/libs/pire/pire/stub/lexical_cast.h> +#include <contrib/libs/pire/pire/stub/lexical_cast.h> #endif namespace Pire { diff --git a/contrib/libs/pire/pire/vbitset.h b/contrib/libs/pire/pire/vbitset.h index c4a5df8aa8..69cb5aeba3 100644 --- a/contrib/libs/pire/pire/vbitset.h +++ b/contrib/libs/pire/pire/vbitset.h @@ -27,8 +27,8 @@ #include <string.h> -#include <contrib/libs/pire/pire/stub/stl.h> - +#include <contrib/libs/pire/pire/stub/stl.h> + namespace Pire { #ifdef _DEBUG diff --git a/library/cpp/regex/pire/extraencodings.cpp b/library/cpp/regex/pire/extraencodings.cpp index 56563e3a5f..2e507e4b67 100644 --- a/library/cpp/regex/pire/extraencodings.cpp +++ b/library/cpp/regex/pire/extraencodings.cpp @@ -4,7 +4,7 @@ #include <util/generic/singleton.h> #include <util/generic/yexception.h> #include <library/cpp/charset/doccodes.h> - + #include "pire.h" namespace NPire { diff --git a/library/cpp/regex/pire/ya.make b/library/cpp/regex/pire/ya.make index 0f3a457be1..c857e6d18b 100644 --- a/library/cpp/regex/pire/ya.make +++ b/library/cpp/regex/pire/ya.make @@ -7,7 +7,7 @@ OWNER( pg ) -CFLAGS(-DPIRE_NO_CONFIG) +CFLAGS(-DPIRE_NO_CONFIG) SRCDIR(contrib/libs/pire/pire) diff --git a/util/datetime/base.h b/util/datetime/base.h index 58b6dca315..5e902b8f63 100644 --- a/util/datetime/base.h +++ b/util/datetime/base.h @@ -171,7 +171,7 @@ public: return Value_; } -protected: +protected: TValue Value_; // microseconds count }; diff --git a/util/folder/dirent_win.c b/util/folder/dirent_win.c index 9e426b199a..7e6db74ce5 100644 --- a/util/folder/dirent_win.c +++ b/util/folder/dirent_win.c @@ -1,13 +1,13 @@ #include <util/system/defaults.h> - -#ifdef _win_ - + +#ifdef _win_ + #include <stdio.h> #include "dirent_win.h" - + #if defined(_MSC_VER) && (_MSC_VER < 1900) -void __cdecl _dosmaperr(unsigned long); - +void __cdecl _dosmaperr(unsigned long); + static void SetErrno() { _dosmaperr(GetLastError()); } @@ -29,11 +29,11 @@ struct DIR* opendir(const char* dirname) { dir->file_no = 0; dir->readdir_buf = NULL; - int len = strlen(dirname); - //Remove trailing slashes + int len = strlen(dirname); + //Remove trailing slashes while (len && (dirname[len - 1] == '\\' || dirname[len - 1] == '/')) { --len; - } + } int len_converted = MultiByteToWideChar(CP_UTF8, 0, dirname, len, 0, 0); if (len_converted == 0) { closedir(dir); @@ -53,42 +53,42 @@ struct DIR* opendir(const char* dirname) { SetErrno(); closedir(dir); return NULL; - } + } + + return dir; +} - return dir; -} - int closedir(struct DIR* dir) { if (dir->sh != INVALID_HANDLE_VALUE) FindClose(dir->sh); - free(dir->fff_templ); - free(dir->readdir_buf); - free(dir); - return 0; -} - + free(dir->fff_templ); + free(dir->readdir_buf); + free(dir); + return 0; +} + int readdir_r(struct DIR* dir, struct dirent* entry, struct dirent** result) { if (!FindNextFileW(dir->sh, &dir->wfd)) { - int err = GetLastError(); - *result = 0; - if (err == ERROR_NO_MORE_FILES) { - SetLastError(0); - return 0; - } else { - return err; - } - } - entry->d_fileno = dir->file_no++; - entry->d_reclen = sizeof(struct dirent); + int err = GetLastError(); + *result = 0; + if (err == ERROR_NO_MORE_FILES) { + SetLastError(0); + return 0; + } else { + return err; + } + } + entry->d_fileno = dir->file_no++; + entry->d_reclen = sizeof(struct dirent); if (dir->wfd.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT && (dir->wfd.dwReserved0 == IO_REPARSE_TAG_MOUNT_POINT || dir->wfd.dwReserved0 == IO_REPARSE_TAG_SYMLINK)) { - entry->d_type = DT_LNK; + entry->d_type = DT_LNK; } else if (dir->wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - entry->d_type = DT_DIR; - } else { - entry->d_type = DT_REG; - } + entry->d_type = DT_DIR; + } else { + entry->d_type = DT_REG; + } int len = lstrlenW(dir->wfd.cFileName); int conv_len = WideCharToMultiByte(CP_UTF8, 0, dir->wfd.cFileName, len, 0, 0, 0, 0); if (conv_len == 0) { @@ -101,25 +101,25 @@ int readdir_r(struct DIR* dir, struct dirent* entry, struct dirent** result) { entry->d_namlen = conv_len; WideCharToMultiByte(CP_UTF8, 0, dir->wfd.cFileName, len, entry->d_name, conv_len, 0, 0); entry->d_name[conv_len] = 0; - *result = entry; - return 0; -} - + *result = entry; + return 0; +} + struct dirent* readdir(struct DIR* dir) { struct dirent* res; if (!dir->readdir_buf) { - dir->readdir_buf = (struct dirent*)malloc(sizeof(struct dirent)); + dir->readdir_buf = (struct dirent*)malloc(sizeof(struct dirent)); if (dir->readdir_buf == 0) return 0; } - readdir_r(dir, dir->readdir_buf, &res); - return res; -} - + readdir_r(dir, dir->readdir_buf, &res); + return res; +} + void rewinddir(struct DIR* dir) { - FindClose(dir->sh); + FindClose(dir->sh); dir->sh = FindFirstFileW(dir->fff_templ, &dir->wfd); - dir->file_no = 0; -} - -#endif //_win_ + dir->file_no = 0; +} + +#endif //_win_ diff --git a/util/folder/dirent_win.h b/util/folder/dirent_win.h index a432fdf51a..ac11a64c04 100644 --- a/util/folder/dirent_win.h +++ b/util/folder/dirent_win.h @@ -1,15 +1,15 @@ #pragma once - + #include <util/system/defaults.h> - -#ifdef _win_ - + +#ifdef _win_ + #include <util/system/winint.h> - + #ifdef __cplusplus -extern "C" { +extern "C" { #endif - + struct DIR { HANDLE sh; WIN32_FIND_DATAW wfd; @@ -17,14 +17,14 @@ extern "C" { int file_no; struct dirent* readdir_buf; }; - + #define MAXNAMLEN (MAX_PATH - 1) * 2 #define MAXPATHLEN MAX_PATH #define DT_DIR 4 #define DT_REG 8 #define DT_LNK 10 #define DT_UNKNOWN 0 - + struct dirent { ui32 d_fileno; /* file number of entry */ ui16 d_reclen; /* length of this record */ @@ -32,15 +32,15 @@ extern "C" { ui8 d_namlen; /* length of string in d_name */ char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */ }; - + struct DIR* opendir(const char* dirname); int closedir(struct DIR* dir); int readdir_r(struct DIR* dir, struct dirent* entry, struct dirent** result); struct dirent* readdir(struct DIR* dir); void rewinddir(struct DIR* dir); - + #ifdef __cplusplus -} +} #endif -#endif //_win_ +#endif //_win_ diff --git a/util/folder/fts.cpp b/util/folder/fts.cpp index 2e9b22342e..0e6a6f86eb 100644 --- a/util/folder/fts.cpp +++ b/util/folder/fts.cpp @@ -38,58 +38,58 @@ #include <util/system/compiler.h> #include <util/system/defaults.h> #include <util/system/error.h> - + #include <stdlib.h> -#ifndef _win_ +#ifndef _win_ #include <inttypes.h> #include <sys/param.h> #include <dirent.h> #include <errno.h> #include <string.h> #include <unistd.h> -#else +#else #include <direct.h> #include "dirent_win.h" #include "lstat_win.h" -#endif +#endif #include <sys/stat.h> #include <fcntl.h> - + #include "fts.h" -#include <limits.h> - -#ifndef _win_ - +#include <limits.h> + +#ifndef _win_ + static const dird invalidDirD = -1; - -dird get_cwdd() { - return open(".", O_RDONLY, 0); -} - -dird get_dird(char* path) { - return open(path, O_RDONLY, 0); -} - -int valid_dird(dird fd) { - return fd < 0; -} - -void close_dird(dird fd) { - (void)close(fd); -} - -int chdir_dird(dird fd) { - return fchdir(fd); -} - -int cmp_dird(dird fd1, dird fd2) { - return fd1 - fd2; -} - + +dird get_cwdd() { + return open(".", O_RDONLY, 0); +} + +dird get_dird(char* path) { + return open(path, O_RDONLY, 0); +} + +int valid_dird(dird fd) { + return fd < 0; +} + +void close_dird(dird fd) { + (void)close(fd); +} + +int chdir_dird(dird fd) { + return fchdir(fd); +} + +int cmp_dird(dird fd1, dird fd2) { + return fd1 - fd2; +} + #else // ndef _win_ - + int stat64UTF(const char* path, struct _stat64* _Stat) { int len_converted = MultiByteToWideChar(CP_UTF8, 0, path, -1, 0, 0); if (len_converted == 0) { @@ -111,23 +111,23 @@ int stat64UTF(dird path, struct _stat64* _Stat) { } const dird invalidDirD = nullptr; - -dird get_cwdd() { + +dird get_cwdd() { return _wgetcwd(nullptr, 0); -} - -int valid_dird(dird fd) { +} + +int valid_dird(dird fd) { return fd == nullptr; -} - -void close_dird(dird fd) { - free(fd); -} - -int chdir_dird(dird fd) { +} + +void close_dird(dird fd) { + free(fd); +} + +int chdir_dird(dird fd) { return _wchdir(fd); -} - +} + int chdir_dird(const char* path) { int len_converted = MultiByteToWideChar(CP_UTF8, 0, path, -1, 0, 0); if (len_converted == 0) { @@ -143,11 +143,11 @@ int chdir_dird(const char* path) { return ret; } -int cmp_dird(dird fd1, dird fd2) { +int cmp_dird(dird fd1, dird fd2) { return lstrcmpW(fd1, fd2); -} - -dird get_dird(char* path) { +} + +dird get_dird(char* path) { int len_converted = MultiByteToWideChar(CP_UTF8, 0, path, -1, 0, 0); if (len_converted == 0) { return nullptr; @@ -163,7 +163,7 @@ dird get_dird(char* path) { free(buf); return ret; } - + #endif // ndef _win_ #ifdef _win_ @@ -172,9 +172,9 @@ dird get_dird(char* path) { #define S_ISLNK(st_mode) ((st_mode & _S_IFMT) == _S_IFLNK) #define O_RDONLY _O_RDONLY static int fts_safe_changedir(FTS*, FTSENT*, int, dird); -#endif - -#if defined(__svr4__) || defined(__linux__) || defined(__CYGWIN__) || defined(_win_) +#endif + +#if defined(__svr4__) || defined(__linux__) || defined(__CYGWIN__) || defined(_win_) #ifdef MAX #undef MAX #endif @@ -294,16 +294,16 @@ FTS* yfts_open(char* const* argv, int options, int (*compar)(const FTSENT**, con /* Allocate/initialize root(s). */ for (root = nullptr, nitems = 0; *argv; ++argv, ++nitems) { /* Don't allow zero-length paths. */ - - len = strlen(*argv); - -//Any subsequent windows call will expect no trailing slashes so we will remove them here -#ifdef _win_ + + len = strlen(*argv); + +//Any subsequent windows call will expect no trailing slashes so we will remove them here +#ifdef _win_ while (len && ((*argv)[len - 1] == '\\' || (*argv)[len - 1] == '/')) { --len; } -#endif - +#endif + if (len == 0) { errno = ENOENT; goto mem3; @@ -361,7 +361,7 @@ FTS* yfts_open(char* const* argv, int options, int (*compar)(const FTSENT**, con * and ".." are all fairly nasty problems. Note, if we can't get the * descriptor we run anyway, just more slowly. */ - + if (!ISSET(FTS_NOCHDIR) && valid_dird(sp->fts_rfd = get_cwdd())) { SET(FTS_NOCHDIR); } @@ -432,9 +432,9 @@ int yfts_close(FTS* sp) /* Return to original directory, save errno if necessary. */ if (!ISSET(FTS_NOCHDIR)) { - saved_errno = chdir_dird(sp->fts_rfd) ? errno : 0; - close_dird(sp->fts_rfd); - + saved_errno = chdir_dird(sp->fts_rfd) ? errno : 0; + close_dird(sp->fts_rfd); + /* Set errno and return. */ if (saved_errno != 0) { /* Free up the stream pointer. */ @@ -784,12 +784,12 @@ fts_build(FTS* sp, int type) int nitems; FTSENT *cur, *tail; -#ifdef _win_ - dird dirpd; +#ifdef _win_ + dird dirpd; struct DIR* dirp; -#else +#else DIR* dirp; -#endif +#endif void* oldaddr; int cderrno, descend, len, level, maxlen, nlinks, saved_errno, @@ -819,10 +819,10 @@ fts_build(FTS* sp, int type) return nullptr; } -#ifdef _win_ - dirpd = get_dird(cur->fts_accpath); -#endif - +#ifdef _win_ + dirpd = get_dird(cur->fts_accpath); +#endif + /* * Nlinks is the number of possible entries of type directory in the * directory if we're cheating on stat calls, 0 if we're not doing @@ -857,11 +857,11 @@ fts_build(FTS* sp, int type) */ cderrno = 0; if (nlinks || type == BREAD) { -#ifndef _win_ +#ifndef _win_ if (fts_safe_changedir(sp, cur, dirfd(dirp), nullptr)) { -#else - if (fts_safe_changedir(sp, cur, -1, dirpd)) { -#endif +#else + if (fts_safe_changedir(sp, cur, -1, dirpd)) { +#endif if (nlinks && type == BREAD) { cur->fts_errno = errno; @@ -871,12 +871,12 @@ fts_build(FTS* sp, int type) cderrno = errno; (void)closedir(dirp); dirp = nullptr; -#ifdef _win_ - close_dird(dirpd); +#ifdef _win_ + close_dird(dirpd); dirpd = invalidDirD; #else Y_UNUSED(invalidDirD); -#endif +#endif } else { descend = 1; } @@ -936,9 +936,9 @@ fts_build(FTS* sp, int type) } fts_lfree(head); (void)closedir(dirp); -#ifdef _win_ - close_dird(dirpd); -#endif +#ifdef _win_ + close_dird(dirpd); +#endif cur->fts_info = FTS_ERR; SET(FTS_STOP); errno = saved_errno; @@ -964,9 +964,9 @@ fts_build(FTS* sp, int type) free(p); fts_lfree(head); (void)closedir(dirp); -#ifdef _win_ - close_dird(dirpd); -#endif +#ifdef _win_ + close_dird(dirpd); +#endif cur->fts_info = FTS_ERR; SET(FTS_STOP); errno = ENAMETOOLONG; @@ -1038,12 +1038,12 @@ fts_build(FTS* sp, int type) } ++nitems; } - if (dirp) { + if (dirp) { (void)closedir(dirp); -#ifdef _win_ - close_dird(dirpd); -#endif - } +#ifdef _win_ + close_dird(dirpd); +#endif + } /* * If realloc() changed the address of the path, adjust the @@ -1130,7 +1130,7 @@ fts_stat(FTS* sp, FTSENT* p, int follow) } p->fts_errno = saved_errno; memset(sbp, 0, sizeof(stat_struct)); - return (FTS_NS); + return (FTS_NS); } } else if (lstat(p->fts_accpath, sbp)) { p->fts_errno = errno; @@ -1138,7 +1138,7 @@ fts_stat(FTS* sp, FTSENT* p, int follow) return (FTS_NS); } - if (S_ISDIR(sbp->st_mode)) { + if (S_ISDIR(sbp->st_mode)) { /* * Set the device/inode. Used to find cycles and check for * crossing mount points. Also remember the link count, used @@ -1161,10 +1161,10 @@ fts_stat(FTS* sp, FTSENT* p, int follow) * number of symbolic links to directories is high enough, * something faster might be worthwhile. */ - + //There is no way to detect symlink or mount cycles on win32 - -#ifndef _win_ + +#ifndef _win_ FTSENT* t; for (t = p->fts_parent; t->fts_level >= FTS_ROOTLEVEL; t = t->fts_parent) { @@ -1173,7 +1173,7 @@ fts_stat(FTS* sp, FTSENT* p, int follow) return (FTS_DC); } } -#endif /*_win_*/ +#endif /*_win_*/ return (FTS_D); } if (S_ISLNK(sbp->st_mode)) { @@ -1353,8 +1353,8 @@ fts_maxarglen(char* const* argv) * tricked by someone changing the world out from underneath us. * Assumes p->fts_dev and p->fts_ino are filled in. */ - -#ifndef _win_ + +#ifndef _win_ static int fts_safe_changedir(FTS* sp, FTSENT* p, int fd, const char* path) { @@ -1386,28 +1386,28 @@ bail: errno = oerrno; return (ret); } -#else -static int +#else +static int fts_safe_changedir(FTS* sp, FTSENT* p, int /*fd*/, const char* path) -{ - int ret; +{ + int ret; stat_struct sb; - - if (ISSET(FTS_NOCHDIR)) - return (0); + + if (ISSET(FTS_NOCHDIR)) + return (0); if (STAT_FUNC(path, &sb)) { - ret = -1; - goto bail; - } - if (p->fts_dev != sb.st_dev) { + ret = -1; + goto bail; + } + if (p->fts_dev != sb.st_dev) { errno = ENOENT; /* disinformation */ - ret = -1; - goto bail; - } + ret = -1; + goto bail; + } ret = chdir_dird(path); -bail: - return (ret); -} +bail: + return (ret); +} static int fts_safe_changedir(FTS* sp, FTSENT* p, int /*fd*/, dird path) { @@ -1429,4 +1429,4 @@ fts_safe_changedir(FTS* sp, FTSENT* p, int /*fd*/, dird path) { bail: return (ret); } -#endif +#endif diff --git a/util/folder/fts.h b/util/folder/fts.h index bd76bbb473..f3c799e8c8 100644 --- a/util/folder/fts.h +++ b/util/folder/fts.h @@ -1,14 +1,14 @@ #pragma once -#include <sys/types.h> +#include <sys/types.h> #include <util/system/defaults.h> - -#ifndef _win32_ + +#ifndef _win32_ typedef int dird; typedef struct stat stat_struct; #define STAT_FUNC stat -#else +#else #include <util/folder/dirent_win.h> typedef WCHAR* dird; typedef unsigned short u_short; @@ -20,8 +20,8 @@ typedef struct _stat64 stat_struct; int stat64UTF(const char* path, struct _stat64* _Stat); int stat64UTF(dird path, struct _stat64* _Stat); #endif -#endif - +#endif + typedef struct { struct _ftsent* fts_cur; /* current node */ struct _ftsent* fts_child; /* linked list of children */ diff --git a/util/folder/fts_ut.cpp b/util/folder/fts_ut.cpp index 51882b2317..c5d59e35f4 100644 --- a/util/folder/fts_ut.cpp +++ b/util/folder/fts_ut.cpp @@ -4,60 +4,60 @@ #include <library/cpp/testing/unittest/registar.h> #include <library/cpp/threading/future/async.h> - + #include <util/system/file.h> #include <util/system/tempfile.h> #include <util/generic/string.h> - -class TFtsTest: public TTestBase { + +class TFtsTest: public TTestBase { UNIT_TEST_SUITE(TFtsTest); UNIT_TEST(TestSimple); UNIT_TEST(TestNoLeakChangingAccessToFolder); UNIT_TEST_SUITE_END(); - + public: void TestSimple(); void TestNoLeakChangingAccessToFolder(); -}; - +}; + void MakeFile(const char* path) { TFile(path, CreateAlways); -} - -//There potentially could be problems in listing order on different platforms +} + +//There potentially could be problems in listing order on different platforms int FtsCmp(const FTSENT** ent1, const FTSENT** ent2) { - return strcmp((*ent1)->fts_accpath, (*ent2)->fts_accpath); -} - + return strcmp((*ent1)->fts_accpath, (*ent2)->fts_accpath); +} + void CheckEnt(FTSENT* ent, const char* name, int type) { - UNIT_ASSERT(ent); - UNIT_ASSERT_STRINGS_EQUAL(ent->fts_path, name); - UNIT_ASSERT_EQUAL(ent->fts_info, type); -} - + UNIT_ASSERT(ent); + UNIT_ASSERT_STRINGS_EQUAL(ent->fts_path, name); + UNIT_ASSERT_EQUAL(ent->fts_info, type); +} + class TFileTree { -public: +public: TFileTree(char* const* argv, int options, int (*compar)(const FTSENT**, const FTSENT**)) { Fts_ = yfts_open(argv, options, compar); - } - + } + ~TFileTree() { yfts_close(Fts_); - } - - FTS* operator()() { + } + + FTS* operator()() { return Fts_; - } + } -private: +private: FTS* Fts_; -}; - +}; + void TFtsTest::TestSimple() { const char* dotPath[2] = {"." LOCSLASH_S, nullptr}; TFileTree currentDirTree((char* const*)dotPath, 0, FtsCmp); - UNIT_ASSERT(currentDirTree()); - TTempDir tempDir = MakeTempName(yfts_read(currentDirTree())->fts_path); + UNIT_ASSERT(currentDirTree()); + TTempDir tempDir = MakeTempName(yfts_read(currentDirTree())->fts_path); MakeDirIfNotExist(tempDir().data()); MakeDirIfNotExist((tempDir() + LOCSLASH_S "dir1").data()); MakeFile((tempDir() + LOCSLASH_S "dir1" LOCSLASH_S "file1").data()); @@ -65,10 +65,10 @@ void TFtsTest::TestSimple() { MakeDirIfNotExist((tempDir() + LOCSLASH_S "dir2").data()); MakeFile((tempDir() + LOCSLASH_S "dir2" LOCSLASH_S "file3").data()); MakeFile((tempDir() + LOCSLASH_S "dir2" LOCSLASH_S "file4").data()); - + const char* path[2] = {tempDir().data(), nullptr}; TFileTree fileTree((char* const*)path, 0, FtsCmp); - UNIT_ASSERT(fileTree()); + UNIT_ASSERT(fileTree()); CheckEnt(yfts_read(fileTree()), tempDir().data(), FTS_D); CheckEnt(yfts_read(fileTree()), (tempDir() + LOCSLASH_S "dir1").data(), FTS_D); CheckEnt(yfts_read(fileTree()), (tempDir() + LOCSLASH_S "dir1" LOCSLASH_S "file1").data(), FTS_F); @@ -80,8 +80,8 @@ void TFtsTest::TestSimple() { CheckEnt(yfts_read(fileTree()), (tempDir() + LOCSLASH_S "dir2").data(), FTS_DP); CheckEnt(yfts_read(fileTree()), (tempDir()).data(), FTS_DP); UNIT_ASSERT_EQUAL(yfts_read(fileTree()), nullptr); -} - +} + class TTempDirWithLostAccess: public TTempDir { public: ~TTempDirWithLostAccess() { diff --git a/util/folder/lstat_win.c b/util/folder/lstat_win.c index 0a1456a3e7..cf94cec01a 100644 --- a/util/folder/lstat_win.c +++ b/util/folder/lstat_win.c @@ -1,6 +1,6 @@ #include <util/system/defaults.h> - -#ifdef _win_ + +#ifdef _win_ #include <util/system/winint.h> #include "lstat_win.h" @@ -14,22 +14,22 @@ int lstat(const char* fileName, stat_struct* fileStat) { MultiByteToWideChar(CP_UTF8, 0, fileName, len, buf, convRes); buf[convRes] = 0; - HANDLE findHandle; + HANDLE findHandle; WIN32_FIND_DATAW findBuf; - int result; + int result; result = _wstat64(buf, fileStat); - if (result == 0) { + if (result == 0) { SetLastError(0); findHandle = FindFirstFileW(buf, &findBuf); if (findBuf.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT && (findBuf.dwReserved0 == IO_REPARSE_TAG_MOUNT_POINT || findBuf.dwReserved0 == IO_REPARSE_TAG_SYMLINK)) { - fileStat->st_mode = fileStat->st_mode & ~_S_IFMT | _S_IFLNK; - } - FindClose(findHandle); - } + fileStat->st_mode = fileStat->st_mode & ~_S_IFMT | _S_IFLNK; + } + FindClose(findHandle); + } free(buf); - return result; -} - -#endif //_win_ + return result; +} + +#endif //_win_ diff --git a/util/folder/lstat_win.h b/util/folder/lstat_win.h index 10152db2b5..0bf7c19055 100644 --- a/util/folder/lstat_win.h +++ b/util/folder/lstat_win.h @@ -1,20 +1,20 @@ #pragma once - + #include <util/system/defaults.h> #include "fts.h" - -#ifdef _win_ + +#ifdef _win_ #include <sys/stat.h> - + #ifdef __cplusplus -extern "C" { +extern "C" { #endif - + #define _S_IFLNK 0xA000 int lstat(const char* fileName, stat_struct* fileStat); - + #ifdef __cplusplus -} +} #endif - -#endif //_win_ + +#endif //_win_ diff --git a/util/system/datetime.cpp b/util/system/datetime.cpp index 0ea6c77ac2..b07b50679a 100644 --- a/util/system/datetime.cpp +++ b/util/system/datetime.cpp @@ -40,38 +40,38 @@ ui64 MicroSeconds() noexcept { ui64 ThreadCPUUserTime() noexcept { #if defined(_win_) - FILETIME creationTime, exitTime, kernelTime, userTime; - GetThreadTimes(GetCurrentThread(), &creationTime, &exitTime, &kernelTime, &userTime); - return ToMicroSeconds(userTime); -#else - return 0; -#endif -} - + FILETIME creationTime, exitTime, kernelTime, userTime; + GetThreadTimes(GetCurrentThread(), &creationTime, &exitTime, &kernelTime, &userTime); + return ToMicroSeconds(userTime); +#else + return 0; +#endif +} + ui64 ThreadCPUSystemTime() noexcept { #if defined(_win_) - FILETIME creationTime, exitTime, kernelTime, userTime; - GetThreadTimes(GetCurrentThread(), &creationTime, &exitTime, &kernelTime, &userTime); - return ToMicroSeconds(kernelTime); -#else - return 0; -#endif -} - + FILETIME creationTime, exitTime, kernelTime, userTime; + GetThreadTimes(GetCurrentThread(), &creationTime, &exitTime, &kernelTime, &userTime); + return ToMicroSeconds(kernelTime); +#else + return 0; +#endif +} + ui64 ThreadCPUTime() noexcept { #if defined(_win_) - FILETIME creationTime, exitTime, kernelTime, userTime; - GetThreadTimes(GetCurrentThread(), &creationTime, &exitTime, &kernelTime, &userTime); - return ToMicroSeconds(userTime) + ToMicroSeconds(kernelTime); + FILETIME creationTime, exitTime, kernelTime, userTime; + GetThreadTimes(GetCurrentThread(), &creationTime, &exitTime, &kernelTime, &userTime); + return ToMicroSeconds(userTime) + ToMicroSeconds(kernelTime); #elif defined(Y_HAS_CLOCK_GETTIME) struct timespec ts; clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts); return ToMicroSeconds(ts); #else return 0; -#endif -} - +#endif +} + ui32 Seconds() noexcept { struct timeval tv; gettimeofday(&tv, nullptr); diff --git a/util/system/datetime.h b/util/system/datetime.h index 1d502cac96..aa009974e0 100644 --- a/util/system/datetime.h +++ b/util/system/datetime.h @@ -27,7 +27,7 @@ inline ui64 millisec() { } /// Current time in seconds since epoch ui32 Seconds() noexcept; -///Current thread time in microseconds +///Current thread time in microseconds ui64 ThreadCPUUserTime() noexcept; ui64 ThreadCPUSystemTime() noexcept; ui64 ThreadCPUTime() noexcept; diff --git a/util/system/file.cpp b/util/system/file.cpp index c2ef13aae1..4a261d020c 100644 --- a/util/system/file.cpp +++ b/util/system/file.cpp @@ -106,11 +106,11 @@ TFileHandle::TFileHandle(const TString& fName, EOpenMode oMode) noexcept { faMode |= GENERIC_WRITE; } if (oMode & ::ForAppend) { - faMode |= GENERIC_WRITE; + faMode |= GENERIC_WRITE; faMode |= FILE_APPEND_DATA; - faMode &= ~FILE_WRITE_DATA; - } - + faMode &= ~FILE_WRITE_DATA; + } + bool inheritHandle = !(oMode & CloseOnExec); ui32 shMode = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE; @@ -139,7 +139,7 @@ TFileHandle::TFileHandle(const TString& fName, EOpenMode oMode) noexcept { if ((oMode & ::ForAppend) && (Fd_ != INVALID_FHANDLE)) { ::SetFilePointer(Fd_, 0, 0, FILE_END); } - + #elif defined(_unix_) switch (createMode) { |