mirror of
https://github.com/tezc/sc.git
synced 2025-01-28 07:03:06 +08:00
parent
54984f40e1
commit
985a70824d
2
.github/workflows/.ubuntu.yml
vendored
2
.github/workflows/.ubuntu.yml
vendored
@ -8,7 +8,7 @@ on:
|
||||
- master
|
||||
jobs:
|
||||
ubuntu:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-20.04
|
||||
name: Build on Ubuntu
|
||||
|
||||
strategy:
|
||||
|
@ -31,7 +31,7 @@ if (SC_BUILD_TEST)
|
||||
set(CMAKE_C_CLANG_TIDY
|
||||
clang-tidy;
|
||||
-line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}];
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*;
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-easily-swappable-parameters*;
|
||||
-warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;)
|
||||
endif ()
|
||||
|
||||
|
@ -31,7 +31,7 @@ if (SC_BUILD_TEST)
|
||||
set(CMAKE_C_CLANG_TIDY
|
||||
clang-tidy;
|
||||
-line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}];
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*;
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-reserved-identifier*;
|
||||
-warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;)
|
||||
endif ()
|
||||
|
||||
|
@ -32,7 +32,7 @@ if (SC_BUILD_TEST)
|
||||
set(CMAKE_C_CLANG_TIDY
|
||||
clang-tidy;
|
||||
-line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}];
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*;
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-implicit-widening-of-multiplication-result*;
|
||||
-warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;)
|
||||
endif ()
|
||||
|
||||
|
@ -31,7 +31,7 @@ if (SC_BUILD_TEST)
|
||||
set(CMAKE_C_CLANG_TIDY
|
||||
clang-tidy;
|
||||
-line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}];
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*;
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-easily-swappable-parameters*;
|
||||
-warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;)
|
||||
endif ()
|
||||
|
||||
|
@ -31,7 +31,7 @@ if (SC_BUILD_TEST)
|
||||
set(CMAKE_C_CLANG_TIDY
|
||||
clang-tidy;
|
||||
-line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}];
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*;
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-easily-swappable-parameters*,-bugprone-reserved-identifier*;
|
||||
-warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;)
|
||||
endif ()
|
||||
|
||||
|
@ -370,7 +370,7 @@ static int sc_log_file(enum sc_log_level level, const char *fmt, va_list va)
|
||||
|
||||
sc_log.file_size += size;
|
||||
|
||||
if (sc_log.file_size > SC_LOG_FILE_SIZE) {
|
||||
if (sc_log.file_size > (size_t) SC_LOG_FILE_SIZE) {
|
||||
fclose(sc_log.fp);
|
||||
(void) rename(sc_log.current_file, sc_log.prev_file);
|
||||
|
||||
|
@ -31,7 +31,7 @@ if (SC_BUILD_TEST)
|
||||
set(CMAKE_C_CLANG_TIDY
|
||||
clang-tidy;
|
||||
-line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}];
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*;
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-easily-swappable-parameters*;
|
||||
-warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;)
|
||||
endif ()
|
||||
|
||||
|
@ -31,7 +31,7 @@ if (SC_BUILD_TEST)
|
||||
set(CMAKE_C_CLANG_TIDY
|
||||
clang-tidy;
|
||||
-line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}];
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*;
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-easily-swappable-parameters*,-bugprone-reserved-identifier*;
|
||||
-warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;)
|
||||
endif ()
|
||||
|
||||
|
@ -31,7 +31,7 @@ if (SC_BUILD_TEST)
|
||||
set(CMAKE_C_CLANG_TIDY
|
||||
clang-tidy;
|
||||
-line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}];
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*;
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-reserved-identifier*;
|
||||
-warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;)
|
||||
endif ()
|
||||
|
||||
|
@ -31,7 +31,7 @@ if (SC_BUILD_TEST)
|
||||
set(CMAKE_C_CLANG_TIDY
|
||||
clang-tidy;
|
||||
-line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}];
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*;
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-reserved-identifier*;
|
||||
-warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;)
|
||||
endif ()
|
||||
|
||||
|
@ -521,6 +521,6 @@ void sc_signal_log(int fd, char *buf, size_t sz, char *fmt, ...)
|
||||
wr = sc_signal_vsnprintf(buf, sz, fmt, args);
|
||||
va_end(args);
|
||||
|
||||
rc = write(fd, buf, (size_t) wr);
|
||||
rc = (int) write(fd, buf, (size_t) wr);
|
||||
(void) rc;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ if (SC_BUILD_TEST)
|
||||
set(CMAKE_C_CLANG_TIDY
|
||||
clang-tidy;
|
||||
-line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}];
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*;
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-easily-swappable-parameters*;
|
||||
-warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;)
|
||||
endif ()
|
||||
|
||||
|
@ -31,7 +31,7 @@ if (SC_BUILD_TEST)
|
||||
set(CMAKE_C_CLANG_TIDY
|
||||
clang-tidy;
|
||||
-line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}];
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*;
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-easily-swappable-parameters*;
|
||||
-warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;)
|
||||
endif ()
|
||||
|
||||
|
@ -31,7 +31,7 @@ if (SC_BUILD_TEST)
|
||||
set(CMAKE_C_CLANG_TIDY
|
||||
clang-tidy;
|
||||
-line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}];
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*;
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-reserved-identifier*;
|
||||
-warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;)
|
||||
endif ()
|
||||
|
||||
|
@ -31,7 +31,7 @@ if (SC_BUILD_TEST)
|
||||
set(CMAKE_C_CLANG_TIDY
|
||||
clang-tidy;
|
||||
-line-filter=[{"name":"${PROJECT_NAME}.h"},{"name":"${PROJECT_NAME}.c"}];
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*;
|
||||
-checks=clang-analyzer-*,misc-*,portability-*,bugprone-*,-bugprone-easily-swappable-parameters*,-bugprone-implicit-widening-of-multiplication-result*;
|
||||
-warnings-as-errors=clang-analyzer-*,misc-*,portability-*,bugprone-*;)
|
||||
endif ()
|
||||
|
||||
|
@ -153,7 +153,7 @@ void sc_timer_cancel(struct sc_timer *t, uint64_t *id)
|
||||
return;
|
||||
}
|
||||
|
||||
pos = (((uint32_t) *id) * t->wheel) + (*id >> 32u);
|
||||
pos = (uint64_t) (((uint32_t) *id) * t->wheel) + (*id >> 32u);
|
||||
|
||||
t->list[pos].timeout = SC_TIMER_INVALID;
|
||||
*id = SC_TIMER_INVALID;
|
||||
|
Loading…
x
Reference in New Issue
Block a user