Commit e2af2754 authored by Adam Wujek's avatar Adam Wujek 💬 Committed by Grzegorz Daniluk

lib/snmp: fix warnings about field offset in a structure

In wrpc's SNMP we store an offset between beginning of a structure and
particullar field. To save memory we store this offset as a uint8_t, which
limits the offset of a filed to 255 bytes. It was necessary to move following
fields below 255 offset:
--n_err_state
--n_err_offset
--n_err_delta_rtt

Compiling wrpc-sw with an offset greater than 255, a compiler prints warnings
like:
lib/snmp.c:405:2: warning: large integer implicitly truncated to unsigned type
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 30e14b0a
...@@ -88,14 +88,6 @@ struct dump_info dump_info[] = { ...@@ -88,14 +88,6 @@ struct dump_info dump_info[] = {
DUMP_FIELD(Integer32, delta_rx_s), DUMP_FIELD(Integer32, delta_rx_s),
DUMP_FIELD(Integer32, fiber_fix_alpha), DUMP_FIELD(Integer32, fiber_fix_alpha),
DUMP_FIELD(Integer32, clock_period_ps), DUMP_FIELD(Integer32, clock_period_ps),
DUMP_FIELD(pp_time, t1),
DUMP_FIELD(pp_time, t2),
DUMP_FIELD(pp_time, t3),
DUMP_FIELD(pp_time, t4),
DUMP_FIELD(pp_time, t5),
DUMP_FIELD(pp_time, t6),
DUMP_FIELD(Integer64, delta_ms_prev),
DUMP_FIELD(int, missed_iters),
DUMP_FIELD(pp_time, mu), /* half of the RTT */ DUMP_FIELD(pp_time, mu), /* half of the RTT */
DUMP_FIELD(Integer64, picos_mu), DUMP_FIELD(Integer64, picos_mu),
DUMP_FIELD(Integer32, cur_setpoint), DUMP_FIELD(Integer32, cur_setpoint),
...@@ -109,6 +101,14 @@ struct dump_info dump_info[] = { ...@@ -109,6 +101,14 @@ struct dump_info dump_info[] = {
DUMP_FIELD(UInteger32, n_err_offset), DUMP_FIELD(UInteger32, n_err_offset),
DUMP_FIELD(UInteger32, n_err_delta_rtt), DUMP_FIELD(UInteger32, n_err_delta_rtt),
DUMP_FIELD(pp_time, update_time), DUMP_FIELD(pp_time, update_time),
DUMP_FIELD(pp_time, t1),
DUMP_FIELD(pp_time, t2),
DUMP_FIELD(pp_time, t3),
DUMP_FIELD(pp_time, t4),
DUMP_FIELD(pp_time, t5),
DUMP_FIELD(pp_time, t6),
DUMP_FIELD(Integer64, delta_ms_prev),
DUMP_FIELD(int, missed_iters),
#undef DUMP_STRUCT #undef DUMP_STRUCT
#define DUMP_STRUCT struct pp_instance #define DUMP_STRUCT struct pp_instance
......
ppsi @ 62e4d20d
Subproject commit 67efec3c7c7f6eac4495fb6d12598e4aca179fb8 Subproject commit 62e4d20dd9b1edd626bd1025a1f7d8d34faecc6d
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment