MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / ReadPTLen

Function ReadPTLen

BaseTools/Source/C/Common/Decompress.c:347–431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

345}
346
347STATIC
348UINT16
349ReadPTLen (
350 IN SCRATCH_DATA *Sd,
351 IN UINT16 nn,
352 IN UINT16 nbit,
353 IN UINT16 Special
354 )
355/*++
356
357Routine Description:
358
359 Reads code lengths for the Extra Set or the Position Set
360
361Arguments:
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
368Returns:
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) {

Callers 2

DecodeCFunction · 0.70
TianoCompress.cFile · 0.50

Calls 3

GetBitsFunction · 0.70
FillBufFunction · 0.70
MakeTableFunction · 0.70

Tested by

no test coverage detected