@@ -488,7 +488,7 @@ typedef struct w64wrapper {
488488 #elif defined(WOLFSSL_TELIT_M2MB)
489489 /* Telit M2MB SDK requires use m2mb_os API's, not std malloc/free */
490490 /* Use of malloc/free will cause CPU reboot */
491- #define XMALLOC (s, h, t ) ((void )h , (void )t , m2mb_os_malloc((s)))
491+ #define XMALLOC (s, h, t ) ((void )(h) , (void )(t) , m2mb_os_malloc((s)))
492492 #ifdef WOLFSSL_XFREE_NO_NULLNESS_CHECK
493493 #define XFREE (p, h, t ) m2mb_os_free(xp)
494494 #else
@@ -505,25 +505,25 @@ typedef struct w64wrapper {
505505 fprintf (stderr, " wolfSSL_malloc failed" );
506506 return NULL ;
507507 };
508- #define XMALLOC (s, h, t ) malloc_check((s))
509- #define XFREE (p, h, t ) WC_DO_NOTHING
510- #define XREALLOC (p, n, h, t ) (NULL )
508+ #define XMALLOC (s, h, t ) (( void )(h), ( void )(t), malloc_check((s) ))
509+ #define XFREE (p, h, t ) ( void )(h); ( void )(t)
510+ #define XREALLOC (p, n, h, t ) (( void )(h), ( void )(t), NULL )
511511 #else
512- #define XMALLOC (s, h, t ) (NULL )
513- #define XFREE (p, h, t ) WC_DO_NOTHING
514- #define XREALLOC (p, n, h, t ) (NULL )
512+ #define XMALLOC (s, h, t ) (( void )(s), ( void )(h), ( void )(t), NULL )
513+ #define XFREE (p, h, t ) ( void )(p); ( void )(h); ( void )(t)
514+ #define XREALLOC (p, n, h, t ) (( void )(p), ( void )(n), ( void )(h), ( void )(t), NULL )
515515 #endif
516516 #else
517- /* just use plain C stdlib stuff if desired */
518- #include < stdlib.h>
519- #define XMALLOC (s, h, t ) ((void )(h), (void )(t), malloc((size_t )(s)))
520- #ifdef WOLFSSL_XFREE_NO_NULLNESS_CHECK
521- #define XFREE (p, h, t ) ((void )(h), (void )(t), free(p))
522- #else
523- #define XFREE (p, h, t ) {void * xp = (p); if (xp) free (xp);}
524- #endif
525- #define XREALLOC (p, n, h, t ) \
526- ((void )(h), (void )(t), realloc((p), (size_t )(n)))
517+ /* just use plain C stdlib stuff if desired */
518+ #include < stdlib.h>
519+ #define XMALLOC (s, h, t ) ((void )(h), (void )(t), malloc((size_t )(s)))
520+ #ifdef WOLFSSL_XFREE_NO_NULLNESS_CHECK
521+ #define XFREE (p, h, t ) ((void )(h), (void )(t), free(p))
522+ #else
523+ #define XFREE (p, h, t ) {void * xp = (p); ( void )(h ); if (xp) free (xp);}
524+ #endif
525+ #define XREALLOC (p, n, h, t ) \
526+ ((void )(h), (void )(t), realloc((p), (size_t )(n)))
527527 #endif
528528
529529 #elif defined(WOLFSSL_LINUXKM)
@@ -560,19 +560,19 @@ typedef struct w64wrapper {
560560 #ifdef WOLFSSL_DEBUG_MEMORY
561561 #define XMALLOC (s, h, t ) ((void )(h), (void )(t), wolfSSL_Malloc((s), __func__, __LINE__))
562562 #ifdef WOLFSSL_XFREE_NO_NULLNESS_CHECK
563- #define XFREE (p, h, t ) wolfSSL_Free(xp, __func__, __LINE__)
563+ #define XFREE (p, h, t ) (( void )(h), ( void )(t), wolfSSL_Free(xp, __func__, __LINE__) )
564564 #else
565- #define XFREE (p, h, t ) {void * xp = (p); if (xp) wolfSSL_Free (xp, __func__, __LINE__);}
565+ #define XFREE (p, h, t ) {void * xp = (p); ( void )(h); ( void )(t); if (xp) wolfSSL_Free (xp, __func__, __LINE__);}
566566 #endif
567- #define XREALLOC (p, n, h, t ) wolfSSL_Realloc((p), (n), __func__, __LINE__)
567+ #define XREALLOC (p, n, h, t ) (( void )(h), ( void )(t), wolfSSL_Realloc((p), (n), __func__, __LINE__) )
568568 #else
569569 #define XMALLOC (s, h, t ) ((void )(h), (void )(t), wolfSSL_Malloc((s)))
570570 #ifdef WOLFSSL_XFREE_NO_NULLNESS_CHECK
571- #define XFREE (p, h, t ) wolfSSL_Free(p)
571+ #define XFREE (p, h, t ) (( void )(h), ( void )(t), wolfSSL_Free(p) )
572572 #else
573- #define XFREE (p, h, t ) {void * xp = (p); if (xp) wolfSSL_Free (xp);}
573+ #define XFREE (p, h, t ) {void * xp = (p); ( void )(h); ( void )(t); if (xp) wolfSSL_Free (xp);}
574574 #endif
575- #define XREALLOC (p, n, h, t ) wolfSSL_Realloc((p), (n))
575+ #define XREALLOC (p, n, h, t ) (( void )(h), ( void )(t), wolfSSL_Realloc((p), (n) ))
576576 #endif /* WOLFSSL_DEBUG_MEMORY */
577577 #endif /* WOLFSSL_STATIC_MEMORY */
578578 #endif
0 commit comments