From: Christophe R. <cs...@ca...> - 2004-03-30 13:44:50
|
"Perry E. Metzger" <pe...@pi...> writes: > Christophe Rhodes <cs...@ca...> writes: >>> +static inline lispobj * >>> +newspace_alloc(int nwords, int constantp) >>> { >>> [...] >>> - orig = newspace_alloc(0,constant); >>> + orig = (lispobj *)newspace_alloc(0,constant); >>> length = 0; >> >> Given the first portion of this patch, the second is redundant, is it >> not? > > orig is not a lispobj * -- it is another kind of pointer -- so the > second part is not redundant. I didn't even notice the need for the > second until I did the first... OK, so now I don't understand; if orig is not a lispobj *, how does casting the return value of newspace_alloc() from a lispobj * to a lispobj * remove warnings. My intuition would have been that an explicit cast to the type of orig would be required, not the null cast. In other words, I can believe that a cast to (struct cons *) would make sense; I can't see how a cast to (lispobj *) helps in any way (apart from maybe quieting gcc a little -- but the code itself seems just as broken, with just the same implicit conversion occurring afterwards as before). Cheers, Christophe -- http://www-jcsu.jesus.cam.ac.uk/~csr21/ +44 1223 510 299/+44 7729 383 757 (set-pprint-dispatch 'number (lambda (s o) (declare (special b)) (format s b))) (defvar b "~&Just another Lisp hacker~%") (pprint #36rJesusCollegeCambridge) |