libcamera: ipa_module: Fix open source license verification
The second argument to std::array is the size of the array, not of the
elements it contains. Fix this by turning the std::array into a simple
array of const char pointers.
Fixes: 099815b853
("libcamera: ipa_module: add isOpenSource")
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
This commit is contained in:
parent
bfbc25785f
commit
8f1dbd6a92
1 changed files with 7 additions and 3 deletions
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "pipeline_handler.h"
|
#include "pipeline_handler.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file ipa_module.h
|
* \file ipa_module.h
|
||||||
|
@ -478,7 +479,7 @@ bool IPAModule::match(PipelineHandler *pipe,
|
||||||
*/
|
*/
|
||||||
bool IPAModule::isOpenSource() const
|
bool IPAModule::isOpenSource() const
|
||||||
{
|
{
|
||||||
static std::array<const char *, sizeof(char *)> osLicenses = {
|
static const char *osLicenses[] = {
|
||||||
"GPL-2.0-only",
|
"GPL-2.0-only",
|
||||||
"GPL-2.0-or-later",
|
"GPL-2.0-or-later",
|
||||||
"GPL-3.0-only",
|
"GPL-3.0-only",
|
||||||
|
@ -489,8 +490,11 @@ bool IPAModule::isOpenSource() const
|
||||||
"LGPL-3.0-or-later",
|
"LGPL-3.0-or-later",
|
||||||
};
|
};
|
||||||
|
|
||||||
return std::find(osLicenses.begin(), osLicenses.end(), info_.license)
|
for (unsigned int i = 0; i < ARRAY_SIZE(osLicenses); i++)
|
||||||
!= osLicenses.end();
|
if (!strcmp(osLicenses[i], info_.license))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* namespace libcamera */
|
} /* namespace libcamera */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue