mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-08-20 05:23:12 -07:00
Warn harder and fix Warnings
This commit is contained in:
parent
59e6603256
commit
8fbd1b9427
6 changed files with 12 additions and 15 deletions
|
@ -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)
|
configure_file(config.h.in include/chiaki/config.h)
|
||||||
target_include_directories(chiaki-lib PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/include")
|
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)
|
add_dependencies(chiaki-lib chiaki-pb)
|
||||||
set_target_properties(chiaki-lib PROPERTIES OUTPUT_NAME chiaki)
|
set_target_properties(chiaki-lib PROPERTIES OUTPUT_NAME chiaki)
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ CHIAKI_EXPORT ChiakiErrorCode chiaki_base64_decode(const char *in, size_t in_siz
|
||||||
|
|
||||||
while (in < end)
|
while (in < end)
|
||||||
{
|
{
|
||||||
unsigned char c = d[*in++];
|
unsigned char c = d[(size_t)(*in++)];
|
||||||
|
|
||||||
switch(c)
|
switch(c)
|
||||||
{
|
{
|
||||||
|
@ -153,4 +153,4 @@ CHIAKI_EXPORT ChiakiErrorCode chiaki_base64_decode(const char *in, size_t in_siz
|
||||||
|
|
||||||
*out_size = len;
|
*out_size = len;
|
||||||
return CHIAKI_ERR_SUCCESS;
|
return CHIAKI_ERR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,6 +157,7 @@ CHIAKI_EXPORT ChiakiErrorCode chiaki_ctrl_send_message(ChiakiCtrl *ctrl, uint16_
|
||||||
}
|
}
|
||||||
chiaki_mutex_unlock(&ctrl->notif_mutex);
|
chiaki_mutex_unlock(&ctrl->notif_mutex);
|
||||||
chiaki_stop_pipe_stop(&ctrl->notif_pipe);
|
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)
|
CHIAKI_EXPORT void chiaki_ctrl_set_login_pin(ChiakiCtrl *ctrl, const uint8_t *pin, size_t pin_size)
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include <pb_encode.h>
|
#include <pb_encode.h>
|
||||||
#include <pb_decode.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;
|
char *str = *arg;
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ typedef struct chiaki_pb_buf_t
|
||||||
uint8_t *buf;
|
uint8_t *buf;
|
||||||
} ChiakiPBBuf;
|
} 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;
|
ChiakiPBBuf *buf = *arg;
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ typedef struct chiaki_pb_decode_buf_t
|
||||||
uint8_t *buf;
|
uint8_t *buf;
|
||||||
} ChiakiPBDecodeBuf;
|
} 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;
|
ChiakiPBDecodeBuf *buf = *arg;
|
||||||
if(stream->bytes_left > buf->max_size)
|
if(stream->bytes_left > buf->max_size)
|
||||||
|
@ -63,7 +63,7 @@ typedef struct chiaki_pb_decode_buf_alloc_t
|
||||||
uint8_t *buf;
|
uint8_t *buf;
|
||||||
} ChiakiPBDecodeBufAlloc;
|
} 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;
|
ChiakiPBDecodeBufAlloc *buf = *arg;
|
||||||
buf->size = stream->bytes_left;
|
buf->size = stream->bytes_left;
|
||||||
|
|
|
@ -334,14 +334,6 @@ static bool session_check_state_pred_pin(void *user)
|
||||||
|| session->login_pin_entered;
|
|| 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
|
#define ENABLE_SENKUSHA
|
||||||
|
|
||||||
static void *session_thread_func(void *arg)
|
static void *session_thread_func(void *arg)
|
||||||
|
|
|
@ -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)));
|
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);
|
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 += 0x11;
|
||||||
av_size -= 0x11;
|
av_size -= 0x11;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue