Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvin-cao committed Jun 24, 2020
2 parents c6781ef + c28545c commit 8f6bd7c
Show file tree
Hide file tree
Showing 24 changed files with 767 additions and 235 deletions.
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@ sudo: required
matrix:
include:
- os: linux
env:
- MAKE_FLAGS="CFLAGS+=-Werror "

- os: linux
env:
- MATRIX_EVAL="CC=clang"
- MAKE_FLAGS="CFLAGS+=-Werror "

- os: linux
env:
- MATRIX_EVAL="CFLAGS=-m32 && LDFLAGS=-m32"
- MAKE_FLAGS="CFLAGS+=-Werror "

- os: linux
addons:
Expand All @@ -25,6 +29,7 @@ matrix:
env:
- CONFIG_OPTS="--host x86_64-w64-mingw32"
- MATRIX_EVAL="CC=x86_64-w64-mingw32-gcc"
- MAKE_FLAGS="CFLAGS+=-Werror "

- os: linux
addons:
Expand All @@ -35,14 +40,15 @@ matrix:
env:
- CONFIG_OPTS="--host i686-w64-mingw32"
- MATRIX_EVAL="CC=i686-w64-mingw32-gcc"
- MAKE_FLAGS="CFLAGS+=-Werror "

- os: linux
install:
- git clone https://git.kernel.org/pub/scm/devel/sparse/sparse.git --branch v0.5.2
- pushd sparse && make HAVE_LLVM=no && sudo make install HAVE_LLVM=no && popd
env:
- MATRIX_EVAL="CC=cgcc"
- MAKE_FLAGS="CFLAGS=-Wsparse-error CFLAGS+=-Wno-vla CFLAGS+=-Wno-old-initializer"
- MAKE_FLAGS="CFLAGS=-Wsparse-error CFLAGS+=-Wno-vla CFLAGS+=-Wno-old-initializer CFLAGS+=-Werror "

before_install:
- eval "${MATRIX_EVAL}"
Expand Down
1 change: 1 addition & 0 deletions Makefile.in
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ ifeq ($(MINGW), YES)
LDLIBS += -lsetupapi -lws2_32
SHLDLIBS = $(LDLIBS)
override CPPFLAGS += -DNTDDI_VERSION=NTDDI_VISTA -D_WIN32_WINNT=_WIN32_WINNT_VISTA
override CFLAGS += -D__USE_MINGW_ANSI_STDIO
else
EXENAME ?= switchtec
INSTEXENAME ?= $(EXENAME)
Expand Down
18 changes: 18 additions & 0 deletions cli/argconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,23 @@ static int cfg_long_suffix_handler(const char *optarg, void *value_addr,
return 0;
}

static int cfg_long_long_handler(const char *optarg, void *value_addr,
const struct argconfig_options *opt)
{
char *endptr;

*((unsigned long long *)value_addr) = strtoull(optarg, &endptr, 0);
if (errno || optarg == endptr) {
fprintf(stderr,
"Expected long long integer argument for '--%s/-%c' "
"but got '%s'!\n",
opt->option, opt->short_option, optarg);
return 1;
}

return 0;
}

static int cfg_double_handler(const char *optarg, void *value_addr,
const struct argconfig_options *opt)
{
Expand Down Expand Up @@ -758,6 +775,7 @@ static type_handler cfg_type_handlers[_CFG_MAX_TYPES] = {
[CFG_SIZE_SUFFIX] = cfg_size_suffix_handler,
[CFG_LONG] = cfg_long_handler,
[CFG_LONG_SUFFIX] = cfg_long_suffix_handler,
[CFG_LONG_LONG] = cfg_long_long_handler,
[CFG_DOUBLE] = cfg_double_handler,
[CFG_BOOL] = cfg_bool_handler,
[CFG_BYTE] = cfg_byte_handler,
Expand Down
1 change: 1 addition & 0 deletions cli/argconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ enum argconfig_types {
CFG_SIZE_SUFFIX,
CFG_LONG,
CFG_LONG_SUFFIX,
CFG_LONG_LONG,
CFG_DOUBLE,
CFG_BOOL,
CFG_BYTE,
Expand Down
Loading

0 comments on commit 8f6bd7c

Please sign in to comment.