updated on Mon Jan 9 08:00:21 UTC 2012
[aur-mirror.git] / dcdis / dcdis.patch
blob72afce6b2513d3f7df11311f69aac183222e7811
1 :100644 100644 14f6ec8... 0000000... M dcdis.c
2 :100644 100644 d385f3b... 0000000... M dcdis.h
3 :100644 100644 bc1039d... 0000000... M decode.c
4 :100644 100644 48d01e0... 0000000... M decode.h
5 :100644 100644 6186d00... 0000000... M symtab.c
6 :100644 100644 4dc82cc... 0000000... M symtab.h
8 diff --git a/dcdis.c b/dcdis.c
9 index 14f6ec8..c4bafcb 100644
10 --- a/dcdis.c
11 +++ b/dcdis.c
12 @@ -196,7 +196,7 @@ main(argc, argv)
13 #endif
14 fprintf(out, "H'%08x: ", my_pc);
16 - my_opcode = char2short(&file[i]);
17 + my_opcode = char2short((uint8_t*)&file[i]);
18 fprintf(out, "H'%04x ", my_opcode);
20 for (j = 0; j < (N_O_BITS/8); j++) {
21 diff --git a/dcdis.h b/dcdis.h
22 index d385f3b..200317c 100644
23 --- a/dcdis.h
24 +++ b/dcdis.h
25 @@ -12,7 +12,7 @@
26 #ifndef _DCDIS_H_
27 #define _DCDIS_H_
29 -#include <sys/types.h>
30 +#include <stdint.h>
32 #define N_O_BITS 16 /* SH-4 instructions are 16-bit fixed width */
33 #define START_ADDRESS 0x8c010000
34 diff --git a/decode.c b/decode.c
35 index bc1039d..af16527 100644
36 --- a/decode.c
37 +++ b/decode.c
38 @@ -16,6 +16,7 @@
39 #include "symtab.h"
40 #endif
41 #include <stdio.h>
42 +#include <string.h>
44 extern int standard_disp;
46 @@ -50,7 +51,7 @@ decode(opcode, cur_PC, file, size, start_address)
47 reference = IMM*2+cur_PC+4;
48 reference2 = (reference&0x1fffffff)-(start_address&0x1fffffff);
49 if (reference2 >= 0 && reference2 <= size) {
50 - literal = char2short(&file[reference2]);
51 + literal = char2short((uint8_t*)&file[reference2]);
53 #ifdef DO_SYMBOL
54 my_sym = (char *)symtab_lookup(reference);
55 @@ -80,7 +81,7 @@ decode(opcode, cur_PC, file, size, start_address)
56 reference = (IMM*4+(cur_PC&0xfffffffc)+4);
57 reference2 = (reference&0x1fffffff)-(start_address&0x1fffffff);
58 if (reference2 >= 0 && reference2 <= size) {
59 - literal = char2int(&file[reference2]);
60 + literal = char2int((uint8_t*)&file[reference2]);
62 #ifdef DO_SYMBOL
63 my_sym = (char *)symtab_lookup(reference);
64 diff --git a/decode.h b/decode.h
65 index 48d01e0..639435f 100644
66 --- a/decode.h
67 +++ b/decode.h
68 @@ -12,7 +12,7 @@
69 #ifndef _DECODE_H_
70 #define _DECODE_H_
72 -#include <sys/types.h>
73 +#include <stdint.h>
75 char *decode(uint16_t, uint32_t, char *, uint32_t, uint32_t);
77 diff --git a/symtab.c b/symtab.c
78 index 6186d00..e9c07fc 100644
79 --- a/symtab.c
80 +++ b/symtab.c
81 @@ -86,8 +86,8 @@ symtab_read(fp)
82 FILE *fp;
85 - unsigned char buf[256];
86 - unsigned char buf2[256];
87 + char buf[256];
88 + char buf2[256];
89 char *ptr;
90 struct symtab *entry;
91 int i;
92 @@ -134,7 +134,7 @@ symtab_read(fp)
93 symtab_insert(entry);
97 + return 0;
100 char *
101 diff --git a/symtab.h b/symtab.h
102 index 4dc82cc..29a72d3 100644
103 --- a/symtab.h
104 +++ b/symtab.h
105 @@ -12,7 +12,7 @@
106 #ifndef _SYMTAB_H_
107 #define _SYMTAB_H_
109 -#include <sys/types.h>
110 +#include <stdint.h>
111 #include "dcdis.h"
112 #include <stdio.h>