| | |
| | | |
| | | static void mergeLicenses(const vector<LicenseInfo>& licenses, LicenseInfo* license_out) { |
| | | if (license_out != nullptr) { |
| | | int days_left = -1; |
| | | int days_left = INT_MIN; |
| | | for (auto it = licenses.begin(); it != licenses.end(); it++) { |
| | | // choose the license that expires later... |
| | | if (!it->has_expiry) { |
| | | *license_out = *it; |
| | | break; |
| | | } else if (days_left < it->days_left) { |
| | | } else if (days_left < (int)it->days_left) { |
| | | *license_out = *it; |
| | | days_left = it->days_left; |
| | | } |
| | |
| | | |
| | | EVENT_TYPE acquire_license(const CallerInformations* callerInformation, const LicenseLocation* licenseLocation, |
| | | LicenseInfo* license_out) { |
| | | license::LicenseReader lr = license::LicenseReader(licenseLocation); |
| | | const license::LicenseReader lr = license::LicenseReader(licenseLocation); |
| | | vector<license::FullLicenseInfo> licenses; |
| | | string project; |
| | | if (callerInformation != nullptr && strlen(callerInformation->project_name) > 0) { |