Просмотр исходного кода

Restoring authorship annotation for Ivan Blinkov <ivan@blinkov.ru>. Commit 2 of 2.

Ivan Blinkov 3 лет назад
Родитель
Сommit
5b283123c8

+ 1 - 1
build/ya.conf.json

@@ -7135,7 +7135,7 @@
                 "sandbox_id": 32521995,
                 "match": "KiWi python protos"
             }
-        }, 
+        },
         "allure_commandline": {
             "formula": {
                 "sandbox_id": 569859192,

+ 27 - 27
contrib/libs/hyperscan/include/boost-patched/graph/reverse_graph.hpp

@@ -1,27 +1,27 @@
-#ifndef REVERSE_GRAPH_PATCHED_H_ 
-#define REVERSE_GRAPH_PATCHED_H_ 
- 
-#include <boost/version.hpp> 
- 
-#include <boost/graph/reverse_graph.hpp> 
- 
-#if defined(BOOST_REVGRAPH_PATCH) 
- 
-// Boost 1.62.0 does not implement degree() in reverse_graph which is required 
-// by BidirectionalGraph, so add it. 
- 
-namespace boost { 
- 
-template <class BidirectionalGraph, class GRef> 
-inline typename graph_traits<BidirectionalGraph>::degree_size_type 
-degree(const typename graph_traits<BidirectionalGraph>::vertex_descriptor u, 
-       const reverse_graph<BidirectionalGraph,GRef>& g) 
-{ 
-    return degree(u, g.m_g); 
-} 
- 
-} // namespace boost 
- 
-#endif // Boost 1.62.0 
- 
-#endif 
+#ifndef REVERSE_GRAPH_PATCHED_H_
+#define REVERSE_GRAPH_PATCHED_H_
+
+#include <boost/version.hpp>
+
+#include <boost/graph/reverse_graph.hpp>
+
+#if defined(BOOST_REVGRAPH_PATCH)
+
+// Boost 1.62.0 does not implement degree() in reverse_graph which is required
+// by BidirectionalGraph, so add it.
+
+namespace boost {
+
+template <class BidirectionalGraph, class GRef>
+inline typename graph_traits<BidirectionalGraph>::degree_size_type
+degree(const typename graph_traits<BidirectionalGraph>::vertex_descriptor u,
+       const reverse_graph<BidirectionalGraph,GRef>& g)
+{
+    return degree(u, g.m_g);
+}
+
+} // namespace boost
+
+#endif // Boost 1.62.0
+
+#endif

+ 10 - 10
contrib/libs/hyperscan/src/alloc.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2017, Intel Corporation 
+ * Copyright (c) 2015-2017, Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -67,7 +67,7 @@ hs_free_t normalise_free(hs_free_t f) {
 }
 
 HS_PUBLIC_API
-hs_error_t HS_CDECL hs_set_allocator(hs_alloc_t allocfunc, hs_free_t freefunc) { 
+hs_error_t HS_CDECL hs_set_allocator(hs_alloc_t allocfunc, hs_free_t freefunc) {
     hs_set_database_allocator(allocfunc, freefunc);
     hs_set_misc_allocator(allocfunc, freefunc);
     hs_set_stream_allocator(allocfunc, freefunc);
@@ -77,8 +77,8 @@ hs_error_t HS_CDECL hs_set_allocator(hs_alloc_t allocfunc, hs_free_t freefunc) {
 }
 
 HS_PUBLIC_API
-hs_error_t HS_CDECL hs_set_database_allocator(hs_alloc_t allocfunc, 
-                                              hs_free_t freefunc) { 
+hs_error_t HS_CDECL hs_set_database_allocator(hs_alloc_t allocfunc,
+                                              hs_free_t freefunc) {
     hs_database_alloc = normalise_alloc(allocfunc);
     hs_database_free = normalise_free(freefunc);
 
@@ -86,8 +86,8 @@ hs_error_t HS_CDECL hs_set_database_allocator(hs_alloc_t allocfunc,
 }
 
 HS_PUBLIC_API
-hs_error_t HS_CDECL hs_set_misc_allocator(hs_alloc_t allocfunc, 
-                                          hs_free_t freefunc) { 
+hs_error_t HS_CDECL hs_set_misc_allocator(hs_alloc_t allocfunc,
+                                          hs_free_t freefunc) {
     hs_misc_alloc = normalise_alloc(allocfunc);
     hs_misc_free = normalise_free(freefunc);
 
@@ -95,8 +95,8 @@ hs_error_t HS_CDECL hs_set_misc_allocator(hs_alloc_t allocfunc,
 }
 
 HS_PUBLIC_API
-hs_error_t HS_CDECL hs_set_scratch_allocator(hs_alloc_t allocfunc, 
-                                             hs_free_t freefunc) { 
+hs_error_t HS_CDECL hs_set_scratch_allocator(hs_alloc_t allocfunc,
+                                             hs_free_t freefunc) {
     hs_scratch_alloc = normalise_alloc(allocfunc);
     hs_scratch_free = normalise_free(freefunc);
 
@@ -104,8 +104,8 @@ hs_error_t HS_CDECL hs_set_scratch_allocator(hs_alloc_t allocfunc,
 }
 
 HS_PUBLIC_API
-hs_error_t HS_CDECL hs_set_stream_allocator(hs_alloc_t allocfunc, 
-                                            hs_free_t freefunc) { 
+hs_error_t HS_CDECL hs_set_stream_allocator(hs_alloc_t allocfunc,
+                                            hs_free_t freefunc) {
     hs_stream_alloc = normalise_alloc(allocfunc);
     hs_stream_free = normalise_free(freefunc);
 

+ 27 - 27
contrib/libs/hyperscan/src/compiler/asserts.cpp

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2017, Intel Corporation 
+ * Copyright (c) 2015-2017, Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -42,8 +42,8 @@
  * word-to-word and word-to-nonword) are dropped.
  */
 #include "asserts.h"
- 
-#include "compiler/compiler.h" 
+
+#include "compiler/compiler.h"
 #include "nfagraph/ng.h"
 #include "nfagraph/ng_prune.h"
 #include "nfagraph/ng_redundancy.h"
@@ -117,13 +117,13 @@ u32 conjunct(u32 flags1, u32 flags2) {
 typedef map<pair<NFAVertex, NFAVertex>, NFAEdge> edge_cache_t;
 
 static
-void replaceAssertVertex(NGHolder &g, NFAVertex t, const ExpressionInfo &expr, 
-                         edge_cache_t &edge_cache, u32 &assert_edge_count) { 
-    DEBUG_PRINTF("replacing assert vertex %zu\n", g[t].index); 
+void replaceAssertVertex(NGHolder &g, NFAVertex t, const ExpressionInfo &expr,
+                         edge_cache_t &edge_cache, u32 &assert_edge_count) {
+    DEBUG_PRINTF("replacing assert vertex %zu\n", g[t].index);
 
     const u32 flags = g[t].assert_flags;
-    DEBUG_PRINTF("consider assert vertex %zu with flags %u\n", g[t].index, 
-                 flags); 
+    DEBUG_PRINTF("consider assert vertex %zu with flags %u\n", g[t].index,
+                 flags);
 
     // Wire up all the predecessors to all the successors.
 
@@ -144,7 +144,7 @@ void replaceAssertVertex(NGHolder &g, NFAVertex t, const ExpressionInfo &expr,
         for (const auto &outEdge : out_edges_range(t, g)) {
             NFAVertex v = target(outEdge, g);
 
-            DEBUG_PRINTF("consider path [%zu,%zu,%zu]\n", g[u].index, 
+            DEBUG_PRINTF("consider path [%zu,%zu,%zu]\n", g[u].index,
                          g[t].index, g[v].index);
 
             if (v == t) {
@@ -175,16 +175,16 @@ void replaceAssertVertex(NGHolder &g, NFAVertex t, const ExpressionInfo &expr,
             auto cache_key = make_pair(u, v);
             auto ecit = edge_cache.find(cache_key);
             if (ecit == edge_cache.end()) {
-                DEBUG_PRINTF("adding edge %zu %zu\n", g[u].index, g[v].index); 
-                NFAEdge e = add_edge(u, v, g); 
+                DEBUG_PRINTF("adding edge %zu %zu\n", g[u].index, g[v].index);
+                NFAEdge e = add_edge(u, v, g);
                 edge_cache.emplace(cache_key, e);
                 g[e].assert_flags = flags;
                 if (++assert_edge_count > MAX_ASSERT_EDGES) {
-                    throw CompileError(expr.index, "Pattern is too large."); 
+                    throw CompileError(expr.index, "Pattern is too large.");
                 }
             } else {
                 NFAEdge e = ecit->second;
-                DEBUG_PRINTF("updating edge %zu %zu [a %zu]\n", g[u].index, 
+                DEBUG_PRINTF("updating edge %zu %zu [a %zu]\n", g[u].index,
                              g[v].index, g[t].index);
                 // Edge already exists.
                 u32 &e_flags = g[e].assert_flags;
@@ -201,29 +201,29 @@ void replaceAssertVertex(NGHolder &g, NFAVertex t, const ExpressionInfo &expr,
 }
 
 static
-void setReportId(ReportManager &rm, NGHolder &g, const ExpressionInfo &expr, 
-                 NFAVertex v, s32 adj) { 
+void setReportId(ReportManager &rm, NGHolder &g, const ExpressionInfo &expr,
+                 NFAVertex v, s32 adj) {
     // Don't try and set the report ID of a special vertex.
     assert(!is_special(v, g));
 
     // There should be no reports set already.
     assert(g[v].reports.empty());
 
-    Report r = rm.getBasicInternalReport(expr, adj); 
+    Report r = rm.getBasicInternalReport(expr, adj);
 
     g[v].reports.insert(rm.getInternalId(r));
-    DEBUG_PRINTF("set report id for vertex %zu, adj %d\n", g[v].index, adj); 
+    DEBUG_PRINTF("set report id for vertex %zu, adj %d\n", g[v].index, adj);
 }
 
 static
-void checkForMultilineStart(ReportManager &rm, NGHolder &g, 
-                            const ExpressionInfo &expr) { 
+void checkForMultilineStart(ReportManager &rm, NGHolder &g,
+                            const ExpressionInfo &expr) {
     vector<NFAEdge> dead;
     for (auto v : adjacent_vertices_range(g.start, g)) {
         if (!(g[v].assert_flags & POS_FLAG_MULTILINE_START)) {
             continue;
         }
-        DEBUG_PRINTF("mls %zu %08x\n", g[v].index, g[v].assert_flags); 
+        DEBUG_PRINTF("mls %zu %08x\n", g[v].index, g[v].assert_flags);
 
         /* we have found a multi-line start (maybe more than one) */
 
@@ -241,7 +241,7 @@ void checkForMultilineStart(ReportManager &rm, NGHolder &g,
     for (const auto &e : dead) {
         NFAVertex dummy = add_vertex(g);
         g[dummy].char_reach.setall();
-        setReportId(rm, g, expr, dummy, -1); 
+        setReportId(rm, g, expr, dummy, -1);
         add_edge(source(e, g), dummy, g[e], g);
         add_edge(dummy, g.accept, g);
     }
@@ -266,8 +266,8 @@ bool hasAssertVertices(const NGHolder &g) {
  * Remove the horrors that are the temporary assert vertices which arise from
  * our construction method. Allows the rest of our code base to live in
  * blissful ignorance of their existence. */
-void removeAssertVertices(ReportManager &rm, NGHolder &g, 
-                          const ExpressionInfo &expr) { 
+void removeAssertVertices(ReportManager &rm, NGHolder &g,
+                          const ExpressionInfo &expr) {
     size_t num = 0;
 
     DEBUG_PRINTF("before: graph has %zu vertices\n", num_vertices(g));
@@ -289,19 +289,19 @@ void removeAssertVertices(ReportManager &rm, NGHolder &g,
 
     for (auto v : vertices_range(g)) {
         if (g[v].assert_flags & WORDBOUNDARY_FLAGS) {
-            replaceAssertVertex(g, v, expr, edge_cache, assert_edge_count); 
+            replaceAssertVertex(g, v, expr, edge_cache, assert_edge_count);
             num++;
         }
     }
 
-    checkForMultilineStart(rm, g, expr); 
+    checkForMultilineStart(rm, g, expr);
 
     if (num) {
         DEBUG_PRINTF("resolved %zu assert vertices\n", num);
         pruneUseless(g);
         pruneEmptyVertices(g);
-        renumber_vertices(g); 
-        renumber_edges(g); 
+        renumber_vertices(g);
+        renumber_edges(g);
     }
 
     DEBUG_PRINTF("after: graph has %zu vertices\n", num_vertices(g));

+ 5 - 5
contrib/libs/hyperscan/src/compiler/asserts.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2017, Intel Corporation 
+ * Copyright (c) 2015-2017, Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -35,9 +35,9 @@
 
 namespace ue2 {
 
-class ExpressionInfo; 
+class ExpressionInfo;
 class ReportManager;
-class NGHolder; 
+class NGHolder;
 
 /** \brief Convert temporary assert vertices (from construction method) to
  * edge-based flags.
@@ -45,8 +45,8 @@ class NGHolder;
  * Remove the horrors that are the temporary assert vertices which arise from
  * our construction method. Allows the rest of our code base to live in
  * blissful ignorance of their existence. */
-void removeAssertVertices(ReportManager &rm, NGHolder &g, 
-                          const ExpressionInfo &expr); 
+void removeAssertVertices(ReportManager &rm, NGHolder &g,
+                          const ExpressionInfo &expr);
 
 } // namespace ue2
 

+ 120 - 120
contrib/libs/hyperscan/src/compiler/compiler.cpp

@@ -29,10 +29,10 @@
 /** \file
  * \brief Compiler front-end interface.
  */
-#include "allocator.h" 
+#include "allocator.h"
 #include "asserts.h"
 #include "compiler.h"
-#include "crc32.h" 
+#include "crc32.h"
 #include "database.h"
 #include "grey.h"
 #include "hs_internal.h"
@@ -58,7 +58,7 @@
 #include "rose/rose_build.h"
 #include "rose/rose_internal.h"
 #include "som/slot_manager_dump.h"
-#include "util/bytecode_ptr.h" 
+#include "util/bytecode_ptr.h"
 #include "util/compile_error.h"
 #include "util/target_info.h"
 #include "util/verify_types.h"
@@ -80,9 +80,9 @@ static
 void validateExt(const hs_expr_ext &ext) {
     static const unsigned long long ALL_EXT_FLAGS = HS_EXT_FLAG_MIN_OFFSET |
                                                     HS_EXT_FLAG_MAX_OFFSET |
-                                                    HS_EXT_FLAG_MIN_LENGTH | 
-                                                    HS_EXT_FLAG_EDIT_DISTANCE | 
-                                                    HS_EXT_FLAG_HAMMING_DISTANCE; 
+                                                    HS_EXT_FLAG_MIN_LENGTH |
+                                                    HS_EXT_FLAG_EDIT_DISTANCE |
+                                                    HS_EXT_FLAG_HAMMING_DISTANCE;
     if (ext.flags & ~ALL_EXT_FLAGS) {
         throw CompileError("Invalid hs_expr_ext flag set.");
     }
@@ -100,13 +100,13 @@ void validateExt(const hs_expr_ext &ext) {
         throw CompileError("In hs_expr_ext, min_length must be less than or "
                            "equal to max_offset.");
     }
- 
-    if ((ext.flags & HS_EXT_FLAG_EDIT_DISTANCE) && 
-        (ext.flags & HS_EXT_FLAG_HAMMING_DISTANCE)) { 
-        throw CompileError("In hs_expr_ext, cannot have both edit distance and " 
-                           "Hamming distance."); 
-    } 
- 
+
+    if ((ext.flags & HS_EXT_FLAG_EDIT_DISTANCE) &&
+        (ext.flags & HS_EXT_FLAG_HAMMING_DISTANCE)) {
+        throw CompileError("In hs_expr_ext, cannot have both edit distance and "
+                           "Hamming distance.");
+    }
+
 }
 
 void ParsedLitExpression::parseLiteral(const char *expression, size_t len,
@@ -150,10 +150,10 @@ ParsedLitExpression::ParsedLitExpression(unsigned index_in,
 }
 
 ParsedExpression::ParsedExpression(unsigned index_in, const char *expression,
-                                   unsigned flags, ReportID report, 
+                                   unsigned flags, ReportID report,
                                    const hs_expr_ext *ext)
-    : expr(index_in, flags & HS_FLAG_ALLOWEMPTY, flags & HS_FLAG_SINGLEMATCH, 
-           false, flags & HS_FLAG_PREFILTER, SOM_NONE, report, 0, MAX_OFFSET, 
+    : expr(index_in, flags & HS_FLAG_ALLOWEMPTY, flags & HS_FLAG_SINGLEMATCH,
+           false, flags & HS_FLAG_PREFILTER, SOM_NONE, report, 0, MAX_OFFSET,
            0, 0, 0, flags & HS_FLAG_QUIET) {
     // We disallow SOM + Quiet.
     if ((flags & HS_FLAG_QUIET) && (flags & HS_FLAG_SOM_LEFTMOST)) {
@@ -165,7 +165,7 @@ ParsedExpression::ParsedExpression(unsigned index_in, const char *expression,
 
     component = parse(expression, mode);
 
-    expr.utf8 = mode.utf8; /* utf8 may be set by parse() */ 
+    expr.utf8 = mode.utf8; /* utf8 may be set by parse() */
 
     const size_t len = strlen(expression);
     if (expr.utf8 && !isValidUtf8(expression, len)) {
@@ -196,7 +196,7 @@ ParsedExpression::ParsedExpression(unsigned index_in, const char *expression,
 
     // Set SOM type.
     if (flags & HS_FLAG_SOM_LEFTMOST) {
-        expr.som = SOM_LEFT; 
+        expr.som = SOM_LEFT;
     }
 
     // Set extended parameters, if we have them.
@@ -205,32 +205,32 @@ ParsedExpression::ParsedExpression(unsigned index_in, const char *expression,
         validateExt(*ext);
 
         if (ext->flags & HS_EXT_FLAG_MIN_OFFSET) {
-            expr.min_offset = ext->min_offset; 
+            expr.min_offset = ext->min_offset;
         }
         if (ext->flags & HS_EXT_FLAG_MAX_OFFSET) {
-            expr.max_offset = ext->max_offset; 
+            expr.max_offset = ext->max_offset;
         }
         if (ext->flags & HS_EXT_FLAG_MIN_LENGTH) {
-            expr.min_length = ext->min_length; 
+            expr.min_length = ext->min_length;
+        }
+        if (ext->flags & HS_EXT_FLAG_EDIT_DISTANCE) {
+            expr.edit_distance = ext->edit_distance;
+        }
+        if (ext->flags & HS_EXT_FLAG_HAMMING_DISTANCE) {
+            expr.hamm_distance = ext->hamming_distance;
         }
-        if (ext->flags & HS_EXT_FLAG_EDIT_DISTANCE) { 
-            expr.edit_distance = ext->edit_distance; 
-        } 
-        if (ext->flags & HS_EXT_FLAG_HAMMING_DISTANCE) { 
-            expr.hamm_distance = ext->hamming_distance; 
-        } 
     }
 
     // These are validated in validateExt, so an error will already have been
     // thrown if these conditions don't hold.
-    assert(expr.max_offset >= expr.min_offset); 
-    assert(expr.max_offset >= expr.min_length); 
+    assert(expr.max_offset >= expr.min_offset);
+    assert(expr.max_offset >= expr.min_length);
 
     // Since prefiltering and SOM aren't supported together, we must squash any
     // min_length constraint as well.
-    if (flags & HS_FLAG_PREFILTER && expr.min_length) { 
+    if (flags & HS_FLAG_PREFILTER && expr.min_length) {
         DEBUG_PRINTF("prefiltering mode: squashing min_length constraint\n");
-        expr.min_length = 0; 
+        expr.min_length = 0;
     }
 }
 
@@ -239,25 +239,25 @@ ParsedExpression::ParsedExpression(unsigned index_in, const char *expression,
  * \brief Dumps the parse tree to screen in debug mode and to disk in dump
  * mode.
  */
-void dumpExpression(UNUSED const ParsedExpression &pe, 
+void dumpExpression(UNUSED const ParsedExpression &pe,
                     UNUSED const char *stage, UNUSED const Grey &grey) {
 #if defined(DEBUG)
-    DEBUG_PRINTF("===== Rule ID: %u (expression index: %u) =====\n", 
-                 pe.expr.report, pe.expr.index); 
+    DEBUG_PRINTF("===== Rule ID: %u (expression index: %u) =====\n",
+                 pe.expr.report, pe.expr.index);
     ostringstream debug_tree;
-    dumpTree(debug_tree, pe.component.get()); 
+    dumpTree(debug_tree, pe.component.get());
     printf("%s\n", debug_tree.str().c_str());
 #endif // DEBUG
 
 #if defined(DUMP_SUPPORT)
     if (grey.dumpFlags & Grey::DUMP_PARSE) {
         stringstream ss;
-        ss << grey.dumpPath << "Expr_" << pe.expr.index << "_componenttree_" 
+        ss << grey.dumpPath << "Expr_" << pe.expr.index << "_componenttree_"
            << stage << ".txt";
         ofstream out(ss.str().c_str());
-        out << "Component Tree for " << pe.expr.report << endl; 
-        dumpTree(out, pe.component.get()); 
-        if (pe.expr.utf8) { 
+        out << "Component Tree for " << pe.expr.report << endl;
+        dumpTree(out, pe.component.get());
+        if (pe.expr.utf8) {
             out << "UTF8 mode" << endl;
         }
     }
@@ -267,13 +267,13 @@ void dumpExpression(UNUSED const ParsedExpression &pe,
 
 /** \brief Run Component tree optimisations on \a expr. */
 static
-void optimise(ParsedExpression &pe) { 
-    if (pe.expr.min_length || pe.expr.som) { 
+void optimise(ParsedExpression &pe) {
+    if (pe.expr.min_length || pe.expr.som) {
         return;
     }
 
     DEBUG_PRINTF("optimising\n");
-    pe.component->optimise(true /* root is connected to sds */); 
+    pe.component->optimise(true /* root is connected to sds */);
 }
 
 void addExpression(NG &ng, unsigned index, const char *expression,
@@ -329,34 +329,34 @@ void addExpression(NG &ng, unsigned index, const char *expression,
 
     // Do per-expression processing: errors here will result in an exception
     // being thrown up to our caller
-    ParsedExpression pe(index, expression, flags, id, ext); 
-    dumpExpression(pe, "orig", cc.grey); 
+    ParsedExpression pe(index, expression, flags, id, ext);
+    dumpExpression(pe, "orig", cc.grey);
 
     // Apply prefiltering transformations if desired.
-    if (pe.expr.prefilter) { 
-        prefilterTree(pe.component, ParseMode(flags)); 
-        dumpExpression(pe, "prefiltered", cc.grey); 
+    if (pe.expr.prefilter) {
+        prefilterTree(pe.component, ParseMode(flags));
+        dumpExpression(pe, "prefiltered", cc.grey);
     }
 
     // Expressions containing zero-width assertions and other extended pcre
     // types aren't supported yet. This call will throw a ParseError exception
     // if the component tree contains such a construct.
-    checkUnsupported(*pe.component); 
+    checkUnsupported(*pe.component);
 
-    pe.component->checkEmbeddedStartAnchor(true); 
-    pe.component->checkEmbeddedEndAnchor(true); 
+    pe.component->checkEmbeddedStartAnchor(true);
+    pe.component->checkEmbeddedEndAnchor(true);
 
     if (cc.grey.optimiseComponentTree) {
-        optimise(pe); 
-        dumpExpression(pe, "opt", cc.grey); 
+        optimise(pe);
+        dumpExpression(pe, "opt", cc.grey);
     }
 
     DEBUG_PRINTF("component=%p, nfaId=%u, reportId=%u\n",
-                 pe.component.get(), pe.expr.index, pe.expr.report); 
+                 pe.component.get(), pe.expr.index, pe.expr.report);
 
     // You can only use the SOM flags if you've also specified an SOM
     // precision mode.
-    if (pe.expr.som != SOM_NONE && cc.streaming && !ng.ssm.somPrecision()) { 
+    if (pe.expr.som != SOM_NONE && cc.streaming && !ng.ssm.somPrecision()) {
         throw CompileError("To use a SOM expression flag in streaming mode, "
                            "an SOM precision mode (e.g. "
                            "HS_MODE_SOM_HORIZON_LARGE) must be specified.");
@@ -364,25 +364,25 @@ void addExpression(NG &ng, unsigned index, const char *expression,
 
     // If this expression is a literal, we can feed it directly to Rose rather
     // than building the NFA graph.
-    if (shortcutLiteral(ng, pe)) { 
+    if (shortcutLiteral(ng, pe)) {
         DEBUG_PRINTF("took literal short cut\n");
         return;
     }
 
-    auto built_expr = buildGraph(ng.rm, cc, pe); 
-    if (!built_expr.g) { 
+    auto built_expr = buildGraph(ng.rm, cc, pe);
+    if (!built_expr.g) {
         DEBUG_PRINTF("NFA build failed on ID %u, but no exception was "
-                     "thrown.\n", pe.expr.report); 
+                     "thrown.\n", pe.expr.report);
         throw CompileError("Internal error.");
     }
 
-    if (!pe.expr.allow_vacuous && matches_everywhere(*built_expr.g)) { 
+    if (!pe.expr.allow_vacuous && matches_everywhere(*built_expr.g)) {
         throw CompileError("Pattern matches empty buffer; use "
                            "HS_FLAG_ALLOWEMPTY to enable support.");
     }
 
-    if (!ng.addGraph(built_expr.expr, std::move(built_expr.g))) { 
-        DEBUG_PRINTF("NFA addGraph failed on ID %u.\n", pe.expr.report); 
+    if (!ng.addGraph(built_expr.expr, std::move(built_expr.g))) {
+        DEBUG_PRINTF("NFA addGraph failed on ID %u.\n", pe.expr.report);
         throw CompileError("Error compiling expression.");
     }
 }
@@ -430,7 +430,7 @@ void addLitExpression(NG &ng, unsigned index, const char *expression,
 }
 
 static
-bytecode_ptr<RoseEngine> generateRoseEngine(NG &ng) { 
+bytecode_ptr<RoseEngine> generateRoseEngine(NG &ng) {
     const u32 minWidth =
         ng.minWidth.is_finite() ? verify_u32(ng.minWidth) : ROSE_BOUND_INF;
     auto rose = ng.rose->buildRose(minWidth);
@@ -455,54 +455,54 @@ platform_t target_to_platform(const target_t &target_info) {
     if (!target_info.has_avx2()) {
         p |= HS_PLATFORM_NOAVX2;
     }
-    if (!target_info.has_avx512()) { 
-        p |= HS_PLATFORM_NOAVX512; 
-    } 
+    if (!target_info.has_avx512()) {
+        p |= HS_PLATFORM_NOAVX512;
+    }
     if (!target_info.has_avx512vbmi()) {
         p |= HS_PLATFORM_NOAVX512VBMI;
     }
     return p;
 }
 
-/** \brief Encapsulate the given bytecode (RoseEngine) in a newly-allocated 
- * \ref hs_database, ensuring that it is padded correctly to give cacheline 
- * alignment.  */ 
-static 
-hs_database_t *dbCreate(const char *in_bytecode, size_t len, u64a platform) { 
-    size_t db_len = sizeof(struct hs_database) + len; 
-    DEBUG_PRINTF("db size %zu\n", db_len); 
-    DEBUG_PRINTF("db platform %llx\n", platform); 
- 
-    struct hs_database *db = (struct hs_database *)hs_database_alloc(db_len); 
-    if (hs_check_alloc(db) != HS_SUCCESS) { 
-        hs_database_free(db); 
-        return nullptr; 
-    } 
- 
-    // So that none of our database is uninitialized 
-    memset(db, 0, db_len); 
- 
-    // we need to align things manually 
-    size_t shift = (uintptr_t)db->bytes & 0x3f; 
-    DEBUG_PRINTF("shift is %zu\n", shift); 
- 
-    db->bytecode = offsetof(struct hs_database, bytes) - shift; 
-    char *bytecode = (char *)db + db->bytecode; 
-    assert(ISALIGNED_CL(bytecode)); 
- 
-    db->magic = HS_DB_MAGIC; 
-    db->version = HS_DB_VERSION; 
-    db->length = len; 
-    db->platform = platform; 
- 
-    // Copy bytecode 
-    memcpy(bytecode, in_bytecode, len); 
- 
-    db->crc32 = Crc32c_ComputeBuf(0, bytecode, db->length); 
-    return db; 
-} 
- 
- 
+/** \brief Encapsulate the given bytecode (RoseEngine) in a newly-allocated
+ * \ref hs_database, ensuring that it is padded correctly to give cacheline
+ * alignment.  */
+static
+hs_database_t *dbCreate(const char *in_bytecode, size_t len, u64a platform) {
+    size_t db_len = sizeof(struct hs_database) + len;
+    DEBUG_PRINTF("db size %zu\n", db_len);
+    DEBUG_PRINTF("db platform %llx\n", platform);
+
+    struct hs_database *db = (struct hs_database *)hs_database_alloc(db_len);
+    if (hs_check_alloc(db) != HS_SUCCESS) {
+        hs_database_free(db);
+        return nullptr;
+    }
+
+    // So that none of our database is uninitialized
+    memset(db, 0, db_len);
+
+    // we need to align things manually
+    size_t shift = (uintptr_t)db->bytes & 0x3f;
+    DEBUG_PRINTF("shift is %zu\n", shift);
+
+    db->bytecode = offsetof(struct hs_database, bytes) - shift;
+    char *bytecode = (char *)db + db->bytecode;
+    assert(ISALIGNED_CL(bytecode));
+
+    db->magic = HS_DB_MAGIC;
+    db->version = HS_DB_VERSION;
+    db->length = len;
+    db->platform = platform;
+
+    // Copy bytecode
+    memcpy(bytecode, in_bytecode, len);
+
+    db->crc32 = Crc32c_ComputeBuf(0, bytecode, db->length);
+    return db;
+}
+
+
 struct hs_database *build(NG &ng, unsigned int *length, u8 pureFlag) {
     assert(length);
 
@@ -513,7 +513,7 @@ struct hs_database *build(NG &ng, unsigned int *length, u8 pureFlag) {
     if (!rose) {
         throw CompileError("Unable to generate bytecode.");
     }
-    *length = rose.size(); 
+    *length = rose.size();
     if (!*length) {
         DEBUG_PRINTF("RoseEngine has zero length\n");
         assert(0);
@@ -594,42 +594,42 @@ bool isSupported(const Component &c) {
 }
 #endif
 
-BuiltExpression buildGraph(ReportManager &rm, const CompileContext &cc, 
-                           const ParsedExpression &pe) { 
-    assert(isSupported(*pe.component)); 
+BuiltExpression buildGraph(ReportManager &rm, const CompileContext &cc,
+                           const ParsedExpression &pe) {
+    assert(isSupported(*pe.component));
 
-    const auto builder = makeNFABuilder(rm, cc, pe); 
+    const auto builder = makeNFABuilder(rm, cc, pe);
     assert(builder);
 
     // Set up START and ACCEPT states; retrieve the special states
-    const auto bs = makeGlushkovBuildState(*builder, pe.expr.prefilter); 
+    const auto bs = makeGlushkovBuildState(*builder, pe.expr.prefilter);
 
     // Map position IDs to characters/components
-    pe.component->notePositions(*bs); 
+    pe.component->notePositions(*bs);
 
     // Wire the start dotstar state to the firsts
-    connectInitialStates(*bs, pe); 
+    connectInitialStates(*bs, pe);
 
     DEBUG_PRINTF("wire up body of expr\n");
     // Build the rest of the FOLLOW set
     vector<PositionInfo> initials = {builder->getStartDotStar(),
                                      builder->getStart()};
-    pe.component->buildFollowSet(*bs, initials); 
+    pe.component->buildFollowSet(*bs, initials);
 
     // Wire the lasts to the accept state
-    connectFinalStates(*bs, pe); 
+    connectFinalStates(*bs, pe);
 
     // Create our edges
     bs->buildEdges();
 
-    BuiltExpression built_expr = builder->getGraph(); 
-    assert(built_expr.g); 
+    BuiltExpression built_expr = builder->getGraph();
+    assert(built_expr.g);
 
-    dumpDotWrapper(*built_expr.g, built_expr.expr, "00_before_asserts", 
-                   cc.grey); 
-    removeAssertVertices(rm, *built_expr.g, built_expr.expr); 
+    dumpDotWrapper(*built_expr.g, built_expr.expr, "00_before_asserts",
+                   cc.grey);
+    removeAssertVertices(rm, *built_expr.g, built_expr.expr);
 
-    return built_expr; 
+    return built_expr;
 }
 
 } // namespace ue2

+ 24 - 24
contrib/libs/hyperscan/src/compiler/compiler.h

@@ -35,9 +35,9 @@
 
 #include "ue2common.h"
 #include "database.h"
-#include "compiler/expression_info.h" 
+#include "compiler/expression_info.h"
 #include "parser/Component.h"
-#include "util/noncopyable.h" 
+#include "util/noncopyable.h"
 #include "util/ue2string.h"
 
 #include <memory>
@@ -51,21 +51,21 @@ struct CompileContext;
 struct Grey;
 struct target_t;
 class NG;
-class NGHolder; 
+class NGHolder;
 class ReportManager;
 
-/** \brief Class gathering together the pieces of a parsed expression. */ 
-class ParsedExpression : noncopyable { 
+/** \brief Class gathering together the pieces of a parsed expression. */
+class ParsedExpression : noncopyable {
 public:
     ParsedExpression(unsigned index, const char *expression, unsigned flags,
-                     ReportID report, const hs_expr_ext *ext = nullptr); 
+                     ReportID report, const hs_expr_ext *ext = nullptr);
 
-    /** \brief Expression information (from flags, extparam etc) */ 
-    ExpressionInfo expr; 
+    /** \brief Expression information (from flags, extparam etc) */
+    ExpressionInfo expr;
 
-    /** \brief Root node of parsed component tree. */ 
-    std::unique_ptr<Component> component; 
-}; 
+    /** \brief Root node of parsed component tree. */
+    std::unique_ptr<Component> component;
+};
 
 
 /** \brief Class gathering together the pieces of a parsed lit-expression. */
@@ -83,16 +83,16 @@ public:
     ue2_literal lit;
 };
 
-/** 
- * \brief Class gathering together the pieces of an expression that has been 
- * built into an NFA graph. 
- */ 
-struct BuiltExpression { 
-    /** \brief Expression information (from flags, extparam etc) */ 
-    ExpressionInfo expr; 
+/**
+ * \brief Class gathering together the pieces of an expression that has been
+ * built into an NFA graph.
+ */
+struct BuiltExpression {
+    /** \brief Expression information (from flags, extparam etc) */
+    ExpressionInfo expr;
 
-    /** \brief Built Glushkov NFA graph. */ 
-    std::unique_ptr<NGHolder> g; 
+    /** \brief Built Glushkov NFA graph. */
+    std::unique_ptr<NGHolder> g;
 };
 
 /**
@@ -109,12 +109,12 @@ struct BuiltExpression {
  * @param ext
  *      Struct containing extra parameters for this expression, or NULL if
  *      none.
- * @param report 
+ * @param report
  *      The identifier to associate with the expression; returned by engine on
  *      match.
  */
 void addExpression(NG &ng, unsigned index, const char *expression,
-                   unsigned flags, const hs_expr_ext *ext, ReportID report); 
+                   unsigned flags, const hs_expr_ext *ext, ReportID report);
 
 void addLitExpression(NG &ng, unsigned index, const char *expression,
                       unsigned flags, const hs_expr_ext *ext, ReportID id,
@@ -148,8 +148,8 @@ struct hs_database *build(NG &ng, unsigned int *length, u8 pureFlag);
  * @return
  *      nullptr on error.
  */
-BuiltExpression buildGraph(ReportManager &rm, const CompileContext &cc, 
-                           const ParsedExpression &expr); 
+BuiltExpression buildGraph(ReportManager &rm, const CompileContext &cc,
+                           const ParsedExpression &expr);
 
 /**
  * Build a platform_t out of a target_t.

+ 17 - 17
contrib/libs/hyperscan/src/compiler/error.cpp

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2016, Intel Corporation 
+ * Copyright (c) 2015-2016, Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -42,7 +42,7 @@ using std::string;
 
 static const char failureNoMemory[] = "Unable to allocate memory.";
 static const char failureInternal[] = "Internal error.";
-static const char failureBadAlloc[] = "Allocator returned misaligned memory."; 
+static const char failureBadAlloc[] = "Allocator returned misaligned memory.";
 
 extern const hs_compile_error_t hs_enomem = {
     const_cast<char *>(failureNoMemory), 0
@@ -50,9 +50,9 @@ extern const hs_compile_error_t hs_enomem = {
 extern const hs_compile_error_t hs_einternal = {
     const_cast<char *>(failureInternal), 0
 };
-extern const hs_compile_error_t hs_badalloc = { 
-    const_cast<char *>(failureBadAlloc), 0 
-}; 
+extern const hs_compile_error_t hs_badalloc = {
+    const_cast<char *>(failureBadAlloc), 0
+};
 
 namespace ue2 {
 
@@ -60,18 +60,18 @@ hs_compile_error_t *generateCompileError(const string &err, int expression) {
     hs_compile_error_t *ret =
         (struct hs_compile_error *)hs_misc_alloc(sizeof(hs_compile_error_t));
     if (ret) {
-        hs_error_t e = hs_check_alloc(ret); 
-        if (e != HS_SUCCESS) { 
-            hs_misc_free(ret); 
-            return const_cast<hs_compile_error_t *>(&hs_badalloc); 
-        } 
+        hs_error_t e = hs_check_alloc(ret);
+        if (e != HS_SUCCESS) {
+            hs_misc_free(ret);
+            return const_cast<hs_compile_error_t *>(&hs_badalloc);
+        }
         char *msg = (char *)hs_misc_alloc(err.size() + 1);
         if (msg) {
-            e = hs_check_alloc(msg); 
-            if (e != HS_SUCCESS) { 
-                hs_misc_free(msg); 
-                return const_cast<hs_compile_error_t *>(&hs_badalloc); 
-            } 
+            e = hs_check_alloc(msg);
+            if (e != HS_SUCCESS) {
+                hs_misc_free(msg);
+                return const_cast<hs_compile_error_t *>(&hs_badalloc);
+            }
             memcpy(msg, err.c_str(), err.size() + 1);
             ret->message = msg;
         } else {
@@ -97,8 +97,8 @@ void freeCompileError(hs_compile_error_t *error) {
     if (!error) {
         return;
     }
-    if (error == &hs_enomem || error == &hs_einternal || 
-        error == &hs_badalloc) { 
+    if (error == &hs_enomem || error == &hs_einternal ||
+        error == &hs_badalloc) {
         // These are not allocated.
         return;
     }

+ 102 - 102
contrib/libs/hyperscan/src/compiler/expression_info.h

@@ -1,108 +1,108 @@
-/* 
+/*
  * Copyright (c) 2017-2018, Intel Corporation
- * 
- * Redistribution and use in source and binary forms, with or without 
- * modification, are permitted provided that the following conditions are met: 
- * 
- *  * Redistributions of source code must retain the above copyright notice, 
- *    this list of conditions and the following disclaimer. 
- *  * Redistributions in binary form must reproduce the above copyright 
- *    notice, this list of conditions and the following disclaimer in the 
- *    documentation and/or other materials provided with the distribution. 
- *  * Neither the name of Intel Corporation nor the names of its contributors 
- *    may be used to endorse or promote products derived from this software 
- *    without specific prior written permission. 
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
- * POSSIBILITY OF SUCH DAMAGE. 
- */ 
- 
-/** 
- * \file 
- * \brief ExpressionInfo class for storing the properties of an expression. 
- */ 
- 
-#ifndef COMPILER_EXPRESSION_INFO_H 
-#define COMPILER_EXPRESSION_INFO_H 
- 
-#include "ue2common.h" 
-#include "som/som.h" 
- 
-namespace ue2 { 
- 
-/** \brief Properties of an expression. */ 
-class ExpressionInfo { 
-public: 
-    ExpressionInfo(unsigned int index_in, bool allow_vacuous_in, 
-                   bool highlander_in, bool utf8_in, bool prefilter_in, 
-                   som_type som_in, ReportID report_in, u64a min_offset_in, 
-                   u64a max_offset_in, u64a min_length_in, u32 edit_distance_in, 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *  * Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *  * Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *  * Neither the name of Intel Corporation nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * \file
+ * \brief ExpressionInfo class for storing the properties of an expression.
+ */
+
+#ifndef COMPILER_EXPRESSION_INFO_H
+#define COMPILER_EXPRESSION_INFO_H
+
+#include "ue2common.h"
+#include "som/som.h"
+
+namespace ue2 {
+
+/** \brief Properties of an expression. */
+class ExpressionInfo {
+public:
+    ExpressionInfo(unsigned int index_in, bool allow_vacuous_in,
+                   bool highlander_in, bool utf8_in, bool prefilter_in,
+                   som_type som_in, ReportID report_in, u64a min_offset_in,
+                   u64a max_offset_in, u64a min_length_in, u32 edit_distance_in,
                    u32 hamm_distance_in, bool quiet_in)
-        : index(index_in), report(report_in), allow_vacuous(allow_vacuous_in), 
-          highlander(highlander_in), utf8(utf8_in), prefilter(prefilter_in), 
-          som(som_in), min_offset(min_offset_in), max_offset(max_offset_in), 
-          min_length(min_length_in), edit_distance(edit_distance_in), 
+        : index(index_in), report(report_in), allow_vacuous(allow_vacuous_in),
+          highlander(highlander_in), utf8(utf8_in), prefilter(prefilter_in),
+          som(som_in), min_offset(min_offset_in), max_offset(max_offset_in),
+          min_length(min_length_in), edit_distance(edit_distance_in),
           hamm_distance(hamm_distance_in), quiet(quiet_in) {}
- 
-    /** 
-     * \brief Index of the expression represented by this graph. 
-     * 
-     * Used: 
-     * - down the track in error handling; 
-     * - for identifying parts of an expression in highlander mode. 
-     */ 
-    unsigned int index; 
- 
-    /** \brief Report ID specified by the user. */ 
-    ReportID report; 
- 
-    /** \brief Vacuous pattern is allowed. (HS_FLAG_ALLOWEMPTY) */ 
-    bool allow_vacuous; 
- 
-    /** \brief "Highlander" (single match) pattern. (HS_FLAG_SINGLEMATCH) */ 
-    bool highlander; 
- 
-    /** \brief UTF-8 pattern. (HS_FLAG_UTF8) */ 
-    bool utf8; 
- 
-    /** \brief Prefiltering pattern. (HS_FLAG_PREFILTER) */ 
-    bool prefilter; 
- 
-    /** \brief Start-of-match type requested, or SOM_NONE. */ 
-    som_type som; 
- 
-    /** \brief Minimum match offset extended parameter. 0 if not used. */ 
-    u64a min_offset; 
- 
-    /** 
-     * \brief Maximum match offset extended parameter. 
-     * MAX_OFFSET if not used. 
-     */ 
-    u64a max_offset; 
- 
-    /** \brief Minimum match length extended parameter. 0 if not used. */ 
-    u64a min_length; 
- 
-    /** 
-     * \brief Approximate matching edit distance extended parameter. 
-     * 0 if not used. 
-     */ 
-    u32 edit_distance; 
-    u32 hamm_distance; 
+
+    /**
+     * \brief Index of the expression represented by this graph.
+     *
+     * Used:
+     * - down the track in error handling;
+     * - for identifying parts of an expression in highlander mode.
+     */
+    unsigned int index;
+
+    /** \brief Report ID specified by the user. */
+    ReportID report;
+
+    /** \brief Vacuous pattern is allowed. (HS_FLAG_ALLOWEMPTY) */
+    bool allow_vacuous;
+
+    /** \brief "Highlander" (single match) pattern. (HS_FLAG_SINGLEMATCH) */
+    bool highlander;
+
+    /** \brief UTF-8 pattern. (HS_FLAG_UTF8) */
+    bool utf8;
+
+    /** \brief Prefiltering pattern. (HS_FLAG_PREFILTER) */
+    bool prefilter;
+
+    /** \brief Start-of-match type requested, or SOM_NONE. */
+    som_type som;
+
+    /** \brief Minimum match offset extended parameter. 0 if not used. */
+    u64a min_offset;
+
+    /**
+     * \brief Maximum match offset extended parameter.
+     * MAX_OFFSET if not used.
+     */
+    u64a max_offset;
+
+    /** \brief Minimum match length extended parameter. 0 if not used. */
+    u64a min_length;
+
+    /**
+     * \brief Approximate matching edit distance extended parameter.
+     * 0 if not used.
+     */
+    u32 edit_distance;
+    u32 hamm_distance;
 
     /** \brief Quiet on match. */
     bool quiet;
-}; 
- 
-} 
- 
-#endif // COMPILER_EXPRESSION_INFO_H 
+};
+
+}
+
+#endif // COMPILER_EXPRESSION_INFO_H

+ 6 - 6
contrib/libs/hyperscan/src/crc32.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2017, Intel Corporation 
+ * Copyright (c) 2015-2017, Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -29,10 +29,10 @@
 #include "crc32.h"
 #include "config.h"
 #include "ue2common.h"
-#include "util/arch.h" 
-#include "util/intrinsics.h" 
+#include "util/arch.h"
+#include "util/intrinsics.h"
 
-#if !defined(HAVE_SSE42) 
+#if !defined(HAVE_SSE42)
 
 /***
  *** What follows is derived from Intel's Slicing-by-8 CRC32 impl, which is BSD
@@ -578,7 +578,7 @@ u32 crc32c_sb8_64_bit(u32 running_crc, const unsigned char* p_buf,
     return crc;
 }
 
-#else // HAVE_SSE42 
+#else // HAVE_SSE42
 
 #ifdef ARCH_64_BIT
 #define CRC_WORD 8
@@ -634,7 +634,7 @@ u32 crc32c_sse42(u32 running_crc, const unsigned char* p_buf,
 
 // Externally visible function
 u32 Crc32c_ComputeBuf(u32 inCrc32, const void *buf, size_t bufLen) {
-#if defined(HAVE_SSE42) 
+#if defined(HAVE_SSE42)
     u32 crc = crc32c_sse42(inCrc32, (const unsigned char *)buf, bufLen);
 #else
     u32 crc = crc32c_sb8_64_bit(inCrc32, (const unsigned char *)buf, bufLen);

Некоторые файлы не были показаны из-за большого количества измененных файлов