Fixed a cast of a pointer to an integer of a possibly different size.
Fixed casts of non-`void *' pointers to uintptr_t. Fixed related style bugs. This file uses perfectly non-KNF formatting for casts.
This commit is contained in:
parent
9e5900ee43
commit
586453fee2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=55090
@ -563,17 +563,17 @@ link_aout_search_symbol(linker_file_t lf, caddr_t value,
|
|||||||
aout_file_t af = lf->priv;
|
aout_file_t af = lf->priv;
|
||||||
u_long off = (uintptr_t) (void *) value;
|
u_long off = (uintptr_t) (void *) value;
|
||||||
u_long diff = off;
|
u_long diff = off;
|
||||||
|
u_long sp_nz_value;
|
||||||
struct nzlist* sp;
|
struct nzlist* sp;
|
||||||
struct nzlist* ep;
|
struct nzlist* ep;
|
||||||
struct nzlist* best = 0;
|
struct nzlist* best = 0;
|
||||||
u_long sp_nz_value;
|
|
||||||
|
|
||||||
for (sp = AOUT_RELOC(af, struct nzlist, LD_SYMBOL(af->dynamic)),
|
for (sp = AOUT_RELOC(af, struct nzlist, LD_SYMBOL(af->dynamic)),
|
||||||
ep = (struct nzlist *) ((caddr_t) sp + LD_STABSZ(af->dynamic));
|
ep = (struct nzlist *) ((caddr_t) sp + LD_STABSZ(af->dynamic));
|
||||||
sp < ep; sp++) {
|
sp < ep; sp++) {
|
||||||
if (sp->nz_name == 0)
|
if (sp->nz_name == 0)
|
||||||
continue;
|
continue;
|
||||||
sp_nz_value = sp->nz_value + (u_long)af->address;
|
sp_nz_value = sp->nz_value + (uintptr_t) (void *) af->address;
|
||||||
if (off >= sp_nz_value) {
|
if (off >= sp_nz_value) {
|
||||||
if (off - sp_nz_value < diff) {
|
if (off - sp_nz_value < diff) {
|
||||||
diff = off - sp_nz_value;
|
diff = off - sp_nz_value;
|
||||||
|
@ -953,17 +953,17 @@ link_elf_search_symbol(linker_file_t lf, caddr_t value,
|
|||||||
c_linker_sym_t* sym, long* diffp)
|
c_linker_sym_t* sym, long* diffp)
|
||||||
{
|
{
|
||||||
elf_file_t ef = lf->priv;
|
elf_file_t ef = lf->priv;
|
||||||
u_long off = (uintptr_t) value;
|
u_long off = (uintptr_t) (void *) value;
|
||||||
u_long diff = off;
|
u_long diff = off;
|
||||||
|
u_long st_value;
|
||||||
const Elf_Sym* es;
|
const Elf_Sym* es;
|
||||||
const Elf_Sym* best = 0;
|
const Elf_Sym* best = 0;
|
||||||
int i;
|
int i;
|
||||||
u_long st_value;
|
|
||||||
|
|
||||||
for (i = 0, es = ef->ddbsymtab; i < ef->ddbsymcnt; i++, es++) {
|
for (i = 0, es = ef->ddbsymtab; i < ef->ddbsymcnt; i++, es++) {
|
||||||
if (es->st_name == 0)
|
if (es->st_name == 0)
|
||||||
continue;
|
continue;
|
||||||
st_value = es->st_value + (u_long)ef->address;
|
st_value = es->st_value + (uintptr_t) (void *) ef->address;
|
||||||
if (off >= st_value) {
|
if (off >= st_value) {
|
||||||
if (off - st_value < diff) {
|
if (off - st_value < diff) {
|
||||||
diff = off - st_value;
|
diff = off - st_value;
|
||||||
|
@ -953,17 +953,17 @@ link_elf_search_symbol(linker_file_t lf, caddr_t value,
|
|||||||
c_linker_sym_t* sym, long* diffp)
|
c_linker_sym_t* sym, long* diffp)
|
||||||
{
|
{
|
||||||
elf_file_t ef = lf->priv;
|
elf_file_t ef = lf->priv;
|
||||||
u_long off = (uintptr_t) value;
|
u_long off = (uintptr_t) (void *) value;
|
||||||
u_long diff = off;
|
u_long diff = off;
|
||||||
|
u_long st_value;
|
||||||
const Elf_Sym* es;
|
const Elf_Sym* es;
|
||||||
const Elf_Sym* best = 0;
|
const Elf_Sym* best = 0;
|
||||||
int i;
|
int i;
|
||||||
u_long st_value;
|
|
||||||
|
|
||||||
for (i = 0, es = ef->ddbsymtab; i < ef->ddbsymcnt; i++, es++) {
|
for (i = 0, es = ef->ddbsymtab; i < ef->ddbsymcnt; i++, es++) {
|
||||||
if (es->st_name == 0)
|
if (es->st_name == 0)
|
||||||
continue;
|
continue;
|
||||||
st_value = es->st_value + (u_long)ef->address;
|
st_value = es->st_value + (uintptr_t) (void *) ef->address;
|
||||||
if (off >= st_value) {
|
if (off >= st_value) {
|
||||||
if (off - st_value < diff) {
|
if (off - st_value < diff) {
|
||||||
diff = off - st_value;
|
diff = off - st_value;
|
||||||
|
Loading…
Reference in New Issue
Block a user