| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
type_util.h
Go to the documentation of this file.
1
11#ifndef __TYPE_UTIL_H__
12#define __TYPE_UTIL_H__
13
14#include <inttypes.h>
15#include "ws_symbol_export.h"
16
17/*
18 * uint64_t to double conversions taken from gstutils.h of GStreamer project
19 *
20 * GStreamer
21 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
22 * 2000 Wim Taymans <wtay@chello.be>
23 * 2002 Thomas Vander Stichele <thomas@apestaart.org>
24 *
25 * gstutils.h: Header for various utility functions
26 *
27 * GNU GPL v2
28 *
29 */
30
39WS_DLL_PUBLIC
40uint64_t type_util_double_to_uint64(double value);
41
50WS_DLL_PUBLIC
51 double type_util_uint64_to_double(uint64_t value);
52
53#ifdef _WIN32
54#define double_to_uint64(value) type_util_double_to_uint64(value)
55#define uint64_to_double(value) type_util_uint64_to_double(value)
56#else
57#define double_to_uint64(value) ((uint64_t)(value))
58#define uint64_to_double(value) ((double)(value))
59#endif
60
61#endif /* __TYPE_UTIL_H__ */
type_util_double_to_uint64
WS_DLL_PUBLIC uint64_t type_util_double_to_uint64(double value)
Converts a double-precision floating-point value to a 64-bit unsigned integer.
Definition type_util.c:48
type_util_uint64_to_double
WS_DLL_PUBLIC double type_util_uint64_to_double(uint64_t value)
Converts a 64-bit unsigned integer to a double-precision floating-point value.
Definition type_util.c:39