dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Re: id3.c: reading id3 tags, is this a bug?

Re: id3.c: reading id3 tags, is this a bug?

From: Linus Nielsen Feltzing <>
Date: Wed, 19 Mar 2003 10:02:27 +0100

TP Diffenbach wrote:
> Examining the latest CVS with Linus Nielsen Feltzing's changes, I'm
> still not sure that the code is correct. Specifically, if the read
> fails (bytes read != bytes requested), I wonder why we shouldn't
> simply bail out.

We do. Where in the code don't we?

> A negative return from read, if I recall correctly, means that the
> read failed. read_frame's caller is only interested in whether
> read_frame's return value is less than zero.

No, not if the caller will display the return code.

> So why mutiply read's
> return value by ten, and subtract one? What is this useful for?

It is useful for debugging purposes. If each caller multiplies the
return code by 10, we will be able to track the return code from each
caller in the chain, and can see the exact chain of events from the
return code only.

Received on 2003-03-19

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy