Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Rudolf
/
huffman
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
259f5553
authored
Nov 16, 2016
by
Rudolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new compiler flag to turn on debugging features
parent
3e5150f8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletions
Makefile
huffman.c
Makefile
View file @
259f5553
...
@@ -5,6 +5,8 @@ SRC_FILES := \
...
@@ -5,6 +5,8 @@ SRC_FILES := \
huffman.c
\
huffman.c
\
print_helper.c
print_helper.c
DEBUG
:=
1
default
:
default
:
gcc
$(SRC_FILES)
-o
huffman
gcc
$(SRC_FILES)
-o
huffman
-DDEBUG
=
$(DEBUG)
huffman.c
View file @
259f5553
...
@@ -57,6 +57,9 @@ int encode_file(FILE *in, FILE *out)
...
@@ -57,6 +57,9 @@ int encode_file(FILE *in, FILE *out)
if
(
!
tree
)
if
(
!
tree
)
return
-
1
;
return
-
1
;
if
(
DEBUG
)
print_tree
(
tree
);
encode_header
(
&
bitbuf
,
tree
);
encode_header
(
&
bitbuf
,
tree
);
fseek
(
in
,
0
,
SEEK_SET
);
fseek
(
in
,
0
,
SEEK_SET
);
...
@@ -81,6 +84,9 @@ int decode_file(FILE *in, FILE *out)
...
@@ -81,6 +84,9 @@ int decode_file(FILE *in, FILE *out)
decode_tree
(
&
bitbuf
,
out
,
decoded
);
decode_tree
(
&
bitbuf
,
out
,
decoded
);
if
(
DEBUG
)
print_tree
(
decoded
);
free
(
decoded
);
free
(
decoded
);
return
0
;
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment