From 18545908ebf2d4a3c728fdb371d37ad38ac1b440 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Thu, 1 Mar 2012 00:08:05 +0000 Subject: [PATCH] Warning fixes. --- org.glite.lb.common/Makefile | 4 ++-- org.glite.lb.common/interface/xml_conversions.h | 1 + org.glite.lb.common/src/status.c.T | 2 +- org.glite.lb.state-machine/src/intjobstat_supp.c | 2 ++ org.glite.lb.state-machine/src/lb_plugin.c | 3 +++ org.glite.lbjp-common.gsoap-plugin/Makefile | 4 ++-- org.glite.lbjp-common.gsoap-plugin/examples/wscalc_srv_ex.c | 1 - org.glite.lbjp-common.gsoap-plugin/examples/wscalc_srv_ex2.c | 2 +- org.glite.lbjp-common.gsoap-plugin/src/sizeof_soap.c | 2 +- org.glite.lbjp-common.jp-interface/src/attr.c | 2 +- org.glite.lbjp-common.server-bones/examples/cnt_example.c | 2 +- org.glite.lbjp-common.server-bones/examples/srv_example.c | 2 +- org.glite.lbjp-common.server-bones/src/srvbones.c | 6 ++++-- 13 files changed, 20 insertions(+), 13 deletions(-) diff --git a/org.glite.lb.common/Makefile b/org.glite.lb.common/Makefile index 215d1cc..432c878 100644 --- a/org.glite.lb.common/Makefile +++ b/org.glite.lb.common/Makefile @@ -53,7 +53,7 @@ EXPAT_LIBS?=${expatlib} -lexpat CLASSADS_CFLAGS?=-I${classads_prefix}/include -I${classads_prefix}/include/classad CLASSADS_LIBS?=${classadslib} -lclassad -CFLAGS:=${CFLAGS} ${DEBUG} -I${top_srcdir}/src -I${top_srcdir}/interface \ +CFLAGS:=${DEBUG} -I${top_srcdir}/src -I${top_srcdir}/interface \ -I. \ -I${top_srcdir}/test \ -I${stagedir}${prefix}/include \ @@ -62,7 +62,7 @@ CFLAGS:=${CFLAGS} ${DEBUG} -I${top_srcdir}/src -I${top_srcdir}/interface \ ${COVERAGE_FLAGS} \ -D_GNU_SOURCE \ -DDATAGRID_EXTENSION ${LB_STANDALONE_FLAGS} \ - -DBUILDING_LB_COMMON + -DBUILDING_LB_COMMON ${CFLAGS} LDFLAGS:=${LDFLAGS} -L${stagedir}${prefix}/${libdir} \ ${COVERAGE_FLAGS} diff --git a/org.glite.lb.common/interface/xml_conversions.h b/org.glite.lb.common/interface/xml_conversions.h index a4ae7dd..6f57c35 100644 --- a/org.glite.lb.common/interface/xml_conversions.h +++ b/org.glite.lb.common/interface/xml_conversions.h @@ -153,6 +153,7 @@ uint16_t edg_wll_from_string_to_uint16_t(edg_wll_XML_ctx *XMLCtx); struct timeval edg_wll_from_string_to_timeval(edg_wll_XML_ctx *XMLCtx); time_t edg_wll_from_string_to_time_t(edg_wll_XML_ctx *XMLCtx); edg_wll_Source edg_wll_from_string_to_logsrc(edg_wll_XML_ctx *XMLCtx); +void *edg_wll_from_string_to_cclassad(edg_wll_XML_ctx *XMLCtx); char *edg_wll_stat_flags_to_string(int flags); int edg_wll_string_to_stat_flags(char *cflags); diff --git a/org.glite.lb.common/src/status.c.T b/org.glite.lb.common/src/status.c.T index 1c48795..b412633 100644 --- a/org.glite.lb.common/src/status.c.T +++ b/org.glite.lb.common/src/status.c.T @@ -32,7 +32,7 @@ static const struct timeval null_timeval = {0,0}; gen qq{$sep $term}; $sep = ", "; } - $sep = ", 0};"; + $sep = "};"; gen qq{$sep}; @@@} diff --git a/org.glite.lb.state-machine/src/intjobstat_supp.c b/org.glite.lb.state-machine/src/intjobstat_supp.c index c4bb463..a436180 100644 --- a/org.glite.lb.state-machine/src/intjobstat_supp.c +++ b/org.glite.lb.state-machine/src/intjobstat_supp.c @@ -17,6 +17,7 @@ limitations under the License. */ +#define _GNU_SOURCE #include #include #include @@ -470,6 +471,7 @@ static struct timeval dec_timeval(char *in, char **rest) t.tv_sec = dec_int(in, &tmp_in); if (tmp_in != NULL) t.tv_usec = dec_int(tmp_in, &tmp_in); + else t.tv_usec = 0; *rest = tmp_in; return t; } diff --git a/org.glite.lb.state-machine/src/lb_plugin.c b/org.glite.lb.state-machine/src/lb_plugin.c index dbef5c1..69b9b35 100644 --- a/org.glite.lb.state-machine/src/lb_plugin.c +++ b/org.glite.lb.state-machine/src/lb_plugin.c @@ -91,6 +91,9 @@ static int readline( ); char* get_namespace(const char* attr); +// XXX: backend_private.h into org.glite.lbjp-common.jp-interface? +int glite_jppsbe_append_tags(void *fpctx, char *jobid, glite_jp_attrval_t *attr); + static int lb_StringToAttr(const char *name) { unsigned int i; diff --git a/org.glite.lbjp-common.gsoap-plugin/Makefile b/org.glite.lbjp-common.gsoap-plugin/Makefile index fa7dd6c..4b8a036 100644 --- a/org.glite.lbjp-common.gsoap-plugin/Makefile +++ b/org.glite.lbjp-common.gsoap-plugin/Makefile @@ -93,12 +93,12 @@ GSOAP_LIBS_lang:=${GSOAPXX_LIBS} endif -CFLAGS:= ${CFLAGS} ${DEBUG} \ +CFLAGS:= ${DEBUG} \ -DVERSION=\"${version}\" \ -DWITH_NONAMESPACES \ -I. -I${top_srcdir2}/interface \ -I${stagedir}${prefix}/include \ - ${COVERAGE_FLAGS} -D_GNU_SOURCE -DDATAGRID_EXTENSION + ${COVERAGE_FLAGS} -D_GNU_SOURCE -DDATAGRID_EXTENSION ${CFLAGS} LDFLAGS:=${LDFLAGS} ${COVERAGE_FLAGS} diff --git a/org.glite.lbjp-common.gsoap-plugin/examples/wscalc_srv_ex.c b/org.glite.lbjp-common.gsoap-plugin/examples/wscalc_srv_ex.c index 975afa8..b0f9528 100644 --- a/org.glite.lbjp-common.gsoap-plugin/examples/wscalc_srv_ex.c +++ b/org.glite.lbjp-common.gsoap-plugin/examples/wscalc_srv_ex.c @@ -48,7 +48,6 @@ main(int argc, char **argv) char *name; char *cert, *key; int opt; - edg_wll_GssCred cred; cert = key = NULL; name = strrchr(argv[0],'/'); diff --git a/org.glite.lbjp-common.gsoap-plugin/examples/wscalc_srv_ex2.c b/org.glite.lbjp-common.gsoap-plugin/examples/wscalc_srv_ex2.c index 3bec28a..1a2819d 100644 --- a/org.glite.lbjp-common.gsoap-plugin/examples/wscalc_srv_ex2.c +++ b/org.glite.lbjp-common.gsoap-plugin/examples/wscalc_srv_ex2.c @@ -52,7 +52,7 @@ main(int argc, char **argv) edg_wll_GssConnection connection; glite_gsplugin_Context ctx; struct sockaddr_storage a; - int alen; + socklen_t alen; char *name, *msg; int opt, port = 19999; diff --git a/org.glite.lbjp-common.gsoap-plugin/src/sizeof_soap.c b/org.glite.lbjp-common.gsoap-plugin/src/sizeof_soap.c index 457d106..61c08e5 100644 --- a/org.glite.lbjp-common.gsoap-plugin/src/sizeof_soap.c +++ b/org.glite.lbjp-common.gsoap-plugin/src/sizeof_soap.c @@ -20,7 +20,7 @@ limitations under the License. int main(int argc, char **argv) { - printf("%lu\n", sizeof(struct soap)); + printf("%zd\n", sizeof(struct soap)); return 0; } diff --git a/org.glite.lbjp-common.jp-interface/src/attr.c b/org.glite.lbjp-common.jp-interface/src/attr.c index 3a9f33b..2fdc2b9 100644 --- a/org.glite.lbjp-common.jp-interface/src/attr.c +++ b/org.glite.lbjp-common.jp-interface/src/attr.c @@ -116,7 +116,7 @@ static char * fb_to_db_full(void *ctx,const glite_jp_attrval_t *attr) if (attr->origin < 0 || attr->origin > GLITE_JP_ATTR_ORIG_FILE) { free(db); return NULL; } - len = sprintf(db,"%c:%d:%c:",attr->binary ? 'B' : 'S', + len = sprintf(db,"%c:%ld:%c:",attr->binary ? 'B' : 'S', attr->timestamp,orig_char[attr->origin]); if (attr->origin_detail) len += escape_colon(attr->origin_detail,db+len); diff --git a/org.glite.lbjp-common.server-bones/examples/cnt_example.c b/org.glite.lbjp-common.server-bones/examples/cnt_example.c index c6a4830..b814604 100644 --- a/org.glite.lbjp-common.server-bones/examples/cnt_example.c +++ b/org.glite.lbjp-common.server-bones/examples/cnt_example.c @@ -149,7 +149,7 @@ int main(int argc, char **argv) int writen(int fd, char *ptr, int nbytes) { - int nleft, nwritten; + int nleft, nwritten = 0; nleft = nbytes; dprintf(("start writing %d bytes\n", nbytes)); diff --git a/org.glite.lbjp-common.server-bones/examples/srv_example.c b/org.glite.lbjp-common.server-bones/examples/srv_example.c index cd46278..131c91e 100644 --- a/org.glite.lbjp-common.server-bones/examples/srv_example.c +++ b/org.glite.lbjp-common.server-bones/examples/srv_example.c @@ -151,7 +151,7 @@ int disconnect(int conn, struct timeval *to, void *cdata) int writen(int fd, char *ptr, int nbytes) { - int nleft, nwritten; + int nleft, nwritten = 0; nleft = nbytes; dprintf(("start writing %d bytes\n", nbytes)); diff --git a/org.glite.lbjp-common.server-bones/src/srvbones.c b/org.glite.lbjp-common.server-bones/src/srvbones.c index 0510cd7..7b4814a 100644 --- a/org.glite.lbjp-common.server-bones/src/srvbones.c +++ b/org.glite.lbjp-common.server-bones/src/srvbones.c @@ -744,7 +744,7 @@ static int check_timeout(struct timeval timeout, struct timeval before, struct t */ static int do_sendmsg(int to_sock, int sock, unsigned long clnt_dispatched, int srv) { - struct msghdr msg = {0}; + struct msghdr msg; struct cmsghdr *cmsg; struct iovec sendiov; int myfds, /* file descriptors to pass. */ @@ -756,6 +756,7 @@ static int do_sendmsg(int to_sock, int sock, unsigned long clnt_dispatched, int memset(sendbuf, 0, sizeof(sendbuf)); snprintf(sendbuf, sizeof(sendbuf), "%u %lu", srv, clnt_dispatched); + memset(&msg, 0, sizeof(msg)); msg.msg_name = NULL; msg.msg_namelen = 0; msg.msg_iov = &sendiov; @@ -786,7 +787,7 @@ static int do_sendmsg(int to_sock, int sock, unsigned long clnt_dispatched, int /* receive socket sock through socket from_sock */ static int do_recvmsg(int from_sock, int *sock, unsigned long *clnt_accepted,int *srv) { - struct msghdr msg = {0}; + struct msghdr msg; struct cmsghdr *cmsg; struct iovec recviov; int myfds; /* file descriptors to pass. */ @@ -794,6 +795,7 @@ static int do_recvmsg(int from_sock, int *sock, unsigned long *clnt_accepted,int char recvbuf[MSG_BUFSIZ]; + memset(&msg, 0, sizeof(msg)); msg.msg_name = NULL; msg.msg_namelen = 0; msg.msg_iov = &recviov; -- 1.8.2.3