Merge pull request #960 from YosysHQ/eddie/equiv_opt_undef
[yosys.git] / libs / minisat / 00_PATCH_remove_zlib.patch
1 --- ParseUtils.h
2 +++ ParseUtils.h
3 @@ -24,8 +24,6 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
4 #include <stdlib.h>
5 #include <stdio.h>
6
7 -#include <zlib.h>
8 -
9 #include "XAlloc.h"
10
11 namespace Minisat {
12 @@ -36,24 +34,16 @@ namespace Minisat {
13
14
15 class StreamBuffer {
16 - gzFile in;
17 unsigned char* buf;
18 int pos;
19 int size;
20
21 enum { buffer_size = 64*1024 };
22
23 - void assureLookahead() {
24 - if (pos >= size) {
25 - pos = 0;
26 - size = gzread(in, buf, buffer_size); } }
27 + virtual void assureLookahead() = 0;
28
29 public:
30 - explicit StreamBuffer(gzFile i) : in(i), pos(0), size(0){
31 - buf = (unsigned char*)xrealloc(NULL, buffer_size);
32 - assureLookahead();
33 - }
34 - ~StreamBuffer() { free(buf); }
35 + virtual ~StreamBuffer() { }
36
37 int operator * () const { return (pos >= size) ? EOF : buf[pos]; }
38 void operator ++ () { pos++; assureLookahead(); }
39 --- Dimacs.h
40 +++ Dimacs.h
41 @@ -76,10 +76,10 @@ static void parse_DIMACS_main(B& in, Solver& S, bool strictp = false) {
42
43 // Inserts problem into solver.
44 //
45 -template<class Solver>
46 -static void parse_DIMACS(gzFile input_stream, Solver& S, bool strictp = false) {
47 - StreamBuffer in(input_stream);
48 - parse_DIMACS_main(in, S, strictp); }
49 +//template<class Solver>
50 +//static void parse_DIMACS(gzFile input_stream, Solver& S, bool strictp = false) {
51 +// StreamBuffer in(input_stream);
52 +// parse_DIMACS_main(in, S, strictp); }
53
54 //=================================================================================================
55 }