diff options
author | Yabin Cui <yabinc@google.com> | 2015-06-25 13:23:55 -0700 |
---|---|---|
committer | Yabin Cui <yabinc@google.com> | 2015-06-25 14:34:42 -0700 |
commit | be6afa300a01ad1e6cb493e748d709d0b3b5e3b5 (patch) | |
tree | 9b385274f53ce90e2810794ebdcae5522921941f /simpleperf/environment.h | |
parent | d713f959ec1fe07ed993e2c9f4166b52aa98a58c (diff) | |
download | extras-be6afa300a01ad1e6cb493e748d709d0b3b5e3b5.tar.gz |
Simpleperf: don't use designation in struct member initialization.
designation is not supported in c++ standard, and partially initialized
struct can be unsafe.
And use constexpr when desired.
Bug: 19483574
Change-Id: I4f445845a7d97aeb685f02176485c70f8b0ca995
Diffstat (limited to 'simpleperf/environment.h')
-rw-r--r-- | simpleperf/environment.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/simpleperf/environment.h b/simpleperf/environment.h index cfa324c3..aa6f5eb5 100644 --- a/simpleperf/environment.h +++ b/simpleperf/environment.h @@ -26,7 +26,7 @@ std::vector<int> GetOnlineCpus(); -static const char* DEFAULT_KERNEL_MMAP_NAME = "[kernel.kallsyms]_text"; +constexpr char DEFAULT_KERNEL_MMAP_NAME[] = "[kernel.kallsyms]_text"; struct KernelMmap { std::string name; @@ -51,7 +51,7 @@ struct ThreadComm { bool GetThreadComms(std::vector<ThreadComm>* thread_comms); -static const char* DEFAULT_EXECNAME_FOR_THREAD_MMAP = "//anon"; +constexpr char DEFAULT_EXECNAME_FOR_THREAD_MMAP[] = "//anon"; struct ThreadMmap { uint64_t start_addr; @@ -63,7 +63,7 @@ struct ThreadMmap { bool GetThreadMmapsInProcess(pid_t pid, std::vector<ThreadMmap>* thread_mmaps); -static const char* DEFAULT_KERNEL_FILENAME_FOR_BUILD_ID = "[kernel.kallsyms]"; +constexpr char DEFAULT_KERNEL_FILENAME_FOR_BUILD_ID[] = "[kernel.kallsyms]"; bool GetKernelBuildId(BuildId* build_id); bool GetModuleBuildId(const std::string& module_name, BuildId* build_id); |