VirtualBox

Changeset 39719 in vbox


Ignore:
Timestamp:
Jan 7, 2012 2:51:31 AM (13 years ago)
Author:
vboxsync
Message:

PyXPCOMMethod_WaitForEvents: Don't restrict the input value to 'int', accept 'long' as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/python/src/module/_xpcom.cpp

    r39718 r39719  
    514514#  include <iprt/err.h>
    515515
    516 static PyObject*
     516static PyObject *
    517517PyXPCOMMethod_WaitForEvents(PyObject *self, PyObject *args)
    518518{
    519     PRInt32 aTimeout;
    520 
    521     if (!PyArg_ParseTuple(args, "i", &aTimeout))
    522     {
    523         PyErr_SetString(PyExc_TypeError, "the timeout argument is not an integer");
     519    long lTimeout;
     520    if (!PyArg_ParseTuple(args, "l", &lTimeout))
    524521        return NULL;
    525     }
    526522
    527523    int rc;
     
    535531
    536532    Py_BEGIN_ALLOW_THREADS
    537     rc = aEventQ->processEventQueue(aTimeout < 0 ? RT_INDEFINITE_WAIT : (uint32_t)aTimeout);
     533
     534    RTMSINTERVAL cMsTimeout = (RTMSINTERVAL)lTimeout;
     535    if (lTimeout < 0 || (long)cMsTimeout != lTimeout)
     536        cMsTimeout = RT_INDEFINITE_WAIT;
     537    rc = aEventQ->processEventQueue(cMsTimeout);
     538
    538539    Py_END_ALLOW_THREADS
    539540    if (RT_SUCCESS(rc))
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette