CC src/ceph_la-ceph.lo
src/ceph.c:1160:14: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
ret, write(io->asok, ((char *)&cmd) + io->amt, cmd_len - io->amt));
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/ceph.c:67:11: note: expanded from macro 'RETRY_ON_EINTR'
ret = expr; \
~ ^~~~
src/ceph.c:1181:25: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
RETRY_ON_EINTR(ret, read(io->asok, ((char *)(&io->d->version)) + io->amt,
~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/ceph.c:67:11: note: expanded from macro 'RETRY_ON_EINTR'
ret = expr; \
~ ^~~~
src/ceph.c:1207:25: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
RETRY_ON_EINTR(ret, read(io->asok, ((char *)(&io->json_len)) + io->amt,
~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/ceph.c:67:11: note: expanded from macro 'RETRY_ON_EINTR'
ret = expr; \
~ ^~~~
src/ceph.c:1229:20: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
read(io->asok, io->json + io->amt, io->json_len - io->amt));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/ceph.c:67:11: note: expanded from macro 'RETRY_ON_EINTR'
ret = expr; \
~ ^~~~
src/ceph.c:1299:29: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
int sec_diff = t1->tv_sec - t2->tv_sec;
~~~~~~~~ ~~~~~~~~~~~^~~~~~~~~~~~
src/ceph.c:1300:31: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
int usec_diff = t1->tv_usec - t2->tv_usec;
~~~~~~~~~ ~~~~~~~~~~~~^~~~~~~~~~~~~
6 warnings generated.
CCLD ceph.la
}
/** Handle a network event for a connection */
}
/** Handle a network event for a connection */
-static int cconn_handle_event(struct cconn *io) {
- int ret;
+static ssize_t cconn_handle_event(struct cconn *io) {
+ ssize_t ret;
switch (io->state) {
case CSTATE_UNCONNECTED:
ERROR("ceph plugin: cconn_handle_event(name=%s) got to illegal "
switch (io->state) {
case CSTATE_UNCONNECTED:
ERROR("ceph plugin: cconn_handle_event(name=%s) got to illegal "
*/
static int milli_diff(const struct timeval *t1, const struct timeval *t2) {
int64_t ret;
*/
static int milli_diff(const struct timeval *t1, const struct timeval *t2) {
int64_t ret;
- int sec_diff = t1->tv_sec - t2->tv_sec;
- int usec_diff = t1->tv_usec - t2->tv_usec;
+ long sec_diff = t1->tv_sec - t2->tv_sec;
+ long usec_diff = t1->tv_usec - t2->tv_usec;
ret = usec_diff / 1000;
ret += (sec_diff * 1000);
return (ret > INT_MAX) ? INT_MAX : ((ret < INT_MIN) ? INT_MIN : (int)ret);
ret = usec_diff / 1000;
ret += (sec_diff * 1000);
return (ret > INT_MAX) ? INT_MAX : ((ret < INT_MIN) ? INT_MIN : (int)ret);
/** This handles the actual network I/O to talk to the Ceph daemons.
*/
/** This handles the actual network I/O to talk to the Ceph daemons.
*/
-static int cconn_main_loop(uint32_t request_type) {
- int ret, some_unreachable = 0;
+static ssize_t cconn_main_loop(uint32_t request_type) {
+ int some_unreachable = 0;
+ ssize_t ret;
struct timeval end_tv;
struct cconn io_array[g_num_daemons];
struct timeval end_tv;
struct cconn io_array[g_num_daemons];
struct cconn *io = io_array + i;
ret = cconn_prepare(io, fds + nfds);
if (ret < 0) {
struct cconn *io = io_array + i;
ret = cconn_prepare(io, fds + nfds);
if (ret < 0) {
- WARNING("ceph plugin: cconn_prepare(name=%s,i=%" PRIsz ",st=%d)=%d",
+ WARNING("ceph plugin: cconn_prepare(name=%s,i=%" PRIsz ",st=%d)=%zd",
io->d->name, i, io->state, ret);
cconn_close(io);
io->request_type = ASOK_REQ_NONE;
io->d->name, i, io->state, ret);
cconn_close(io);
io->request_type = ASOK_REQ_NONE;
}
RETRY_ON_EINTR(ret, poll(fds, nfds, diff));
if (ret < 0) {
}
RETRY_ON_EINTR(ret, poll(fds, nfds, diff));
if (ret < 0) {
- ERROR("ceph plugin: poll(2) error: %d", ret);
+ ERROR("ceph plugin: poll(2) error: %zd", ret);
goto done;
}
for (int i = 0; i < nfds; ++i) {
goto done;
}
for (int i = 0; i < nfds; ++i) {
ret = cconn_handle_event(io);
if (ret) {
WARNING("ceph plugin: cconn_handle_event(name=%s,"
ret = cconn_handle_event(io);
if (ret) {
WARNING("ceph plugin: cconn_handle_event(name=%s,"
- "i=%d,st=%d): error %d",
+ "i=%d,st=%d): error %zd",
io->d->name, i, io->state, ret);
cconn_close(io);
io->request_type = ASOK_REQ_NONE;
io->d->name, i, io->state, ret);
cconn_close(io);
io->request_type = ASOK_REQ_NONE;
-static int ceph_read(void) { return cconn_main_loop(ASOK_REQ_DATA); }
+static int ceph_read(void) { return (int)cconn_main_loop(ASOK_REQ_DATA); }
/******* lifecycle *******/
static int ceph_init(void) {
/******* lifecycle *******/
static int ceph_init(void) {
- return cconn_main_loop(ASOK_REQ_VERSION);
+ return (int)cconn_main_loop(ASOK_REQ_VERSION);
}
static int ceph_shutdown(void) {
}
static int ceph_shutdown(void) {