~ubuntu-branches/ubuntu/maverick/sip4-qt3/maverick

« back to all changes in this revision

Viewing changes to sipgen/transform.c

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-07-21 10:18:00 UTC
  • mfrom: (1.3.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100721101800-9lk0k2t6hx6pq0dh
Tags: 4.10.5-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
514
514
        if (ct->cppsig == NULL || !isPublicCtor(ct))
515
515
            continue;
516
516
 
517
 
        if (ct->cppsig->nrArgs == 0)
 
517
        if (ct->cppsig->nrArgs == 0 || ct->cppsig->args[0].defval != NULL)
 
518
        {
 
519
            /*
 
520
             * The ctor either has no arguments or all arguments have defaults.
 
521
             */
518
522
            pub_def_ctor = TRUE;
 
523
        }
519
524
        else if (ct->cppsig->nrArgs == 1)
520
525
        {
521
526
            argDef *ad = &ct->cppsig->args[0];
1862
1867
    /* Handle the Python signature. */
1863
1868
    resolvePySigTypes(pt, mod, c_scope, od, &od->pysig, isSignal(od));
1864
1869
 
 
1870
    res = &od->pysig.result;
 
1871
 
 
1872
    /* These slots must return SIP_SSIZE_T (or int - deprecated). */
 
1873
    if (isSSizeReturnSlot(od->common))
 
1874
        if ((res->atype != ssize_type && res->atype != int_type) || res->nrderefs != 0 ||
 
1875
            isReference(res) || isConstArg(res))
 
1876
            fatal("%s slots must return SIP_SSIZE_T\n",
 
1877
                    od->common->pyname->text);
 
1878
 
1865
1879
    /* These slots must return int. */
1866
 
    res = &od->pysig.result;
1867
 
 
1868
1880
    if (isIntReturnSlot(od->common))
1869
1881
        if (res->atype != int_type || res->nrderefs != 0 ||
1870
1882
            isReference(res) || isConstArg(res))
1944
1956
                    fatal("::");
1945
1957
                }
1946
1958
 
1947
 
                fatal("%s() unsupported signal argument type\n");
 
1959
                fatal("%s() unsupported signal argument type\n", od->cppname);
1948
1960
            }
1949
1961
        }
1950
1962
        else if (!supportedType(scope,od,ad,TRUE) && (od -> cppsig == &od -> pysig || od -> methodcode == NULL || (isVirtual(od) && od -> virthandler -> virtcode == NULL)))
2019
2031
    case long_type:
2020
2032
    case ulonglong_type:
2021
2033
    case longlong_type:
 
2034
    case ssize_type:
2022
2035
    case pyobject_type:
2023
2036
    case pytuple_type:
2024
2037
    case pylist_type:
2148
2161
    case long_type:
2149
2162
    case ulonglong_type:
2150
2163
    case longlong_type:
 
2164
    case ssize_type:
2151
2165
    case pyobject_type:
2152
2166
    case pytuple_type:
2153
2167
    case pylist_type:
2423
2437
            (t) == latin1_string_type || (t) == utf8_string_type)
2424
2438
#define pyAsFloat(t)    ((t) == cfloat_type || (t) == float_type || \
2425
2439
            (t) == cdouble_type || (t) == double_type)
2426
 
#define pyAsInt(t)  ((t) == bool_type || \
 
2440
#define pyAsInt(t)  ((t) == bool_type || (t) == ssize_type || \
2427
2441
            (t) == short_type || (t) == ushort_type || \
2428
2442
            (t) == cint_type || (t) == int_type || (t) == uint_type)
2429
2443
#define pyAsLong(t) ((t) == long_type || (t) == longlong_type)