Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Broadcom Open-Sources Wireless Drivers

Name: Anonymous 2010-09-09 15:26

The ternary operator is dissapointed.


/*
Description: This function saturate input 32 bit number into a 16 bit number.
If input number is greater than 0x7fff then output is saturated to 0x7fff.
else if input number is less than 0xffff8000 then output is saturated to 0xffff8000
else output is same as input.
*/
int16 qm_sat32(int32 op)
{
    int16 result;
    if (op > (int32) 0x7fff) {
        result = 0x7fff;
    } else if (op < (int32) 0xffff8000) {
        result = (int16) (0x8000);
    } else {
        result = (int16) op;
    }
    return result;
}

Name: Anonymous 2010-09-13 22:52

>>49-50
C compilers tend to have an inlining extension, such as __inline/declspec stuff. Common Lisp implementations have inline/notinline declarations as well, however unlike the C ones, those are specified in the standard, however some Lispers(including me), believe that those 2 are themselves not enough as one might want to be able to control wether function calls are direct or indirect too, which is more important in Lisp as it allows redefinition at runtime (of just about anything you can think of).

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List