< prev index next >

src/java.desktop/share/native/libfreetype/include/freetype/internal/ftmemory.h

Print this page

        

*** 1,21 **** ! /***************************************************************************/ ! /* */ ! /* ftmemory.h */ ! /* */ ! /* The FreeType memory management macros (specification). */ ! /* */ ! /* Copyright 1996-2018 by */ ! /* David Turner, Robert Wilhelm, and Werner Lemberg */ ! /* */ ! /* This file is part of the FreeType project, and may only be used, */ ! /* modified, and distributed under the terms of the FreeType project */ ! /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ ! /* this file you indicate that you have read the license and */ ! /* understand and accept it fully. */ ! /* */ ! /***************************************************************************/ #ifndef FTMEMORY_H_ #define FTMEMORY_H_ --- 1,21 ---- ! /**************************************************************************** ! * ! * ftmemory.h ! * ! * The FreeType memory management macros (specification). ! * ! * Copyright (C) 1996-2019 by ! * David Turner, Robert Wilhelm, and Werner Lemberg ! * ! * This file is part of the FreeType project, and may only be used, ! * modified, and distributed under the terms of the FreeType project ! * license, LICENSE.TXT. By continuing to use, modify, or distribute ! * this file you indicate that you have read the license and ! * understand and accept it fully. ! * ! */ #ifndef FTMEMORY_H_ #define FTMEMORY_H_
*** 26,45 **** FT_BEGIN_HEADER ! /*************************************************************************/ ! /* */ ! /* <Macro> */ ! /* FT_SET_ERROR */ ! /* */ ! /* <Description> */ ! /* This macro is used to set an implicit `error' variable to a given */ ! /* expression's value (usually a function call), and convert it to a */ ! /* boolean which is set whenever the value is != 0. */ ! /* */ #undef FT_SET_ERROR #define FT_SET_ERROR( expression ) \ ( ( error = (expression) ) != 0 ) --- 26,45 ---- FT_BEGIN_HEADER ! /************************************************************************** ! * ! * @macro: ! * FT_SET_ERROR ! * ! * @description: ! * This macro is used to set an implicit 'error' variable to a given ! * expression's value (usually a function call), and convert it to a ! * boolean which is set whenever the value is != 0. ! */ #undef FT_SET_ERROR #define FT_SET_ERROR( expression ) \ ( ( error = (expression) ) != 0 )
*** 57,68 **** /*************************************************************************/ /* * C++ refuses to handle statements like p = (void*)anything, with `p' a ! * typed pointer. Since we don't have a `typeof' operator in standard ! * C++, we have to use a template to emulate it. */ #ifdef __cplusplus extern "C++" --- 57,68 ---- /*************************************************************************/ /* * C++ refuses to handle statements like p = (void*)anything, with `p' a ! * typed pointer. Since we don't have a `typeof' operator in standard C++, ! * we have to use a template to emulate it. */ #ifdef __cplusplus extern "C++"
*** 105,116 **** #endif /* !FT_DEBUG_MEMORY */ /* ! * The allocation functions return a pointer, and the error code ! * is written to through the `p_error' parameter. */ /* The `q' variants of the functions below (`q' for `quick') don't fill */ /* the allocated or reallocated memory with zero bytes. */ --- 105,116 ---- #endif /* !FT_DEBUG_MEMORY */ /* ! * The allocation functions return a pointer, and the error code is written ! * to through the `p_error' parameter. */ /* The `q' variants of the functions below (`q' for `quick') don't fill */ /* the allocated or reallocated memory with zero bytes. */
*** 251,274 **** source, \ (FT_Offset)(count) * sizeof ( *(dest) ) ) /* ! * Return the maximum number of addressable elements in an array. ! * We limit ourselves to INT_MAX, rather than UINT_MAX, to avoid ! * any problems. */ #define FT_ARRAY_MAX( ptr ) ( FT_INT_MAX / sizeof ( *(ptr) ) ) #define FT_ARRAY_CHECK( ptr, count ) ( (count) <= FT_ARRAY_MAX( ptr ) ) ! /*************************************************************************/ ! /* */ ! /* The following functions macros expect that their pointer argument is */ ! /* _typed_ in order to automatically compute array element sizes. */ ! /* */ #define FT_MEM_NEW_ARRAY( ptr, count ) \ FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \ sizeof ( *(ptr) ), \ 0, \ --- 251,273 ---- source, \ (FT_Offset)(count) * sizeof ( *(dest) ) ) /* ! * Return the maximum number of addressable elements in an array. We limit ! * ourselves to INT_MAX, rather than UINT_MAX, to avoid any problems. */ #define FT_ARRAY_MAX( ptr ) ( FT_INT_MAX / sizeof ( *(ptr) ) ) #define FT_ARRAY_CHECK( ptr, count ) ( (count) <= FT_ARRAY_MAX( ptr ) ) ! /************************************************************************** ! * ! * The following functions macros expect that their pointer argument is ! * _typed_ in order to automatically compute array element sizes. ! */ #define FT_MEM_NEW_ARRAY( ptr, count ) \ FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \ sizeof ( *(ptr) ), \ 0, \
< prev index next >