mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 15:20:17 +01:00
glapi: disable python escape sequences in strings that use invalid ones
We use invalid escape sequences in a few string.
r'...' disables escape sequences. This fixes validator errors:
/home/marek/dev/mesa/src/mapi/mapi_abi.py:45: SyntaxWarning: invalid escape sequence '\w'
'^(?P<type>[\w\s*]+?)(?P<name>\w+)(\[(?P<array>\d+)\])?$')
/home/marek/dev/mesa/src/mapi/glapi/gen/api_exec_init.py:43: SyntaxWarning: invalid escape sequence '\p'
header = """/**
/home/marek/dev/mesa/src/mapi/glapi/gen/gl_enums.py:64: SyntaxWarning: invalid escape sequence '\c'
print("""
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33634>
This commit is contained in:
parent
1f75715dae
commit
72db4a1e50
3 changed files with 5 additions and 5 deletions
|
|
@ -40,8 +40,8 @@ exec_flavor_map = {
|
|||
}
|
||||
|
||||
|
||||
header = """/**
|
||||
* \\file api_exec_init.c
|
||||
header = r"""/**
|
||||
* \file api_exec_init.c
|
||||
* Initialize dispatch table.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class PrintGlEnums(gl_XML.gl_print_base):
|
|||
return
|
||||
|
||||
def print_code(self):
|
||||
print("""
|
||||
print(r"""
|
||||
typedef int (*cfunc)(const void *, const void *);
|
||||
|
||||
/**
|
||||
|
|
@ -102,7 +102,7 @@ _mesa_enum_to_string(int nr)
|
|||
else {
|
||||
/* this is not re-entrant safe, no big deal here */
|
||||
snprintf(token_tmp, sizeof(token_tmp) - 1, "0x%x", nr);
|
||||
token_tmp[sizeof(token_tmp) - 1] = '\\0';
|
||||
token_tmp[sizeof(token_tmp) - 1] = '\0';
|
||||
return token_tmp;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class ABIEntry(object):
|
|||
"""Represent an ABI entry."""
|
||||
|
||||
_match_c_param = re.compile(
|
||||
'^(?P<type>[\w\s*]+?)(?P<name>\w+)(\[(?P<array>\d+)\])?$')
|
||||
r'^(?P<type>[\w\s*]+?)(?P<name>\w+)(\[(?P<array>\d+)\])?$')
|
||||
|
||||
def __init__(self, cols, attrs, xml_data = None):
|
||||
self._parse(cols)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue