Skip to content

Commit

Permalink
Modify: Fix indentation for Stack.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Shen committed Jan 5, 2019
1 parent 4aed44f commit 8001ce2
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ static const unsigned DEFAULT_CAPACITY = 32;
/*===========================================================================*
* Implementation for the exported operations *
*===========================================================================*/
Stack* StackInit()
{
Stack* StackInit() {

Stack* obj = (Stack*)malloc(sizeof(Stack));
if (unlikely(!obj))
return NULL;
Expand Down Expand Up @@ -82,8 +82,8 @@ Stack* StackInit()
return obj;
}

void StackDeinit(Stack* obj)
{
void StackDeinit(Stack* obj) {

if (unlikely(!obj))
return;

Expand All @@ -104,8 +104,8 @@ void StackDeinit(Stack* obj)
return;
}

bool StackPush(Stack *self, void* element)
{
bool StackPush(Stack *self, void* element) {

StackData* data = self->data;
void** elements = data->elements_;
unsigned size = data->size_;
Expand All @@ -128,8 +128,8 @@ bool StackPush(Stack *self, void* element)
return true;
}

bool StackPop(Stack *self)
{
bool StackPop(Stack *self) {

StackData* data = self->data;
void** elements = data->elements_;
unsigned size = data->size_;
Expand All @@ -146,8 +146,8 @@ bool StackPop(Stack *self)
return true;
}

bool StackTop(Stack *self, void** p_elements)
{
bool StackTop(Stack *self, void** p_elements) {

StackData* data = self->data;
void** elements = data->elements_;
unsigned size = data->size_;
Expand All @@ -158,12 +158,10 @@ bool StackTop(Stack *self, void** p_elements)
return true;
}

unsigned StackSize(Stack *self)
{
unsigned StackSize(Stack *self) {
return self->data->size_;
}

void StackSetClean(Stack* self, StackClean func)
{
void StackSetClean(Stack* self, StackClean func) {
self->data->func_clean_ = func;
}

0 comments on commit 8001ce2

Please sign in to comment.