mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 16:20:11 -04:00
Merge branch 'release/1.10.x'
This commit is contained in:
commit
a68ecb9765
File diff suppressed because it is too large
Load Diff
@ -1,8 +1,9 @@
|
|||||||
/* A Bison parser, made by GNU Bison 3.1. */
|
/* A Bison parser, made by GNU Bison 3.8.2. */
|
||||||
|
|
||||||
/* Bison interface for Yacc-like parsers in C
|
/* Bison interface for Yacc-like parsers in C
|
||||||
|
|
||||||
Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc.
|
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
|
||||||
|
Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -15,7 +16,7 @@
|
|||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
/* As a special exception, you may create a larger work that contains
|
/* As a special exception, you may create a larger work that contains
|
||||||
part or all of the Bison parser skeleton and distribute that work
|
part or all of the Bison parser skeleton and distribute that work
|
||||||
@ -30,6 +31,10 @@
|
|||||||
This special exception was added by the Free Software Foundation in
|
This special exception was added by the Free Software Foundation in
|
||||||
version 2.2 of Bison. */
|
version 2.2 of Bison. */
|
||||||
|
|
||||||
|
/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
|
||||||
|
especially those whose name start with YY_ or yy_. They are
|
||||||
|
private implementation details that can be changed or removed. */
|
||||||
|
|
||||||
#ifndef YY_DCYY_BUILT_TMP_DCPARSER_YXX_H_INCLUDED
|
#ifndef YY_DCYY_BUILT_TMP_DCPARSER_YXX_H_INCLUDED
|
||||||
# define YY_DCYY_BUILT_TMP_DCPARSER_YXX_H_INCLUDED
|
# define YY_DCYY_BUILT_TMP_DCPARSER_YXX_H_INCLUDED
|
||||||
/* Debug traces. */
|
/* Debug traces. */
|
||||||
@ -40,54 +45,63 @@
|
|||||||
extern int dcyydebug;
|
extern int dcyydebug;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Token type. */
|
/* Token kinds. */
|
||||||
#ifndef YYTOKENTYPE
|
#ifndef YYTOKENTYPE
|
||||||
# define YYTOKENTYPE
|
# define YYTOKENTYPE
|
||||||
enum yytokentype
|
enum yytokentype
|
||||||
{
|
{
|
||||||
UNSIGNED_INTEGER = 258,
|
YYEMPTY = -2,
|
||||||
SIGNED_INTEGER = 259,
|
YYEOF = 0, /* "end of file" */
|
||||||
REAL = 260,
|
YYerror = 256, /* error */
|
||||||
STRING = 261,
|
YYUNDEF = 257, /* "invalid token" */
|
||||||
IDENTIFIER = 262,
|
UNSIGNED_INTEGER = 258, /* UNSIGNED_INTEGER */
|
||||||
HEX_STRING = 263,
|
SIGNED_INTEGER = 259, /* SIGNED_INTEGER */
|
||||||
KEYWORD = 264,
|
REAL = 260, /* REAL */
|
||||||
KW_DCLASS = 265,
|
STRING = 261, /* STRING */
|
||||||
KW_STRUCT = 266,
|
IDENTIFIER = 262, /* IDENTIFIER */
|
||||||
KW_FROM = 267,
|
HEX_STRING = 263, /* HEX_STRING */
|
||||||
KW_IMPORT = 268,
|
KEYWORD = 264, /* KEYWORD */
|
||||||
KW_TYPEDEF = 269,
|
KW_DCLASS = 265, /* KW_DCLASS */
|
||||||
KW_KEYWORD = 270,
|
KW_STRUCT = 266, /* KW_STRUCT */
|
||||||
KW_SWITCH = 271,
|
KW_FROM = 267, /* KW_FROM */
|
||||||
KW_CASE = 272,
|
KW_IMPORT = 268, /* KW_IMPORT */
|
||||||
KW_DEFAULT = 273,
|
KW_TYPEDEF = 269, /* KW_TYPEDEF */
|
||||||
KW_BREAK = 274,
|
KW_KEYWORD = 270, /* KW_KEYWORD */
|
||||||
KW_INT8 = 275,
|
KW_SWITCH = 271, /* KW_SWITCH */
|
||||||
KW_INT16 = 276,
|
KW_CASE = 272, /* KW_CASE */
|
||||||
KW_INT32 = 277,
|
KW_DEFAULT = 273, /* KW_DEFAULT */
|
||||||
KW_INT64 = 278,
|
KW_BREAK = 274, /* KW_BREAK */
|
||||||
KW_UINT8 = 279,
|
KW_INT8 = 275, /* KW_INT8 */
|
||||||
KW_UINT16 = 280,
|
KW_INT16 = 276, /* KW_INT16 */
|
||||||
KW_UINT32 = 281,
|
KW_INT32 = 277, /* KW_INT32 */
|
||||||
KW_UINT64 = 282,
|
KW_INT64 = 278, /* KW_INT64 */
|
||||||
KW_FLOAT64 = 283,
|
KW_UINT8 = 279, /* KW_UINT8 */
|
||||||
KW_STRING = 284,
|
KW_UINT16 = 280, /* KW_UINT16 */
|
||||||
KW_BLOB = 285,
|
KW_UINT32 = 281, /* KW_UINT32 */
|
||||||
KW_BLOB32 = 286,
|
KW_UINT64 = 282, /* KW_UINT64 */
|
||||||
KW_INT8ARRAY = 287,
|
KW_FLOAT64 = 283, /* KW_FLOAT64 */
|
||||||
KW_INT16ARRAY = 288,
|
KW_STRING = 284, /* KW_STRING */
|
||||||
KW_INT32ARRAY = 289,
|
KW_BLOB = 285, /* KW_BLOB */
|
||||||
KW_UINT8ARRAY = 290,
|
KW_BLOB32 = 286, /* KW_BLOB32 */
|
||||||
KW_UINT16ARRAY = 291,
|
KW_INT8ARRAY = 287, /* KW_INT8ARRAY */
|
||||||
KW_UINT32ARRAY = 292,
|
KW_INT16ARRAY = 288, /* KW_INT16ARRAY */
|
||||||
KW_UINT32UINT8ARRAY = 293,
|
KW_INT32ARRAY = 289, /* KW_INT32ARRAY */
|
||||||
KW_CHAR = 294,
|
KW_UINT8ARRAY = 290, /* KW_UINT8ARRAY */
|
||||||
START_DC = 295,
|
KW_UINT16ARRAY = 291, /* KW_UINT16ARRAY */
|
||||||
START_PARAMETER_VALUE = 296,
|
KW_UINT32ARRAY = 292, /* KW_UINT32ARRAY */
|
||||||
START_PARAMETER_DESCRIPTION = 297
|
KW_UINT32UINT8ARRAY = 293, /* KW_UINT32UINT8ARRAY */
|
||||||
|
KW_CHAR = 294, /* KW_CHAR */
|
||||||
|
START_DC = 295, /* START_DC */
|
||||||
|
START_PARAMETER_VALUE = 296, /* START_PARAMETER_VALUE */
|
||||||
|
START_PARAMETER_DESCRIPTION = 297 /* START_PARAMETER_DESCRIPTION */
|
||||||
};
|
};
|
||||||
|
typedef enum yytokentype yytoken_kind_t;
|
||||||
#endif
|
#endif
|
||||||
/* Tokens. */
|
/* Token kinds. */
|
||||||
|
#define YYEMPTY -2
|
||||||
|
#define YYEOF 0
|
||||||
|
#define YYerror 256
|
||||||
|
#define YYUNDEF 257
|
||||||
#define UNSIGNED_INTEGER 258
|
#define UNSIGNED_INTEGER 258
|
||||||
#define SIGNED_INTEGER 259
|
#define SIGNED_INTEGER 259
|
||||||
#define REAL 260
|
#define REAL 260
|
||||||
@ -134,6 +148,8 @@ extern int dcyydebug;
|
|||||||
|
|
||||||
extern YYSTYPE dcyylval;
|
extern YYSTYPE dcyylval;
|
||||||
|
|
||||||
|
|
||||||
int dcyyparse (void);
|
int dcyyparse (void);
|
||||||
|
|
||||||
|
|
||||||
#endif /* !YY_DCYY_BUILT_TMP_DCPARSER_YXX_H_INCLUDED */
|
#endif /* !YY_DCYY_BUILT_TMP_DCPARSER_YXX_H_INCLUDED */
|
||||||
|
@ -297,6 +297,7 @@ dclass_or_struct:
|
|||||||
dclass:
|
dclass:
|
||||||
KW_DCLASS optional_name
|
KW_DCLASS optional_name
|
||||||
{
|
{
|
||||||
|
$<u.dclass>$ = current_class;
|
||||||
current_class = new DCClass(dc_file, $2, false, false);
|
current_class = new DCClass(dc_file, $2, false, false);
|
||||||
}
|
}
|
||||||
dclass_derivation '{' dclass_fields '}'
|
dclass_derivation '{' dclass_fields '}'
|
||||||
@ -401,6 +402,7 @@ dclass_field:
|
|||||||
struct:
|
struct:
|
||||||
KW_STRUCT optional_name
|
KW_STRUCT optional_name
|
||||||
{
|
{
|
||||||
|
$<u.dclass>$ = current_class;
|
||||||
current_class = new DCClass(dc_file, $2, true, false);
|
current_class = new DCClass(dc_file, $2, true, false);
|
||||||
}
|
}
|
||||||
struct_derivation '{' struct_fields '}'
|
struct_derivation '{' struct_fields '}'
|
||||||
@ -488,6 +490,7 @@ struct_field:
|
|||||||
atomic_field:
|
atomic_field:
|
||||||
optional_name '('
|
optional_name '('
|
||||||
{
|
{
|
||||||
|
$<u.atomic>$ = current_atomic;
|
||||||
if (current_class == nullptr) {
|
if (current_class == nullptr) {
|
||||||
yyerror("Cannot define a method outside of a struct or class.");
|
yyerror("Cannot define a method outside of a struct or class.");
|
||||||
DCClass *temp_class = new DCClass(dc_file, "temp", false, false); // memory leak.
|
DCClass *temp_class = new DCClass(dc_file, "temp", false, false); // memory leak.
|
||||||
@ -1243,12 +1246,13 @@ optional_name:
|
|||||||
switch:
|
switch:
|
||||||
KW_SWITCH optional_name '(' parameter_or_atomic ')' '{'
|
KW_SWITCH optional_name '(' parameter_or_atomic ')' '{'
|
||||||
{
|
{
|
||||||
|
$<u.dswitch>$ = current_switch;
|
||||||
current_switch = new DCSwitch($2, $4);
|
current_switch = new DCSwitch($2, $4);
|
||||||
}
|
}
|
||||||
switch_fields '}'
|
switch_fields '}'
|
||||||
{
|
{
|
||||||
$$ = current_switch;
|
$$ = current_switch;
|
||||||
current_switch = (DCSwitch *)$<u.parameter>7;
|
current_switch = $<u.dswitch>7;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -3315,8 +3315,9 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
init_app_for_gui()
|
init_app_for_gui()
|
||||||
|
|
||||||
# Disable the Windows message loop, since Tcl wants to handle this all
|
# Disable the Windows message loop, since Tcl wants to handle this all
|
||||||
# on its own.
|
# on its own, except if the Panda window is on a separate thread.
|
||||||
ConfigVariableBool('disable-message-loop', False).value = True
|
if self.graphicsEngine.getThreadingModel().getDrawStage() == 0:
|
||||||
|
ConfigVariableBool('disable-message-loop', False).value = True
|
||||||
|
|
||||||
if ConfigVariableBool('tk-main-loop', True):
|
if ConfigVariableBool('tk-main-loop', True):
|
||||||
# Put Tkinter in charge of the main loop. It really
|
# Put Tkinter in charge of the main loop. It really
|
||||||
|
@ -68,6 +68,33 @@ static string format_error() {
|
|||||||
#define format_error() strerror(errno)
|
#define format_error() strerror(errno)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(_WIN32) && defined(LIBRESSL_VERSION_NUMBER)
|
||||||
|
/**
|
||||||
|
* This exists to work around an issue with LibreSSL's version of
|
||||||
|
* BIO_sock_should_retry, which does not understand Windows error codes.
|
||||||
|
* The implementation here matches the behaviour of OpenSSL on Windows.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
sock_should_retry(int i) {
|
||||||
|
if (i == 0 || i == -1) {
|
||||||
|
int err = WSAGetLastError();
|
||||||
|
|
||||||
|
switch (err) {
|
||||||
|
case WSAEWOULDBLOCK:
|
||||||
|
case ENOTCONN:
|
||||||
|
case EINPROGRESS:
|
||||||
|
case EALREADY:
|
||||||
|
return 1;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#define sock_should_retry(err) BIO_sock_should_retry(err)
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This flavor of the constructor automatically creates a socket BIO and feeds
|
* This flavor of the constructor automatically creates a socket BIO and feeds
|
||||||
* it the server and port name from the indicated URL. It doesn't call
|
* it the server and port name from the indicated URL. It doesn't call
|
||||||
@ -214,8 +241,7 @@ connect() {
|
|||||||
result = BIO_sock_error(fd);
|
result = BIO_sock_error(fd);
|
||||||
} else {
|
} else {
|
||||||
result = ::connect(fd, (sockaddr *)&_addr, _addrlen);
|
result = ::connect(fd, (sockaddr *)&_addr, _addrlen);
|
||||||
|
if (result != 0 && sock_should_retry(-1)) {
|
||||||
if (result != 0 && BIO_sock_should_retry(-1)) {
|
|
||||||
// It's still in progress; we should retry later. This causes
|
// It's still in progress; we should retry later. This causes
|
||||||
// should_retry() to return true.
|
// should_retry() to return true.
|
||||||
BIO_set_flags(_bio, BIO_FLAGS_SHOULD_RETRY);
|
BIO_set_flags(_bio, BIO_FLAGS_SHOULD_RETRY);
|
||||||
|
63
tests/test_tools.py
Normal file
63
tests/test_tools.py
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
import pytest
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
import tempfile
|
||||||
|
import panda3d
|
||||||
|
|
||||||
|
try:
|
||||||
|
panda3d_tools = pytest.importorskip("panda3d_tools")
|
||||||
|
except:
|
||||||
|
panda3d_tools = None
|
||||||
|
|
||||||
|
|
||||||
|
def get_tool(name):
|
||||||
|
if sys.platform == 'win32':
|
||||||
|
name += '.exe'
|
||||||
|
|
||||||
|
if panda3d_tools:
|
||||||
|
tools_dir = os.path.dirname(panda3d_tools.__file__)
|
||||||
|
else:
|
||||||
|
tools_dir = os.path.join(os.path.dirname(os.path.dirname(panda3d.__file__)), 'bin')
|
||||||
|
|
||||||
|
path = os.path.join(tools_dir, name)
|
||||||
|
if not os.path.isfile(path):
|
||||||
|
pytest.skip(name + ' not found')
|
||||||
|
|
||||||
|
return path
|
||||||
|
|
||||||
|
|
||||||
|
def test_bam_info():
|
||||||
|
path = get_tool('bam-info')
|
||||||
|
output = subprocess.check_output([path, '-h'], stderr=subprocess.STDOUT).strip()
|
||||||
|
assert output.startswith(b"This program scans one or more Bam files")
|
||||||
|
|
||||||
|
|
||||||
|
def test_egg_trans():
|
||||||
|
path = get_tool('egg-trans')
|
||||||
|
output = subprocess.check_output([path, '-h'], stderr=subprocess.STDOUT).strip()
|
||||||
|
assert output.startswith(b"egg-trans reads an egg file and writes")
|
||||||
|
|
||||||
|
|
||||||
|
def test_pzip():
|
||||||
|
data = b'test \000 data'
|
||||||
|
|
||||||
|
try:
|
||||||
|
file = tempfile.NamedTemporaryFile(suffix='.bin', delete=False)
|
||||||
|
file.write(data)
|
||||||
|
file.close()
|
||||||
|
|
||||||
|
path = get_tool('pzip')
|
||||||
|
subprocess.check_output([path, file.name])
|
||||||
|
|
||||||
|
zlib = pytest.importorskip('zlib')
|
||||||
|
|
||||||
|
with open(file.name + '.pz', 'rb') as pz:
|
||||||
|
assert zlib.decompress(pz.read(), 32 + 15, 4096) == data
|
||||||
|
|
||||||
|
finally:
|
||||||
|
if os.path.isfile(file.name):
|
||||||
|
os.remove(file.name)
|
||||||
|
|
||||||
|
if os.path.isfile(file.name + '.pz'):
|
||||||
|
os.remove(file.name + '.pz')
|
Loading…
x
Reference in New Issue
Block a user