diff options
author | Chih-Hung Hsieh <chh@google.com> | 2015-03-19 12:04:54 -0700 |
---|---|---|
committer | Chih-Hung Hsieh <chh@google.com> | 2015-03-19 13:46:13 -0700 |
commit | 54b4246bb2025a5dcfdf1611c199998448d28424 (patch) | |
tree | 5dbf2230fe538c13d314b8bb9f9aed3077f94bdb /services | |
parent | 5a23aa949188fafe1d8d35966ff5a73974294dfd (diff) | |
download | frameworks_av-54b4246bb2025a5dcfdf1611c199998448d28424.zip frameworks_av-54b4246bb2025a5dcfdf1611c199998448d28424.tar.gz frameworks_av-54b4246bb2025a5dcfdf1611c199998448d28424.tar.bz2 |
Fix link error of PROCESS_STATE_NONEXISTENT.
* A reference to PROCESS_STATE_NONEXISTENT will cause link error with
clang or standard C++ compiler because there is no out-of-class definition,
although g++ is allowing it.
Use +PROCESS_STATE_NONEXISTENT to get the value instead of reference.
Change-Id: I62049584b94e6847b64b572f6ef6c3e9dcc573eb
Diffstat (limited to 'services')
-rw-r--r-- | services/camera/libcameraservice/CameraService.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp index 574165b..55f7a40 100644 --- a/services/camera/libcameraservice/CameraService.cpp +++ b/services/camera/libcameraservice/CameraService.cpp @@ -884,7 +884,11 @@ status_t CameraService::handleEvictionsLocked(const String8& cameraId, int clien std::vector<int> ownerPids(mActiveClientManager.getAllOwners()); ownerPids.push_back(clientPid); - std::vector<int> priorities(ownerPids.size(), PROCESS_STATE_NONEXISTENT); + // Use the value +PROCESS_STATE_NONEXISTENT, to avoid taking + // address of PROCESS_STATE_NONEXISTENT as a reference argument + // for the vector constructor. PROCESS_STATE_NONEXISTENT does + // not have an out-of-class definition. + std::vector<int> priorities(ownerPids.size(), +PROCESS_STATE_NONEXISTENT); // Get priorites of all active PIDs ProcessInfoService::getProcessStatesFromPids(ownerPids.size(), &ownerPids[0], |