]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
shengdump: use StdioFile
authorJustin Viiret <justin.viiret@intel.com>
Thu, 29 Jun 2017 03:10:40 +0000 (13:10 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Mon, 21 Aug 2017 01:12:16 +0000 (11:12 +1000)
src/nfa/shengdump.cpp

index ce87beaf64cc0486f3b4309d12f1cd784aa28996..99fda76fd87d2ffcd4db3a367f97a1ee9aae1e20 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Intel Corporation
+ * Copyright (c) 2016-2017, Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -41,7 +41,6 @@
 #include "util/dump_util.h"
 #include "util/simd_types.h"
 
-
 #ifndef DUMP_SUPPORT
 #error No dump support!
 #endif
@@ -267,12 +266,8 @@ void nfaExecSheng_dumpDot(const NFA *nfa, FILE *f) {
 
 void nfaExecSheng_dump(const NFA *nfa, const string &base) {
     assert(nfa->type == SHENG_NFA);
-    FILE *f = fopen_or_throw((base + ".txt").c_str(), "w");
-    nfaExecSheng_dumpText(nfa, f);
-    fclose(f);
-    f = fopen_or_throw((base + ".dot").c_str(), "w");
-    nfaExecSheng_dumpDot(nfa, f);
-    fclose(f);
+    nfaExecSheng_dumpText(nfa, StdioFile(base + ".txt", "w"));
+    nfaExecSheng_dumpDot(nfa, StdioFile(base + ".dot", "w"));
 }
 
 } // namespace ue2