juhovh / shairplay

Apple airplay and raop protocol server
Other
1.35k stars 228 forks source link

[fixups] - some fixups for making it compile with visual studio and elem... #1

Closed Memphiz closed 12 years ago

Memphiz commented 12 years ago

...ination of some warnings...

juhovh commented 12 years ago

Very nice work, the stdcall seems plain wrong and snprintf is a very good point that MinGW fixes automatically. However I'm a bit worried that it has so many forced casts, they should not be necessary since in C (unlike C++) void * can be assigned to any pointer type. Have you tried getting rid of the warnings by changing Visual Studio settings? I found the following for Visual Studio .NET:

Would this fix the casting issues without modifications to the code?

Memphiz commented 12 years ago

I don't think so, because the project setting is set to "default" which means it compiles .c files as C Code and .cpp files as C++ code.

Though this are only warnings. There are a bunch of other warnings due to type truncation i didn't even try to fix ;)

juhovh commented 12 years ago

Hmm, I'm looking at the Microsoft documentation at http://msdn.microsoft.com/en-us/library/6ewkz86d(v=vs.80).aspx and they don't seem to cast the return pointer on C code either. How about including malloc.h on Windows, could it fix the problem?

Memphiz commented 12 years ago

Mhhh strange ... it complained on my visual studio 2010 pro at work - but doesn't with my visual studio 2010 express at home - using he same project on both. I guess i do a new pr then without these casts?

Memphiz commented 12 years ago

I've changed the pull request and removed the unneeded castings. I've cleared some warnings though.

juhovh commented 12 years ago

Thank you for the patch!