| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The macros provided by this library would expand to an unguarded
conditional that could have potential unwanted consequences. Consider
the following example:
dynstr_append_or_ret_null(&d, "example");
else
{
/* This is unexpectedly working. */
}
The example above would expand to:
if (dynstr_append(__VA_ARGS__) != DYNSTR_OK) return false;
else
{
/* This is unexpectedly working. */
}
Which is valid C yet allows possibly unexpected behaviour. The solution
is then to enclose these conditions into a `do while (0)` statement.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
- Removed trailing ';' from convenience macros.
- Convenience macros did not really need the ## __VA_ARGS__ extension.
Simply grouping all parameters into '...', while decreasing readability,
solves the portability issue.
- Added C99 check to dynstr.c.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
- Replaced int by specific, more meaningful error codes.
- C99 states realloc can be safely called using NULL pointers.
- New function dynstr_dup().
|
| | |
|
| | |
|
| | |
|
| |
|