gnuastro-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[task #15109] Size of dataset as an Arithmetic operator


From: Mohammad Akhlaghi
Subject: [task #15109] Size of dataset as an Arithmetic operator
Date: Thu, 5 Mar 2020 20:25:57 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0

Follow-up Comment #9, task #15109 (project gnuastro):

In the previous post I forgot to mention how you can read the contents of
`arg' after doing basic sanity checks.

Again, you can find the way by inspecting other functions, but generally, this
is what I usually do: 1) define a new `size_t' variable, maybe `arg_val'. 2)
Convert `arg' to the `GAL_TYPE_SIZE_T' TYPE (with the
`gal_data_copy_to_new_type_free' function). Note that freeing should only be
done if the freeing flag is set. 3) Now that you know the type of the
`arg->array' pointer, just read/copy it into the variable with something like
this: `arg_val=(size_t *)(arg->array)'. Ofcourse you can also directly read
`arg->array' as a size_t array, its just more clear for a reader if you use a
clearly-named variable.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/task/?15109>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]