From b097cb1b533a0b40f05d4bcd26f8420c88ae33f0 Mon Sep 17 00:00:00 2001 From: Alex Coyte Date: Fri, 6 May 2016 13:20:00 +1000 Subject: [PATCH] use the correct way to refer to void * --- src/nfagraph/ng_calc_components.cpp | 10 +++++----- src/nfagraph/ng_rose.cpp | 4 ++-- src/rose/rose_build_add.cpp | 8 ++++---- src/rose/rose_build_matchers.cpp | 2 +- src/rose/rose_build_merge.cpp | 2 +- src/rose/rose_build_role_aliasing.cpp | 3 +-- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/nfagraph/ng_calc_components.cpp b/src/nfagraph/ng_calc_components.cpp index 5ca5ce3a..9365cfb3 100644 --- a/src/nfagraph/ng_calc_components.cpp +++ b/src/nfagraph/ng_calc_components.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 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: @@ -219,8 +219,8 @@ vector findShellEdges(const NGHolder &g, static void removeVertices(const flat_set &verts, NFAUndirectedGraph &ug, - ue2::unordered_map &old2new, - ue2::unordered_map &new2old) { + ue2::unordered_map &old2new, + ue2::unordered_map &new2old) { for (auto v : verts) { assert(contains(old2new, v)); auto uv = old2new.at(v); @@ -280,7 +280,7 @@ void splitIntoComponents(const NGHolder &g, deque> &comps, createUnGraph(g.g, true, true, ug, old2new, newIdx2old); // Construct reverse mapping. - ue2::unordered_map new2old; + ue2::unordered_map new2old; for (const auto &m : old2new) { new2old.emplace(m.second, m.first); } @@ -308,7 +308,7 @@ void splitIntoComponents(const NGHolder &g, deque> &comps, // Collect vertex lists per component. for (const auto &m : split_components) { - NFAVertex uv = m.first; + NFAUndirectedVertex uv = m.first; u32 c = m.second; assert(contains(new2old, uv)); NFAVertex v = new2old.at(uv); diff --git a/src/nfagraph/ng_rose.cpp b/src/nfagraph/ng_rose.cpp index 3015af4c..997191d2 100644 --- a/src/nfagraph/ng_rose.cpp +++ b/src/nfagraph/ng_rose.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 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: @@ -2245,7 +2245,7 @@ bool improveLHS(RoseInGraph &ig, const vector &edges, const vector &local = by_src[v]; vector graphs; - map > by_graph; + map > by_graph; for (const auto &e : local) { NGHolder *gp = ig[e].graph.get(); if (!contains(by_graph, gp)) { diff --git a/src/rose/rose_build_add.cpp b/src/rose/rose_build_add.cpp index 23c122a7..ae155361 100644 --- a/src/rose/rose_build_add.cpp +++ b/src/rose/rose_build_add.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 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: @@ -315,7 +315,7 @@ void createVertices(RoseBuildImpl *tbi, w = created[key]; } - NFAVertex p = pv.first; + RoseVertex p = pv.first; RoseEdge e; bool added; @@ -943,7 +943,7 @@ void populateRoseGraph(RoseBuildImpl *tbi, RoseBuildData &bd) { const vector &images = vertex_map[u]; // We should have no dupes. - assert(set(images.begin(), images.end()).size() + assert(set(images.begin(), images.end()).size() == images.size()); for (auto v_image : images) { @@ -1133,7 +1133,7 @@ u32 maxAvailableDelay(const ue2_literal &pred_key, const ue2_literal &lit_key) { } static -u32 findMaxSafeDelay(const RoseInGraph &ig, RoseInVertex u, RoseVertex v) { +u32 findMaxSafeDelay(const RoseInGraph &ig, RoseInVertex u, RoseInVertex v) { // First, check the overlap constraints on (u,v). size_t max_delay; if (ig[v].type == RIV_LITERAL) { diff --git a/src/rose/rose_build_matchers.cpp b/src/rose/rose_build_matchers.cpp index 83c49556..12aadd72 100644 --- a/src/rose/rose_build_matchers.cpp +++ b/src/rose/rose_build_matchers.cpp @@ -359,7 +359,7 @@ bool isDirectHighlander(const RoseBuildImpl &build, const u32 id, // Called by isNoRunsLiteral below. static -bool isNoRunsVertex(const RoseBuildImpl &build, NFAVertex u) { +bool isNoRunsVertex(const RoseBuildImpl &build, RoseVertex u) { const RoseGraph &g = build.g; if (!g[u].isBoring()) { DEBUG_PRINTF("u=%zu is not boring\n", g[u].idx); diff --git a/src/rose/rose_build_merge.cpp b/src/rose/rose_build_merge.cpp index a10bc86e..759e0dbe 100644 --- a/src/rose/rose_build_merge.cpp +++ b/src/rose/rose_build_merge.cpp @@ -338,7 +338,7 @@ void findUncalcLeavesCandidates(RoseBuildImpl &tbi, deque &ordered) { const RoseGraph &g = tbi.g; - vector suffix_vertices; // vertices with suffix graphs + vector suffix_vertices; // vertices with suffix graphs ue2::unordered_map fcount; // ref count per graph for (auto v : vertices_range(g)) { diff --git a/src/rose/rose_build_role_aliasing.cpp b/src/rose/rose_build_role_aliasing.cpp index 1f873403..8e883ab9 100644 --- a/src/rose/rose_build_role_aliasing.cpp +++ b/src/rose/rose_build_role_aliasing.cpp @@ -1185,8 +1185,7 @@ bool attemptRoseGraphMerge(RoseBuildImpl &tbi, bool preds_same, RoseVertex a, ReportID new_report = tbi.getNewNfaReport(); shared_ptr new_graph = cloneHolder(*b_h); duplicateReport(*new_graph, b_left.leftfix_report, new_report); - pruneReportIfUnused(tbi, new_graph, set(), - b_left.leftfix_report); + pruneReportIfUnused(tbi, new_graph, {}, b_left.leftfix_report); rrm[a_left_id].erase(a); rrm[b_left_id].erase(b);