[PATCH] replace the magic constants in the parental management information
Hello, This patch replaces the hard coded number of levels in the parental management information by a constant. The size of the bit mask was also hard coded to 2 bytes. This patch replaces it by sizeof(uint16_t) as it is defined as such in dvdread/ifo_types.h. Frederic
This patch replaces the hard coded number of levels in the parental management information by a constant.
The size of the bit mask was also hard coded to 2 bytes. This patch replaces it by sizeof(uint16_t) as it is defined as such in dvdread/ifo_types.h.
I may just accept this. But is it possible to use nr_of_vtss or whatever the flag is in sizeof instead of uint16_t. It is highly unlikely (near impossible) that the sizes of entries in the DVD format are ever going to change. But it always makes more sense to do the sizeof on the variable instead of the type. Thanks for splitting up the patch. It makes it much easier to review. E -- Erik Hovland erik@hovland.org http://hovland.org/
On Monday 22 November 2010 21:56:57 Erik Hovland wrote:
This patch replaces the hard coded number of levels in the parental management information by a constant.
The size of the bit mask was also hard coded to 2 bytes. This patch replaces it by sizeof(uint16_t) as it is defined as such in dvdread/ifo_types.h.
I may just accept this. But is it possible to use nr_of_vtss or whatever the flag is in sizeof instead of uint16_t. It is highly unlikely (near impossible) that the sizes of entries in the DVD format are ever going to change. But it always makes more sense to do the sizeof on the variable instead of the type.
Do you mean something like the attached patch ? Frederic
This patch replaces the hard coded number of levels in the parental management information by a constant.
The size of the bit mask was also hard coded to 2 bytes. This patch replaces it by sizeof(uint16_t) as it is defined as such in dvdread/ifo_types.h.
I may just accept this. But is it possible to use nr_of_vtss or whatever the flag is in sizeof instead of uint16_t. It is highly unlikely (near impossible) that the sizes of entries in the DVD format are ever going to change. But it always makes more sense to do the sizeof on the variable instead of the type.
Do you mean something like the attached patch ?
Yep, thanks. E -- Erik Hovland erik@hovland.org http://hovland.org/
This patch replaces the hard coded number of levels in the parental management information by a constant.
The size of the bit mask was also hard coded to 2 bytes. This patch replaces it by sizeof(uint16_t) as it is defined as such in dvdread/ifo_types.h.
I may just accept this. But is it possible to use nr_of_vtss or whatever the flag is in sizeof instead of uint16_t. It is highly unlikely (near impossible) that the sizes of entries in the DVD format are ever going to change. But it always makes more sense to do the sizeof on the variable instead of the type.
Do you mean something like the attached patch ?
Using sizeof on a stack allocated array should be OK. Does anyone know of a platform that doesn't support this? E -- Erik Hovland erik@hovland.org http://hovland.org/
participants (2)
-
Erik Hovland -
Frédéric Marchal