c-for-go icon indicating copy to clipboard operation
c-for-go copied to clipboard

PtrTips "sref" not behaving as expected for fundamental data types

Open coolgeek6667 opened this issue 7 years ago • 0 comments

I found this issue trying to wrap a library that returns a pointer to allocated memory through an unsigned char** parameter, and boiled it down to the following minimal sample:


Function being wrapped void test_sref(unsigned char** char_val, int** int_val, test_struct_t** struct_val);

Relevant section of yml config

TRANSLATOR:
  PtrTips:
    function:
      - {target: ^test_sref$, tips: [sref,sref,sref]}

Expected Output: func test_sref(char_val **byte, int_val **int32, struct_val **test_struct_t) { ... }

Actual Output: func test_sref(char_val []*byte, int_val []*int32, struct_val **test_struct_t) { ... }


Please advise if there is a way to tweak the yml file to produce the expected output.

coolgeek6667 avatar Aug 31 '18 13:08 coolgeek6667