The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

u/hashset: Fix ISO C++ warning

+12 -2
+1
doc/changes/misc_fixes/mr.268.md
··· 1 + Fix warnings in `util/u_hashset.h` after pedantic warnings where enabled for C++.
+2 -2
src/xrt/auxiliary/util/u_hashset.cpp
··· 77 77 extern "C" int 78 78 u_hashset_insert_item(struct u_hashset *hs, struct u_hashset_item *item) 79 79 { 80 - std::string key = std::string(item->c_str, item->length); 80 + std::string key = std::string(item->c_str(), item->length); 81 81 hs->map[key] = item; 82 82 return 0; 83 83 } ··· 85 85 extern "C" int 86 86 u_hashset_erase_item(struct u_hashset *hs, struct u_hashset_item *item) 87 87 { 88 - std::string key = std::string(item->c_str, item->length); 88 + std::string key = std::string(item->c_str(), item->length); 89 89 hs->map.erase(key); 90 90 return 0; 91 91 }
+9
src/xrt/auxiliary/util/u_hashset.h
··· 37 37 { 38 38 size_t hash; 39 39 size_t length; 40 + 41 + #ifdef __cplusplus 42 + inline const char * 43 + c_str() 44 + { 45 + return (const char *)&this[1]; 46 + } 47 + #else 40 48 const char c_str[]; 49 + #endif 41 50 }; 42 51 43 52 typedef void (*u_hashset_callback)(struct u_hashset_item *item, void *priv);