| 345 | } |
| 346 | |
| 347 | STATIC |
| 348 | UINT16 |
| 349 | ReadPTLen ( |
| 350 | IN SCRATCH_DATA *Sd, |
| 351 | IN UINT16 nn, |
| 352 | IN UINT16 nbit, |
| 353 | IN UINT16 Special |
| 354 | ) |
| 355 | /*++ |
| 356 | |
| 357 | Routine Description: |
| 358 | |
| 359 | Reads code lengths for the Extra Set or the Position Set |
| 360 | |
| 361 | Arguments: |
| 362 | |
| 363 | Sd - The global scratch data |
| 364 | nn - Number of symbols |
| 365 | nbit - Number of bits needed to represent nn |
| 366 | Special - The special symbol that needs to be taken care of |
| 367 | |
| 368 | Returns: |
| 369 | |
| 370 | 0 - OK. |
| 371 | BAD_TABLE - Table is corrupted. |
| 372 | |
| 373 | --*/ |
| 374 | { |
| 375 | UINT16 Number; |
| 376 | UINT16 CharC; |
| 377 | UINT16 Index; |
| 378 | UINT32 Mask; |
| 379 | |
| 380 | assert (nn <= NPT); |
| 381 | |
| 382 | Number = (UINT16) GetBits (Sd, nbit); |
| 383 | |
| 384 | if (Number == 0) { |
| 385 | CharC = (UINT16) GetBits (Sd, nbit); |
| 386 | |
| 387 | for (Index = 0; Index < 256; Index++) { |
| 388 | Sd->mPTTable[Index] = CharC; |
| 389 | } |
| 390 | |
| 391 | for (Index = 0; Index < nn; Index++) { |
| 392 | Sd->mPTLen[Index] = 0; |
| 393 | } |
| 394 | |
| 395 | return 0; |
| 396 | } |
| 397 | |
| 398 | Index = 0; |
| 399 | |
| 400 | while (Index < Number && Index < NPT) { |
| 401 | |
| 402 | CharC = (UINT16) (Sd->mBitBuf >> (BITBUFSIZ - 3)); |
| 403 | |
| 404 | if (CharC == 7) { |
no test coverage detected