Skip to content

Commit

Permalink
cmake: Fix warning as error issues
Browse files Browse the repository at this point in the history
  • Loading branch information
christophe-lunarg committed Sep 12, 2023
1 parent 38979bb commit 47d5529
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 44 deletions.
12 changes: 12 additions & 0 deletions layer/profiles_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,18 @@ void LogFlush(ProfileLayerSettings *layer_settings) {
}
}

static ForceDevice GetForceDevice(const std::string &value) {
if (value == "FORCE_DEVICE_OFF") {
return FORCE_DEVICE_OFF;
} else if (value == "FORCE_DEVICE_WITH_UUID") {
return FORCE_DEVICE_WITH_UUID;
} else if (value == "FORCE_DEVICE_WITH_NAME") {
return FORCE_DEVICE_WITH_NAME;
}

return FORCE_DEVICE_OFF;
}

void InitProfilesLayerSettings(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator,
ProfileLayerSettings *layer_settings) {
assert(layer_settings != nullptr);
Expand Down
43 changes: 0 additions & 43 deletions layer/profiles_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,6 @@ enum SimulateCapabilityBits {
};
typedef int SimulateCapabilityFlags;

static std::vector<std::string> GetSimulateCapabilityStrings(SimulateCapabilityFlags flags) {
static const char *table[] = {
"SIMULATE_API_VERSION_BIT", "SIMULATE_FEATURES_BIT", "SIMULATE_PROPERTIES_BIT",
"SIMULATE_EXTENSIONS_BIT", "SIMULATE_FORMATS_BIT", "SIMULATE_QUEUE_FAMILY_PROPERTIES_BIT"};

std::vector<std::string> result;

for (std::size_t i = 0, n = std::size(table); i < n; ++i) {
if (flags & (1 << i)) {
result.push_back(table[i]);
}
}

return result;
}

enum DebugActionBits {
DEBUG_ACTION_FILE_BIT = (1 << 0),
DEBUG_ACTION_STDOUT_BIT = (1 << 1),
Expand Down Expand Up @@ -125,21 +109,6 @@ static DebugReportFlags GetDebugReportFlags(const std::vector<std::string> &valu
return result;
}

static std::vector<std::string> GetDebugReportStrings(DebugReportFlags flags) {
static const char *table[] = {
"DEBUG_REPORT_NOTIFICATION_BIT", "DEBUG_REPORT_WARNING_BIT", "DEBUG_REPORT_ERROR_BIT", "DEBUG_REPORT_DEBUG_BIT"};

std::vector<std::string> result;

for (std::size_t i = 0, n = std::size(table); i < n; ++i) {
if (flags & (1 << i)) {
result.push_back(table[i]);
}
}

return result;
}

enum DefaultFeatureValues {
DEFAULT_FEATURE_VALUES_FALSE = 0,
DEFAULT_FEATURE_VALUES_DEVICE
Expand Down Expand Up @@ -171,18 +140,6 @@ enum ForceDevice {
FORCE_DEVICE_WITH_NAME
};

static ForceDevice GetForceDevice(const std::string &value) {
if (value == "FORCE_DEVICE_OFF") {
return FORCE_DEVICE_OFF;
} else if (value == "FORCE_DEVICE_WITH_UUID") {
return FORCE_DEVICE_WITH_UUID;
} else if (value == "FORCE_DEVICE_WITH_NAME") {
return FORCE_DEVICE_WITH_NAME;
}

return FORCE_DEVICE_OFF;
}

struct ProfileLayerSettings {
~ProfileLayerSettings() {
if (log.profiles_log_file != nullptr) {
Expand Down
30 changes: 30 additions & 0 deletions layer/tests/tests_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@ TEST(TestsUtil, DebugAction) {
EXPECT_TRUE(flags & DEBUG_ACTION_BREAKPOINT_BIT);
}

static std::vector<std::string> GetDebugReportStrings(DebugReportFlags flags) {
static const char *table[] = {"DEBUG_REPORT_NOTIFICATION_BIT", "DEBUG_REPORT_WARNING_BIT", "DEBUG_REPORT_ERROR_BIT",
"DEBUG_REPORT_DEBUG_BIT"};

std::vector<std::string> result;

for (std::size_t i = 0, n = std::size(table); i < n; ++i) {
if (flags & (1 << i)) {
result.push_back(table[i]);
}
}

return result;
}

TEST(TestsUtil, DebugReport) {
std::vector<std::string> strings = GetDebugReportStrings(DEBUG_REPORT_MAX_ENUM);

Expand Down Expand Up @@ -76,6 +91,21 @@ static SimulateCapabilityFlags GetSimulateCapability(const std::vector<std::stri
return result;
}

static std::vector<std::string> GetSimulateCapabilityStrings(SimulateCapabilityFlags flags) {
static const char *table[] = {"SIMULATE_API_VERSION_BIT", "SIMULATE_FEATURES_BIT", "SIMULATE_PROPERTIES_BIT",
"SIMULATE_EXTENSIONS_BIT", "SIMULATE_FORMATS_BIT", "SIMULATE_QUEUE_FAMILY_PROPERTIES_BIT"};

std::vector<std::string> result;

for (std::size_t i = 0, n = std::size(table); i < n; ++i) {
if (flags & (1 << i)) {
result.push_back(table[i]);
}
}

return result;
}

TEST(TestsUtil, SimulateCapability) {
std::vector<std::string> strings = GetSimulateCapabilityStrings(SIMULATE_MAX_ENUM);

Expand Down
2 changes: 1 addition & 1 deletion scripts/known_good.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"sub_dir": "Vulkan-Utility-Libraries",
"build_dir": "Vulkan-Utility-Libraries/build",
"install_dir": "Vulkan-Utility-Libraries/build/install",
"commit": "v1.3.264",
"commit": "ba0d57a51424de68a86326e393a65b26373e1c1f",
"deps": [
{
"var_name": "VULKAN_HEADERS_INSTALL_DIR",
Expand Down

0 comments on commit 47d5529

Please sign in to comment.