From 470866d758fc133ec6b08777c7c1be28802814fd Mon Sep 17 00:00:00 2001
From: Mike Iovine <mike.iovine7@gmail.com>
Date: Fri, 3 Apr 2020 07:20:31 -0700
Subject: [PATCH] Remove unused import

---
 Makefile  |  2 +-
 inflate.c | 25 ++-----------------------
 2 files changed, 3 insertions(+), 24 deletions(-)

diff --git a/Makefile b/Makefile
index d10cfea..639061f 100644
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@ huffman : huffman.c
 	cc huffman.c -o huffman
 
 inflate : inflate.c
-	cc inflate.c -o inflate -lm 
+	cc inflate.c -o inflate 
 
 clean :
 	rm myzip0 myunzip0 huffman inflate
diff --git a/inflate.c b/inflate.c
index ba911e1..e8ceaf1 100644
--- a/inflate.c
+++ b/inflate.c
@@ -4,36 +4,16 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <stdbool.h>
-#include <math.h>
+
+#include "inflate.h"
 
 /* Types of huffman codes */ 
 #define FIXED 1
 #define DYNAMIC 2
 
-/* Maximum length for any Huffman code */ 
-#define MAX_LENGTH 15
-
 /* Dummy value for min_codes in huffman_t structs */
 #define NO_CODE -1
 
-typedef struct huffman {
-    /* bl_counts[i] = number of codes of length i */
-    int bl_counts[MAX_LENGTH + 1]; 
-
-    /* This stores the alphabet.
-     * alphabet[i] returns an array of alphabet symbols of length bl_counts[i]. 
-     */
-    int *alphabet[MAX_LENGTH + 1]; 
-
-    /* Suppose we are reading a code and we want an index into the alphabet array. 
-     * These are basically the numerical offsets for such an index. 
-     * So if the code we are reading has value c and is of length i, 
-     * its alphabet character is indexed by (c - min_codes[i]). 
-     */
-    int min_codes[MAX_LENGTH + 1]; 
-
-} huffman_t;
-
 /*
  * Constants for FIXED code type
  */ 
@@ -323,7 +303,6 @@ int *read_lens(char *buf, huffman_t *hf_codes, int num_symbols, int num_codes) {
     return lens; 
 }
 
-/* Read the block starting at the n-th bit */ 
 void read_block(char *buf, FILE *out) {
     /* First bit is the BFINAL flag */ 
 
-- 
GitLab