Warn harder and fix Warnings

This commit is contained in:
Florian Märkl 2020-11-04 12:09:42 +01:00
commit 8fbd1b9427
No known key found for this signature in database
GPG key ID: 125BC8A5A6A1E857
6 changed files with 12 additions and 15 deletions

View file

@ -86,6 +86,10 @@ add_library(chiaki-lib ${HEADER_FILES} ${SOURCE_FILES} ${CHIAKI_LIB_PROTO_SOURCE
configure_file(config.h.in include/chiaki/config.h)
target_include_directories(chiaki-lib PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/include")
if(CMAKE_C_COMPILER_ID STREQUAL GNU OR CMAKE_C_COMPILER_ID STREQUAL Clang)
target_compile_options(chiaki-lib PRIVATE -Wall)
endif()
add_dependencies(chiaki-lib chiaki-pb)
set_target_properties(chiaki-lib PROPERTIES OUTPUT_NAME chiaki)

View file

@ -110,7 +110,7 @@ CHIAKI_EXPORT ChiakiErrorCode chiaki_base64_decode(const char *in, size_t in_siz
while (in < end)
{
unsigned char c = d[*in++];
unsigned char c = d[(size_t)(*in++)];
switch(c)
{
@ -153,4 +153,4 @@ CHIAKI_EXPORT ChiakiErrorCode chiaki_base64_decode(const char *in, size_t in_siz
*out_size = len;
return CHIAKI_ERR_SUCCESS;
}
}

View file

@ -157,6 +157,7 @@ CHIAKI_EXPORT ChiakiErrorCode chiaki_ctrl_send_message(ChiakiCtrl *ctrl, uint16_
}
chiaki_mutex_unlock(&ctrl->notif_mutex);
chiaki_stop_pipe_stop(&ctrl->notif_pipe);
return CHIAKI_ERR_SUCCESS;
}
CHIAKI_EXPORT void chiaki_ctrl_set_login_pin(ChiakiCtrl *ctrl, const uint8_t *pin, size_t pin_size)

View file

@ -6,7 +6,7 @@
#include <pb_encode.h>
#include <pb_decode.h>
static bool chiaki_pb_encode_string(pb_ostream_t *stream, const pb_field_t *field, void *const *arg)
static inline bool chiaki_pb_encode_string(pb_ostream_t *stream, const pb_field_t *field, void *const *arg)
{
char *str = *arg;
@ -22,7 +22,7 @@ typedef struct chiaki_pb_buf_t
uint8_t *buf;
} ChiakiPBBuf;
static bool chiaki_pb_encode_buf(pb_ostream_t *stream, const pb_field_t *field, void *const *arg)
static inline bool chiaki_pb_encode_buf(pb_ostream_t *stream, const pb_field_t *field, void *const *arg)
{
ChiakiPBBuf *buf = *arg;
@ -40,7 +40,7 @@ typedef struct chiaki_pb_decode_buf_t
uint8_t *buf;
} ChiakiPBDecodeBuf;
static bool chiaki_pb_decode_buf(pb_istream_t *stream, const pb_field_t *field, void **arg)
static inline bool chiaki_pb_decode_buf(pb_istream_t *stream, const pb_field_t *field, void **arg)
{
ChiakiPBDecodeBuf *buf = *arg;
if(stream->bytes_left > buf->max_size)
@ -63,7 +63,7 @@ typedef struct chiaki_pb_decode_buf_alloc_t
uint8_t *buf;
} ChiakiPBDecodeBufAlloc;
static bool chiaki_pb_decode_buf_alloc(pb_istream_t *stream, const pb_field_t *field, void **arg)
static inline bool chiaki_pb_decode_buf_alloc(pb_istream_t *stream, const pb_field_t *field, void **arg)
{
ChiakiPBDecodeBufAlloc *buf = *arg;
buf->size = stream->bytes_left;

View file

@ -334,14 +334,6 @@ static bool session_check_state_pred_pin(void *user)
|| session->login_pin_entered;
}
static bool session_check_state_pred_session_id(void *user)
{
ChiakiSession *session = user;
return session->should_stop
|| session->ctrl_failed
|| session->ctrl_session_id_received;
}
#define ENABLE_SENKUSHA
static void *session_thread_func(void *arg)

View file

@ -1273,7 +1273,7 @@ CHIAKI_EXPORT ChiakiErrorCode chiaki_takion_v9_av_packet_parse(ChiakiTakionAVPac
uint32_t key_pos_low = ntohl(*((chiaki_unaligned_uint32_t *)(av + 0xd)));
packet->key_pos = chiaki_key_state_request_pos(key_state, key_pos_low, true);
uint8_t unknown_1 = av[0x11];
uint8_t unknown_1 = av[0x11]; (void)unknown_1;
av += 0x11;
av_size -= 0x11;