20 May 2004 Spooky   » (Master)

GNOME with 64-bits

I've found the gconf problem (and filed the patch in bugzilla). It was one of those classic 64-bit vs. 32-bit problems, combined with endianess issues. An int* had been passed to a function which expected a gsize*. gsize is 64-bits long and so the function was filling out the int and then some. This wasn't the actual cause of the bug though, on a big-endian system the first four bytes, that the caller sees when it dereferences its int, are the top 32 bits of the size, i.e. zero for the small files gconf uses. So gconf assumes the file is empty and tells the app that there isn't any such key. Little-endian machines luck out and get the right half of the 64-bit number.

Moral of the story: Always make sure you pass the correct pointer to a function. Not doing so is always a bug.

The other bug I'm seeing (and posting bugs for when I notice them) is dodgy pointer arithmetic involving casting the pointer to an int, doing something, and then casting it back. e.g.:

pointer = (char *)((unsigned int)pointer - 1);

On ppc64 ints and pointers are different sizes. Doing this chops off the high 32-bits of the address. Fortunately on Linux the code is loaded at 0x1000000 and the program is question doesn't normally chew more than 3G of data so it works.

Moral of the story: Never, ever, cast a pointer to an int. In C, the compiler will either let you do the operation directly or it is a bloody stupid thing to do.

Spatial Nautilus

I avoided mentioning this on the desktop-devel thread-of-doom, but I have a hunch I know why a lot of experienced nautilus users hate spatial mode. File managers work best when navigating data you've organised with that file manager. Spatial mode encourages wide, shallow trees with easy access for the things you care about (actually it probably encourages easy access for everything because you don't want to spend time burying things you don't care about). The people complaining seemed to have very deep, 10 000 file, home directories. Maybe that is the problem.

I like spatial nautilus because it adds value over the shell. Browser nautilus didn't. In fact I usually used a terminal in preference to nautilus.

Colour-blindness

My current work involves me wearing glasses which cut out near-IR light. Unfortunately they also cut out a lot of red light giving me an artificial form of colour-blindness. Using a computer has been an interesting experience. There are some good bits, magenta is now an almost pleasant colour, but there are also some subtle things that catch you out. Like all the suits in aisleriot being nearly the same colour.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!