And fixed const issues and other build errors.
This commit is contained in:
parent
ad209175c1
commit
b6a8d24c3e
|
@ -42,7 +42,7 @@ uint32_t uiControlType(void)
|
|||
|
||||
static uint32_t nextControlID = UINT32_C(0x80000000);
|
||||
|
||||
uint32_t uiRegisterControlType(const char *name, uiControlVtable *vtable, uiControlOSVtable *osVtable, size_t implDataSize)
|
||||
uint32_t uiRegisterControlType(const char *name, const uiControlVtable *vtable, const uiControlOSVtable *osVtable, size_t implDataSize)
|
||||
{
|
||||
struct controlType *ct;
|
||||
|
||||
|
|
|
@ -70,8 +70,8 @@ uiprivPrintfFunc(
|
|||
extern void uiprivReportError(const char *prefix, const char *msg, const char *suffix, bool internal);
|
||||
|
||||
// controls.c
|
||||
extern bool uiprivOSVtableValid(uiControlOSVtable *osVtable, const char *func);
|
||||
extern uiControlOSVtable *uiprivCloneOSVtable(uiControlOSVtable *osVtable);
|
||||
extern bool uiprivOSVtableValid(const uiControlOSVtable *osVtable, const char *func);
|
||||
extern uiControlOSVtable *uiprivCloneOSVtable(const uiControlOSVtable *osVtable);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// 8 june 2019
|
||||
#import "uipriv_darwin.h"
|
||||
|
||||
bool uiprivOSVtableValid(uiControlOSVtable *osVtable, const char *func)
|
||||
bool uiprivOSVtableValid(const uiControlOSVtable *osVtable, const char *func)
|
||||
{
|
||||
if (osVtable->Size != sizeof (uiControlOSVtable)) {
|
||||
uiprivProgrammerErrorWrongStructSize(osVtable->Size, "uiControlOSVtable", func);
|
||||
|
@ -10,7 +10,7 @@ bool uiprivOSVtableValid(uiControlOSVtable *osVtable, const char *func)
|
|||
return true;
|
||||
}
|
||||
|
||||
uiControlOSVtable *uiprivCloneOSVtable(uiControlOSVtable *osVtable)
|
||||
uiControlOSVtable *uiprivCloneOSVtable(const uiControlOSVtable *osVtable)
|
||||
{
|
||||
uiControlOSVtable *v2;
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@ static void testVtableFree(uiControl *c, void *implData)
|
|||
// do nothing
|
||||
}
|
||||
|
||||
const uiControlVtable dummyVtable = {
|
||||
Size: sizeof (uiControlVtable),
|
||||
Init: testVtableInit,
|
||||
Free: testVtableFree,
|
||||
const uiControlVtable testVtable = {
|
||||
.Size = sizeof (uiControlVtable),
|
||||
.Init = testVtableInit,
|
||||
.Free = testVtableFree,
|
||||
};
|
||||
|
|
|
@ -23,7 +23,7 @@ static const struct checkErrorCase cases[] = {
|
|||
|
||||
memset(&vtable, 0, sizeof (uiControlVtable));
|
||||
vtable.Size = 1;
|
||||
uiRegisterControlSize("name", &vtable, NULL, 0);
|
||||
uiRegisterControlType("name", &vtable, NULL, 0);
|
||||
},
|
||||
"uiRegisterControlType(): wrong size 1 for uiControlVtable",
|
||||
},
|
||||
|
|
2
ui.h
2
ui.h
|
@ -75,7 +75,7 @@ struct uiControlVtable {
|
|||
void (*Free)(uiControl *c, void *implData);
|
||||
};
|
||||
|
||||
uiprivExtern uint32_t uiRegisterControlType(const char *nane, uiControlVtable *vtable, uiControlOSVtable *osVtable, size_t implDataSize);
|
||||
uiprivExtern uint32_t uiRegisterControlType(const char *nane, const uiControlVtable *vtable, const uiControlOSVtable *osVtable, size_t implDataSize);
|
||||
uiprivExtern void *uiCheckControlType(void *c, uint32_t type);
|
||||
|
||||
uiprivExtern uiControl *uiNewControl(uint32_t type, void *initData);
|
||||
|
|
Loading…
Reference in New Issue