Merge "Suppress implicit-fallthrough warnings." am: 16fef65f9e
am: 3784224654
Change-Id: I42f2e5fcbc5308b3bb2b688bfeda11a496158d4f
This commit is contained in:
commit
229d380b14
13 changed files with 52 additions and 31 deletions
|
|
@ -170,7 +170,9 @@ void UNUSED(const T&...) {
|
||||||
//
|
//
|
||||||
// In either case this macro has no effect on runtime behavior and performance
|
// In either case this macro has no effect on runtime behavior and performance
|
||||||
// of code.
|
// of code.
|
||||||
|
#ifndef FALLTHROUGH_INTENDED
|
||||||
#define FALLTHROUGH_INTENDED [[clang::fallthrough]] // NOLINT
|
#define FALLTHROUGH_INTENDED [[clang::fallthrough]] // NOLINT
|
||||||
|
#endif
|
||||||
|
|
||||||
// Current ABI string
|
// Current ABI string
|
||||||
#if defined(__arm__)
|
#if defined(__arm__)
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include <android-base/file.h>
|
#include <android-base/file.h>
|
||||||
|
#include <android-base/macros.h>
|
||||||
#include <android-base/stringprintf.h>
|
#include <android-base/stringprintf.h>
|
||||||
#ifdef __ANDROID__ // includes sys/properties.h which does not exist outside
|
#ifdef __ANDROID__ // includes sys/properties.h which does not exist outside
|
||||||
#include <cutils/properties.h>
|
#include <cutils/properties.h>
|
||||||
|
|
@ -2516,7 +2517,7 @@ static int android_log_buffer_to_string(const char* msg, size_t len,
|
||||||
#endif
|
#endif
|
||||||
elem.data.string = const_cast<char*>("<unknown>");
|
elem.data.string = const_cast<char*>("<unknown>");
|
||||||
elem.len = strlen(elem.data.string);
|
elem.len = strlen(elem.data.string);
|
||||||
/* FALLTHRU */
|
FALLTHROUGH_INTENDED;
|
||||||
case EVENT_TYPE_STRING:
|
case EVENT_TYPE_STRING:
|
||||||
if (elem.len <= strOutLen) {
|
if (elem.len <= strOutLen) {
|
||||||
memcpy(strOut, elem.data.string, elem.len);
|
memcpy(strOut, elem.data.string, elem.len);
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,7 @@ LOCAL_SRC_FILES_mips64 := $(PIXELFLINGER_SRC_FILES_mips64)
|
||||||
LOCAL_CFLAGS := $(PIXELFLINGER_CFLAGS)
|
LOCAL_CFLAGS := $(PIXELFLINGER_CFLAGS)
|
||||||
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
|
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
|
||||||
LOCAL_C_INCLUDES += $(LOCAL_EXPORT_C_INCLUDE_DIRS)
|
LOCAL_C_INCLUDES += $(LOCAL_EXPORT_C_INCLUDE_DIRS)
|
||||||
|
LOCAL_HEADER_LIBRARIES := libbase_headers
|
||||||
LOCAL_SHARED_LIBRARIES := libcutils liblog libutils
|
LOCAL_SHARED_LIBRARIES := libcutils liblog libutils
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
#include <android-base/macros.h>
|
||||||
|
|
||||||
#include "buffer.h"
|
#include "buffer.h"
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
|
|
@ -266,8 +268,11 @@ uint32_t ggl_pack_color(context_t* c, int32_t format,
|
||||||
p = downshift_component(p, b, hbits, lbits, f->bh, f->bl, 0, 1, -1);
|
p = downshift_component(p, b, hbits, lbits, f->bh, f->bl, 0, 1, -1);
|
||||||
p = downshift_component(p, a, hbits, lbits, f->ah, f->al, 0, 1, -1);
|
p = downshift_component(p, a, hbits, lbits, f->ah, f->al, 0, 1, -1);
|
||||||
switch (f->size) {
|
switch (f->size) {
|
||||||
case 1: p |= p << 8; // fallthrough
|
case 1:
|
||||||
case 2: p |= p << 16;
|
p |= p << 8;
|
||||||
|
FALLTHROUGH_INTENDED;
|
||||||
|
case 2:
|
||||||
|
p |= p << 16;
|
||||||
}
|
}
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#include <android-base/macros.h>
|
||||||
#include <log/log.h>
|
#include <log/log.h>
|
||||||
|
|
||||||
#include "GGLAssembler.h"
|
#include "GGLAssembler.h"
|
||||||
|
|
@ -301,7 +302,7 @@ void GGLAssembler::build_blend_factor(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// fall-through...
|
FALLTHROUGH_INTENDED;
|
||||||
case GGL_ONE_MINUS_DST_COLOR:
|
case GGL_ONE_MINUS_DST_COLOR:
|
||||||
case GGL_DST_COLOR:
|
case GGL_DST_COLOR:
|
||||||
case GGL_ONE_MINUS_SRC_COLOR:
|
case GGL_ONE_MINUS_SRC_COLOR:
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,8 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include <android-base/file.h>
|
||||||
|
#include <android-base/macros.h>
|
||||||
#include <log/log.h>
|
#include <log/log.h>
|
||||||
#include <sysutils/SocketClient.h>
|
#include <sysutils/SocketClient.h>
|
||||||
|
|
||||||
|
|
@ -145,7 +147,8 @@ char *SocketClient::quoteArg(const char *arg) {
|
||||||
switch (*arg) {
|
switch (*arg) {
|
||||||
case '\\':
|
case '\\':
|
||||||
case '"':
|
case '"':
|
||||||
*(current++) = '\\'; // fallthrough
|
*(current++) = '\\';
|
||||||
|
FALLTHROUGH_INTENDED;
|
||||||
default:
|
default:
|
||||||
*(current++) = *(arg++);
|
*(current++) = *(arg++);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include <android-base/macros.h>
|
||||||
#include <android-base/stringprintf.h>
|
#include <android-base/stringprintf.h>
|
||||||
|
|
||||||
#include <unwindstack/DwarfError.h>
|
#include <unwindstack/DwarfError.h>
|
||||||
|
|
@ -154,13 +155,15 @@ std::string DwarfCfa<AddressType>::GetOperandString(uint8_t operand, uint64_t va
|
||||||
break;
|
break;
|
||||||
case DwarfCfaInfo::DWARF_DISPLAY_ADVANCE_LOC:
|
case DwarfCfaInfo::DWARF_DISPLAY_ADVANCE_LOC:
|
||||||
*cur_pc += value;
|
*cur_pc += value;
|
||||||
// Fall through to log the value.
|
FALLTHROUGH_INTENDED;
|
||||||
|
// Fall through to log the value.
|
||||||
case DwarfCfaInfo::DWARF_DISPLAY_NUMBER:
|
case DwarfCfaInfo::DWARF_DISPLAY_NUMBER:
|
||||||
string += " " + std::to_string(value);
|
string += " " + std::to_string(value);
|
||||||
break;
|
break;
|
||||||
case DwarfCfaInfo::DWARF_DISPLAY_SET_LOC:
|
case DwarfCfaInfo::DWARF_DISPLAY_SET_LOC:
|
||||||
*cur_pc = value;
|
*cur_pc = value;
|
||||||
// Fall through to log the value.
|
FALLTHROUGH_INTENDED;
|
||||||
|
// Fall through to log the value.
|
||||||
case DwarfCfaInfo::DWARF_DISPLAY_ADDRESS:
|
case DwarfCfaInfo::DWARF_DISPLAY_ADDRESS:
|
||||||
if (std::is_same<AddressType, uint32_t>::value) {
|
if (std::is_same<AddressType, uint32_t>::value) {
|
||||||
string += android::base::StringPrintf(" 0x%" PRIx32, static_cast<uint32_t>(value));
|
string += android::base::StringPrintf(" 0x%" PRIx32, static_cast<uint32_t>(value));
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,7 @@ cc_defaults {
|
||||||
"-Werror",
|
"-Werror",
|
||||||
],
|
],
|
||||||
header_libs: [
|
header_libs: [
|
||||||
|
"libbase_headers",
|
||||||
"libutils_headers",
|
"libutils_headers",
|
||||||
],
|
],
|
||||||
export_header_lib_headers: [
|
export_header_lib_headers: [
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
#include <android-base/macros.h>
|
||||||
|
|
||||||
#include <utils/RefBase.h>
|
#include <utils/RefBase.h>
|
||||||
|
|
||||||
#include <utils/CallStack.h>
|
#include <utils/CallStack.h>
|
||||||
|
|
@ -479,7 +481,7 @@ void RefBase::forceIncStrong(const void* id) const
|
||||||
case INITIAL_STRONG_VALUE:
|
case INITIAL_STRONG_VALUE:
|
||||||
refs->mStrong.fetch_sub(INITIAL_STRONG_VALUE,
|
refs->mStrong.fetch_sub(INITIAL_STRONG_VALUE,
|
||||||
std::memory_order_relaxed);
|
std::memory_order_relaxed);
|
||||||
// fall through...
|
FALLTHROUGH_INTENDED;
|
||||||
case 0:
|
case 0:
|
||||||
refs->mBase->onFirstRef();
|
refs->mBase->onFirstRef();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,9 @@
|
||||||
|
|
||||||
#define LOG_TAG "unicode"
|
#define LOG_TAG "unicode"
|
||||||
|
|
||||||
#include <utils/Unicode.h>
|
#include <android-base/macros.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include <utils/Unicode.h>
|
||||||
|
|
||||||
#include <log/log.h>
|
#include <log/log.h>
|
||||||
|
|
||||||
|
|
@ -105,8 +106,11 @@ static inline void utf32_codepoint_to_utf8(uint8_t* dstP, char32_t srcChar, size
|
||||||
switch (bytes)
|
switch (bytes)
|
||||||
{ /* note: everything falls through. */
|
{ /* note: everything falls through. */
|
||||||
case 4: *--dstP = (uint8_t)((srcChar | kByteMark) & kByteMask); srcChar >>= 6;
|
case 4: *--dstP = (uint8_t)((srcChar | kByteMark) & kByteMask); srcChar >>= 6;
|
||||||
|
FALLTHROUGH_INTENDED;
|
||||||
case 3: *--dstP = (uint8_t)((srcChar | kByteMark) & kByteMask); srcChar >>= 6;
|
case 3: *--dstP = (uint8_t)((srcChar | kByteMark) & kByteMask); srcChar >>= 6;
|
||||||
|
FALLTHROUGH_INTENDED;
|
||||||
case 2: *--dstP = (uint8_t)((srcChar | kByteMark) & kByteMask); srcChar >>= 6;
|
case 2: *--dstP = (uint8_t)((srcChar | kByteMark) & kByteMask); srcChar >>= 6;
|
||||||
|
FALLTHROUGH_INTENDED;
|
||||||
case 1: *--dstP = (uint8_t)(srcChar | kFirstByteMark[bytes]);
|
case 1: *--dstP = (uint8_t)(srcChar | kFirstByteMark[bytes]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
#include "logcat.h"
|
#include "logcat.h"
|
||||||
|
|
||||||
|
#include <android-base/macros.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
@ -959,7 +960,7 @@ static int __logcat(android_logcat_context_internal* context) {
|
||||||
case 't':
|
case 't':
|
||||||
got_t = true;
|
got_t = true;
|
||||||
mode |= ANDROID_LOG_RDONLY | ANDROID_LOG_NONBLOCK;
|
mode |= ANDROID_LOG_RDONLY | ANDROID_LOG_NONBLOCK;
|
||||||
// FALLTHRU
|
FALLTHROUGH_INTENDED;
|
||||||
case 'T':
|
case 'T':
|
||||||
if (strspn(optarg, "0123456789") != strlen(optarg)) {
|
if (strspn(optarg, "0123456789") != strlen(optarg)) {
|
||||||
char* cp = parseTime(tail_time, optarg);
|
char* cp = parseTime(tail_time, optarg);
|
||||||
|
|
@ -1009,7 +1010,7 @@ static int __logcat(android_logcat_context_internal* context) {
|
||||||
getLogSize = true;
|
getLogSize = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// FALLTHRU
|
FALLTHROUGH_INTENDED;
|
||||||
|
|
||||||
case 'G': {
|
case 'G': {
|
||||||
char* cp;
|
char* cp;
|
||||||
|
|
@ -1023,15 +1024,15 @@ static int __logcat(android_logcat_context_internal* context) {
|
||||||
case 'g':
|
case 'g':
|
||||||
case 'G':
|
case 'G':
|
||||||
setLogSize *= 1024;
|
setLogSize *= 1024;
|
||||||
// FALLTHRU
|
FALLTHROUGH_INTENDED;
|
||||||
case 'm':
|
case 'm':
|
||||||
case 'M':
|
case 'M':
|
||||||
setLogSize *= 1024;
|
setLogSize *= 1024;
|
||||||
// FALLTHRU
|
FALLTHROUGH_INTENDED;
|
||||||
case 'k':
|
case 'k':
|
||||||
case 'K':
|
case 'K':
|
||||||
setLogSize *= 1024;
|
setLogSize *= 1024;
|
||||||
// FALLTHRU
|
FALLTHROUGH_INTENDED;
|
||||||
case '\0':
|
case '\0':
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -1051,7 +1052,7 @@ static int __logcat(android_logcat_context_internal* context) {
|
||||||
getPruneList = true;
|
getPruneList = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// FALLTHRU
|
FALLTHROUGH_INTENDED;
|
||||||
|
|
||||||
case 'P':
|
case 'P':
|
||||||
setPruneList = optarg;
|
setPruneList = optarg;
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include <android-base/file.h>
|
#include <android-base/file.h>
|
||||||
|
#include <android-base/macros.h>
|
||||||
#include <android-base/stringprintf.h>
|
#include <android-base/stringprintf.h>
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <log/event_tag_map.h>
|
#include <log/event_tag_map.h>
|
||||||
|
|
@ -572,13 +573,13 @@ static int get_groups(const char* cmd) {
|
||||||
switch (size_mult[0]) {
|
switch (size_mult[0]) {
|
||||||
case 'G':
|
case 'G':
|
||||||
full_size *= 1024;
|
full_size *= 1024;
|
||||||
/* FALLTHRU */
|
FALLTHROUGH_INTENDED;
|
||||||
case 'M':
|
case 'M':
|
||||||
full_size *= 1024;
|
full_size *= 1024;
|
||||||
/* FALLTHRU */
|
FALLTHROUGH_INTENDED;
|
||||||
case 'K':
|
case 'K':
|
||||||
full_size *= 1024;
|
full_size *= 1024;
|
||||||
/* FALLTHRU */
|
FALLTHROUGH_INTENDED;
|
||||||
case 'B':
|
case 'B':
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
@ -588,13 +589,13 @@ static int get_groups(const char* cmd) {
|
||||||
switch (consumed_mult[0]) {
|
switch (consumed_mult[0]) {
|
||||||
case 'G':
|
case 'G':
|
||||||
full_consumed *= 1024;
|
full_consumed *= 1024;
|
||||||
/* FALLTHRU */
|
FALLTHROUGH_INTENDED;
|
||||||
case 'M':
|
case 'M':
|
||||||
full_consumed *= 1024;
|
full_consumed *= 1024;
|
||||||
/* FALLTHRU */
|
FALLTHROUGH_INTENDED;
|
||||||
case 'K':
|
case 'K':
|
||||||
full_consumed *= 1024;
|
full_consumed *= 1024;
|
||||||
/* FALLTHRU */
|
FALLTHROUGH_INTENDED;
|
||||||
case 'B':
|
case 'B':
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
@ -1241,26 +1242,26 @@ TEST(logcat, blocking_clear) {
|
||||||
switch (size_mult[0]) {
|
switch (size_mult[0]) {
|
||||||
case 'G':
|
case 'G':
|
||||||
full_size *= 1024;
|
full_size *= 1024;
|
||||||
/* FALLTHRU */
|
FALLTHROUGH_INTENDED;
|
||||||
case 'M':
|
case 'M':
|
||||||
full_size *= 1024;
|
full_size *= 1024;
|
||||||
/* FALLTHRU */
|
FALLTHROUGH_INTENDED;
|
||||||
case 'K':
|
case 'K':
|
||||||
full_size *= 1024;
|
full_size *= 1024;
|
||||||
/* FALLTHRU */
|
FALLTHROUGH_INTENDED;
|
||||||
case 'B':
|
case 'B':
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch (consumed_mult[0]) {
|
switch (consumed_mult[0]) {
|
||||||
case 'G':
|
case 'G':
|
||||||
full_consumed *= 1024;
|
full_consumed *= 1024;
|
||||||
/* FALLTHRU */
|
FALLTHROUGH_INTENDED;
|
||||||
case 'M':
|
case 'M':
|
||||||
full_consumed *= 1024;
|
full_consumed *= 1024;
|
||||||
/* FALLTHRU */
|
FALLTHROUGH_INTENDED;
|
||||||
case 'K':
|
case 'K':
|
||||||
full_consumed *= 1024;
|
full_consumed *= 1024;
|
||||||
/* FALLTHRU */
|
FALLTHROUGH_INTENDED;
|
||||||
case 'B':
|
case 'B':
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -475,9 +475,7 @@ void LogKlog::synchronize(const char* buf, ssize_t len) {
|
||||||
static int convertKernelPrioToAndroidPrio(int pri) {
|
static int convertKernelPrioToAndroidPrio(int pri) {
|
||||||
switch (pri & LOG_PRIMASK) {
|
switch (pri & LOG_PRIMASK) {
|
||||||
case LOG_EMERG:
|
case LOG_EMERG:
|
||||||
// FALLTHRU
|
|
||||||
case LOG_ALERT:
|
case LOG_ALERT:
|
||||||
// FALLTHRU
|
|
||||||
case LOG_CRIT:
|
case LOG_CRIT:
|
||||||
return ANDROID_LOG_FATAL;
|
return ANDROID_LOG_FATAL;
|
||||||
|
|
||||||
|
|
@ -488,9 +486,7 @@ static int convertKernelPrioToAndroidPrio(int pri) {
|
||||||
return ANDROID_LOG_WARN;
|
return ANDROID_LOG_WARN;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// FALLTHRU
|
|
||||||
case LOG_NOTICE:
|
case LOG_NOTICE:
|
||||||
// FALLTHRU
|
|
||||||
case LOG_INFO:
|
case LOG_INFO:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue