talloc: remove const warning in _info example.
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 31 Oct 2012 11:29:50 +0000 (21:59 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 31 Oct 2012 11:29:50 +0000 (21:59 +1030)
Compiler:
/home/rusty/devel/cvs/ccan/ccan/talloc/_info: In function ‘main’:
/home/rusty/devel/cvs/ccan/ccan/talloc/_info:84:9: warning: passing argument 2 of ‘open_output_cmd’ discards ‘const’ qualifier from pointer target type [enabled by default]
/home/rusty/devel/cvs/ccan/ccan/talloc/_info:52:24: note: expected ‘char *’ but argument is of type ‘const char *’

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/talloc/_info
ccan/tcon/test/compile_fail-tcon_cast.c

index 9a189455bb27cfcdf8d02332e055c1a2d7003470..b229ba2583b1001ce2569919cbb1b2d84be8eeb5 100644 (file)
@@ -49,7 +49,8 @@
  *     }
  *
  *     // This function opens a writable pipe to the given command.
- *     static struct command *open_output_cmd(const void *ctx, char *fmt, ...)
+ *     static struct command *open_output_cmd(const void *ctx,
+ *                                            const char *fmt, ...)
  *     {
  *             va_list ap;
  *             struct command *cmd = talloc(ctx, struct command);
index f80ef42c091dde6ff817ba8dc6ea10ce9c9b3fb0..3df0333ca047422eef3d83de1ea3b68063ab3df5 100644 (file)
@@ -25,5 +25,5 @@ int main(int argc, char *argv[])
 
        icon.raw.p = NULL;
        x = tcon_cast(&icon, tc1, icon.raw.p);
-       return 0;
+       return x != NULL ? 0 : 1;
 }