[kln2-devel] kln2 - compiling problems (fwd)
Brought to you by:
wiecko
From: Marek W. <Mar...@fu...> - 2004-02-20 05:44:41
|
Hi e-body, Carlo had the same problems with compiling and here is his solution. Mo, I hope this works for you too. ~Marek PS: [...] marks cut text. ---------- Forwarded message ---------- Date: Fri, 20 Feb 2004 01:43:39 +0100 From: Silhusk <silhusk AT bluewin.ch> To: Marek Wieckowski <wiecko AT users.sourceforge.net> Subject: kln2 - compiling problems [...] ** my compiling problems were the same described in the mail [...] > 2612 and 2637:"`void *' in pointer arithmetic": we have an void* v1 > pointer and an integer v2 counting how many bytes farther the memcpy > should copy some data; the warning is caused by 'v1+v2' I solved them with some casts, below you can find the diff. This compiles, but I couldn't test if it works as it should. I used a cast to char*, so (as far as I know) in new_pos = (char *)old_point + n the compiler adds to old_point n times the size of a char (wich is platform dependent and != 1 byte) so instead of memcpy((prefetch+prefetch_pos*(FRAG_SIZE)), buffer_raw, FRAG_SIZE); there maybe should stay memcpy(((unsigned char*)prefetch+(prefetch_pos*(FRAG_SIZE)/sizeof(char))), buffer_raw, FRAG_SIZE); here the diff from file klearnnotes2/src/voice_recognition.cpp 2564c2564 < int prefetch_N = 5; --- > const int prefetch_N = 5; 2612c2612 < memcpy((prefetch+prefetch_pos*(FRAG_SIZE)), buffer_raw, FRAG_SIZE); --- > memcpy(((unsigned char*)prefetch+prefetch_pos*(FRAG_SIZE)), buffer_raw, FRAG_SIZE); 2637c2637 < memcpy(data->buffer, prefetch+(i%prefetch_N)*FRAG_SIZE, FRAG_SIZE); --- > memcpy(data->buffer, (unsigned char*)prefetch+(i%prefetch_N)*FRAG_SIZE, FRAG_SIZE); ** still a problem: I cannot manage to have MIDI playback running this is probably a matter with my configuration... I have an Intel i810 audio card, and I'm running a Mandrake 9.2 wich choses by herself wich sound server to run (ALSA doesn't work) (I have the same problem with rosegarden, but timidity should work, I still have to try it) |