summaryrefslogtreecommitdiffstats
path: root/container_of.c
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-01-30 11:18:39 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2013-01-30 11:18:39 +0100
commit0042a0da85c2bd0d321e1e6ec22dfe0330ba6b9b (patch)
treecbf22fefafa1b891875743e741826cfad8fab5a2 /container_of.c
parent4e1cc10bb6763bb034acab3e12b6dce0d5570386 (diff)
downloadlock_free-0042a0da85c2bd0d321e1e6ec22dfe0330ba6b9b.zip
lock_free-0042a0da85c2bd0d321e1e6ec22dfe0330ba6b9b.tar.gz
code cleanup
Diffstat (limited to 'container_of.c')
-rw-r--r--container_of.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/container_of.c b/container_of.c
index 13f8e69..53e6ffe 100644
--- a/container_of.c
+++ b/container_of.c
@@ -1,7 +1,7 @@
/*
* File : container_of.c
* Author : Jérémy Zurcher <jeremy@asynk.ch>
- * Date : 01/11/09
+ * Date : 2009/11/01
* License :
*
* Permission is hereby granted, free of charge, to any person obtaining
@@ -48,7 +48,7 @@ static void _check(int cond, const char *msg)
{
if(!cond)
{
- fprintf(stderr,"%s\n",msg);
+ fprintf(stderr,"%s failed\n",msg);
exit(EXIT_FAILURE);
}
}
@@ -57,17 +57,17 @@ int main(int argc, char *argv[])
{
struct node n;
- _check((&n==container_of( &n.data1, struct node, data1)),"1 container_of failed");
- _check((&n==container_of( &n.data2, struct node, data2)),"2 container_of failed");
- _check((&n==container_of( &n.data3, struct node, data3)),"3 container_of failed");
- _check((&n==container_of( &n.data4, struct node, data4)),"4 container_of failed");
- _check((&n==container_of( &n.data5, struct node, data5)),"5 container_of failed");
+ _check((&n==container_of( &n.data1, struct node, data1)),"1 container_of");
+ _check((&n==container_of( &n.data2, struct node, data2)),"2 container_of");
+ _check((&n==container_of( &n.data3, struct node, data3)),"3 container_of");
+ _check((&n==container_of( &n.data4, struct node, data4)),"4 container_of");
+ _check((&n==container_of( &n.data5, struct node, data5)),"5 container_of");
- _check((&n==containerof( &n.data1, struct node, data1)),"1 container_of failed");
- _check((&n==containerof( &n.data2, struct node, data2)),"2 container_of failed");
- _check((&n==containerof( &n.data3, struct node, data3)),"3 container_of failed");
- _check((&n==containerof( &n.data4, struct node, data4)),"4 container_of failed");
- _check((&n==containerof( &n.data5, struct node, data5)),"5 container_of failed");
+ _check((&n==containerof( &n.data1, struct node, data1)),"1 containerof");
+ _check((&n==containerof( &n.data2, struct node, data2)),"2 containerof");
+ _check((&n==containerof( &n.data3, struct node, data3)),"3 containerof");
+ _check((&n==containerof( &n.data4, struct node, data4)),"4 containerof");
+ _check((&n==containerof( &n.data5, struct node, data5)),"5 containerof");
printf("success\n");