]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - apps/tidep0084.git/blob - components/common/inc/void_ptr.h
Updated to use the latest TI 15.4-Stack v2.1.0 from the SimpleLink CC13x0 SDK v1.30.
[apps/tidep0084.git] / components / common / inc / void_ptr.h
1 /******************************************************************************
2  @file void_ptr.h
4  @brief TIMAC 2.0 API Compiler macros to handle void pointers
6  Group: WCS LPC
7  $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350$
9  ******************************************************************************
10  $License: BSD3 2016 $
11   
12    Copyright (c) 2015, Texas Instruments Incorporated
13    All rights reserved.
14   
15    Redistribution and use in source and binary forms, with or without
16    modification, are permitted provided that the following conditions
17    are met:
18   
19    *  Redistributions of source code must retain the above copyright
20       notice, this list of conditions and the following disclaimer.
21   
22    *  Redistributions in binary form must reproduce the above copyright
23       notice, this list of conditions and the following disclaimer in the
24       documentation and/or other materials provided with the distribution.
25   
26    *  Neither the name of Texas Instruments Incorporated nor the names of
27       its contributors may be used to endorse or promote products derived
28       from this software without specific prior written permission.
29   
30    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
31    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
32    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
33    PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
34    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
35    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
36    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
37    OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
38    WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
39    OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
40    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41  ******************************************************************************
42  $Release Name: TI-15.4Stack Linux x64 SDK ENG$
43  $Release Date: Mar 08, 2017 (2.01.00.10)$
44  *****************************************************************************/
46 #if !defined(VOID_PTR_H)
47 #define VOID_PTR_H
49 /*!
50  *
51  * OVERVIEW
52  * ========
53  *
54  * Some compilers complain when code performs "void pointer math"
55  * Other compilers treat a void pointer as a "uint8_t" byte pointer.
56  *
57  * These macros help elimiinate compiler warning noise.
58  */
60 /*!
61  * @def c_void_ptr_add() add a constant to a 'const' void pointer.
62  *
63  * @param VP - the void pointer
64  * @param N  - number (of bytes) to add to the void pointer
65  * @return A new void pointer
66  */
67 #define c_void_ptr_add(VP, N)   ((const void *)(((const char *)(VP))+(N)))
69 /*!
70  * @def void_ptr_add() add a constant to a 'non-const' void pointer.
71  *
72  * @param VP - the void pointer
73  * @param N  - number (of bytes) to add to the void pointer
74  * @return A new void pointer
75  */
76 #define void_ptr_add(VP, N)     ((void *)(((char *)(VP))+(N)))
78 #endif
80 /*
81  *  ========================================
82  *  Texas Instruments Micro Controller Style
83  *  ========================================
84  *  Local Variables:
85  *  mode: c
86  *  c-file-style: "bsd"
87  *  tab-width: 4
88  *  c-basic-offset: 4
89  *  indent-tabs-mode: nil
90  *  End:
91  *  vim:set  filetype=c tabstop=4 shiftwidth=4 expandtab=true
92  */