… | |
… | |
23 | #include <stdlib.h> |
23 | #include <stdlib.h> |
24 | #include <math.h> |
24 | #include <math.h> |
25 | |
25 | |
26 | #include "parse_routines.h" |
26 | #include "parse_routines.h" |
27 | #include "error.h" |
27 | #include "error.h" |
|
|
28 | |
|
|
29 | #ifdef DMALLOC |
|
|
30 | #include <dmalloc.h> |
|
|
31 | #endif |
28 | |
32 | |
29 | /* Very inefficient, but good enough for now. By implementing it ourselves, |
33 | /* Very inefficient, but good enough for now. By implementing it ourselves, |
30 | we do not have to link with -lm */ |
34 | we do not have to link with -lm */ |
31 | psiconv_float_t pow2(int n) |
35 | psiconv_float_t pow2(int n) |
32 | { |
36 | { |
… | |
… | |
120 | res = psiconv_read_u8(buf,lev+2,off,&localstatus) >> 2; |
124 | res = psiconv_read_u8(buf,lev+2,off,&localstatus) >> 2; |
121 | if (localstatus) |
125 | if (localstatus) |
122 | goto ERROR; |
126 | goto ERROR; |
123 | len = 1; |
127 | len = 1; |
124 | psiconv_debug(lev+2,off,"Indicator (1 byte): %02x",res); |
128 | psiconv_debug(lev+2,off,"Indicator (1 byte): %02x",res); |
125 | } else if ((temp & 0x07) == 0x03) { |
129 | } else if ((temp & 0x07) == 0x05) { |
126 | res = psiconv_read_u16(buf,lev+2,off,&localstatus) >> 3; |
130 | res = psiconv_read_u16(buf,lev+2,off,&localstatus) >> 3; |
127 | if (localstatus) |
131 | if (localstatus) |
128 | goto ERROR; |
132 | goto ERROR; |
129 | len = 2; |
133 | len = 2; |
130 | psiconv_debug(lev+2,off,"Indicator (2 bytes): %04x",res); |
134 | psiconv_debug(lev+2,off,"Indicator (2 bytes): %04x",res); |