]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
docs: Fix problems with example code 14007/head
authorBrad Hubbard <bhubbard@redhat.com>
Fri, 17 Mar 2017 06:12:41 +0000 (16:12 +1000)
committerBrad Hubbard <bhubbard@redhat.com>
Fri, 17 Mar 2017 06:12:41 +0000 (16:12 +1000)
Current code generates warnings and, in some cases, doesn't compile.

Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
doc/rados/api/librados-intro.rst

index ee5f58207cafd99fc8e148f061f9d034c1941213..8405f6e3968ae94e7d769721e72c787d2bbca25d 100644 (file)
@@ -266,10 +266,11 @@ it and connecting to the cluster might look something like this:
 .. code-block:: c
 
        #include <stdio.h>
+       #include <stdlib.h>
        #include <string.h>
        #include <rados/librados.h>
 
-       int main (int argc, char argv**
+       int main (int argc, const char **argv
        {
 
                /* Declare the cluster handle and required arguments. */
@@ -346,7 +347,7 @@ you to initialize a ``librados::Rados`` cluster handle object:
                librados::Rados cluster;
                char cluster_name[] = "ceph";
                char user_name[] = "client.admin";
-               uint64_t flags; 
+               uint64_t flags = 0
        
                /* Initialize the cluster handle with the "ceph" cluster name and "client.admin" user */ 
                {
@@ -577,9 +578,9 @@ C Example
 .. code-block:: c
 
        #include <stdio.h>
+       #include <stdlib.h>
        #include <string.h>
        #include <rados/librados.h>
-       #include <stdlib.h>
 
        int main (int argc, const char **argv) 
        {