power: clang-format
* Using AOSP interface .clang-format * Clean Android.mk while we are at it Change-Id: I630f72e3dffb676ca1930e72945e897f62103ada Signed-off-by: Arian <arian.kulmer@web.de>
This commit is contained in:
26
list.c
26
list.c
@@ -31,13 +31,12 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "list.h"
|
||||
#include <utils/Log.h>
|
||||
#include "list.h"
|
||||
|
||||
struct list_node *add_list_node(struct list_node *head, void *data)
|
||||
{
|
||||
struct list_node* add_list_node(struct list_node* head, void* data) {
|
||||
/* Create a new list_node. And put 'data' into it. */
|
||||
struct list_node *new_node;
|
||||
struct list_node* new_node;
|
||||
|
||||
if (head == NULL) {
|
||||
return NULL;
|
||||
@@ -59,10 +58,9 @@ struct list_node *add_list_node(struct list_node *head, void *data)
|
||||
/*
|
||||
* Delink and de-allocate 'node'.
|
||||
*/
|
||||
int remove_list_node(struct list_node *head, struct list_node *del_node)
|
||||
{
|
||||
struct list_node *current_node;
|
||||
struct list_node *saved_node;
|
||||
int remove_list_node(struct list_node* head, struct list_node* del_node) {
|
||||
struct list_node* current_node;
|
||||
struct list_node* saved_node;
|
||||
|
||||
if (head == NULL || head->next == NULL) {
|
||||
return -1;
|
||||
@@ -92,18 +90,14 @@ int remove_list_node(struct list_node *head, struct list_node *del_node)
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct list_node* find_node(struct list_node* head, void* comparison_data) {
|
||||
struct list_node* current_node = head;
|
||||
|
||||
struct list_node *find_node(struct list_node *head, void *comparison_data)
|
||||
{
|
||||
struct list_node *current_node = head;
|
||||
|
||||
if (head == NULL)
|
||||
return NULL;
|
||||
if (head == NULL) return NULL;
|
||||
|
||||
while ((current_node = current_node->next)) {
|
||||
if (current_node->compare) {
|
||||
if (current_node->compare(current_node->data,
|
||||
comparison_data) == 0) {
|
||||
if (current_node->compare(current_node->data, comparison_data) == 0) {
|
||||
/* Match found. Return current_node. */
|
||||
return current_node;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user