Download
oleargs cpp orig mon jul 21 20 48 10 1997 oleargs cpp fri may 5 18 55 56 2006 37 59 n.
Skip this Video
Loading SlideShow in 5 Seconds..
else if (PyLong_Check(obj)) PowerPoint Presentation
Download Presentation
else if (PyLong_Check(obj))

else if (PyLong_Check(obj))

113 Vues Download Presentation
Télécharger la présentation

else if (PyLong_Check(obj))

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. *** oleargs.cpp.orig Mon Jul 21 20:48:10 1997 --- oleargs.cpp Fri May 5 18:55:56 2006 *************** *** 37,59 **** }

  2. else if (PyLong_Check(obj))

  3. {

  4. ! double dval = PyLong_AsDouble(obj);

  5. ! BOOL isDword = FALSE;

  6. ! if (dval >= 0 && dval < (double)ULONG_MAX)

  7. {

  8. ! DWORD dwval = (DWORD)dval;

  9. ! if ((double)dwval == dval)

  10. ! {

  11. V_VT(var) = VT_I4;

  12. ! V_I4(var) = dwval;

  13. ! isDword = TRUE;

  14. }

  15. }

  16. ! if (!isDword)

  17. ! {

  18. ! V_VT(var) = VT_R8;

  19. ! V_R8(var) = dval;

  20. }

  21. }

  22. else if (PyFloat_Check(obj))

  23. {

  24. --- 37,110 ---- }

  25. else if (PyLong_Check(obj))

  26. {

  27. ! PyObject *exc_type = 0;

  28. ! PyObject *exc_value = 0;

  29. ! PyObject *exc_traceback = 0;

  30. !

  31. ! if(PyErr_Occured())

  32. ! PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);

  33. !

  34. ! bool converted = false;

  35. !

  36. {

  37. ! PyErr_Clear();

  38. ! long v = PyLong_AsLong(obj);

  39. ! if(!PyErr_Occured()){

  40. V_VT(var) = VT_I4;

  41. ! V_I4(var) = v;

  42. ! converted = true;

  43. }

  44. }

  45. !

  46. ! if(!converted){

  47. ! PyErr_Clear();

  48. ! unsigned long v = PyLong_AsUnsignedLong(obj);

  49. ! if(!PyErr_Occured()){

  50. ! V_VT(var) = VT_UI4;