[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] libvchan: address compiler warnings



commit b541d3fe1d438e152c755b2fba6e5905e27041ca
Author:     Jan Beulich <JBeulich@xxxxxxxx>
AuthorDate: Wed Feb 4 16:07:48 2015 +0000
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Thu Feb 5 12:21:48 2015 +0000

    libvchan: address compiler warnings
    
    Both vchan_wr() and stdout_wr() should be defined with a non-empty
    argument list (i.e. void). Additionally both of them as well as usage()
    should be static to make clear that no other code is referencing them.
    
    Further, statements should follow declarations.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 tools/libvchan/node-select.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/tools/libvchan/node-select.c b/tools/libvchan/node-select.c
index 13c5822..6712df0 100644
--- a/tools/libvchan/node-select.c
+++ b/tools/libvchan/node-select.c
@@ -39,7 +39,7 @@
 
 #include <libxenvchan.h>
 
-void usage(char** argv)
+static void usage(char** argv)
 {
        fprintf(stderr, "usage:\n"
                "\t%s [client|server] domainid nodepath [rbufsiz wbufsiz]\n",
@@ -54,10 +54,12 @@ int insiz = 0;
 int outsiz = 0;
 struct libxenvchan *ctrl = 0;
 
-void vchan_wr() {
+static void vchan_wr(void) {
+       int ret;
+
        if (!insiz)
                return;
-       int ret = libxenvchan_write(ctrl, inbuf, insiz);
+       ret = libxenvchan_write(ctrl, inbuf, insiz);
        if (ret < 0) {
                fprintf(stderr, "vchan write failed\n");
                exit(1);
@@ -68,10 +70,12 @@ void vchan_wr() {
        }
 }
 
-void stdout_wr() {
+static void stdout_wr(void) {
+       int ret;
+
        if (!outsiz)
                return;
-       int ret = write(1, outbuf, outsiz);
+       ret = write(1, outbuf, outsiz);
        if (ret < 0 && errno != EAGAIN)
                exit(1);
        if (ret > 0) {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.