Commit 7078ab0a authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

satsolver: use precise fstream class for input or output

* spot/misc/satsolver.cc: Here.
parent 22af7aef
// -*- coding: utf-8 -*- // -*- coding: utf-8 -*-
// Copyright (C) 2013, 2014, 2015 Laboratoire de Recherche et Développement // Copyright (C) 2013, 2014, 2015, 2016 Laboratoire de Recherche et
// de l'Epita. // Développement de l'Epita.
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
...@@ -91,7 +91,7 @@ namespace spot ...@@ -91,7 +91,7 @@ namespace spot
if (filename[0] == '-' && filename[1] == 0) if (filename[0] == '-' && filename[1] == 0)
in = &std::cin; in = &std::cin;
else else
in = new std::fstream(filename, std::ios_base::in); in = new std::ifstream(filename);
int c; int c;
while ((c = in->get()) != EOF) while ((c = in->get()) != EOF)
...@@ -131,9 +131,8 @@ namespace spot ...@@ -131,9 +131,8 @@ namespace spot
void satsolver::start() void satsolver::start()
{ {
cnf_tmp_ = create_tmpfile("sat-", ".cnf"); cnf_tmp_ = create_tmpfile("sat-", ".cnf");
cnf_stream_ = new std::fstream(cnf_tmp_->name(), cnf_stream_ = new std::ofstream(cnf_tmp_->name(), std::ios_base::trunc);
std::ios_base::trunc | std::ios_base::out); cnf_stream_->exceptions(std::ofstream::failbit | std::ofstream::badbit);
cnf_stream_->exceptions(std::ifstream::failbit | std::ifstream::badbit);
} }
satsolver::~satsolver() satsolver::~satsolver()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment