Started FINALLY renaming uiAlloc(), uiNew(), uiRealloc(), and uiFree() into uipriv* forms. This handles the common folder.

This commit is contained in:
Pietro Gagliardi 2018-04-15 15:53:27 -04:00
parent 4a57b15d09
commit 72e8b9a198
5 changed files with 7 additions and 18 deletions

View File

@ -1,9 +1,4 @@
extern void *uiAlloc(size_t, const char *);
#define uiNew(T) ((T *) uiAlloc(sizeof (T), #T))
extern void *uiRealloc(void *, size_t, const char *);
extern void uiFree(void *);
// ugh, this was only introduced in MSVC 2015...
#ifdef _MSC_VER
#define __func__ __FUNCTION__

View File

@ -85,7 +85,7 @@ uiAttribute *uiNewFamilyAttribute(const char *family)
uiAttribute *a;
a = newAttribute(uiAttributeTypeFamily);
a->u.family = (char *) uiAlloc((strlen(family) + 1) * sizeof (char), "char[] (uiAttribute)");
a->u.family = (char *) uiprivAlloc((strlen(family) + 1) * sizeof (char), "char[] (uiAttribute)");
strcpy(a->u.family, family);
return a;
}

View File

@ -1,11 +1,5 @@
// 19 february 2018
// TODO remove when done migrating these functions
#define uiprivNew(x) uiNew(x)
#define uiprivAlloc(x, y) uiAlloc(x, y)
#define uiprivRealloc(x, y, z) uiRealloc(x, y, z)
#define uiprivFree(x) uiFree(x)
// attribute.c
extern uiAttribute *uiprivAttributeRetain(uiAttribute *a);
extern void uiprivAttributeRelease(uiAttribute *a);

View File

@ -63,7 +63,7 @@ uiControl *uiAllocControl(size_t size, uint32_t OSsig, uint32_t typesig, const c
{
uiControl *c;
c = (uiControl *) uiAlloc(size, typenamestr);
c = (uiControl *) uiprivAlloc(size, typenamestr);
c->Signature = uiControlSignature;
c->OSSignature = OSsig;
c->TypeSignature = typesig;
@ -74,7 +74,7 @@ void uiFreeControl(uiControl *c)
{
if (uiControlParent(c) != NULL)
userbug("You cannot destroy a uiControl while it still has a parent. (control: %p)", c);
uiFree(c);
uiprivFree(c);
}
void uiControlVerifySetParent(uiControl *c, uiControl *parent)

View File

@ -10,10 +10,10 @@ extern "C" {
extern uiInitOptions uiprivOptions;
extern void *uiAlloc(size_t, const char *);
#define uiNew(T) ((T *) uiAlloc(sizeof (T), #T))
extern void *uiRealloc(void *, size_t, const char *);
extern void uiFree(void *);
extern void *uiprivAlloc(size_t, const char *);
#define uiprivNew(T) ((T *) uiprivAlloc(sizeof (T), #T))
extern void *uiprivRealloc(void *, size_t, const char *);
extern void uiprivFree(void *);
// ugh, this was only introduced in MSVC 2015...
#ifdef _MSC_VER