jherico / OculusSDK

Oculus SDK for Virtual Reality
Other
202 stars 114 forks source link

SDK uses wrong declaration of argv in startup routines #7

Open jherico opened 11 years ago

jherico commented 11 years ago

A number of places in the code attempt to work with command line arguments, normally passed in the form (int argc, char \ argv), but incorrectly declare the second part as 'const char*' or 'const char \ []'.

'X _' and 'const X _' are incontrovertible in both directions, and the existing convention of 'char **' for command line argument arrays should be used exclusively. See http://www.parashift.com/c++-faq-lite/constptrptr-conversion.html

Because these are declared incorrectly, any attempt to use the arguments with an existing library expecting 'char**' will fail with a compiler error (if your compiler isn't broken and/or hopelessly permissive).

This means that the Application::OnStartup(int, const char **) method in the Sample/CommonSrc/Platform files should be fixed as well.