Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
saitoha committed Jul 31, 2014
2 parents afd5eb1 + 75cbd3c commit 22343fc
Show file tree
Hide file tree
Showing 11 changed files with 272 additions and 36 deletions.
1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
repo_token: Jxt5jbb7ikvavZRPMOOXGG6t3ixedOyHq
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ env:
- XCC=i686-w64-mingw32-gcc HOST="--host=i686-w64-mingw32" WINE=wine
- XCC=i586-mingw32msvc-gcc HOST="--host=i586-mingw32msvc" WINE=wine
- XCC=x86_64-w64-mingw32-gcc HOST="--host=x86_64-w64-mingw32" WINE=wine64
- XCC=gcc HOST= WINE= GCOV="--enable-gcov"

before_install:
- "sudo apt-get -qq update --force-yes > /dev/null"
Expand All @@ -17,13 +18,17 @@ before_install:
- "if [ x$XCC = xi686-w64-mingw32-gcc ]; then sudo apt-get install -qq gcc-mingw-w64-i686 binutils-mingw-w64-i686; fi"
- "if [ x$XCC = xi586-mingw32msvc-gcc ]; then sudo apt-get install -qq mingw32; fi"
- "if [ x$XCC = xx86_64-w64-mingw32-gcc ]; then sudo apt-get install -qq gcc-mingw-w64-x86-64 binutils-mingw-w64-x86-64; fi"
- "if [ x$GCOV != x ]; then sudo apt-get install libyaml-dev; fi"
- "if [ x$GCOV != x ]; then sudo pip install cpp-coveralls pyyaml; fi"

before_script:
- "CC=$XCC ./configure --prefix=/usr ${HOST}"
- "CC=$XCC ./configure --prefix=/usr ${HOST} ${GCOV}"

script:
- "make"
- "sudo make install"
- "$WINE seq2gif --version"
- "if [ x$GCOV != x ]; then make coveralls || exit 1; fi"

after_success:
- "if [ x$WINE = x ]; then make valgrind && exit 0 || cat valgrind.log && exit 1; fi"
22 changes: 20 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@

if COND_GCOV
MAYBE_COVERAGE = --coverage
endif

CLEANFILES = *.gcno *.gcda *.gcov

bin_PROGRAMS = seq2gif
seq2gif_SOURCES = main.c util.c pseudo.c terminal.c function.c \
osc.c dcs.c parse.c gifsave89.c \
malloc_stub.c wcwidth.c \
util.h pseudo.h terminal.h function.h \
osc.h dcs.h parse.h gifsave89.h \
wcwidth.h malloc_stub.h
seq2gif_CFLAGS = $(MAYBE_COVERAGE)

test: all
./seq2gif -i tests/data/sl.tty -o /dev/null

coveralls: test
coveralls -E '.*\.h' -e tests -e glyph -e m4

run:
cat ttyrecord | ./seq2gif | img2sixel
valgrind: all
valgrind --leak-check=full --show-reachable=no --error-limit=no ./seq2gif -i tests/data/sl.tty -o /dev/null 2>&1 \
| grep ^== \
| tee valgrind.log
grep "All heap blocks were freed" valgrind.log || grep "definitely lost: 0 bytes in 0 blocks" valgrind.log
grep "All heap blocks were freed" valgrind.log || grep "indirectly lost: 0 bytes in 0 blocks" valgrind.log
test ! $$(grep Invalid valgrind.log)
213 changes: 195 additions & 18 deletions Makefile.in

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
seq2gif
=======
[![Build Status](https://travis-ci.org/saitoha/seq2gif.svg?branch=master)](https://travis-ci.org/saitoha/seq2gif)
[![Coverage Status](https://img.shields.io/coveralls/saitoha/seq2gif.svg)](https://coveralls.io/r/saitoha/seq2gif)


Description
Expand Down
24 changes: 24 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,8 @@ CPPFLAGS
LDFLAGS
CFLAGS
CC
COND_GCOV_FALSE
COND_GCOV_TRUE
AM_BACKSLASH
AM_DEFAULT_VERBOSITY
AM_DEFAULT_V
Expand Down Expand Up @@ -715,6 +717,7 @@ ac_user_opts='
enable_option_checking
enable_silent_rules
with_fontdata
enable_gcov
enable_dependency_tracking
'
ac_precious_vars='build_alias
Expand Down Expand Up @@ -1342,6 +1345,7 @@ Optional Features:
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-silent-rules less verbose build output (undo: "make V=1")
--disable-silent-rules verbose build output (undo: "make V=0")
--enable-gcov Use gcov
--enable-dependency-tracking
do not reject slow dependency extractors
--disable-dependency-tracking
Expand Down Expand Up @@ -2969,6 +2973,22 @@ $as_echo "#define SELECTED_FONT FONT_MPLUS" >>confdefs.h
fi
# Check whether --enable-gcov was given.
if test "${enable_gcov+set}" = set; then :
enableval=$enable_gcov;
else
enable_gcov=no
fi
if test x$enable_gcov != xno; then
COND_GCOV_TRUE=
COND_GCOV_FALSE='#'
else
COND_GCOV_TRUE='#'
COND_GCOV_FALSE=
fi
# Checks for programs.
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
Expand Down Expand Up @@ -5036,6 +5056,10 @@ else
am__EXEEXT_FALSE=
fi
if test -z "${COND_GCOV_TRUE}" && test -z "${COND_GCOV_FALSE}"; then
as_fn_error $? "conditional \"COND_GCOV\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
as_fn_error $? "conditional \"AMDEP\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
Expand Down
7 changes: 7 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ else
AC_DEFINE(SELECTED_FONT, FONT_MPLUS, [selected font data])
fi

AC_ARG_ENABLE([gcov],
[AS_HELP_STRING([--enable-gcov],
[Use gcov])],
[],
[enable_gcov=no])
AM_CONDITIONAL([COND_GCOV], [test x$enable_gcov != xno])

# Checks for programs.
AC_PROG_CC

Expand Down
20 changes: 10 additions & 10 deletions dcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ enum {
LSMAX = 100,
};

static inline int sixel_bitmap(struct terminal *term, struct sixel_canvas_t *sc, uint8_t bitmap)
static int sixel_bitmap(struct terminal *term, struct sixel_canvas_t *sc, uint8_t bitmap)
{
int i, offset;

Expand Down Expand Up @@ -80,7 +80,7 @@ static inline int sixel_bitmap(struct terminal *term, struct sixel_canvas_t *sc,
return 1;
}

static inline int sixel_repeat(struct terminal *term, struct sixel_canvas_t *sc, char *buf)
static int sixel_repeat(struct terminal *term, struct sixel_canvas_t *sc, char *buf)
{
int i, count;
size_t length;
Expand Down Expand Up @@ -110,7 +110,7 @@ static inline int sixel_repeat(struct terminal *term, struct sixel_canvas_t *sc,
return length + 1;
}

static inline int sixel_attr(struct sixel_canvas_t *sc, char *buf)
static int sixel_attr(struct sixel_canvas_t *sc, char *buf)
{
char *cp, tmp[BUFSIZE];
size_t length;
Expand Down Expand Up @@ -139,7 +139,7 @@ static inline int sixel_attr(struct sixel_canvas_t *sc, char *buf)
return length;
}

static inline uint32_t hue2rgb(int n1, int n2, int hue)
static uint32_t hue2rgb(int n1, int n2, int hue)
{
if (hue < 0)
hue += HUEMAX;
Expand All @@ -157,7 +157,7 @@ static inline uint32_t hue2rgb(int n1, int n2, int hue)
return n1;
}

static inline uint32_t hls2rgb(int hue, int lum, int sat)
static uint32_t hls2rgb(int hue, int lum, int sat)
{
uint32_t r, g, b;
int magic1, magic2;
Expand All @@ -179,7 +179,7 @@ static inline uint32_t hls2rgb(int hue, int lum, int sat)
return (r << 16) + (g << 8) + b;
}

static inline int sixel_color(struct sixel_canvas_t *sc, char *buf)
static int sixel_color(struct sixel_canvas_t *sc, char *buf)
{
char *cp, tmp[BUFSIZE];
int index, type;
Expand Down Expand Up @@ -243,7 +243,7 @@ static inline int sixel_color(struct sixel_canvas_t *sc, char *buf)
return length;
}

static inline int sixel_cr(struct sixel_canvas_t *sc)
static int sixel_cr(struct sixel_canvas_t *sc)
{
if (DEBUG)
fprintf(stderr, "sixel_cr()\n");
Expand All @@ -253,7 +253,7 @@ static inline int sixel_cr(struct sixel_canvas_t *sc)
return 1;
}

static inline int sixel_nl(struct sixel_canvas_t *sc)
static int sixel_nl(struct sixel_canvas_t *sc)
{
if (DEBUG)
fprintf(stderr, "sixel_nl()\n");
Expand Down Expand Up @@ -446,7 +446,7 @@ void sixel_parse_header(struct terminal *term, char *start_buf)
sixel_copy2cell(term, &term->sixel);
}

static inline void decdld_bitmap(struct glyph_t *glyph, uint8_t bitmap, uint8_t row, uint8_t column)
static void decdld_bitmap(struct glyph_t *glyph, uint8_t bitmap, uint8_t row, uint8_t column)
{
/*
MSB LSB (glyph_t bitmap order, padding at LSB side)
Expand Down Expand Up @@ -490,7 +490,7 @@ static inline void decdld_bitmap(struct glyph_t *glyph, uint8_t bitmap, uint8_t
}
}

static inline void init_glyph(struct glyph_t *glyph)
static void init_glyph(struct glyph_t *glyph)
{
int i;

Expand Down
3 changes: 3 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,9 @@ int main(int argc, char *argv[])
delay = 0;
}
now = readtime(in_file, obuf);
if (now == -1) {
break;
}
}
if (settings.last_frame_delay > 0) {
controlgif(gsdata, -1, settings.last_frame_delay / 10, 0, 0);
Expand Down
6 changes: 3 additions & 3 deletions osc.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#endif

/* function for osc sequence */
int32_t parse_color1(char *seq)
static int32_t parse_color1(char *seq)
{
/*
format
Expand Down Expand Up @@ -83,7 +83,7 @@ int32_t parse_color1(char *seq)
return color;
}

int32_t parse_color2(char *seq)
static int32_t parse_color2(char *seq)
{
/*
format
Expand Down Expand Up @@ -222,7 +222,7 @@ void reset_palette(struct terminal *term, void *arg)
}
}

int isdigit_or_questionmark(int c)
static int isdigit_or_questionmark(int c)
{
if (isdigit(c) || c == '?')
return 1;
Expand Down
4 changes: 2 additions & 2 deletions pseudo.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# define memcpy(d, s, n) (bcopy ((s), (d), (n)))
#endif

static inline void draw_sixel(struct pseudobuffer *pb, int line, int col, uint8_t *bitmap)
static void draw_sixel(struct pseudobuffer *pb, int line, int col, uint8_t *bitmap)
{
int h, w, src_offset, dst_offset;
uint32_t pixel, color = 0;
Expand All @@ -47,7 +47,7 @@ static inline void draw_sixel(struct pseudobuffer *pb, int line, int col, uint8_
}
}

static inline void draw_line(struct pseudobuffer *pb, struct terminal *term, int line)
static void draw_line(struct pseudobuffer *pb, struct terminal *term, int line)
{
int pos, bdf_padding, glyph_width, margin_right;
int col, w, h;
Expand Down

0 comments on commit 22343fc

Please sign in to comment.