Skip to content
This repository was archived by the owner on Jul 1, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions vendor/newrelic/axiom/nr_axiom.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,21 @@ NRINLINE void* nr_remove_const(const void* ptr) {

#endif /* } */


#if defined(__clang__)
#if __has_attribute(fallthrough)
#define FALLTHROUGH __attribute__((fallthrough));
#else
#define FALLTHROUGH
#endif
#else
#if defined(__GNUC__) && __GNUC__ >= 7
#define FALLTHROUGH __attribute__((fallthrough));
#else
#define FALLTHROUGH
#endif /* __GNUC__ >= 7 */
#endif

/*
* The macro nr_clang_assert is redefined to assert iff we are compiling using
* the clang static analyzer scan-build. scan-build is sensitive to
Expand Down
4 changes: 2 additions & 2 deletions vendor/newrelic/axiom/util_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ uint32_t nr_mkhash(const char* str, int* len) {
switch (str_len & 3) {
case 3:
k1 ^= tail[2] << 16;
/* FALLTHROUGH */
FALLTHROUGH /* FALLTHROUGH */
case 2:
k1 ^= tail[1] << 8;
/* FALLTHROUGH */
FALLTHROUGH /* FALLTHROUGH */
case 1:
k1 ^= tail[0];

Expand Down
4 changes: 2 additions & 2 deletions vendor/newrelic/axiom/util_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -1349,12 +1349,12 @@ static const char* parse_string(nrintobj_t* item, const char* str) {
case 3:
*--ptr2 = ((uc | 0x80) & 0xBF);
uc >>= 6;
/*FALLTHROUGH*/
FALLTHROUGH /* FALLTHROUGH */

case 2:
*--ptr2 = ((uc | 0x80) & 0xBF);
uc >>= 6;
/*FALLTHROUGH*/
FALLTHROUGH /* FALLTHROUGH */

case 1:
*--ptr2 = (uc | firstByteMark[len]);
Expand Down
2 changes: 1 addition & 1 deletion vendor/newrelic/axiom/util_regex.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ void nr_regex_add_quoted_to_buffer(nrbuf_t* buf,
case ':':
case '-':
nr_buffer_add(buf, NR_PSTR("\\"));
/* FALLTHROUGH */
FALLTHROUGH /* FALLTHROUGH */

default:
nr_buffer_add(buf, &str[i], 1);
Expand Down