search for: insert_method_script

Displaying 3 results from an estimated 3 matches for "insert_method_script".

2020 Apr 20
1
Re: [PATCH nbdkit 2/2] Add insert function and use the new vector library in several places.
...ntlist.c | 113 ++++++++++++++++---------------- > TODO | 5 +- > 6 files changed, 119 insertions(+), 123 deletions(-) > +++ b/plugins/eval/eval.c > @@ -104,21 +106,12 @@ compare_script (const void *methodvp, const void *entryvp) > static int > insert_method_script (const char *method, char *script) > { > - struct method_script *newp; > - size_t i; > int r; > + size_t i; > + struct method_script new_entry = { .method = method, .script = script }; > > - newp = realloc (method_scripts, > - sizeof (struct...
2020 Apr 19
2
[PATCH nbdkit 1/2] vddk: Use new vector library to allocate the argv list.
--- plugins/vddk/vddk.c | 41 +++++++++++++++++++++++++---------------- TODO | 1 - 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/plugins/vddk/vddk.c b/plugins/vddk/vddk.c index 87c0d146..d1a3015f 100644 --- a/plugins/vddk/vddk.c +++ b/plugins/vddk/vddk.c @@ -51,6 +51,7 @@ #include "isaligned.h" #include "minmax.h" #include
2020 Apr 19
0
[PATCH nbdkit 2/2] Add insert function and use the new vector library in several places.
...; -} *method_scripts; +}; +DEFINE_VECTOR_TYPE(method_script_list, struct method_script); +static method_script_list method_scripts; static int compare_script (const void *methodvp, const void *entryvp) @@ -104,21 +106,12 @@ compare_script (const void *methodvp, const void *entryvp) static int insert_method_script (const char *method, char *script) { - struct method_script *newp; - size_t i; int r; + size_t i; + struct method_script new_entry = { .method = method, .script = script }; - newp = realloc (method_scripts, - sizeof (struct method_script) * (nr_method_scripts + 1)); - i...