(SYNC) Synchronisation with local latest modifications.

This commit is contained in:
William
2024-06-24 22:34:47 +08:00
parent 95a49ebefa
commit 69d827c38e
18 changed files with 607 additions and 407 deletions

View File

@@ -2,7 +2,7 @@
Status Var_Create(Var *inst, size_t size)
{
fails(inst, apply(UnavailableInstance));
nonull(inst, apply(UnavailableInstance));
state(inst->alive, apply(InstanceStillAlive));
state(!size,
apply(normal(NormalStatus, "Exited with given parameter size as ZERO.")));
@@ -17,9 +17,9 @@ Status Var_Create(Var *inst, size_t size)
// Status Var_Create(Var *inst, void *addr, size_t size, char *identity)
// {
// /* Skip when inst is unavailable. */
// fails(inst, apply(UnavailableInstance));
// nonull(inst, apply(UnavailableInstance));
// /* Skip when identity is unavailable. */
// fails(identity, NullPointerAccounted);
// nonull(identity, NullPointerAccounted);
// /* Skip when identity does not pass the examine. */
// state(!VarUtils_IsIdentityLegal(identity), IllegalVarIdentity);
@@ -33,9 +33,9 @@ Status Var_Create(Var *inst, size_t size)
Status Var_CopyOf(Var *inst, Var *other)
{
/* Skip when inst or other is unavailable. */
fails(inst, apply(UnavailableInstance));
nonull(inst, apply(UnavailableInstance));
state(inst->alive, apply(InstanceStillAlive));
fails(other, apply(InvalidParameter));
nonull(other, apply(InvalidParameter));
/* Copy members from other. Only has to apply size, no addr is needed. */
state(!((inst->addr = malloc(other->size))), apply(InsufficientMemory));