Permalink
Browse files

Fix codingstd violations in src/platform/generic/dl.c

  • Loading branch information...
1 parent 0488f0a commit 905dba7eb3a040ce83cc7825472f76e5820ca5c5 @niner niner committed Mar 30, 2012
Showing with 20 additions and 15 deletions.
  1. +20 −15 src/platform/generic/dl.c
View
@@ -44,8 +44,11 @@ push_handle_entry(void *handle)
{
struct handle_entry *e;
- e = (struct handle_entry *) malloc(sizeof(struct handle_entry));
- if (!e) { return; }
+ e = (struct handle_entry *) malloc(sizeof (struct handle_entry));
+ if (!e) {
+ return;
+ }
+
e->handle = handle;
e->next = handle_list;
handle_list = e;
@@ -56,10 +59,11 @@ find_handle_entry(void *handle)
{
struct handle_entry *e;
- for(e = handle_list; e; e = e->next) {
- if (e->handle == handle)
- return handle;
+ for (e = handle_list; e; e = e->next) {
+ if (e->handle == handle)
+ return handle;
}
+
return NULL;
}
@@ -69,19 +73,20 @@ remove_handle_entry(void *handle)
struct handle_entry *cur, *prev, *p;
if (handle_list) {
- if (handle_list->handle == handle) {
- p = handle_list;
- handle_list = p->next;
- free(p);
- } else {
- for (cur = handle_list; cur; prev = cur, cur = cur->next) {
- if (cur->handle == handle) {
- prev->next = cur->next;
- free(cur);
+ if (handle_list->handle == handle) {
+ p = handle_list;
+ handle_list = p->next;
+ free(p);
}
+ else {
+ for (cur = handle_list; cur; prev = cur, cur = cur->next) {
+ if (cur->handle == handle) {
+ prev->next = cur->next;
+ free(cur);
+ }
+ }
}
}
- }
}
#endif /* PARROT_HAS_HEADER_DLFCN */

0 comments on commit 905dba7

Please sign in to comment.