Skip to content

Commit bf16146

Browse files
committed
fixed writer removed tests
1 parent 54da1ea commit bf16146

File tree

10 files changed

+20
-116
lines changed

10 files changed

+20
-116
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ endif ()
9393

9494
add_library(${PROJECT_NAME} STATIC ${${PROJECT_NAME}_SOURCES} ${${PROJECT_NAME}_HEADERS})
9595
set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${${PROJECT_NAME}_HEADERS}")
96-
add_executable(${PROJECT_NAME}_exe ${${PROJECT_NAME}_SOURCES} ${${PROJECT_NAME}_HEADERS} cli.c)
96+
add_executable(${PROJECT_NAME}_exe ${${PROJECT_NAME}_SOURCES} ${${PROJECT_NAME}_HEADERS} src/cli.c)
9797
target_link_libraries(${PROJECT_NAME}_exe ${PROJECT_NAME})
9898

9999
if (${PROJECT_NAME}_DEPS)

include/bsq/io.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ typedef struct s_writer
3232
t_u16cursor;
3333
}t_writer;
3434

35-
extern t_writerbsq_writer();
36-
extern voidbsq_write(t_writer *writer, char c);
35+
extern t_writerbsq_writer(void);
36+
extern voidbsq_write(t_writer *writer, t_u8 c);
3737
extern voidbsq_idea(t_writer *writer);
3838

3939

src/io.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,24 @@ inline t_u8 bsq_next(t_reader *reader)
3939
reader->cursor = 0;
4040
return (reader->buf[reader->cursor++]);
4141
}
42-
inline t_writerbsq_writer()
42+
43+
inline t_writerbsq_writer(void)
4344
{
44-
t_writerwriter;
45+
t_writer writer;
4546

4647
writer.cursor = 0;
4748
return (writer);
4849
}
4950

5051
inline voidbsq_idea(t_writer *writer)
5152
{
52-
write(0 , writer->buf, writer->cursor);
53+
write(1, writer->buf, writer->cursor);
54+
writer->cursor = 0;
5355
}
5456

55-
inline voidbsq_write(t_writer *writer, char c)
57+
inline voidbsq_write(t_writer *writer, t_u8 c)
5658
{
57-
if (writer->cursor >= 2)
59+
if (writer->cursor >= BUF_SIZE)
5860
bsq_idea(writer);
5961
writer->buf[writer->cursor++] = c;
6062
}
61-

src/matrix.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313
#include "bsq/compress.h"
1414

15-
intprint_binary_matrix(t_u8 seg, t_info *info, t_u32 e, t_writer *writer)
15+
intprint_binary_matrix(t_u8 seg, t_info *info, t_u32 e, t_writer *writer)
1616
{
17-
t_u8 i;
18-
t_u32 max;
17+
t_u8i;
18+
t_u32max;
1919

2020
i = 0;
2121
max = (info->height * info->width) - e;
@@ -29,11 +29,11 @@ int print_binary_matrix(t_u8 seg, t_info *info, t_u32 e, t_writer *writer)
2929
return (7);
3030
}
3131

32-
intprint_repeat_matrix(t_u8 seg, t_info *info, t_u32 e, t_writer *writer)
32+
intprint_repeat_matrix(t_u8 seg, t_info *info, t_u32 e, t_writer *writer)
3333
{
34-
t_u8 i;
35-
t_bool val;
36-
t_u8 len;
34+
t_u8i;
35+
t_boolval;
36+
t_u8len;
3737

3838
val = (t_bool) ((seg >> 6) & 1);
3939
len = (t_u8) ((seg & 0x3F) + 7);
@@ -48,9 +48,9 @@ int print_repeat_matrix(t_u8 seg, t_info *info, t_u32 e, t_writer *writer)
4848

4949
voidmatrix_print(t_matrix *matrix, t_info *info)
5050
{
51-
t_u32 i;
52-
t_lbuf*lbuf;
53-
t_u32e;
51+
t_u32i;
52+
t_lbuf*lbuf;
53+
t_u32e;
5454
t_writerwriter;
5555

5656
writer = bsq_writer();

test/bsq.c

Lines changed: 0 additions & 13 deletions
This file was deleted.

test/ds.c

Lines changed: 0 additions & 34 deletions
This file was deleted.

test/io.c

Lines changed: 0 additions & 13 deletions
This file was deleted.

test/parser.c

Lines changed: 0 additions & 11 deletions
This file was deleted.

test/types.c

Lines changed: 0 additions & 13 deletions
This file was deleted.

test/utils.c

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)