static int clone_vect(struct vect **to, const struct vect **from, void *data)
{
*to = malloc(sizeof(struct vect));
- if(*to == NULL)
+ if (*to == NULL)
return -1;
return
int own_name )
{
// first, take ownership of the name, if it's not yet ours
- if(!own_name)
+ if (!own_name)
name = strdup(name);
- if(name == NULL)
+ if (name == NULL)
return -1;
// push to the name->addr map
int result = DICT_INSERT(&names->names, &name, &addr);
- if(result == 1) {
+ if (result == 1) {
// This symbol is already present in the table. This library has
// multiple copies of this symbol (probably corresponding to
// different symbol versions). I should handle this gracefully
return 0;
}
- if(result != 0)
+ if (result != 0)
return result;
// push to the addr->names map
if (paliases == NULL) {
aliases = malloc(sizeof(struct vect));
- if(aliases == NULL)
+ if (aliases == NULL)
return -1;
VECT_INIT(aliases, const char*);
result = DICT_INSERT(&names->addrs, &addr, &aliases);
- if(result != 0)
+ if (result != 0)
return result;
}
else
aliases = *paliases;
const char *namedup = strdup(name);
- if(namedup == NULL)
+ if (namedup == NULL)
return -1;
result = vect_pushback(aliases, &namedup);
- if(result != 0)
+ if (result != 0)
return result;
return 0;
struct library_exported_names_each_context *context =
(struct library_exported_names_each_context*)data;
enum callback_status status = context->inner_cb(*key, context->data);
- if(status == CBS_FAIL)
+ if (status == CBS_FAIL)
context->failure = true;
return status;
}
// I do not report the original name we were asked about. Otherwise, any
// time the caller asks for aliases of symbol "sym", I'll always report
// "sym" along with any actual aliases
- if(strcmp(*name, context->origname) == 0)
+ if (strcmp(*name, context->origname) == 0)
return CBS_CONT;
enum callback_status status = context->inner_cb(*name, context->data);
- if(status == CBS_FAIL)
+ if (status == CBS_FAIL)
context->failure = true;
return status;
}
// aliased names
uint64_t *addr = DICT_FIND_REF(&names->names,
&aliasname, uint64_t);
- if(addr == NULL)
+ if (addr == NULL)
return false;
// OK. I have an address. Get the list of symbols at this address
struct vect **aliases = DICT_FIND_REF(&names->addrs,
addr, struct vect*);
- if(aliases == NULL)
+ if (aliases == NULL)
return false;
struct library_exported_names_each_alias_context context =