GEEK ALERT! If you don't

GEEK ALERT! If you don’t want to read a technical programming discussion, skip this entry

Problem: I need to call any arbitrary function from a shared library, not knowing in advance how many arguments it requires. This is to be done in PowerPC code running under MacOS X.

I spent the last few days up to my neck in PowerPC assembly code (which I understand only enough to get myself into trouble). I finally came up with something like this, which doesn’t use any assembler:

long callfunc(FunctionPtr func,long *ap)

{

return (*func)(ap[0], ap[1], ap[2], ap[3], ap[4], ap[5], ap[6], ap[7],

ap[8], ap[9], ap[10], ap[11], ap[12], ap[13], ap[14], ap[15], ap[16], ap[17]);

}

This takes advantage of the fact that the caller, not the function being called cleans up the stack, and since the first 8 arguments are passed in registers and the remaining ones are passed at fixed offsets, the function being called can ignore any arguments it doesn’t use.

I’ve made the assumption that there’ll never be more than 18 arguments – I’ve never seen a toolbox function that takes more than 10. I’m also not handling floating point arguments, which need to be passed in FPRs instead of GPRs, but once again, I won’t be dealing with any toolbox functions that use floating point.

The application will be extensible by adding new shared libraries, so we’ll have to stay within these restrictions for our own code.

there's a good coverage of

there’s a good coverage of the freedom fighters of the digital world in the la times .: [ via slashdot ]

In a soft voice, the computer scientist explains what is troubling him: the scarcity of news surrounding all those people, then numbering about 500, who have been rounded up in the terrorism investigation. Who are they? Why are they being held? Does anybody know anything? “Who’s representing these people and trying to get them out?”

The panelists’ silence leaves Gilmore exasperated.

“Are all the civil rights organizations afraid to step up to defend potential terrorists?”

Say this about the leaders of the Electronic Frontier Foundation: They are not afraid to speak their minds. They are not afraid to push back.

the electronic frontier foundation (eff) is our vanguard. in more ways than one. they are buying us the time to form the friggin’ army. without them we don’t have a chance.

give them your support. end your apathy. help us build a free world.

[tav explores radio]

13908 ª January 16 1:58 PM. World’s Smallest [Libertarian-centric] Political Quiz… Nothing earth-shattering. It’s short, thought-provoking, and a tad biased. Or maybe it isn’t and I’m just chafing at being called an Authoritarian (neither Fascist, nor a Communist… somewhere in between).

I’m not I tell you… really! [MetaFilter]

Here’s my results:

Your Personal Self-Government Score is 100%.

Your Economic Self-Government Score is 70%.

I just found out that

I just found out that my friend Tom De Martini died of cancer last night in Casper, WY. He was in a lot of pain for the last few months.

Tom grew up in New Jersey, but spent a lot of time in Louisiana before moving to Los Angeles and eventually settling in Casper. He was a screenwriter, director, and businessman as well as an expert Cajun chef. He often worked with character actor John O’Leary and got involved in some nasty politics in Louisiana after making some TV ads for the former governor.

Mix-up has plaque honoring accused

Mix-up has plaque honoring accused MLK killer instead of black actor

LAUDERHILL, FL — The plaque stated, “Thank you James Earl Ray for keeping the dream alive.” But the name should have been “James Earl Jones,” the Tony Award-winning actor and voice of Star Wars’ Darth Vader, The Lion King’s Mufasa and CNN.

The plaque was intended as a gift from the city of Lauderhill to Jones, who will be the featured speaker at the city’s annual Martin Luther King celebration Saturday. James Earl Ray shot and killed King in 1968.