[llvm-commits] [test-suite] r40937 [1/5] - in /test-suite/trunk/MultiSource/Applications/minisat: Main.cpp Makefile long.cnf long.cnf.gz short.cnf short.cnf.gz small.cnf small.cnf.gz

Lauro Ramos Venancio lauro.venancio at gmail.com
Wed Aug 8 12:30:23 PDT 2007


Author: laurov
Date: Wed Aug  8 14:30:23 2007
New Revision: 40937

URL: http://llvm.org/viewvc/llvm-project?rev=40937&view=rev
Log:
Removed the need for zlib.


Added:
    test-suite/trunk/MultiSource/Applications/minisat/long.cnf
    test-suite/trunk/MultiSource/Applications/minisat/short.cnf
    test-suite/trunk/MultiSource/Applications/minisat/small.cnf
Removed:
    test-suite/trunk/MultiSource/Applications/minisat/long.cnf.gz
    test-suite/trunk/MultiSource/Applications/minisat/short.cnf.gz
    test-suite/trunk/MultiSource/Applications/minisat/small.cnf.gz
Modified:
    test-suite/trunk/MultiSource/Applications/minisat/Main.cpp
    test-suite/trunk/MultiSource/Applications/minisat/Makefile

Modified: test-suite/trunk/MultiSource/Applications/minisat/Main.cpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/minisat/Main.cpp?rev=40937&r1=40936&r2=40937&view=diff

==============================================================================
--- test-suite/trunk/MultiSource/Applications/minisat/Main.cpp (original)
+++ test-suite/trunk/MultiSource/Applications/minisat/Main.cpp Wed Aug  8 14:30:23 2007
@@ -23,7 +23,7 @@
 #include <errno.h>
 
 #include <signal.h>
-#include <zlib.h>
+#include <stdio.h>
 
 #include "Solver.h"
 
@@ -84,7 +84,7 @@
 #define CHUNK_LIMIT 1048576
 
 class StreamBuffer {
-    gzFile  in;
+    FILE   *in;
     char    buf[CHUNK_LIMIT];
     int     pos;
     int     size;
@@ -92,10 +92,10 @@
     void assureLookahead() {
         if (pos >= size) {
             pos  = 0;
-            size = gzread(in, buf, sizeof(buf)); } }
+            size = read(fileno(in), buf, sizeof(buf)); } }
 
 public:
-    StreamBuffer(gzFile i) : in(i), pos(0), size(0) {
+    StreamBuffer(FILE *i) : in(i), pos(0), size(0) {
         assureLookahead(); }
 
     int  operator *  () { return (pos >= size) ? EOF : buf[pos]; }
@@ -177,7 +177,7 @@
 
 // Inserts problem into solver.
 //
-static void parse_DIMACS(gzFile input_stream, Solver& S) {
+static void parse_DIMACS(FILE *input_stream, Solver& S) {
     StreamBuffer in(input_stream);
     parse_DIMACS_main(in, S); }
 
@@ -300,7 +300,7 @@
     if (argc == 1)
         reportf("Reading from standard input... Use '-h' or '--help' for help.\n");
 
-    gzFile in = (argc == 1) ? gzdopen(0, "rb") : gzopen(argv[1], "rb");
+    FILE *in = (argc == 1) ? stdin : fopen(argv[1], "rb");
     if (in == NULL)
         reportf("ERROR! Could not open file: %s\n", argc == 1 ? "<stdin>" : argv[1]), exit(1);
 
@@ -308,7 +308,7 @@
     reportf("|                                                                             |\n");
 
     parse_DIMACS(in, S);
-    gzclose(in);
+    fclose(in);
     FILE* res = (argc >= 3) ? fopen(argv[2], "wb") : NULL;
 
     if (!S.simplify()){

Modified: test-suite/trunk/MultiSource/Applications/minisat/Makefile
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/minisat/Makefile?rev=40937&r1=40936&r2=40937&view=diff

==============================================================================
--- test-suite/trunk/MultiSource/Applications/minisat/Makefile (original)
+++ test-suite/trunk/MultiSource/Applications/minisat/Makefile Wed Aug  8 14:30:23 2007
@@ -3,14 +3,14 @@
 LEVEL = ../../..
 PROG = minisat
 CPPFLAGS = -D NDEBUG
-LDFLAGS = -lz -lstdc++ -lm
+LDFLAGS = -lstdc++ -lm
 ifdef SMALL_PROBLEM_SIZE
-RUN_OPTIONS = -verbosity=0 $(PROJ_SRC_DIR)/small.cnf.gz
+RUN_OPTIONS = -verbosity=0 $(PROJ_SRC_DIR)/small.cnf
 else
 ifdef LARGE_PROBLEM_SIZE
-RUN_OPTIONS = -verbosity=0 $(PROJ_SRC_DIR)/long.cnf.gz
+RUN_OPTIONS = -verbosity=0 $(PROJ_SRC_DIR)/long.cnf
 else
-RUN_OPTIONS = -verbosity=0 $(PROJ_SRC_DIR)/short.cnf.gz
+RUN_OPTIONS = -verbosity=0 $(PROJ_SRC_DIR)/short.cnf
 endif
 endif
 FP_TOLERANCE = 0.1





More information about the llvm-commits mailing list