URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 19 |
Rev 100 |
Line 57... |
Line 57... |
void
|
void
|
add_label (oraddr_t addr, char *name)
|
add_label (oraddr_t addr, char *name)
|
{
|
{
|
struct label_entry **tmp;
|
struct label_entry **tmp;
|
tmp = &(label_hash[addr % LABELS_HASH_SIZE]);
|
tmp = &(label_hash[addr % LABELS_HASH_SIZE]);
|
for (; *tmp; tmp = &((*tmp)->next));
|
for (; *tmp; tmp = &((*tmp)->next)); // Find the next NULL label entry pointer (loop while the pointer de-refernce is non-NULL)
|
*tmp = malloc (sizeof (**tmp));
|
*tmp = malloc (sizeof (**tmp)); // allocate space for the pointer to the hash entry pointer
|
(*tmp)->name = malloc (strlen (name) + 1);
|
(*tmp)->name = malloc (strlen (name) + 1); // now allocate space for the name string
|
(*tmp)->addr = addr;
|
(*tmp)->addr = addr;
|
strcpy ((*tmp)->name, name);
|
strcpy ((*tmp)->name, name);
|
(*tmp)->next = NULL;
|
(*tmp)->next = NULL;
|
}
|
}
|
|
|
© copyright 1999-2025
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.