Skip to content

Conversation

@nijek
Copy link

@nijek nijek commented Nov 11, 2022

…data type

Pode usar qualquer tipo de dado, é só passar uma função que printe adequadamente o tipo de dado escolhido e que compare adequadamente o tipo de dado escolhido.

return -1;
}

int compareDouble(void *a, void *b)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about using the fabs() method? This would simplify this function

printf("%s ", (char *)data);
}

int compareChar(void *a, void *b)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider documenting what each return parameter means, e.g.
0 -> they are equal
1 and -1 > greater or lower

One option is using the @param tag

return -1;
}

int compareInt(void *a, void *b)
Copy link
Owner

@azolinmf azolinmf Jan 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same about the return documentation for all methods that this applies

Copy link
Owner

@azolinmf azolinmf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR! I've suggested a few improvements, feel free to adopt them before merging if they make sense to you (:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants