aboutsummaryrefslogtreecommitdiff
path: root/src/common/container.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-09-30 01:09:52 +0000
committerNick Mathewson <nickm@torproject.org>2005-09-30 01:09:52 +0000
commit92451f74a8fd50bbd2f360526263a4913d145677 (patch)
tree0fd53e000abac269d11ca5bb7c13ae7a14d997bc /src/common/container.c
parent6ce1add8da1de0c814b4f10f99e7c1f89736ed90 (diff)
downloadtor-92451f74a8fd50bbd2f360526263a4913d145677.tar
tor-92451f74a8fd50bbd2f360526263a4913d145677.tar.gz
Reformat inconsistent function declarations.
svn:r5160
Diffstat (limited to 'src/common/container.c')
-rw-r--r--src/common/container.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/common/container.c b/src/common/container.c
index c9e1d63dc..436c4bc01 100644
--- a/src/common/container.c
+++ b/src/common/container.c
@@ -43,7 +43,8 @@ struct smartlist_t {
/** Allocate and return an empty smartlist.
*/
smartlist_t *
-smartlist_create(void) {
+smartlist_create(void)
+{
smartlist_t *sl = tor_malloc(sizeof(smartlist_t));
sl->num_used = 0;
sl->capacity = SMARTLIST_DEFAULT_CAPACITY;
@@ -55,7 +56,8 @@ smartlist_create(void) {
* list's elements.
*/
void
-smartlist_free(smartlist_t *sl) {
+smartlist_free(smartlist_t *sl)
+{
free(sl->list);
free(sl);
}
@@ -66,7 +68,9 @@ smartlist_free(smartlist_t *sl) {
* currently in the list, reduce the list's capacity as much as
* possible without losing elements.
*/
-void smartlist_set_capacity(smartlist_t *sl, int n) {
+void
+smartlist_set_capacity(smartlist_t *sl, int n)
+{
if (n < sl->num_used)
n = sl->num_used;
if (sl->capacity != n) {
@@ -78,7 +82,8 @@ void smartlist_set_capacity(smartlist_t *sl, int n) {
/** Remove all elements from the list.
*/
void
-smartlist_clear(smartlist_t *sl) {
+smartlist_clear(smartlist_t *sl)
+{
sl->num_used = 0;
}
@@ -95,7 +100,8 @@ smartlist_truncate(smartlist_t *sl, int len)
/** Append element to the end of the list. */
void
-smartlist_add(smartlist_t *sl, void *element) {
+smartlist_add(smartlist_t *sl, void *element)
+{
if (sl->num_used >= sl->capacity) {
int higher = sl->capacity * 2;
tor_assert(higher > sl->capacity); /* detect overflow */