Coverage Report

Created: 2026-04-11 06:28

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