tgl icon indicating copy to clipboard operation
tgl copied to clipboard

Type warnings

Open lkraider opened this issue 9 years ago • 7 comments

When compiling on a 64bit architecture there are many type warnings. Some even seem are errors, like inconsistent type for message id.

This fixes a few of these issues (not all).

lkraider avatar Nov 15 '14 01:11 lkraider

Thx for pull requests. It will take some time to merge them, but I'll try to it today

vysheng avatar Nov 17 '14 12:11 vysheng

Updated to follow new commits in master. Also changed tree to use long instead of int because of lrand48 return type.

lkraider avatar Nov 20 '14 22:11 lkraider

No you should not use long y in trees. It's just random key to balance tree, no need to use more memory.

vysheng avatar Nov 21 '14 10:11 vysheng

That's true, the implementation of lrand48 uses a uint32_t internally, I'll add a cast to that so the warnings don't show.

lkraider avatar Nov 24 '14 16:11 lkraider

Ended up creating a function irand48 that does the cast to int. It is inside tree.h and declared as static inline so all files that deal with the tree have it included.

lkraider avatar Nov 24 '14 19:11 lkraider

There are still 175 warnings, most associated with pointer arithmetic.

lkraider avatar Nov 26 '14 20:11 lkraider

That's why I don't want to spend time to fix them

vysheng avatar Nov 27 '14 12:11 vysheng