mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
glx: Generalize __glXGetStringFromTable a little
Make the second argument optional, and treat its absence as if the filter always matches. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10223>
This commit is contained in:
parent
2014e1fe05
commit
3f6996acfd
1 changed files with 3 additions and 3 deletions
|
|
@ -658,7 +658,7 @@ __glExtensionBitIsEnabled(struct glx_context *gc, unsigned bit)
|
|||
*/
|
||||
static char *
|
||||
__glXGetStringFromTable(const struct extension_info *ext,
|
||||
const unsigned char *supported)
|
||||
const unsigned char *filter)
|
||||
{
|
||||
unsigned i;
|
||||
unsigned ext_str_len;
|
||||
|
|
@ -668,7 +668,7 @@ __glXGetStringFromTable(const struct extension_info *ext,
|
|||
|
||||
ext_str_len = 0;
|
||||
for (i = 0; ext[i].name != NULL; i++) {
|
||||
if (EXT_ENABLED(ext[i].bit, supported)) {
|
||||
if (!filter || EXT_ENABLED(ext[i].bit, filter)) {
|
||||
ext_str_len += ext[i].name_len + 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -678,7 +678,7 @@ __glXGetStringFromTable(const struct extension_info *ext,
|
|||
point = ext_str;
|
||||
|
||||
for (i = 0; ext[i].name != NULL; i++) {
|
||||
if (EXT_ENABLED(ext[i].bit, supported)) {
|
||||
if (!filter || EXT_ENABLED(ext[i].bit, filter)) {
|
||||
(void) memcpy(point, ext[i].name, ext[i].name_len);
|
||||
point += ext[i].name_len;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue