Skip to content

Commit

Permalink
<fix>(project): fix strict prototype compile bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
kyonRay committed Nov 22, 2023
1 parent 4a2644c commit a04b545
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 32 deletions.
27 changes: 10 additions & 17 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,6 @@ jobs:
run: cd build && CTEST_OUTPUT_ON_FAILURE=TRUE make test
- name: run coverage
run: cd build && make cov
- uses: actions/upload-artifact@v2
with:
name: libbcos-c-sdk.so.zip
path: build/libbcos-c-sdk.so
- uses: actions/upload-artifact@v2
with:
name: libbcos-sdk-jni.so.zip
path: bindings/java/jni/src/main/resources/META-INF/native/libbcos-sdk-jni.so
- name: upload coverage report
uses: codecov/codecov-action@v3
with:
Expand Down Expand Up @@ -149,6 +141,7 @@ jobs:
- name: install CentOS dependencies
run: |
yum install -y epel-release centos-release-scl
yum install -y https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
yum install -y java-11-openjdk-devel wget git make gcc gcc-c++ glibc-static glibc-devel openssl openssl-devel ccache devtoolset-11 llvm-toolset-7.0 rh-perl530-perl libzstd-devel zlib-devel flex bison python-devel python3-devel
- name: reinstall cmake
run: |
Expand All @@ -174,14 +167,14 @@ jobs:
make -j4
- name: run test
run: cd build && CTEST_OUTPUT_ON_FAILURE=TRUE make test
# - uses: actions/upload-artifact@v2
# with:
# name: libbcos-c-sdk.so.zip
# path: build/libbcos-c-sdk.so
# - uses: actions/upload-artifact@v2
# with:
# name: libbcos-sdk-jni.so.zip
# path: bindings/java/jni/src/main/resources/META-INF/native/libbcos-sdk-jni.so
- uses: actions/upload-artifact@v2
with:
name: libbcos-c-sdk.so.zip
path: build/libbcos-c-sdk.so
- uses: actions/upload-artifact@v2
with:
name: libbcos-sdk-jni.so.zip
path: bindings/java/jni/src/main/resources/META-INF/native/libbcos-sdk-jni.so
build_with_windows:
name: build_with_windows
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -211,7 +204,7 @@ jobs:
if: runner.os == 'Windows'
run: |
mkdir -p build && cd build
cmake -G "Visual Studio 16 2019" -A x64 ../ -DTESTS=ON -DBUILD_JNI=ON -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake || cat C:\vcpkg\buildtrees\fisco-bcos-cpp-sdk\config-x64-windows-out.log && cat C:\vcpkg\buildtrees\hsm-crypto\install-*
cmake -G "Visual Studio 16 2019" -A x64 ../ -DTESTS=ON -DBUILD_JNI=ON -DVCPKG_TARGET_TRIPLET='x64-windows-static' -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake || cat C:\vcpkg\buildtrees\fisco-bcos-cpp-sdk\config-x64-windows-out.log && cat C:\vcpkg\buildtrees\hsm-crypto\install-*
- name: compile
run: cd build && MSBuild bcos-c-sdk.sln /p:Configuration=Release /p:Platform=x64
- uses: actions/upload-artifact@v2
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ target_include_directories(${BCOS_C_SDK_STATIC_TARGET} PUBLIC $<BUILD_INTERFACE:
target_link_libraries(${BCOS_C_SDK_STATIC_TARGET} PUBLIC fiscobcos::bcos-cpp-sdk)

add_library(${BCOS_C_SDK_TARGET} SHARED ${SOURCES})
target_include_directories(${BCOS_C_SDK_TARGET} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}> $<INSTALL_INTERFACE:include/bcos-cpp-sdk>)
target_include_directories(${BCOS_C_SDK_TARGET} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
target_link_libraries(${BCOS_C_SDK_TARGET} PUBLIC fiscobcos::bcos-cpp-sdk)

add_dependencies(${BCOS_C_SDK_STATIC_TARGET} BuildInfo.h)
Expand Down
2 changes: 1 addition & 1 deletion bcos-c-sdk/bcos_sdk_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ extern "C" {
*
* @return const char*
*/
const char* bcos_sdk_version();
const char* bcos_sdk_version(void);

/**
* @brief: create bcos sdk object by config object
Expand Down
2 changes: 1 addition & 1 deletion bcos-c-sdk/bcos_sdk_c_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ struct bcos_sdk_c_config
* @brief create bcos_sdk_c_config in default value
* @return struct bcos_sdk_c_config*
*/
struct bcos_sdk_c_config* bcos_sdk_c_config_create_empty();
struct bcos_sdk_c_config* bcos_sdk_c_config_create_empty(void);

/**
* @brief duplicate string
Expand Down
8 changes: 4 additions & 4 deletions bcos-c-sdk/bcos_sdk_c_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ extern "C" {
*
* @return int
*/
extern int bcos_sdk_is_last_opr_success();
extern int bcos_sdk_is_last_opr_success(void);

/**
* @brief gets status of the recent sync operation
* Note: thread safe operation
*
* @return int
*/
extern int bcos_sdk_get_last_error();
extern int bcos_sdk_get_last_error(void);

/**
* @brief gets error message of the recent sync operation, effect if bcos_sdk_get_last_error,
Expand All @@ -70,12 +70,12 @@ extern int bcos_sdk_get_last_error();
*
* @return const char*
*/
extern const char* bcos_sdk_get_last_error_msg();
extern const char* bcos_sdk_get_last_error_msg(void);

/**
* @brief clear the last error
*/
extern void bcos_sdk_clear_last_error();
extern void bcos_sdk_clear_last_error(void);

/**
* @brief set the last error and error message
Expand Down
2 changes: 1 addition & 1 deletion sample/amop/broadcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------

void usage()
void usage(void)
{
printf("Desc: broadcast amop message by command params\n");
printf("Usage: broadcast <config> <topic> <message>\n");
Expand Down
2 changes: 1 addition & 1 deletion sample/amop/publish.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------

void usage()
void usage(void)
{
printf("Desc: publish amop message by command params\n");
printf("Usage: publish <config> <topic> <message>\n");
Expand Down
2 changes: 1 addition & 1 deletion sample/amop/subscribe.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include <unistd.h>

//------------------------------------------------------------------------------
void usage()
void usage(void)
{
printf("Desc: subscribe amop topic by command params\n");
printf("Usage: subscribe <config> <topic>\n");
Expand Down
2 changes: 1 addition & 1 deletion sample/eventsub/eventsub.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------

void usage()
void usage(void)
{
printf("Desc: subscribe contract events by command params\n");
printf("Usage: eventsub <config> <group_id> <from> <to> <address>[Optional]\n");
Expand Down
2 changes: 1 addition & 1 deletion sample/rpc/rpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void usage()
void usage(void)
{
printf("Desc: rpc methods call test\n");
printf("Usage: rpc <host> <port> <ssl type> <group_id>\n");
Expand Down
2 changes: 1 addition & 1 deletion sample/tx/hello_sample.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const char* g_hw_abi =
}
*/

void usage()
void usage(void)
{
printf("Desc: HelloWorld contract sample\n");
printf("Usage: hello_sample <config> <group_id>\n");
Expand Down
2 changes: 1 addition & 1 deletion sample/tx/hello_sample_hsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const char* g_hw_abi =
}
*/

void usage()
void usage(void)
{
printf("Desc: HelloWorld contract sample with hsm key pair\n");
printf(
Expand Down
2 changes: 1 addition & 1 deletion sample/tx/tx_struct_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ const char* g_hw_abi =
}
*/

void usage()
void usage(void)
{
printf("Desc: tx struct test sample\n");
printf("Usage: tx_struct_test <config> <group_id>\n");
Expand Down

0 comments on commit a04b545

Please sign in to comment.