castle_dump: use StdioFile

This commit is contained in:
Justin Viiret 2017-06-29 12:46:56 +10:00 committed by Matthew Barr
parent 31a445a0e8
commit a18fbfe873

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015-2016, Intel Corporation * Copyright (c) 2015-2017, Intel Corporation
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
@ -71,7 +71,7 @@ void dumpTextSubCastle(const SubCastle &sub, FILE *f) {
void nfaExecCastle_dump(const struct NFA *nfa, const string &base) { void nfaExecCastle_dump(const struct NFA *nfa, const string &base) {
const Castle *c = (const Castle *)getImplNfa(nfa); const Castle *c = (const Castle *)getImplNfa(nfa);
FILE *f = fopen_or_throw((base + ".txt").c_str(), "w"); StdioFile f(base + ".txt", "w");
fprintf(f, "Castle multi-tenant repeat engine\n"); fprintf(f, "Castle multi-tenant repeat engine\n");
fprintf(f, "\n"); fprintf(f, "\n");
@ -117,7 +117,6 @@ void nfaExecCastle_dump(const struct NFA *nfa, const string &base) {
fprintf(f, "Sub %u:\n", i); fprintf(f, "Sub %u:\n", i);
dumpTextSubCastle(sub[i], f); dumpTextSubCastle(sub[i], f);
} }
fclose(f);
} }
} // namespace ue2 } // namespace ue2