Hi!
7-Мар-2005 04:58 [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote to
[email protected]:
jo> I assume you are pointing out the use of hiword & loword versus what I used
jo> I did this for two reasons, the 1st is that those macros are not in the
jo> stable kernel's portab.h, so using them would just make a kernel that did
jo> not
jo> compile. Yes I could easily add them, but that wasn't the point of the
jo> commits,
jo> they were to fix specific issues whose changes I am reasonably sure have no
jo> negative
jo> side effects.
But adding things, which eases following fixes (and not breaks anything
already existing) - what bad in this?
jo> Testing directly against 0xFFFF as a boundary condition is clearer and more
jo> succinct
jo> (to me) than testing if (0xFFFF & (unsigned)((pEntry->NumSect) >> 16u))
jo> equals 0,
jo> hence my selection of it over the use of hiword.
But this (manual macro expanding) introduces more differences (in
source and code) between different branches.
jo> The use of loword is
jo> technically
jo> safer and more accurate, but again the macro isn't available in stable yet,
jo> and unless
jo> someone changes UWORD to be smaller or signed, in which case, this is the
jo> least of
jo> their issues, the resulting value should still be the same (based on the if)
jo> .
jo> Please explain why you feel hiword is better and I will reconsider.
jo> (and please do, if you have a reason other than style or if the general
jo> consensus is that using hiword is clearer, then I will make the change)
- it more readable (we check hi/lo word/part of long number, not check for
hit in some range, as may be suggested from comparing "val <= 0xFFFF").
- it (in some cases) more efficient:
______________O\_/_________________________________\_/O______________
; if (hs > hiword(LBA_address)) /* LBA_address < hs * 0x10000ul */
cmp ax,word ptr [bp-6]
jbe L$122
_____________________________________________________________________
O/~\ /~\O
- if this macro inefficient on some compiler, it may be adapted for this
compiler without changes in (main) sources.
jo> if (hiword (pEntry->NumSect) == 0)
jo> {
jo> pddt->ddt_defbpb.bpb_nsize = loword (pEntry->NumSect);
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Freedos-kernel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel