Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
fx_memcpy_wrappers.h
Go to the documentation of this file.
1
// Copyright 2023 The PDFium Authors
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7
#
ifndef
CORE_FXCRT_FX_MEMCPY_WRAPPERS_H_
8
#
define
CORE_FXCRT_FX_MEMCPY_WRAPPERS_H_
9
10
#
include
<
stddef
.
h
>
11
#
include
<
stdint
.
h
>
12
#
include
<
string
.
h
>
13
#
include
<
wchar
.
h
>
14
15
#
include
"core/fxcrt/compiler_specific.h"
16
17
// Wrappers to avoid the zero-length w/NULL arg gotchas in C spec. Use these
18
// if there is a possibility of a NULL arg (or a bad arg) that is to be ignored
19
// when the length is zero, otherwise just call the C Run Time Library function
20
// itself.
21
UNSAFE_BUFFER_USAGE
inline
int
FXSYS_memcmp
(
const
void
* ptr1,
22
const
void
* ptr2,
23
size_t len) {
24
return
len ? memcmp(ptr1, ptr2, len) : 0;
25
}
26
27
UNSAFE_BUFFER_USAGE
inline
int
FXSYS_wmemcmp
(
const
wchar_t
* ptr1,
28
const
wchar_t
* ptr2,
29
size_t len) {
30
return
len ? wmemcmp(ptr1, ptr2, len) : 0;
31
}
32
33
UNSAFE_BUFFER_USAGE
inline
void
*
FXSYS_memcpy
(
void
* ptr1,
34
const
void
* ptr2,
35
size_t len) {
36
return
len ? memcpy(ptr1, ptr2, len) : ptr1;
37
}
38
39
UNSAFE_BUFFER_USAGE
inline
wchar_t
*
FXSYS_wmemcpy
(
wchar_t
* ptr1,
40
const
wchar_t
* ptr2,
41
size_t len) {
42
return
len ? wmemcpy(ptr1, ptr2, len) : ptr1;
43
}
44
45
UNSAFE_BUFFER_USAGE
inline
void
*
FXSYS_memmove
(
void
* ptr1,
46
const
void
* ptr2,
47
size_t len) {
48
return
len ? memmove(ptr1, ptr2, len) : ptr1;
49
}
50
51
UNSAFE_BUFFER_USAGE
inline
wchar_t
*
FXSYS_wmemmove
(
wchar_t
* ptr1,
52
const
wchar_t
* ptr2,
53
size_t len) {
54
return
len ? wmemmove(ptr1, ptr2, len) : ptr1;
55
}
56
57
UNSAFE_BUFFER_USAGE
inline
void
*
FXSYS_memset
(
void
* ptr1,
int
val, size_t len) {
58
return
len ? memset(ptr1, val, len) : ptr1;
59
}
60
61
UNSAFE_BUFFER_USAGE
inline
wchar_t
*
FXSYS_wmemset
(
wchar_t
* ptr1,
62
int
val,
63
size_t len) {
64
return
len ? wmemset(ptr1, val, len) : ptr1;
65
}
66
67
UNSAFE_BUFFER_USAGE
inline
const
void
*
FXSYS_memchr
(
const
void
* ptr1,
68
int
val,
69
size_t len) {
70
return
len ? memchr(ptr1, val, len) :
nullptr
;
71
}
72
73
UNSAFE_BUFFER_USAGE
inline
const
wchar_t
*
FXSYS_wmemchr
(
const
wchar_t
* ptr1,
74
wchar_t
val,
75
size_t len) {
76
return
len ? wmemchr(ptr1, val, len) :
nullptr
;
77
}
78
79
#
endif
// CORE_FXCRT_FX_MEMCPY_WRAPPERS_H_
DCHECK
#define DCHECK
Definition
check.h:33
CHECK_EQ
#define CHECK_EQ(x, y)
Definition
check_op.h:10
pdfium::CFDETextOutLargeBitmapTest
Definition
cfde_textout_unittest.cpp:117
UNSAFE_BUFFER_USAGE
#define UNSAFE_BUFFER_USAGE
Definition
compiler_specific.h:83
UNSAFE_TODO
#define UNSAFE_TODO(...)
Definition
compiler_specific.h:102
CRYPT_AESEncrypt
void CRYPT_AESEncrypt(CRYPT_aes_context *ctx, pdfium::span< uint8_t > dest, pdfium::span< const uint8_t > src)
Definition
fx_crypt_aes.cpp:624
MOVEWORD
#define MOVEWORD(i)
Definition
fx_crypt_aes.cpp:437
LASTWORD
#define LASTWORD(i)
Definition
fx_crypt_aes.cpp:443
FMAKEWORD
#define FMAKEWORD(i)
Definition
fx_crypt_aes.cpp:438
CRYPT_AESSetIV
void CRYPT_AESSetIV(CRYPT_aes_context *ctx, const uint8_t *iv)
Definition
fx_crypt_aes.cpp:586
ADD_ROUND_KEY_4
#define ADD_ROUND_KEY_4()
Definition
fx_crypt_aes.cpp:434
CRYPT_AESDecrypt
void CRYPT_AESDecrypt(CRYPT_aes_context *ctx, uint8_t *dest, const uint8_t *src, uint32_t size)
Definition
fx_crypt_aes.cpp:594
mulby2
#define mulby2(x)
Definition
fx_crypt_aes.cpp:15
CRYPT_AESSetKey
void CRYPT_AESSetKey(CRYPT_aes_context *ctx, const uint8_t *key, uint32_t keylen)
Definition
fx_crypt_aes.cpp:530
FXSYS_wmemcpy
UNSAFE_BUFFER_USAGE wchar_t * FXSYS_wmemcpy(wchar_t *ptr1, const wchar_t *ptr2, size_t len)
Definition
fx_memcpy_wrappers.h:39
FXSYS_wmemchr
UNSAFE_BUFFER_USAGE const wchar_t * FXSYS_wmemchr(const wchar_t *ptr1, wchar_t val, size_t len)
Definition
fx_memcpy_wrappers.h:73
FXSYS_memset
UNSAFE_BUFFER_USAGE void * FXSYS_memset(void *ptr1, int val, size_t len)
Definition
fx_memcpy_wrappers.h:57
FXSYS_memcmp
UNSAFE_BUFFER_USAGE int FXSYS_memcmp(const void *ptr1, const void *ptr2, size_t len)
Definition
fx_memcpy_wrappers.h:21
FXSYS_wmemcmp
UNSAFE_BUFFER_USAGE int FXSYS_wmemcmp(const wchar_t *ptr1, const wchar_t *ptr2, size_t len)
Definition
fx_memcpy_wrappers.h:27
FXSYS_memmove
UNSAFE_BUFFER_USAGE void * FXSYS_memmove(void *ptr1, const void *ptr2, size_t len)
Definition
fx_memcpy_wrappers.h:45
FXSYS_wmemset
UNSAFE_BUFFER_USAGE wchar_t * FXSYS_wmemset(wchar_t *ptr1, int val, size_t len)
Definition
fx_memcpy_wrappers.h:61
FXSYS_memcpy
UNSAFE_BUFFER_USAGE void * FXSYS_memcpy(void *ptr1, const void *ptr2, size_t len)
Definition
fx_memcpy_wrappers.h:33
FXSYS_wmemmove
UNSAFE_BUFFER_USAGE wchar_t * FXSYS_wmemmove(wchar_t *ptr1, const wchar_t *ptr2, size_t len)
Definition
fx_memcpy_wrappers.h:51
FXSYS_memchr
UNSAFE_BUFFER_USAGE const void * FXSYS_memchr(const void *ptr1, int val, size_t len)
Definition
fx_memcpy_wrappers.h:67
fxcrt
Definition
stl_util.h:17
fxcrt::PutUInt32MSBFirst
void PutUInt32MSBFirst(uint32_t value, pdfium::span< uint8_t, 4 > span)
Definition
byteorder.h:116
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
CRYPT_aes_context
Definition
fx_crypt_aes.h:16
CRYPT_aes_context::Nb
int Nb
Definition
fx_crypt_aes.h:21
CRYPT_aes_context::Nr
int Nr
Definition
fx_crypt_aes.h:22
qtwebengine
src
3rdparty
chromium
third_party
pdfium
core
fxcrt
fx_memcpy_wrappers.h
Generated on
for Qt by
1.18.0