Coverage Report

Created: 2026-04-28 06:29

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