odissey: fix jenkins compilation warnings

This commit is contained in:
Dmitry Simonenko 2017-08-17 17:13:31 +03:00
parent cfa978d402
commit ad8809acb2
4 changed files with 6 additions and 8 deletions

View File

@ -12,9 +12,9 @@ if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE "Debug")
endif()
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
set(CMAKE_C_FLAGS "-std=gnu99 -pedantic -Wall -Wextra -g -O2")
set(CMAKE_C_FLAGS "-std=gnu99 -pedantic -Wall -Wextra -Wstrict-aliasing -g -O2")
elseif("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
set(CMAKE_C_FLAGS "-std=gnu99 -pedantic -Wall -Wextra -g -O0")
set(CMAKE_C_FLAGS "-std=gnu99 -pedantic -Wall -Wextra -Wstrict-aliasing -g -O0")
endif()
string(TOLOWER ${CMAKE_BUILD_TYPE} OD_VERSION_BUILD)

View File

@ -187,7 +187,7 @@ error:
static inline void
od_frontend_key(od_client_t *client)
{
client->key.key_pid = *(uint32_t*)client->id.id;
client->key.key_pid = *(int32_t*)client->id.id;
client->key.key = 1 + rand();
}

View File

@ -113,11 +113,9 @@ void od_idmgr_generate(od_idmgr_t *mgr, od_id_t *id, char *prefix)
mgr->seed[0] ^= seq ^ second;
mgr->seed[1] ^= seq ^ minute;
mgr->seed[2] ^= seq ^ (hour + day + month);
mgr->seed[3] ^= ((uint8_t*)&seq)[0] ^ ((uint8_t*)&seq)[1];
mgr->seed[4] ^= ((uint8_t*)&seq)[2] ^ ((uint8_t*)&seq)[3];
mgr->seed[3] ^= ((uint8_t*)&seq)[0] ^ ((uint8_t*)&seq)[1] ^ mgr->pid;
mgr->seed[4] ^= ((uint8_t*)&seq)[2] ^ ((uint8_t*)&seq)[3] ^ mgr->uid;
mgr->seed[5] ^= seq ^ (uintptr_t)id;
mgr->seed[6] ^= seq ^ (mgr->pid + mgr->uid);
mgr->seed[7] ^= seq;
char *dest = id->id;
static const char *hex = "0123456789abcdef";

View File

@ -54,7 +54,7 @@ od_logger_write(od_logger_t *logger, od_logger_ident_t *ident,
od_logfile_write(&logger->log, buf, buf_len);
od_logsystem(&logger->log_system, ident->syslog_prio, buf, buf_len);
if (logger->log_stdout) {
write(0, buf, buf_len);
(void)write(0, buf, buf_len);
}
}