From: Richard W.M. Jones Date: Tue, 23 Nov 2010 18:12:26 +0000 (+0000) Subject: ocaml: Fix some unused parameter warnings in OCaml bindings. X-Git-Tag: 1.7.13~18 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=8d3e97679a698386980bd1e5e5833542412a56f6;p=libguestfs.git ocaml: Fix some unused parameter warnings in OCaml bindings. --- diff --git a/generator/generator_ocaml.ml b/generator/generator_ocaml.ml index 860242c..393a062 100644 --- a/generator/generator_ocaml.ml +++ b/generator/generator_ocaml.ml @@ -537,7 +537,8 @@ copy_table (char * const * argv) pr "CAMLprim value "; pr "ocaml_guestfs_%s_byte (value *argv, int argn);\n" name; pr "CAMLprim value\n"; - pr "ocaml_guestfs_%s_byte (value *argv, int argn)\n" name; + pr "ocaml_guestfs_%s_byte (value *argv, int argn ATTRIBUTE_UNUSED)\n" + name; pr "{\n"; pr " return ocaml_guestfs_%s (argv[0]" name; iteri (fun i _ -> pr ", argv[%d]" i) (List.tl params); diff --git a/ocaml/guestfs_c.c b/ocaml/guestfs_c.c index 7648ba9..1324fb6 100644 --- a/ocaml/guestfs_c.c +++ b/ocaml/guestfs_c.c @@ -225,7 +225,7 @@ clear_progress_callback (guestfs_h *g) } static void -progress_callback (guestfs_h *g, void *root, +progress_callback (guestfs_h *g ATTRIBUTE_UNUSED, void *root, int proc_nr, int serial, uint64_t position, uint64_t total) { CAMLparam0 (); diff --git a/ocaml/guestfs_c.h b/ocaml/guestfs_c.h index 29da053..219dc2f 100644 --- a/ocaml/guestfs_c.h +++ b/ocaml/guestfs_c.h @@ -29,4 +29,14 @@ extern void ocaml_guestfs_raise_closed (const char *func) extern char **ocaml_guestfs_strings_val (guestfs_h *g, value sv); extern void ocaml_guestfs_free_strings (char **r); +# ifdef __GNUC__ +# ifndef ATTRIBUTE_UNUSED +# define ATTRIBUTE_UNUSED __attribute__((__unused__)) +# endif +#else +# ifndef ATTRIBUTE_UNUSED +# define ATTRIBUTE_UNUSED +# endif +#endif + #endif /* GUESTFS_OCAML_C_H */