Zdravim, mam povodny program (este z roku 1994) a zdrojaky, ktory v sucasnosti potrebujem upravit, ale bohuzial cast kodu sa mi nedari skompilovat. Pise mi warning (vid
(1) v kode), ze "
Mixing pointers to different 'char' types" - toto by ale nemalo vadit v kompilacii, kedze je to len Warning. Problem je pri chybe (vid
(2) v kode) "
Could not find a match for 'strchr(unsigned char *,unsigned char)'". Skusal som pretypovat to *q na int, ale to nepomohlo, vypisalo to tu istu hlasku. Viete mi prosim pomoct s nejakym riesenim ako by to malo byt? Vopred dakujem.
Kód:
...
...
unsigned char neascii[]="¬ Ô ›ŸØ·•Ö–’ µ"
" éì íü "
" åÕ çýêè "
" "
" "
" "
" "
" ";
unsigned char platneznaky[]="\x0A\x0D\x1A !\x22#$\x25&'()*+,-./"
"0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"[\\]^_\x60"
"abcdefghijklmnopqrstuvwxyz{|}~"
"\x81\x82\x84\x85\x8E\x90\x91\x92\x93"
"\x94\x95\x96\x99\x9A\x9B\x9C\x9F"
"\xA0\xA1\xA2\xA3\xA6\xA7\xAC\xAD"
"\xB5\xB7\xD2\xD4\xD5\xD6\xD8\xDE"
"\xE0\xE2\xE5\xE6\xE7\xE8\xE9\xEA"
"\xEC\xED\xFC\xFD";
void uprav_kam_na_ascii(char *co)
{
unsigned char *q = co; // (1)
while(*q)
{
if(*q >= 128 && neascii[*q-128]!=' ') *q = neascii[*q-128];
if(strchr(platneznaky,*q)==NULL) *q=' '; // (2)
q++;
}
}
void main(int argc, char * argv[])
{
...
uprav_kam_na_ascii(inriadok);
...
}