diff options
| author | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-01-19 23:33:44 +0900 | 
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-01-19 23:33:44 +0900 | 
| commit | 79ced6fbbdda1158aef437760ee0455fb9a9016d (patch) | |
| tree | 5c1dc33e117f0a4846cb874f41434722741eb388 /sip/tdecore | |
| parent | 12236609d02d708a0076a78145d527e023f47bab (diff) | |
| download | pytde-79ced6fb.tar.gz pytde-79ced6fb.zip | |
Remove/replace old conditional python code.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'sip/tdecore')
| -rw-r--r-- | sip/tdecore/kmacroexpander.sip | 4 | ||||
| -rw-r--r-- | sip/tdecore/tdeaccel.sip | 2 | ||||
| -rw-r--r-- | sip/tdecore/tdeapplication.sip | 4 | ||||
| -rw-r--r-- | sip/tdecore/tdecmdlineargs.sip | 12 | ||||
| -rw-r--r-- | sip/tdecore/tdeconfigbase.sip | 14 | 
5 files changed, 13 insertions, 23 deletions
| diff --git a/sip/tdecore/kmacroexpander.sip b/sip/tdecore/kmacroexpander.sip index bb3a39d..8d0d3d0 100644 --- a/sip/tdecore/kmacroexpander.sip +++ b/sip/tdecore/kmacroexpander.sip @@ -143,7 +143,7 @@ TQString              expandMacrosShellQuote (const TQString&, const TQMap<TQStr      for (it = map.begin (); it != map.end (); ++it)      {          TQChar acpp = it.key (); -        PyObject *binst = SIPBytes_FromString ((char *)((TQString *)&it.data ())); +        PyObject *binst = PyBytes_FromString ((char *)((TQString *)&it.data ()));          PyObject *ainst;          if (((ainst = sipConvertFromNewType(new TQChar(acpp), sipType_TQChar, sipTransferObj)) == NULL)              || (binst == NULL) @@ -232,7 +232,7 @@ TQString              expandMacrosShellQuote (const TQString&, const TQMap<TQStr      for (it = map.begin (); it != map.end (); ++it)      {          TQStringList bcpp = it.data (); -        PyObject *ainst = SIPBytes_FromString ((char *)((TQString *)&it.key ())); +        PyObject *ainst = PyBytes_FromString ((char *)((TQString *)&it.key ()));          PyObject *binst;          if (((binst = sipConvertFromNewType(new TQStringList(bcpp), sipType_TQStringList, sipTransferObj)) == NULL)              || (ainst == NULL) diff --git a/sip/tdecore/tdeaccel.sip b/sip/tdecore/tdeaccel.sip index 15875a1..e8097ce 100644 --- a/sip/tdecore/tdeaccel.sip +++ b/sip/tdecore/tdeaccel.sip @@ -184,7 +184,7 @@ public:      for (it = map.begin (); it != map.end (); ++it)          {                  PyObject *iKey  = PyLong_FromLong (((long) it.key ())); -                PyObject *sData = SIPBytes_FromString ((char *)((TQString *)&it.data ())); +                PyObject *sData = PyBytes_FromString ((char *)((TQString *)&it.data ()));                  if ((iKey == NULL) || (sData == NULL) || (PyDict_SetItem (dict, iKey, sData) < 0))                  { diff --git a/sip/tdecore/tdeapplication.sip b/sip/tdecore/tdeapplication.sip index 4f167b4..f4b40dd 100644 --- a/sip/tdecore/tdeapplication.sip +++ b/sip/tdecore/tdeapplication.sip @@ -419,9 +419,9 @@ char **pyArgvToC(PyObject *argvlist,int *argcp)        {          arg = tqstrdup(sipString_AsUTF8String(&argObject));        } -      else if (SIPBytes_Check(argObject)) +      else if (PyBytes_Check(argObject))        { -        arg = tqstrdup(SIPBytes_AS_STRING(argObject)); +        arg = tqstrdup(PyBytes_AS_STRING(argObject));        }        else        { diff --git a/sip/tdecore/tdecmdlineargs.sip b/sip/tdecore/tdecmdlineargs.sip index 954d2d1..4fe3904 100644 --- a/sip/tdecore/tdecmdlineargs.sip +++ b/sip/tdecore/tdecmdlineargs.sip @@ -172,9 +172,9 @@ public:              {                opts[i].name= tqstrdup(sipString_AsUTF8String(&member));              } -            else if (SIPBytes_Check(member)) +            else if (PyBytes_Check(member))              { -              opts[i].name= tqstrdup(SIPBytes_AS_STRING(member)); +              opts[i].name= tqstrdup(PyBytes_AS_STRING(member));              }              else              { @@ -188,9 +188,9 @@ public:                  {                    opts[i].description= tqstrdup(sipString_AsUTF8String(&member));                  } -                else if (SIPBytes_Check(member)) +                else if (PyBytes_Check(member))                  { -                  opts[i].description= tqstrdup(SIPBytes_AS_STRING(member)); +                  opts[i].description= tqstrdup(PyBytes_AS_STRING(member));                  }                  else                  { @@ -208,9 +208,9 @@ public:                  {                    opts[i].def= tqstrdup(sipString_AsUTF8String(&member));                  } -                else if (SIPBytes_Check(member)) +                else if (PyBytes_Check(member))                  { -                  opts[i].def= tqstrdup(SIPBytes_AS_STRING(member)); +                  opts[i].def= tqstrdup(PyBytes_AS_STRING(member));                  }                  else                  { diff --git a/sip/tdecore/tdeconfigbase.sip b/sip/tdecore/tdeconfigbase.sip index 8b0d147..26b392f 100644 --- a/sip/tdecore/tdeconfigbase.sip +++ b/sip/tdecore/tdeconfigbase.sip @@ -260,11 +260,6 @@ protected:  %MappedType longlong  //converts a Python long  { -%TypeHeaderCode -#if PY_MAJOR_VERSION >= 2 && PY_MINOR_VERSION >= 3 -#define LONG_LONG  PY_LONG_LONG -#endif -%End  %ConvertFromTypeCode      if (!sipCpp)          Py_INCREF (Py_None); @@ -272,7 +267,7 @@ protected:  //    PyObject *LongLong; -    return PyLong_FromLongLong (*(LONG_LONG *)sipCpp); +    return PyLong_FromLongLong (*(PY_LONG_LONG *)sipCpp);  %End  %ConvertToTypeCode @@ -296,17 +291,12 @@ protected:  %MappedType ulonglong  //converts a Python long  { -%TypeHeaderCode -#if PY_MAJOR_VERSION >= 2 && PY_MINOR_VERSION >= 3 -#define LONG_LONG  PY_LONG_LONG -#endif -%End  %ConvertFromTypeCode      if (!sipCpp)          Py_INCREF (Py_None);          return Py_None; -    return PyLong_FromUnsignedLongLong (*(LONG_LONG *)sipCpp); +    return PyLong_FromUnsignedLongLong (*(PY_LONG_LONG *)sipCpp);  %End  %ConvertToTypeCode | 
