Coverage Report

Created: 2026-07-16 06:59

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/util-linux/include/iso9660.h
Line
Count
Source
1
/*
2
 * No copyright is claimed.  This code is in the public domain; do with
3
 * it what you wish.
4
 */
5
#ifndef UTIL_LINUX_ISO_H
6
#define UTIL_LINUX_ISO_H
7
8
#include <inttypes.h>
9
#include <stdbool.h>
10
#include <stdint.h>
11
12
#include "c.h"
13
14
static inline uint16_t isonum_721(const unsigned char *p)
15
386
{
16
386
  return ((p[0] & 0xff)
17
386
    | ((p[1] & 0xff) << 8));
18
386
}
19
20
static inline uint16_t isonum_722(const unsigned char *p)
21
386
{
22
386
  return ((p[1] & 0xff)
23
386
    | ((p[0] & 0xff) << 8));
24
386
}
25
26
static inline uint16_t isonum_723(const unsigned char *p, bool check_match)
27
386
{
28
386
  uint16_t le = isonum_721(p);
29
386
  uint16_t be = isonum_722(p + 2);
30
31
386
  if (check_match && le != be)
32
    /* translation is useless */
33
0
    warnx("723error: le=%d be=%d", le, be);
34
386
  return (le);
35
386
}
36
37
static inline uint32_t isonum_731(const unsigned char *p)
38
1.17k
{
39
1.17k
  return ((p[0] & 0xff)
40
1.17k
    | ((p[1] & 0xff) << 8)
41
1.17k
    | ((p[2] & 0xff) << 16)
42
1.17k
    | (((uint32_t) p[3] & 0xff) << 24));
43
1.17k
}
44
45
static inline uint32_t isonum_732(const unsigned char *p)
46
386
{
47
386
  return ((p[3] & 0xff)
48
386
    | ((p[2] & 0xff) << 8)
49
386
    | ((p[1] & 0xff) << 16)
50
386
    | (((uint32_t) p[0] & 0xff) << 24));
51
386
}
52
53
static inline uint32_t isonum_733(const unsigned char *p, bool check_match)
54
386
{
55
386
  uint32_t le = isonum_731(p);
56
386
  uint32_t be = isonum_732(p + 4);
57
58
386
  if (check_match && le != be)
59
    /* translation is useless */
60
0
    warnx("733error: le=%"PRIu32" be=%"PRIu32, le, be);
61
386
  return(le);
62
386
}
63
64
#endif