Repository: jerryscript-project/jerryscript
File: jerry-ext/include/jerryscript-ext/arg.impl.h (C/C++)

Code before:
static inline jerryx_arg_t
jerryx_arg_ignore (void)
{
  return (jerryx_arg_t){ .func = jerryx_arg_transform_ignore };
} /* jerryx_arg_ignore */

/**
 * Create a jerryx_arg_t instance with custom transform.
 *
 * @return a jerryx_arg_t instance.
 */
static inline jerryx_arg_t
jerryx_arg_custom (void *dest, /**< pointer to the native argument where the result should be stored */
                   uintptr_t extra_info, /**< the extra parameter, specific to the transform function */
                   jerryx_arg_transform_func_t func) /**< the custom transform function */
{
  return (jerryx_arg_t){ .func = func, .dest = dest, .extra_info = extra_info };
} /* jerryx_arg_custom */

/**
 * Create a jerryx_arg_t instance for object properties.
 *
 * @return a jerryx_arg_t instance.
 */
static inline jerryx_arg_t
jerryx_arg_object_properties (
  const jerryx_arg_object_props_t *object_props_p, /**< pointer to object property mapping */
  jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */
{
  jerryx_arg_transform_func_t func;

  if (opt_flag == JERRYX_ARG_OPTIONAL)
  {
    func = jerryx_arg_transform_object_props_optional;
  }
  else
  {
    func = jerryx_arg_transform_object_props;
  }

  return (jerryx_arg_t){ .func = func, .dest = NULL, .extra_info = (uintptr_t) object_props_p };
} /* jerryx_arg_object_properties */

/**
 * Create a jerryx_arg_t instance for array.
 *
 * @return a jerryx_arg_t instance.
 */
static inline jerryx_arg_t
jerryx_arg_array (const jerryx_arg_array_items_t *array_items_p, /**< pointer to array items mapping */
                  jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */

Review comment (suggestion):
What do you think about renaming to `obj_prop_p` instead, so it can be written in the same line. This indentation is a bit unusual.

Code after:
static inline jerryx_arg_t
jerryx_arg_ignore (void)
{
  return (jerryx_arg_t){ .func = jerryx_arg_transform_ignore };
} /* jerryx_arg_ignore */

/**
 * Create a jerryx_arg_t instance with custom transform.
 *
 * @return a jerryx_arg_t instance.
 */
static inline jerryx_arg_t
jerryx_arg_custom (void *dest, /**< pointer to the native argument where the result should be stored */
                   uintptr_t extra_info, /**< the extra parameter, specific to the transform function */
                   jerryx_arg_transform_func_t func) /**< the custom transform function */
{
  return (jerryx_arg_t){ .func = func, .dest = dest, .extra_info = extra_info };
} /* jerryx_arg_custom */

/**
 * Create a jerryx_arg_t instance for object properties.
 *
 * @return a jerryx_arg_t instance.
 */
static inline jerryx_arg_t
jerryx_arg_object_properties (const jerryx_arg_object_props_t *obj_prop_p, /**< pointer to object property mapping */
                              jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */
{
  jerryx_arg_transform_func_t func;

  if (opt_flag == JERRYX_ARG_OPTIONAL)
  {
    func = jerryx_arg_transform_object_props_optional;
  }
  else
  {
    func = jerryx_arg_transform_object_props;
  }

  return (jerryx_arg_t){ .func = func, .dest = NULL, .extra_info = (uintptr_t) obj_prop_p };
} /* jerryx_arg_object_properties */

/**
 * Create a jerryx_arg_t instance for array.
 *
 * @return a jerryx_arg_t instance.
 */
static inline jerryx_arg_t
jerryx_arg_array (const jerryx_arg_array_items_t *array_items_p, /**< pointer to array items mapping */
                  jerryx_arg_optional_t opt_flag) /**< whether the argument is optional */
{