aboutsummaryrefslogtreecommitdiff
path: root/stack.c
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2014-06-20 14:24:18 +0000
committerDimitri Sokolyuk <demon@dim13.org>2014-06-20 14:24:18 +0000
commit4f48a490f9af51f22946af72d908777af1c1f148 (patch)
tree4b59268e161ed032aca4ba88222568017e442e0d /stack.c
parentc8d16a1660532531343da62074d7e22a8c0ba91a (diff)
indent
Diffstat (limited to 'stack.c')
-rw-r--r--stack.c48
1 files changed, 22 insertions, 26 deletions
diff --git a/stack.c b/stack.c
index 254283a..fe15590 100644
--- a/stack.c
+++ b/stack.c
@@ -15,48 +15,44 @@
static int stack[MAX_ELEMENTS];
static int index;
-void stackInit( void )
+void
+stackInit(void)
{
- index = 0;
-
- return;
+ index = 0;
}
-
-int stackNumElems( void )
+int
+stackNumElems(void)
{
- return index;
+ return index;
}
-
-unsigned int stackTop( void )
+unsigned int
+stackTop(void)
{
- assert( index > 0 );
+ assert(index > 0);
- return (stack[index-1]);
+ return (stack[index - 1]);
}
-
-void stackPush( unsigned int value )
+void
+stackPush(unsigned int value)
{
- assert ( index < MAX_ELEMENTS );
+ assert(index < MAX_ELEMENTS);
- stack[index] = value;
- index++;
-
- return;
+ stack[index] = value;
+ index++;
}
-
-unsigned int stackPop( void )
+unsigned int
+stackPop(void)
{
- unsigned int value;
+ unsigned int value;
- assert( index > 0 );
+ assert(index > 0);
- index--;
- value = stack[index];
+ index--;
+ value = stack[index];
- return value;
+ return value;
}
-