History

Use void instead of void_t

There's really no reason for adding a typedef for void.

Martin Storsjö committed 12 years ago

Commit 7b96c671 parent 2b77fe755 files · +400 −404Browse files

Showing the changes to codec/decoder/core/src/mem_align.cpp (1 of 55 files). Show all

Unified · Split

codec/decoder/core/src/mem_align.cpp+7−7
@@ -44,8 +44,8 @@ int32_t iCountMalloc = 0; · 43 unmodified lines
44#endif44#endif
45//45//
46 46
47void_t* WelsMalloc (const uint32_t kuiSize, const str_t* kpTag) {47void* WelsMalloc (const uint32_t kuiSize, const str_t* kpTag) {
48 const int32_t kiSizeVoidPtr = sizeof (void_t**);48 const int32_t kiSizeVoidPtr = sizeof (void**);
49 const int32_t kiSizeInt = sizeof (int32_t);49 const int32_t kiSizeInt = sizeof (int32_t);
50 const int32_t kiAlignBytes = 15;50 const int32_t kiAlignBytes = 15;
51 uint8_t* pBuf = (uint8_t*) malloc (kuiSize + kiAlignBytes + kiSizeVoidPtr + kiSizeInt);51 uint8_t* pBuf = (uint8_t*) malloc (kuiSize + kiAlignBytes + kiSizeVoidPtr + kiSizeInt);
@@ -59,7 +59,7 @@ void_t* WelsMalloc (const uint32_t kuiSize, const str_t* kpTag) { · 7 unmodified lines
59 59
60 if (kpTag != NULL) {60 if (kpTag != NULL) {
61 if (pMemCheckMalloc != NULL) {61 if (pMemCheckMalloc != NULL) {
62 fprintf (pMemCheckMalloc, "0x%x, size: %d , malloc %s\n", (void_t*)pBuf,62 fprintf (pMemCheckMalloc, "0x%x, size: %d , malloc %s\n", (void*)pBuf,
63 (kuiSize + kiAlignBytes + kiSizeVoidPtr + kiSizeInt), kpTag);63 (kuiSize + kiAlignBytes + kiSizeVoidPtr + kiSizeInt), kpTag);
64 }64 }
65 if (pMemCheckMalloc != NULL) {65 if (pMemCheckMalloc != NULL) {
@@ -76,7 +76,7 @@ void_t* WelsMalloc (const uint32_t kuiSize, const str_t* kpTag) { · 10 unmodified lines
76 76
77 pAlignBuf = pBuf + kiAlignBytes + kiSizeVoidPtr + kiSizeInt;77 pAlignBuf = pBuf + kiAlignBytes + kiSizeVoidPtr + kiSizeInt;
78 pAlignBuf -= (uintptr_t) pAlignBuf & kiAlignBytes;78 pAlignBuf -= (uintptr_t) pAlignBuf & kiAlignBytes;
79 * ((void_t**) (pAlignBuf - kiSizeVoidPtr)) = pBuf;79 * ((void**) (pAlignBuf - kiSizeVoidPtr)) = pBuf;
80 * ((int32_t*) (pAlignBuf - (kiSizeVoidPtr + kiSizeInt))) = kuiSize;80 * ((int32_t*) (pAlignBuf - (kiSizeVoidPtr + kiSizeInt))) = kuiSize;
81 81
82 return (pAlignBuf);82 return (pAlignBuf);
@@ -84,15 +84,15 @@ void_t* WelsMalloc (const uint32_t kuiSize, const str_t* kpTag) { · 1 unmodified line
84 84
85/////////////////////////////////////////////////////////////////////////////85/////////////////////////////////////////////////////////////////////////////
86 86
87void_t WelsFree (void_t* pPtr, const str_t* kpTag) {87void WelsFree (void* pPtr, const str_t* kpTag) {
88 if (pPtr) {88 if (pPtr) {
89#ifdef MEMORY_CHECK89#ifdef MEMORY_CHECK
90 if (NULL != pMemCheckFree && kpTag != NULL) {90 if (NULL != pMemCheckFree && kpTag != NULL) {
91 fprintf (pMemCheckFree, "0x%x, free %s\n", (void_t*) (* (((void_t**) pPtr) - 1)), kpTag);91 fprintf (pMemCheckFree, "0x%x, free %s\n", (void*) (* (((void**) pPtr) - 1)), kpTag);
92 fflush (pMemCheckFree);92 fflush (pMemCheckFree);
93 }93 }
94#endif94#endif
95 free (* (((void_t**) pPtr) - 1));95 free (* (((void**) pPtr) - 1));
96 }96 }
97}97}
98 98

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t