revert 0cb5727f264472ba6bef4c7dc1518e854ea609a3 partially

all parts that used size_t casts for the int->void* issue
were removed again.

it seems the fix was not right, as motor crashes still on 64 bit sys
(maybe due to newer gcc versions which are more sensitive to UB).
fix to work on 64bit (again)

segfaults were encountered again due to bogus int -> pointer conversions
in functions like tree.additem (sometimes called with ints like 10,20,
sometimes with char*s, sometimes even with C++ iterators...), .addleaf, etc.

since the code is big it's hard to figure out why those intcasts were being
done and how the same functionality could be implemented without invoking UB.

after several tries to remove the offending calls, i reverted everything
and decided to use intptr_t *everywhere*.

- converted every occurence of int to INT so it can be overridden
with CPP directives to intptr_t.
- manually reverted the few ones that were conflicting with called
libc functions.
- when 0 was used as an arg in an overloaded function call expecting
INT or void*, NULL is used now to use the pointer version (the
INT version is just a wrapper around the respective void* version).

used this regex for .h/.cc
find . -name '*.h' -exec sed -i \
's/^int$/INT/g;s/^int\([^a-zA-Z0-9_]\)/INT\1/g;s/\([^a-zA-Z0-9_]\)int$/\1INT/g;s/\([^a-zA-Z0-9_]\)int\([^a-zA-Z0-9]\)/\1INT\2/g' \
{} \;