comparison ifo_read.c @ 64:70c34d162e6e src

Replaces the hard-coded values The parental management structure has ratings levels. The size of the bit mask is constant but magic values were being used instead of named constants. This commit changes them to named constants. This is based on a patch submitted by Frederic Marchal, fmarchal at perso dot be. Thanks for this tidy cleanup.
author erik
date Sun, 30 Jan 2011 23:44:13 +0000
parents 46c05a214511
children fb0ccb03eb7d
comparison
equal deleted inserted replaced
63:46c05a214511 64:70c34d162e6e
1346 1346
1347 for(i = 0; i < ptl_mait->nr_of_countries; i++) { 1347 for(i = 0; i < ptl_mait->nr_of_countries; i++) {
1348 CHECK_ZERO(ptl_mait->countries[i].zero_1); 1348 CHECK_ZERO(ptl_mait->countries[i].zero_1);
1349 CHECK_ZERO(ptl_mait->countries[i].zero_2); 1349 CHECK_ZERO(ptl_mait->countries[i].zero_2);
1350 CHECK_VALUE(ptl_mait->countries[i].pf_ptl_mai_start_byte 1350 CHECK_VALUE(ptl_mait->countries[i].pf_ptl_mai_start_byte
1351 + 8*2 * (ptl_mait->nr_of_vtss + 1) <= ptl_mait->last_byte + 1); 1351 + sizeof(pf_level_t) * (ptl_mait->nr_of_vtss + 1) <= ptl_mait->last_byte + 1);
1352 } 1352 }
1353 1353
1354 for(i = 0; i < ptl_mait->nr_of_countries; i++) { 1354 for(i = 0; i < ptl_mait->nr_of_countries; i++) {
1355 uint16_t *pf_temp; 1355 uint16_t *pf_temp;
1356 1356
1387 ifofile->ptl_mait = NULL; 1387 ifofile->ptl_mait = NULL;
1388 return 0; 1388 return 0;
1389 } 1389 }
1390 { /* Transpose the array so we can use C indexing. */ 1390 { /* Transpose the array so we can use C indexing. */
1391 int level, vts; 1391 int level, vts;
1392 for(level = 0; level < 8; level++) { 1392 for(level = 0; level < PTL_MAIT_NUM_LEVEL; level++) {
1393 for(vts = 0; vts <= ptl_mait->nr_of_vtss; vts++) { 1393 for(vts = 0; vts <= ptl_mait->nr_of_vtss; vts++) {
1394 ptl_mait->countries[i].pf_ptl_mai[vts][level] = 1394 ptl_mait->countries[i].pf_ptl_mai[vts][level] =
1395 pf_temp[(7-level)*(ptl_mait->nr_of_vtss+1) + vts]; 1395 pf_temp[(7-level)*(ptl_mait->nr_of_vtss+1) + vts];
1396 } 1396 }
1397 } 1397 }