A question for a C guru

English: Dada guru
Image via Wikipedia
The debugging continues, but unfortunately I have not yet been able to identify what is fundamentally broken with my file system code.

But along the way I have spotted and fixed various bugs. Here is one, I am not even sure why it compiled in the first place, so maybe a C guru could tell me…

Was:

if le16_to_cpu(((u16 *) bh->b_data)[j * VMU_DIR_RECORD_LEN16 + VMUFAT_FIRSTBLOCK_OFFSET16] == ino)

Now:

if (le16_to_cpu(((u16 *) bh->b_data)[j * VMU_DIR_RECORD_LEN16 + VMUFAT_FIRSTBLOCK_OFFSET16]) == ino)

Advertisement

2 responses to “A question for a C guru”

  1. Maybe le16_to_cpu is a macro which has braces around its contents (this is standard practice).

    1. Tobi, You are quite right in that it is a macro. Well spotted. Though it’s a macro that references another macro – which I assume is bracketed as you say, though haven’t been able to confirm that.

%d bloggers like this: