open62541 1.4.15
Open source implementation of OPC UA
Loading...
Searching...
No Matches
padding.h
Go to the documentation of this file.
1/** This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
4 *
5 * Copyright 2020 (c) Matthias Konnerth
6 */
7
8#ifndef PADDING_H
9#define PADDING_H
10
11#include <assert.h>
12
13static inline UA_Byte getPadding(int alignment, int offset)
14{
15 assert(alignment != 0);
16 return (UA_Byte)((alignment - (offset % alignment)) % alignment);
17}
18
19#endif
uint8_t UA_Byte
Definition types.h:37