# HG changeset patch # User Matti Hamalainen # Date 1578850349 -7200 # Node ID 263093248f26e19191bed4538754f54f917b9404 # Parent 01c6a526196258ccf290a1b3710a83be1a8b9a72 Change dmPrintWrap() API and move the string argument last. diff -r 01c6a5261962 -r 263093248f26 src/dmargs.c --- a/src/dmargs.c Sun Jan 12 19:25:52 2020 +0200 +++ b/src/dmargs.c Sun Jan 12 19:32:29 2020 +0200 @@ -186,13 +186,13 @@ * Print given string indented in such a way that it is automatically * line-wrapped as necessary, taking hard linefeeds into account as well. * @param fh stdio file handle to output to - * @param str string to output * @param spad starting pad/indent of the first line * @param rpad how much to pad the other lines * @param width total line width to wrap at + * @param str string to output */ -void dmPrintWrap(FILE *fh, const char *str, - const int spad, int const rpad, const int width) +void dmPrintWrap(FILE *fh, const int spad, int const rpad, + const int width, const char *str) { size_t pos = 0; BOOL first = TRUE; @@ -319,7 +319,7 @@ fputs(fmtBuf, fh); dmPrintPad(fh, padWidth, ' '); - dmPrintWrap(fh, opt->desc, *lineWidth, *lineWidth, 79); + dmPrintWrap(fh, *lineWidth, *lineWidth, 79, opt->desc); } } diff -r 01c6a5261962 -r 263093248f26 src/dmargs.h --- a/src/dmargs.h Sun Jan 12 19:25:52 2020 +0200 +++ b/src/dmargs.h Sun Jan 12 19:32:29 2020 +0200 @@ -53,8 +53,8 @@ void dmArgsPrintHelp(FILE *fh, const DMOptArg *opts, const int nopts, const int flags); -void dmPrintWrap(FILE *fh, const char *str, - const int spad, const int rpad, const int width); +void dmPrintWrap(FILE *fh, const int spad, const int rpad, + const int width, const char *str); #ifdef __cplusplus }