History

tccelf/tcccoff: fix some type conversion warnings

grischka committed 15 years ago

Commit 21c2a681 parent 86ffc482 files · +7 −7Browse files

Unified · Split

2 files
  1. tcccoff.c +1 −1
  2. tccelf.c +6 −6
tcccoff.c+1−1
@@ -943,7 +943,7 @@ ST_FUNC int tcc_load_coff(TCCState * s1, int fd) · 942 unmodified lines
943943 if (name[0] == '_' && strcmp(name, "_main") != 0)
944944 name++;
945945
946− tcc_add_symbol(s1, name, (void*)csym.n_value);
946+ tcc_add_symbol(s1, name, (void*)(uplong)csym.n_value);
947947 }
948948 // skip any aux records
949949
tccelf.c+6−6
@@ -506,14 +506,14 @@ static uplong add_got_table(TCCState *s1, uplong val) · 505 unmodified lines
506506 }
507507 #elif defined TCC_TARGET_ARM
508508 #define JMP_TABLE_ENTRY_SIZE 8
509−static int add_jmp_table(TCCState *s1, int val)
509+static uplong add_jmp_table(TCCState *s1, int val)
510510 {
511511 uint32_t *p = (uint32_t *)(s1->runtime_plt_and_got + s1->runtime_plt_and_got_offset);
512512 s1->runtime_plt_and_got_offset += JMP_TABLE_ENTRY_SIZE;
513513 /* ldr pc, [pc, #-4] */
514514 p[0] = 0xE51FF004;
515515 p[1] = val;
516− return (int)p;
516+ return (uplong)p;
517517 }
518518 #endif
519519 #endif
@@ -666,8 +666,8 @@ ST_FUNC void relocate_section(TCCState *s1, Section *s) · 146 unmodified lines
666666 *(int*)ptr ^= 0xE12FFF10 ^ 0xE1A0F000; /* BX Rm -> MOV PC, Rm */
667667 break;
668668 default:
669− fprintf(stderr,"FIXME: handle reloc type %x at %lx [%.8x] to %lx\n",
670− type,addr,(unsigned int)(long)ptr,val);
669+ fprintf(stderr,"FIXME: handle reloc type %x at %x [%.8x] to %x\n",
670+ type, (unsigned)addr, (unsigned)(uplong)ptr, (unsigned)val);
671671 break;
672672 #elif defined(TCC_TARGET_C67)
673673 case R_C60_32:
@@ -692,8 +692,8 @@ ST_FUNC void relocate_section(TCCState *s1, Section *s) · 18 unmodified lines
692692 case R_C60HI16:
693693 break;
694694 default:
695− fprintf(stderr,"FIXME: handle reloc type %x at %lx [%.8x] to %lx\n",
696− type,addr,(unsigned int)(long)ptr, val);
695+ fprintf(stderr,"FIXME: handle reloc type %x at %x [%.8x] to %x\n",
696+ type, (unsigned)addr, (unsigned)(uplong)ptr, (unsigned)val);
697697 break;
698698 #elif defined(TCC_TARGET_X86_64)
699699 case R_X86_64_64:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t