coding style: remove trailing whitespaces, etc

Amazing how many crept up over time, should have set the
execute bit of .git/hooks/pre-commit already, duh.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2009-03-14 13:50:36 -03:00
parent 5a0113c615
commit 4d44276d85
24 changed files with 84 additions and 84 deletions

View File

@ -1,4 +1,4 @@
/*
/*
Copyright (C) 2006 Mandriva Conectiva S.A.
Copyright (C) 2006 Arnaldo Carvalho de Melo <acme@mandriva.com>
@ -706,7 +706,7 @@ static void print_total_function_diff(const char *filename)
if (total_function_bytes_removed != 0)
printf(", %u bytes removed", total_function_bytes_removed);
printf(", diff: %+d",
(total_function_bytes_added -
total_function_bytes_removed));

View File

@ -399,7 +399,7 @@ static int create_new_base_type(struct ctf_state *sp, void *ptr,
base = base_type__new(name, CTF_TYPE_INT_BITS(eval));
if (base == NULL)
oom("base_type__new");
base->tag.tag = DW_TAG_base_type;
cu__add_tag(sp->cu, &base->tag, &id);
@ -422,7 +422,7 @@ static int create_new_base_type_float(struct ctf_state *sp, void *ptr,
base = base_type__new(name, CTF_TYPE_FP_BITS(eval));
if (base == NULL)
oom("base_type__new");
base->tag.tag = DW_TAG_base_type;
cu__add_tag(sp->cu, &base->tag, &id);
@ -813,7 +813,7 @@ static int class__fixup_ctf_bitfields(struct tag *self, struct cu *cu)
if (type->tag != DW_TAG_base_type)
continue;
struct base_type *bt = tag__base_type(type);
size_t bit_size = base_type__name_to_size(bt);

View File

@ -1,6 +1,6 @@
#ifndef _CTF_LOADER_H_
#define _CTF_LOADER_H_ 1
/*
/*
Copyright (C) 2008 Arnaldo Carvalho de Melo <acme@redhat.com>
This program is free software; you can redistribute it and/or modify it

View File

@ -1,4 +1,4 @@
/*
/*
Copyright (C) 2006 Mandriva Conectiva S.A.
Copyright (C) 2006 Arnaldo Carvalho de Melo <acme@mandriva.com>
@ -171,7 +171,7 @@ static void method__add(struct cu *cu, struct function *function, uint32_t id)
function->priv = (void *)(long)id;
}
/*
/*
* We want just the function tags that have as one of its parameters
* a pointer to the specified "class" (a struct, unions can be added later).
*/
@ -238,7 +238,7 @@ static struct class_member *class__remove_member(struct class *self, const struc
struct class_member *bitfield_tail = NULL;
struct list_head *next;
uint16_t member_hole = member->hole;
if (member->bit_size != 0) {
bitfield_tail = class_member__bitfield_tail(member, self);
member_hole = bitfield_tail->hole;
@ -472,7 +472,7 @@ static int class__emit_ostra_converter(struct tag *tag_self)
return 0;
}
/*
/*
* We want just the DW_TAG_structure_type tags that have a member that is a pointer
* to the target class.
*/
@ -531,7 +531,7 @@ static void class__find_pointers(const char *class_name)
cus__for_each_cu(methods_cus, cu_find_pointers_iterator, (void *)class_name, cu_filter);
}
/*
/*
* We want just the DW_TAG_structure_type tags that have as its first member
* a struct of type target.
*/
@ -726,14 +726,14 @@ static int cu_emit_probes_iterator(struct cu *cu, void *cookie)
/* OK, this type is not present in this compile unit */
if (target == NULL)
return 0;
list_for_each_entry(pos, &cu->tool_list, tool_node) {
uint32_t function_id = (long)pos->priv;
if (methods__add(&probes_emitted, function__name(pos, cu)) != 0)
continue;
function__emit_probes(pos, function_id, cu, target_type_id, 0, NULL); /* entry */
function__emit_probes(pos, function_id, cu, target_type_id, 1, NULL); /* exit */
function__emit_probes(pos, function_id, cu, target_type_id, 1, NULL); /* exit */
}
return 0;
@ -779,7 +779,7 @@ static int cu_emit_pointer_probes_iterator(struct cu *cu, void *cookie)
function__emit_probes(pos_tag, function_id, cu, target_type_id, 0,
class_member__name(pos_member)); /* entry */
function__emit_probes(pos_tag, function_id, cu, target_type_id, 1,
class_member__name(pos_member)); /* exit */
class_member__name(pos_member)); /* exit */
}
return 0;
@ -796,7 +796,7 @@ static int cu_emit_functions_table(struct cu *cu, void *fp)
list_for_each_entry(pos, &cu->tool_list, tool_node)
if (pos->priv != NULL) {
uint32_t function_id = (long)pos->priv;
uint32_t function_id = (long)pos->priv;
fprintf(fp, "%d:%s\n", function_id,
function__name(pos, cu));
pos->priv = NULL;
@ -914,7 +914,7 @@ failure:
fputs("ctracer: insufficient memory\n", stderr);
goto out;
}
/*
* if --dir/-D was specified, recursively traverse the path looking for
* object files (compilation units) that match the glob specified (*.ko)

View File

@ -1,4 +1,4 @@
/*
/*
Copyright (C) 2006 Mandriva Conectiva S.A.
Copyright (C) 2006 Arnaldo Carvalho de Melo <acme@mandriva.com>

View File

@ -1,4 +1,4 @@
/*
/*
Copyright (C) 2007 Arnaldo Carvalho de Melo <acme@redhat.com>
This program is free software; you can redistribute it and/or modify it
@ -57,11 +57,11 @@ int strlist__load(struct strlist *self, const char *filename)
if (len == 0)
continue;
entry[len - 1] = '\0';
if (strlist__add(self, entry) != 0)
goto out;
}
err = 0;
out:
fclose(fp);

View File

@ -1,6 +1,6 @@
#ifndef _DUTIL_H_
#define _DUTIL_H_ 1
/*
/*
Copyright (C) 2007 Arnaldo Carvalho de Melo <acme@redhat.com>
This program is free software; you can redistribute it and/or modify it

View File

@ -249,11 +249,11 @@ static void *tag__alloc(size_t size)
{
struct dwarf_tag *dtag = malloc(sizeof(*dtag));
if (dtag == NULL)
if (dtag == NULL)
return NULL;
struct tag *self = malloc(size);
if (self == NULL) {
free(dtag);
return NULL;
@ -566,7 +566,7 @@ static void lexblock__init(struct lexblock *self, Dwarf_Die *die)
self->size_inline_expansions =
self->nr_inline_expansions =
self->nr_labels =
self->nr_lexblocks =
self->nr_lexblocks =
self->nr_variables = 0;
}
@ -917,7 +917,7 @@ static struct tag *die__create_new_enumeration(Dwarf_Die *die)
oom("class__new");
if (!dwarf_haschildren(die) || dwarf_child(die, &child) != 0) {
/* Seen on libQtCore.so.4.3.4.debug,
/* Seen on libQtCore.so.4.3.4.debug,
* class QAbstractFileEngineIterator, enum EntryInfoType */
goto out;
}
@ -1152,7 +1152,7 @@ static void die__process_unit(Dwarf_Die *die, struct cu *cu)
cu__hash(cu, tag);
struct dwarf_tag *dtag = tag->priv;
dtag->small_id = id;
}
} while (dwarf_siblingof(die, die) == 0);
}
@ -1330,7 +1330,7 @@ static void lexblock__recode_dwarf_types(struct lexblock *self, struct cu *cu)
break;
struct variable *var = tag__variable(pos);
if (var->abstract_origin == 0) {
/*
* DW_TAG_variable completely empty was
@ -1630,7 +1630,7 @@ static int cus__load_module(struct cus *self, struct conf_load *conf,
cus__add(self, cu);
}
return DWARF_CB_OK;
}
@ -1652,7 +1652,7 @@ static int cus__process_dwflmod(Dwfl_Module *dwflmod,
* WARNING: Don't remove the seemingly useless call to
* dwfl_module_getelf, as it will change dwflmod internal state in a
* way that is required by dwfl_module_getdwarf.
*/
*/
GElf_Addr dwflbias;
dwfl_module_getelf(dwflmod, &dwflbias);

View File

@ -1,6 +1,6 @@
#ifndef _DWARF_LOADER_H_
#define _DWARF_LOADER_H_ 1
/*
/*
Copyright (C) 2008 Arnaldo Carvalho de Melo <acme@redhat.com>
This program is free software; you can redistribute it and/or modify it

View File

@ -284,7 +284,7 @@ reevaluate:
member_size = tag__type(type)->size;
break;
}
/* long long */
if (member_size > cu->addr_size)
return pos;
@ -428,7 +428,7 @@ void cus__add(struct cus *self, struct cu *cu)
list_add_tail(&cu->node, &self->cus);
cu__find_class_holes(cu);
}
static void ptr_table__init(struct ptr_table *self)
{
self->entries = NULL;
@ -616,12 +616,12 @@ static const char *tag__prefix(const struct cu *cu, const uint32_t tag)
struct tag *cu__find_tag_by_id(const struct cu *self, const uint32_t id)
{
return self ? ptr_table__entry(&self->tags_table, id) : NULL;
return self ? ptr_table__entry(&self->tags_table, id) : NULL;
}
struct tag *cu__find_type_by_id(const struct cu *self, const uint16_t id)
{
return self ? ptr_table__entry(&self->types_table, id) : NULL;
return self ? ptr_table__entry(&self->types_table, id) : NULL;
}
struct tag *cu__find_first_typedef_of_type(const struct cu *self,
@ -1300,7 +1300,7 @@ static size_t union_member__fprintf(struct class_member *self,
{
const size_t size = tag__size(type, cu);
size_t printed = type__fprintf(type, cu, s(self->name), conf, fp);
if ((tag__is_union(type) || tag__is_struct(type) ||
tag__is_enumeration(type)) &&
/* Look if is a type defined inline */
@ -1319,7 +1319,7 @@ static size_t union_member__fprintf(struct class_member *self,
}
} else {
printed += fprintf(fp, ";");
if (!conf->suppress_offset_comment) {
const int spacing = conf->type_spacing + conf->name_spacing - printed;
printed += fprintf(fp, "%*s/* %11zd */",
@ -1460,7 +1460,7 @@ const char *function__name(struct function *self, const struct cu *cu __unused)
}
const char *function__prototype(const struct function *self,
const struct cu *cu, char *bf, size_t len)
const struct cu *cu, char *bf, size_t len)
{
FILE *bfp = fmemopen(bf, len, "w");
@ -2131,7 +2131,7 @@ size_t class__fprintf(struct class *self, const struct cu *cu,
}
if (pos->offset != last->offset)
bitfield_real_offset = last->offset + last_size;
} else {
} else {
const ssize_t cc_last_size = ((ssize_t)pos->offset -
(ssize_t)last->offset);
@ -2173,7 +2173,7 @@ size_t class__fprintf(struct class *self, const struct cu *cu,
const uint16_t padding = tag__class(type)->padding;
if (padding > 0) {
++nr_paddings;
sum_paddings += padding;
sum_paddings += padding;
if (!newline++) {
fputc('\n', fp);
++printed;
@ -2390,7 +2390,7 @@ size_t tag__fprintf(struct tag *self, const struct cu *cu,
if (conf == NULL) {
tconf = conf_fprintf__defaults;
pconf = &tconf;
pconf = &tconf;
if (tconf.expand_types)
tconf.name_spacing = 55;
@ -2398,7 +2398,7 @@ size_t tag__fprintf(struct tag *self, const struct cu *cu,
tconf.name_spacing = 21;
} else if (conf->name_spacing == 0 || conf->type_spacing == 0) {
tconf = *conf;
pconf = &tconf;
pconf = &tconf;
if (tconf.name_spacing == 0) {
if (tconf.expand_types)

View File

@ -1,6 +1,6 @@
#ifndef _DWARVES_H_
#define _DWARVES_H_ 1
/*
/*
Copyright (C) 2006 Mandriva Conectiva S.A.
Copyright (C) 2006 Arnaldo Carvalho de Melo <acme@mandriva.com>
@ -139,7 +139,7 @@ struct cu {
/** struct tag - basic representation of a debug info element
* @priv - extra data, for instance, DWARF offset, id, decl_{file,line}
* @top_level -
* @top_level -
*/
struct tag {
struct list_head node;
@ -196,7 +196,7 @@ static inline int tag__is_type(const struct tag *self)
tag__is_typedef(self) ||
tag__is_enumeration(self);
}
/**
* tag__is_tag_type - is this one of the possible types for a tag?
* @tag - tag queried
@ -254,7 +254,7 @@ static inline struct ptr_to_member_type *
{
return (struct ptr_to_member_type *)self;
}
struct namespace {
struct tag tag;
strings_t name;
@ -308,7 +308,7 @@ static inline struct class *type__class(const struct type *self)
return (struct class *)self;
}
/**
/**
* type__for_each_tag - iterate thru all the tags
* @self: struct type instance to iterate
* @pos: struct tag iterator
@ -316,7 +316,7 @@ static inline struct class *type__class(const struct type *self)
#define type__for_each_tag(self, pos) \
list_for_each_entry(pos, &(self)->namespace.tags, node)
/**
/**
* type__for_each_enumerator - iterate thru the enumerator entries
* @self: struct type instance to iterate
* @pos: struct enumerator iterator
@ -324,7 +324,7 @@ static inline struct class *type__class(const struct type *self)
#define type__for_each_enumerator(self, pos) \
list_for_each_entry(pos, &(self)->namespace.tags, tag.node)
/**
/**
* type__for_each_member - iterate thru the entries that use space
* (data members and inheritance entries)
* @self: struct type instance to iterate
@ -337,7 +337,7 @@ static inline struct class *type__class(const struct type *self)
continue; \
else
/**
/**
* type__for_each_data_member - iterate thru the data member entries
* @self: struct type instance to iterate
* @pos: struct class_member iterator
@ -348,7 +348,7 @@ static inline struct class *type__class(const struct type *self)
continue; \
else
/**
/**
* type__for_each_member_safe - safely iterate thru the entries that use space
* (data members and inheritance entries)
* @self: struct type instance to iterate
@ -361,7 +361,7 @@ static inline struct class *type__class(const struct type *self)
continue; \
else
/**
/**
* type__for_each_data_member_safe - safely iterate thru the data member entries
* @self: struct type instance to iterate
* @pos: struct class_member iterator
@ -517,7 +517,7 @@ static inline struct ftype *tag__ftype(const struct tag *self)
return (struct ftype *)self;
}
/**
/**
* ftype__for_each_parameter - iterate thru all the parameters
* @self: struct ftype instance to iterate
* @pos: struct parameter iterator
@ -560,7 +560,7 @@ static __pure inline int tag__is_function(const struct tag *self)
return self->tag == DW_TAG_subprogram;
}
/**
/**
* function__for_each_parameter - iterate thru all the parameters
* @self: struct function instance to iterate
* @pos: struct parameter iterator

View File

@ -99,7 +99,7 @@ static int tag__emit_definitions(struct tag *tag, struct cu *cu,
static int typedef__emit_definitions(struct tag *tdef, struct cu *cu,
struct type_emissions *emissions, FILE *fp)
{
{
struct type *def = tag__type(tdef);
struct tag *type, *ptr_type;
int is_pointer = 0;
@ -151,7 +151,7 @@ static int typedef__emit_definitions(struct tag *tdef, struct cu *cu,
conf.suffix = type__name(def);
enumeration__emit_definitions(type, emissions, &conf, fp);
goto out;
} else
} else
enumeration__emit_definitions(type, emissions, &conf, fp);
}
break;

View File

@ -1,6 +1,6 @@
#ifndef _DWARVES_EMIT_H_
#define _DWARVES_EMIT_H_ 1
/*
/*
Copyright (C) 2006 Mandriva Conectiva S.A.
Copyright (C) 2006 Arnaldo Carvalho de Melo <acme@mandriva.com>
Copyright (C) 2007 Arnaldo Carvalho de Melo <acme@ghostprotocols.net>

View File

@ -103,7 +103,7 @@ void class__fixup_alignment(struct class *self, const struct cu *cu)
}
}
}
last_member = pos;
}
@ -144,7 +144,7 @@ static struct class_member *
bitfield_head = NULL;
if (member->hole != 0) {
const size_t member_size = class_member__size(member, cu);
if (member_size != 0 && member_size <= size)
return bitfield_head ? : member;
}
@ -296,7 +296,7 @@ static void class__move_member(struct class *class, struct class_member *dest,
dest->tag.node.next);
from->offset = new_from_offset;
}
if (verbose)
fprintf(fp, " from after '%s' to after '%s' */\n",
class_member__name(from_prev),
@ -563,7 +563,7 @@ static int class__demote_bitfields(struct class *class, const struct cu *cu,
base_type__name(tag__base_type(new_type_tag)));
class__demote_bitfield_members(class,
bitfield_head, member,
bitfield_head, member,
tag__base_type(old_type_tag),
tag__base_type(new_type_tag),
new_type_id);
@ -612,7 +612,7 @@ static int class__demote_bitfields(struct class *class, const struct cu *cu,
base_type__name(tag__base_type(old_type_tag)),
base_type__name(tag__base_type(new_type_tag)));
class__demote_bitfield_members(class,
member, member,
member, member,
tag__base_type(old_type_tag),
tag__base_type(new_type_tag),
new_type_id);
@ -703,7 +703,7 @@ static void class__fixup_bitfield_types(struct class *self,
*
* short int d; / * 66 2 * /
* <SNIP>
*
*
* The compiler (gcc 4.1.1 20070105 (Red Hat 4.1.1-51) in the above example),
* Decided to combine what was declared as an int (4 bytes) bitfield but doesn't
* uses even one byte with the next field, that is a short int (2 bytes),
@ -740,7 +740,7 @@ static void class__fixup_member_types(struct class *self, const struct cu *cu,
const size_t size = class_member__size(bitfield_head,
cu);
if (real_size != size) {
uint16_t new_type_id;
uint16_t new_type_id;
struct tag *new_type_tag =
cu__find_base_type_of_size(cu,
real_size,
@ -779,7 +779,7 @@ void class__reorganize(struct class *self, const struct cu *cu,
while (class__demote_bitfields(self, cu, verbose, fp))
class__reorganize_bitfields(self, cu, verbose, fp);
/* Now try to combine holes */
restart:
class__find_holes(self, cu);

View File

@ -1,6 +1,6 @@
#ifndef _DWARVES_REORGANIZE_H_
#define _DWARVES_REORGANIZE_H_ 1
/*
/*
Copyright (C) 2006 Mandriva Conectiva S.A.
Copyright (C) 2006 Arnaldo Carvalho de Melo <acme@mandriva.com>
Copyright (C) 2007 Arnaldo Carvalho de Melo <acme@ghostprotocols.net>

View File

@ -1,6 +1,6 @@
#ifndef _GOBUFFER_H_
#define _GOBUFFER_H_ 1
/*
/*
Copyright (C) 2008 Arnaldo Carvalho de Melo <acme@redhat.com>
This program is free software; you can redistribute it and/or modify it

2
list.h
View File

@ -1,6 +1,6 @@
#ifndef _LINUX_LIST_H
#define _LINUX_LIST_H
/*
/*
Copyright (C) Cast of dozens, comes from the Linux kernel
This program is free software; you can redistribute it and/or modify it

View File

@ -289,7 +289,7 @@ static void print_classes(struct cu *cu)
print_packable_info(pos, cu, id);
else if (formatter != NULL)
formatter(pos, cu, id);
if (structures__add(pos) == NULL) {
fprintf(stderr, "pahole: insufficient memory for "
"processing %s, skipping it...\n", cu->name);
@ -311,16 +311,16 @@ static struct cu *cu__filter(struct cu *cu)
static int class__packable(struct class *self, const struct cu *cu)
{
struct class *clone;
struct class *clone;
size_t savings;
if (self->nr_holes == 0 && self->nr_bit_holes == 0)
return 0;
clone = class__clone(self, NULL);
if (clone == NULL)
clone = class__clone(self, NULL);
if (clone == NULL)
return 0;
class__reorganize(clone, cu, 0, stdout);
class__reorganize(clone, cu, 0, stdout);
savings = class__size(self) - class__size(clone);
if (savings != 0) {
self->priv = clone;
@ -533,7 +533,7 @@ static void union__find_new_size(struct tag *tag, struct cu *cu)
max_size = size;
}
if (max_size > self->size)
if (max_size > self->size)
self->size_diff = max_size - self->size;
else
self->size_diff = self->size - max_size;
@ -615,7 +615,7 @@ static void cu__account_nr_methods(struct cu *self)
if (!class__filter(class, self, 0))
continue;
str = structures__add(class);
if (str == NULL) {
fprintf(stderr, "pahole: insufficient memory for "
@ -999,7 +999,7 @@ static enum load_steal_kind pahole_stealer(struct cu *cu,
if (defined_in) {
if (class_sname == 0)
class_sname = strings__find(strings, class_name);
if (cu__find_struct_by_sname(cu, class_sname, 0, NULL))
puts(cu->name);
@ -1038,7 +1038,7 @@ static enum load_steal_kind pahole_stealer(struct cu *cu,
return EXIT_FAILURE;
}
tag__fprintf(tag, cu, &conf, stdout);
tag__fprintf(tag, cu, &conf, stdout);
putchar('\n');
cu__delete(cu);
return LSK__STOP_LOADING;
@ -1051,7 +1051,7 @@ static enum load_steal_kind pahole_stealer(struct cu *cu,
goto dump_it;
}
if (reorganize) {
if (reorganize) {
size_t savings;
const uint8_t reorg_verbose =
show_reorg_steps ? 2 : global_verbose;
@ -1089,7 +1089,7 @@ static enum load_steal_kind pahole_stealer(struct cu *cu,
} else if (find_pointers_in_structs) {
print_structs_with_pointer_to(cu, class_id);
goto dump_it;
} else {
} else {
/*
* We don't need to print it for every compile unit
* but the previous options need

View File

@ -1,4 +1,4 @@
/*
/*
Copyright (C) 2007 Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
This program is free software; you can redistribute it and/or modify it

View File

@ -193,7 +193,7 @@ static void fn_stats__dupmsg(struct function *self,
function__name(self, self_cu),
self_cu->name,
dup_cu->name);
va_start(args, fmt);
vprintf(fmt, args);
va_end(args);

View File

@ -1,4 +1,4 @@
/*
/*
Copyright (C) 2006 Mandriva Conectiva S.A.
Copyright (C) 2006 Arnaldo Carvalho de Melo <acme@mandriva.com>

View File

@ -103,7 +103,7 @@ strings_t strings__find(struct strings *self, const char *str)
s = tfind(&key, &self->tree, strings__compare);
return s ? *s : 0;
}
int strings__cmp(const struct strings *self, strings_t a, strings_t b)
{
return a == b ? 0 : strcmp(strings__ptr(self, a),

View File

@ -1,6 +1,6 @@
#ifndef _STRINGS_H_
#define _STRINGS_H_ 1
/*
/*
Copyright (C) 2008 Arnaldo Carvalho de Melo <acme@redhat.com>
This program is free software; you can redistribute it and/or modify it

View File

@ -1,4 +1,4 @@
/*
/*
Copyright (C) 2007 Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
System call sign extender