dc80973726
Both humans and the clang static analyzer find libadf's error handling confusing. Now that the platform has better C++ support, we can clean up things up by switching to C++ and using STL + RAII in targeted parts of the code. This isn't a complete rewrite in idiomatic C++, but it's enough to get rid of all the "goto" statements (and the false-positive memory leaks found by clang's static analyzer). Bug: 27125399 Test: WITH_STATIC_ANALYZER=1 mmm system/core/adf/libadf Test: /data/nativetest/adf-unit-tests/adf-unit-tests (on Nexus 9) Test: /data/nativetest64/adf-unit-tests/adf-unit-tests (on Nexus 9) Change-Id: Ie9dd5d5dc424d1a3ddcc3cba836fce04190f46fd Signed-off-by: Greg Hackmann <ghackmann@google.com>
23 lines
800 B
Text
23 lines
800 B
Text
// Copyright (C) 2013 The Android Open Source Project
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
cc_library_static {
|
|
name: "libadf",
|
|
srcs: ["adf.cpp"],
|
|
cflags: ["-Werror"],
|
|
local_include_dirs: ["include"],
|
|
export_include_dirs: ["include"],
|
|
}
|
|
|
|
subdirs = ["tests"]
|