Format strings are typically read-only data (literal strings), and they
are not modified by the functions receiving them, so it makes no sense
for them not to be const.
This helps avoid some "passing value to function foo discards const
qualifier" kind of warnings.
Change-Id: Ibaaaf5690bed21e1d541f1b676627dfd70541219
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2130
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
* test_comment -- a comment to print afterwards, may be NULL
*/
unsigned int
* test_comment -- a comment to print afterwards, may be NULL
*/
unsigned int
-_gen_result(int ok, const char *func, char *file, unsigned int line,
- char *test_name, ...)
+_gen_result(int ok, const char *func, const char *file, unsigned int line,
+ const char *test_name, ...)
{
va_list ap;
char *local_test_name = NULL;
{
va_list ap;
char *local_test_name = NULL;
* Note that the plan is to skip all tests
*/
int
* Note that the plan is to skip all tests
*/
int
-plan_skip_all(char *reason)
+plan_skip_all(const char *reason)
+diag(const char *fmt, ...)
-skip(unsigned int n, char *fmt, ...)
+skip(unsigned int n, const char *fmt, ...)
{
va_list ap;
char *skip_msg = NULL;
{
va_list ap;
char *skip_msg = NULL;
-todo_start(char *fmt, ...)
+todo_start(const char *fmt, ...)
#define skip_end() } while(0);
__attribute__((format(printf, 5, 6)))
#define skip_end() } while(0);
__attribute__((format(printf, 5, 6)))
-unsigned int _gen_result(int, const char *, char *, unsigned int, char *, ...);
+unsigned int _gen_result(int, const char *, const char *, unsigned int, const char *, ...);
-int plan_skip_all(char *);
+int plan_skip_all(const char *);
int plan_tests(unsigned int);
__attribute__((format(printf, 1, 2)))
int plan_tests(unsigned int);
__attribute__((format(printf, 1, 2)))
-unsigned int diag(char *, ...);
+unsigned int diag(const char *, ...);
void diag_multiline(const char *);
__attribute__((format(printf, 2, 3)))
void diag_multiline(const char *);
__attribute__((format(printf, 2, 3)))
-int skip(unsigned int, char *, ...);
+int skip(unsigned int, const char *, ...);
__attribute__((format(printf, 1, 2)))
__attribute__((format(printf, 1, 2)))
-void todo_start(char *, ...);
+void todo_start(const char *, ...);
void todo_end(void);
int exit_status(void);
void todo_end(void);
int exit_status(void);