search for: val_

Displaying 7 results from an estimated 7 matches for "val_".

Did you mean: val
2020 Sep 06
0
[libnbd PATCH 3/3] ocaml: Typesafe returns for REnum/RFlags
...pr "}\n"; + pr "\n"; + pr "/* Convert int to OCaml %s.t. */\n" enum_prefix; + (* Easier to mark function as potentially unused than to search whether + * any REnum references this type. + *) + pr "static value __attribute__ ((unused))\n"; + pr "Val_%s (int i)\n" enum_prefix; + pr "{\n"; + pr " CAMLparam0 ();\n"; + pr " CAMLlocal1 (rv);\n"; + pr "\n"; + pr " switch (i) {\n"; + List.iteri ( + fun i (enum, _) -> + pr " case LIBNBD_%s_%s: rv = Val_int (%d); break;\n&q...
2020 Sep 07
0
[libnbd PATCH v2 3/3] ocaml: Typesafe returns for REnum/RFlags
...exists ( + function + | _, { ret = REnum { enum_prefix = prefix } } -> + (prefix = enum_prefix) + | _ -> false + ) handle_calls then ( + pr "/* Convert int to OCaml %s.t. */\n" enum_prefix; + pr "static value\n"; + pr "Val_%s (int i)\n" enum_prefix; + pr "{\n"; + pr " CAMLparam0 ();\n"; + pr " CAMLlocal1 (rv);\n"; + pr "\n"; + pr " switch (i) {\n"; + List.iteri ( + fun i (enum, _) -> + pr " case LIBNBD_%s_%s: rv = Val_int...
2020 Sep 07
4
[libnbd PATCH v2 0/3] Improve type-safety of ocaml/golang getters
Well, the golang changes (patch 1 and 2/3 of v1) were already committed, all that was left was the OCaml changes. I'm a lot happier with how things turned out with an UNKNOWN constructor in the OCaml variants. Eric Blake (3): tests: Enhance coverage of enum/flag range checking ocaml: Support unknown values for Enum/Flags ocaml: Typesafe returns for REnum/RFlags generator/OCaml.ml
2011 Jun 28
0
time series question
...Val=rep(runif(26), 10), Year=rep(2000:2009, 26)) DF[as.numeric(rownames(DF)) %% 3 == 0,"Val"] <- NA # make some holes DF2 <- cast(melt(DF, id=c("Var", "Year")), ... ~ variable + Year, fun=mean, na.rm=T) # my attempt library(reshape) prev <- grep("Val_", names(DF2)) - 1 this <- grep("Fac_", names(DF2)) DF3 <- DF2 DF3[, prev] <- mapply("*", DF2[, this], DF2[, prev]) This doesn't work. Another option would be to use two loops for cols and rows, but I didn't get that to work either :-( Suggestions for c...
2020 Sep 06
8
[libnbd PATCH 0/3] Improve type-safety of ocaml/golang getters
...caml bugs in the setters. However, on at least the OCaml code, I'm not sure what we should do if a newer libnbd ever returns a bit that an older NBD.mli was not expecting at the time the OCaml compiler ran (see below). I'm also not sure if there is a more efficient way to avoid outputting Val_FOO() converters for types not referenced in REnum/RFlags than my hack of __attribute__((unused)). Hence I'll wait for a review on these. Now, for the future compatibility lesson, promised above. nbd_get_handshake_flags is documented as potentially returning additional bits from a newer libnbd...
2007 Mar 22
0
7 commits - configure.ac doc/swfdec-docs.sgml libswfdec/js libswfdec/swfdec_buffer.c libswfdec/swfdec_buffer.h libswfdec/swfdec_js_movie.c test/trace
...swapDepths (JSContext *c SwfdecMovie *other; int depth; - movie = JS_GetPrivate (cx, obj); - g_assert (movie); + movie = swfdec_scriptable_from_object (cx, obj, SWFDEC_TYPE_MOVIE); + if (movie == NULL) { + SWFDEC_WARNING ("not a movie"); + return JS_TRUE; + } if (JSVAL_IS_OBJECT (argv[0])) { other = swfdec_scriptable_from_jsval (cx, argv[0], SWFDEC_TYPE_MOVIE); @@ -462,8 +507,11 @@ swfdec_js_movie_attachMovie (JSContext * SwfdecContent *content; SwfdecGraphic *sprite; - movie = JS_GetPrivate (cx, obj); - g_assert (movie); + movie = swfdec_scriptabl...
2013 Mar 25
86
[PATCH 00/28] libxl: ocaml: improve the bindings
The following series of patches fill in most of the gaps in the OCaml bindings to libxl, to make them useful for clients such as xapi/xenopsd (from XCP). There are a number of bugfixes to the existing bindings as well. I have an experimental version of xenopsd that successfully uses the new bindings. An earlier version of the first half of the series was submitted to the last by Ian Campbell on