Coverage Report

Created: 2026-10-28 07:07

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
522
{
16
522
  return ((p[0] & 0xff)
17
522
    | ((p[1] & 0xff) << 8));
18
522
}
19
20
static inline uint16_t isonum_722(const unsigned char *p)
21
522
{
22
522
  return ((p[1] & 0xff)
23
522
    | ((p[0] & 0xff) << 8));
24
522
}
25
26
static inline uint16_t isonum_723(const unsigned char *p, bool check_match)
27
522
{
28
522
  uint16_t le = isonum_721(p);
29
522
  uint16_t be = isonum_722(p + 2);
30
31
522
  if (check_match && le != be)
32
    /* translation is useless */
33
0
    warnx("723error: le=%d be=%d", le, be);
34
522
  return (le);
35
522
}
36
37
static inline uint32_t isonum_731(const unsigned char *p)
38
1.57k
{
39
1.57k
  return ((p[0] & 0xff)
40
1.57k
    | ((p[1] & 0xff) << 8)
41
1.57k
    | ((p[2] & 0xff) << 16)
42
1.57k
    | (((uint32_t) p[3] & 0xff) << 24));
43
1.57k
}
44
45
static inline uint32_t isonum_732(const unsigned char *p)
46
522
{
47
522
  return ((p[3] & 0xff)
48
522
    | ((p[2] & 0xff) << 8)
49
522
    | ((p[1] & 0xff) << 16)
50
522
    | (((uint32_t) p[0] & 0xff) << 24));
51
522
}
52
53
static inline uint32_t isonum_733(const unsigned char *p, bool check_match)
54
522
{
55
522
  uint32_t le = isonum_731(p);
56
522
  uint32_t be = isonum_732(p + 4);
57
58
522
  if (check_match && le != be)
59
    /* translation is useless */
60
0
    warnx("733error: le=%"PRIu32" be=%"PRIu32, le, be);
61
522
  return(le);
62
522
}
63
64
#endif