Skip to content

How to deal with void* parameters to MagickWand API methods? #5743

Discussion options

You must be logged in to vote

Typically, void* is used to pass a buffer of raw data, however, you always need to first cast the pointer to interpret it. Since SetStringInfo*() typically operated on strings, it was built around unsigned char*. Signed/unsigned characters are typically utilized whenever their is a length associated with data. Whereas, with void pointers, a length would not make sense given void is a general declaration that can hold any pointer type.

We'll correct the const issue. The profile is const void* and therefore we would assume const unsigned char* when placing it in a StringInfo container.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Haidar0096
Comment options

@urban-warrior
Comment options

@Haidar0096
Comment options

Answer selected by Haidar0096
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants