projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use compiler-agnostic defines to silence warning
[lttng-tools.git]
/
src
/
common
/
compat
/
string.hpp
diff --git
a/src/common/compat/string.hpp
b/src/common/compat/string.hpp
index 526f2b2ced3b200ecfa696083baa9fadc72408eb..c34c7aa49b04feed30e23b01f0130dd2f7437db5 100644
(file)
--- a/
src/common/compat/string.hpp
+++ b/
src/common/compat/string.hpp
@@
-9,18
+9,16
@@
#ifndef _COMPAT_STRING_H
#define _COMPAT_STRING_H
#ifndef _COMPAT_STRING_H
#define _COMPAT_STRING_H
-#include <string.h>
#include <stdlib.h>
#include <stdlib.h>
+#include <string.h>
#ifdef HAVE_STRNLEN
#ifdef HAVE_STRNLEN
-static inline
-size_t lttng_strnlen(const char *str, size_t max)
+static inline size_t lttng_strnlen(const char *str, size_t max)
{
return strnlen(str, max);
}
#else
{
return strnlen(str, max);
}
#else
-static inline
-size_t lttng_strnlen(const char *str, size_t max)
+static inline size_t lttng_strnlen(const char *str, size_t max)
{
size_t ret;
const char *end;
{
size_t ret;
const char *end;
@@
-38,14
+36,12
@@
size_t lttng_strnlen(const char *str, size_t max)
#endif /* HAVE_STRNLEN */
#ifdef HAVE_STRNDUP
#endif /* HAVE_STRNLEN */
#ifdef HAVE_STRNDUP
-static inline
-char *lttng_strndup(const char *s, size_t n)
+static inline char *lttng_strndup(const char *s, size_t n)
{
return strndup(s, n);
}
#else
{
return strndup(s, n);
}
#else
-static inline
-char *lttng_strndup(const char *s, size_t n)
+static inline char *lttng_strndup(const char *s, size_t n)
{
char *ret;
size_t navail;
{
char *ret;
size_t navail;
@@
-110,20
+106,18
@@
static inline int lttng_fls(int val)
#endif /* HAVE_FLS */
#ifdef HAVE_MEMRCHR
#endif /* HAVE_FLS */
#ifdef HAVE_MEMRCHR
-static inline
-void *lttng_memrchr(const void *s, int c, size_t n)
+static inline void *lttng_memrchr(const void *s, int c, size_t n)
{
return (void *) memrchr(s, c, n);
}
#else
{
return (void *) memrchr(s, c, n);
}
#else
-static inline
-void *lttng_memrchr(const void *s, int c, size_t n)
+static inline void *lttng_memrchr(const void *s, int c, size_t n)
{
int i;
const char *str = (const char *) s;
{
int i;
const char *str = (const char *) s;
- for (i = n
-
1; i >= 0; i--) {
- if (str[i] == (char)c) {
- return (void *)
(str+
i);
+ for (i = n
-
1; i >= 0; i--) {
+ if (str[i] == (char)
c) {
+ return (void *)
(str +
i);
}
}
return NULL;
}
}
return NULL;
This page took
0.024287 seconds
and
4
git commands to generate.