mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
[qfcc] Catch assignment of void* to class pointers
id and other class pointers imply that the object can receive messages, but void * has no such implication, so treat it as a mismatch.
This commit is contained in:
parent
65a5e4f2a4
commit
ccaa4ad3d2
1 changed files with 7 additions and 1 deletions
|
@ -445,8 +445,14 @@ obj_types_assignable (const type_t *dst, const type_t *src)
|
|||
int i;
|
||||
|
||||
//puts ("%$$\"$#%");
|
||||
if (!obj_is_classptr (dst) || !obj_is_classptr (src))
|
||||
if (!obj_is_classptr (src)) {
|
||||
// if dst is a class pointer, then the types are not compatible,
|
||||
// otherwise unknown
|
||||
return obj_is_classptr (dst) - 1;
|
||||
}
|
||||
if (!obj_is_classptr (dst)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
dst_is_proto = obj_is_id (dst) && (dst_protos = obj_get_protos (dst));
|
||||
src_is_proto = obj_is_id (src) && (src_protos = obj_get_protos (src));
|
||||
|
|
Loading…
Reference in a new issue