Commits
Ville Suoranta authored 5ad7fa6c0ed Merge
929 929 | } |
930 930 | PyObject *o3 = PyTuple_New(1); |
931 931 | PyTuple_SetItem(o3,0,o); |
932 932 | o2 = $result; |
933 933 | $result = PySequence_Concat(o2,o3); |
934 934 | Py_DECREF(o2); |
935 935 | Py_DECREF(o3); |
936 936 | } |
937 937 | } |
938 938 | |
939 + | %typemap(argout) long& OUTARGINT{ |
940 + | PyObject *o = PyLong_FromLong(*$1); |
941 + | if((!$result) || ($result == Py_None)){ |
942 + | $result = o; |
943 + | } else { |
944 + | PyObject *o2 = $result; |
945 + | if (!PyTuple_Check($result)) { |
946 + | $result = PyTuple_New(1); |
947 + | PyTuple_SetItem($result,0,o2); |
948 + | } |
949 + | PyObject *o3 = PyTuple_New(1); |
950 + | PyTuple_SetItem(o3,0,o); |
951 + | o2 = $result; |
952 + | $result = PySequence_Concat(o2,o3); |
953 + | Py_DECREF(o2); |
954 + | Py_DECREF(o3); |
955 + | } |
956 + | } |
957 + | |
939 958 | %typemap(argout) double& OUTARGDBL{ |
940 959 | PyObject *o = PyFloat_FromDouble(*$1); |
941 960 | if((!$result) || ($result == Py_None)){ |
942 961 | $result = o; |
943 962 | } else { |
944 963 | PyObject *o2 = $result; |
945 964 | if (!PyTuple_Check($result)) { |
946 965 | $result = PyTuple_New(1); |
947 966 | PyTuple_SetItem($result,0,o2); |
948 967 | } |