Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 148277 | Differences between
and this patch

Collapse All | Expand All

(-)sip-4.2.1.vanilla/sipgen/gencode.c (-1 / +1 lines)
Lines 3043-3049 Link Here
3043
3043
3044
	if (isNumberSlot(md) || isInplaceNumberSlot(md))
3044
	if (isNumberSlot(md) || isInplaceNumberSlot(md))
3045
		prcode(fp,
3045
		prcode(fp,
3046
"	if (!PyType_IsSubtype(sipSelf -> ob_type,&sipClass_%C -> super.type))\n"
3046
"	if (!PyType_IsSubtype(sipSelf -> ob_type,&sipClass_%C -> super.ht_type))\n"
3047
"	{\n"
3047
"	{\n"
3048
"		Py_INCREF(Py_NotImplemented);\n"
3048
"		Py_INCREF(Py_NotImplemented);\n"
3049
"		return Py_NotImplemented;\n"
3049
"		return Py_NotImplemented;\n"
(-)sip-4.2.1.vanilla/siplib/objmap.c (-2 / +2 lines)
Lines 114-121 Link Here
114
		 * of it, or vice versa, then we assume it is the same C++
114
		 * of it, or vice versa, then we assume it is the same C++
115
		 * object.
115
		 * object.
116
		 */
116
		 */
117
		if (PyObject_TypeCheck(w,&type -> super.type) ||
117
		if (PyObject_TypeCheck(w,&type -> super.ht_type) ||
118
		    PyType_IsSubtype(&type -> super.type,w -> ob_type))
118
		    PyType_IsSubtype(&type -> super.ht_type,w -> ob_type))
119
			return w;
119
			return w;
120
	}
120
	}
121
121
(-)sip-4.2.1.vanilla/siplib/qtlib.cpp (-1 / +1 lines)
Lines 1235-1241 Link Here
1235
				char *meth;
1235
				char *meth;
1236
1236
1237
				// Get the method name.
1237
				// Get the method name.
1238
				meth = ((PyCFunctionObject *)rxObj) -> m_ml -> ml_name;
1238
				meth = (char*)((PyCFunctionObject *)rxObj) -> m_ml -> ml_name;
1239
1239
1240
				if ((sp -> name = (char *)sip_api_malloc(strlen(meth) + 2)) == NULL)
1240
				if ((sp -> name = (char *)sip_api_malloc(strlen(meth) + 2)) == NULL)
1241
					return -1;
1241
					return -1;
(-)sip-4.2.1.vanilla/siplib/siplib.c (-23 / +23 lines)
Lines 303-309 Link Here
303
	if (PyType_Ready(&sipWrapperType_Type) < 0)
303
	if (PyType_Ready(&sipWrapperType_Type) < 0)
304
		Py_FatalError("sip: Failed to initialise sip.wrappertype type");
304
		Py_FatalError("sip: Failed to initialise sip.wrappertype type");
305
305
306
	if (PyType_Ready(&sipWrapper_Type.super.type) < 0)
306
	if (PyType_Ready(&sipWrapper_Type.super.ht_type) < 0)
307
		Py_FatalError("sip: Failed to initialise sip.wrapper type");
307
		Py_FatalError("sip: Failed to initialise sip.wrapper type");
308
308
309
	if (PyType_Ready(&sipVoidPtr_Type) < 0)
309
	if (PyType_Ready(&sipVoidPtr_Type) < 0)
Lines 671-677 Link Here
671
		sipWrapperType *wt;
671
		sipWrapperType *wt;
672
672
673
		while ((wt = *mw++) != NULL)
673
		while ((wt = *mw++) != NULL)
674
			if (addInstances(wt -> super.type.tp_dict,&wt -> type -> td_instances) < 0)
674
			if (addInstances(wt -> super.ht_type.tp_dict,&wt -> type -> td_instances) < 0)
675
				return -1;
675
				return -1;
676
	}
676
	}
677
677
Lines 1568-1574 Link Here
1568
				type = va_arg(va,sipWrapperType *);
1568
				type = va_arg(va,sipWrapperType *);
1569
				va_arg(va,void **);
1569
				va_arg(va,void **);
1570
1570
1571
				if (arg != Py_None && !PyObject_TypeCheck(arg,&type -> super.type))
1571
				if (arg != Py_None && !PyObject_TypeCheck(arg,&type -> super.ht_type))
1572
					valid = PARSE_TYPE;
1572
					valid = PARSE_TYPE;
1573
1573
1574
				/* Handle the sub-format. */
1574
				/* Handle the sub-format. */
Lines 1662-1668 Link Here
1662
#if defined(SIP_QT_SUPPORT)
1662
#if defined(SIP_QT_SUPPORT)
1663
				/* Sub-class of QObject. */
1663
				/* Sub-class of QObject. */
1664
1664
1665
				if (PyObject_TypeCheck(arg,&sipQObjectClass -> super.type))
1665
				if (PyObject_TypeCheck(arg,&sipQObjectClass -> super.ht_type))
1666
					*va_arg(va,PyObject **) = arg;
1666
					*va_arg(va,PyObject **) = arg;
1667
				else
1667
				else
1668
					valid = PARSE_TYPE;
1668
					valid = PARSE_TYPE;
Lines 2405-2411 Link Here
2405
2405
2406
	/* Get the dictionary into which the type will be placed. */
2406
	/* Get the dictionary into which the type will be placed. */
2407
	if (type -> td_scope >= 0)
2407
	if (type -> td_scope >= 0)
2408
		dict = client -> em_types[type -> td_scope] -> super.type.tp_dict;
2408
		dict = client -> em_types[type -> td_scope] -> super.ht_type.tp_dict;
2409
	else
2409
	else
2410
		dict = mod_dict;
2410
		dict = mod_dict;
2411
2411
Lines 2474-2480 Link Here
2474
2474
2475
	/* Get the dictionary into which the type will be placed. */
2475
	/* Get the dictionary into which the type will be placed. */
2476
	if (ed -> e_scope >= 0)
2476
	if (ed -> e_scope >= 0)
2477
		dict = client -> em_types[ed -> e_scope] -> super.type.tp_dict;
2477
		dict = client -> em_types[ed -> e_scope] -> super.ht_type.tp_dict;
2478
	else
2478
	else
2479
		dict = mod_dict;
2479
		dict = mod_dict;
2480
2480
Lines 2597-2603 Link Here
2597
2597
2598
	self = PyTuple_GET_ITEM(args,argnr);
2598
	self = PyTuple_GET_ITEM(args,argnr);
2599
2599
2600
	if (!PyObject_TypeCheck(self,&type -> super.type))
2600
	if (!PyObject_TypeCheck(self,&type -> super.ht_type))
2601
		return PARSE_UNBOUND;
2601
		return PARSE_UNBOUND;
2602
2602
2603
	*selfp = (sipWrapper *)self;
2603
	*selfp = (sipWrapper *)self;
Lines 2700-2706 Link Here
2700
		if ((attr = createEnumMember(in, enm)) == NULL)
2700
		if ((attr = createEnumMember(in, enm)) == NULL)
2701
			return NULL;
2701
			return NULL;
2702
2702
2703
		if (PyDict_SetItem(in -> super.type.tp_dict,nameobj,attr) < 0)
2703
		if (PyDict_SetItem(in -> super.ht_type.tp_dict,nameobj,attr) < 0)
2704
		{
2704
		{
2705
			Py_DECREF(attr);
2705
			Py_DECREF(attr);
2706
			return NULL;
2706
			return NULL;
Lines 3329-3335 Link Here
3329
{
3329
{
3330
	/* If this is a wrapped type then get the type dictionary. */
3330
	/* If this is a wrapped type then get the type dictionary. */
3331
	if (sipWrapperType_Check(dict))
3331
	if (sipWrapperType_Check(dict))
3332
		dict = ((sipWrapperType *)dict) -> super.type.tp_dict;
3332
		dict = ((sipWrapperType *)dict) -> super.ht_type.tp_dict;
3333
3333
3334
	return addSingleClassInstance(dict,name,cppPtr,wt,SIP_SIMPLE);
3334
	return addSingleClassInstance(dict,name,cppPtr,wt,SIP_SIMPLE);
3335
}
3335
}
Lines 3620-3626 Link Here
3620
			 * convertor might be able to convert the target type
3620
			 * convertor might be able to convert the target type
3621
			 * to something more specific.
3621
			 * to something more specific.
3622
			 */
3622
			 */
3623
			if (PyType_IsSubtype(&type -> super.type,&scc -> scc_basetype -> super.type))
3623
			if (PyType_IsSubtype(&type -> super.ht_type,&scc -> scc_basetype -> super.ht_type))
3624
			{
3624
			{
3625
				sipWrapperType *subtype;
3625
				sipWrapperType *subtype;
3626
3626
Lines 4077-4083 Link Here
4077
	 * super-type.
4077
	 * super-type.
4078
	 */
4078
	 */
4079
	if (self -> type == NULL)
4079
	if (self -> type == NULL)
4080
		self -> type = ((sipWrapperType *)self -> super.type.tp_base) -> type;
4080
		self -> type = ((sipWrapperType *)self -> super.ht_type.tp_base) -> type;
4081
4081
4082
	return 0;
4082
	return 0;
4083
}
4083
}
Lines 4107-4113 Link Here
4107
		PyObject *dict, *tmpdict, *proxy;
4107
		PyObject *dict, *tmpdict, *proxy;
4108
		PyMethodDef *pmd;
4108
		PyMethodDef *pmd;
4109
4109
4110
		dict = wt -> super.type.tp_dict;
4110
		dict = wt -> super.ht_type.tp_dict;
4111
4111
4112
		/* The base type doesn't have any type information. */
4112
		/* The base type doesn't have any type information. */
4113
		if ((td = wt -> type) == NULL)
4113
		if ((td = wt -> type) == NULL)
Lines 4304-4310 Link Here
4304
	}
4304
	}
4305
4305
4306
	/* Call the standard super-type new. */
4306
	/* Call the standard super-type new. */
4307
	return PyBaseObject_Type.tp_new(&wt -> super.type,args,kwds);
4307
	return PyBaseObject_Type.tp_new(&wt -> super.ht_type,args,kwds);
4308
}
4308
}
4309
4309
4310
4310
Lines 4744-4751 Link Here
4744
		switch (slots++ -> psd_type)
4744
		switch (slots++ -> psd_type)
4745
		{
4745
		{
4746
		case str_slot:
4746
		case str_slot:
4747
			if (sp -> type.tp_str == NULL)
4747
			if (sp -> ht_type.tp_str == NULL)
4748
				sp -> type.tp_str = (reprfunc)f;
4748
				sp -> ht_type.tp_str = (reprfunc)f;
4749
			break;
4749
			break;
4750
4750
4751
		case int_slot:
4751
		case int_slot:
Lines 4891-4898 Link Here
4891
			break;
4891
			break;
4892
4892
4893
		case call_slot:
4893
		case call_slot:
4894
			if (sp -> type.tp_call == NULL)
4894
			if (sp -> ht_type.tp_call == NULL)
4895
				sp -> type.tp_call = sipWrapper_call;
4895
				sp -> ht_type.tp_call = sipWrapper_call;
4896
			break;
4896
			break;
4897
4897
4898
		case getitem_slot:
4898
		case getitem_slot:
Lines 4916-4928 Link Here
4916
		case ne_slot:
4916
		case ne_slot:
4917
		case gt_slot:
4917
		case gt_slot:
4918
		case ge_slot:
4918
		case ge_slot:
4919
			if (sp -> type.tp_richcompare == NULL)
4919
			if (sp -> ht_type.tp_richcompare == NULL)
4920
				sp -> type.tp_richcompare = sipWrapper_richcompare;
4920
				sp -> ht_type.tp_richcompare = sipWrapper_richcompare;
4921
			break;
4921
			break;
4922
4922
4923
		case cmp_slot:
4923
		case cmp_slot:
4924
			if (sp -> type.tp_compare == NULL)
4924
			if (sp -> ht_type.tp_compare == NULL)
4925
				sp -> type.tp_compare = (cmpfunc)f;
4925
				sp -> ht_type.tp_compare = (cmpfunc)f;
4926
			break;
4926
			break;
4927
4927
4928
		case nonzero_slot:
4928
		case nonzero_slot:
Lines 4936-4943 Link Here
4936
			break;
4936
			break;
4937
4937
4938
		case repr_slot:
4938
		case repr_slot:
4939
			if (sp -> type.tp_repr == NULL)
4939
			if (sp -> ht_type.tp_repr == NULL)
4940
				sp -> type.tp_repr = (reprfunc)f;
4940
				sp -> ht_type.tp_repr = (reprfunc)f;
4941
			break;
4941
			break;
4942
		}
4942
		}
4943
}
4943
}

Return to bug 148277