libcamera: file: Turn MapFlag and OpenModeFlag into enum class
Add type safety by turning the MapFlag and OpenModeFlag enum into enum class. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
@@ -275,7 +275,7 @@ IPAModule::~IPAModule()
|
||||
int IPAModule::loadIPAModuleInfo()
|
||||
{
|
||||
File file{ libPath_ };
|
||||
if (!file.open(File::ReadOnly)) {
|
||||
if (!file.open(File::OpenModeFlag::ReadOnly)) {
|
||||
LOG(IPAModule, Error) << "Failed to open IPA library: "
|
||||
<< strerror(-file.error());
|
||||
return file.error();
|
||||
@@ -317,13 +317,13 @@ int IPAModule::loadIPAModuleInfo()
|
||||
|
||||
/* Load the signature. Failures are not fatal. */
|
||||
File sign{ libPath_ + ".sign" };
|
||||
if (!sign.open(File::ReadOnly)) {
|
||||
if (!sign.open(File::OpenModeFlag::ReadOnly)) {
|
||||
LOG(IPAModule, Debug)
|
||||
<< "IPA module " << libPath_ << " is not signed";
|
||||
return 0;
|
||||
}
|
||||
|
||||
data = sign.map(0, -1, File::MapPrivate);
|
||||
data = sign.map(0, -1, File::MapFlag::Private);
|
||||
signature_.resize(data.size());
|
||||
memcpy(signature_.data(), data.data(), data.size());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user